there are two kinds of bugs:
1) write() does not close the structure on output storage after it is done.
2) neither write() nor read() handle multiclass SVMs properly. in the
case of write(), this is due to not closing the structure correctly
again. in the case of read(), there is a missing CV_NEXT_SEQ_ELEM().
This patch fixes both of these problems.
ali.
rahimi@keerkoloft:~/Desktop/opencv-1.0.0/ml/src$ diff -ub
../../../tmp/opencv-1.0.0/ml/src/mlsvm.cpp mlsvm.cpp
--- ../../../tmp/opencv-1.0.0/ml/src/mlsvm.cpp 2006-08-18
05:56:30.000000000 -0700
+++ mlsvm.cpp 2007-07-25 11:56:55.000000000 -0700
@@ -1724,8 +1724,10 @@
}
else
CV_ASSERT( sv_count == sv_total );
+ cvEndWriteStruct( fs );
}
cvEndWriteStruct( fs );
+
cvEndWriteStruct( fs );
__END__;
@@ -1928,6 +1930,8 @@
}
else
df[i].sv_index = 0;
+
+ CV_NEXT_SEQ_ELEM(df_node->data.seq->elem_size, reader);
}
create_kernel();
@@ -2304,4 +2308,3 @@
#endif
/* End of file. */
-