IMAGE COMPARISON USING OPENCV code from poitr
HI i found this code to compare images
cv::Mat img1 = ...
cv::Mat img2 = ...
cv::Mat result = ...
int threshold = (double)(img1.rows * img1.cols) * 0.7;
cv::compare(img1 , img2 , result , cv::CMP_EQ );
int similarPixels = countNonZero(result);
if ( similarPixels > threshold ) {
cout << "similar" << endl;
}
but since i m new to OPENCV i dont know what are the values for " cv::Mat
img1=..." please help me out and tried out the code with the image path as
value but its giving an error
No comments:
Post a Comment