Home opencv SVM detect mouth wounds area
Reply: 0

opencv SVM detect mouth wounds area

user1025
1#
user1025 Published in July 17, 2018, 7:54 am

I want to use openCV's SVM to train data and to detect mouth wounds area in image.
I try to put the pixel into Mat,but always appear a lot of bug. I already read this opencv train image.
My image is : image1 and image2 and labels :result1 and result2

for (int i = 0; i<img_mat.rows; i++) {
        for (int j = 0; j < img_mat.cols; j++) {
            training_mat.at<Vec3f>(cv::Point(ii,0)) = img_mat.at<Vec3f>(cv::Point(j,i));
            for (int k = 0; k < contours_Ans[0].size(); k++)
            {
                if (contours_Ans[0][k].x == j && contours_Ans[0][k].y == i)
                {
                    labels.at<int>(cv::Point(0, ii)) = 1;
                    break;
                }
                else if(k+1 == contours_Ans[0].size())
                    labels.at<int>(cv::Point( 0, ii)) = 2;
            }
            ii++;
        }
    }

Who can help me to resolve this problem. Thank you very much.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.505772 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO