How to train an SVM with opencv based on a set of images?

后端 未结 2 573
日久生厌
日久生厌 2021-02-04 18:13

I have a folder of positives and another of negatives images in JPG format, and I want to train an SVM based on that images, I\'ve done the following but I receive an error:

2条回答
  •  再見小時候
    2021-02-04 18:57

    Just as the error says, You need to change type of Your matrix, from integer type, probably CV_8U, to floating point one, CV_32F or CV_64F. To do it You can use cv::Mat::convertTo(). Here is a bit about depths and types of matrices.

提交回复
热议问题