Pregunta

I want to classify images into two classes based on their shapes. For this I have used fourier descriptors with SVM classifer. My problem is that length of fourier descriptor depends upon number of boundary points, hence length of descriptors of various images is different. But for training SVM I need the training matrix with descriptors as rows of matrix(cv::Mat).I am implementing it in c++ using openCV.What should I do ? should I :
1.pad the remaining descriptors to length of longest descriptor with zeroes
2.sample only fixed number of points from boundary

Else suggest me the right way.

¿Fue útil?

Solución

The best approach in this case is to sample a fixed number of points from the boundary, so that your input vectors are of equal length. Padding is a bad idea because by doing so you implicitly change the definition of distance between padded points and non-padded points.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top