Reputation: 23035
I want to detect missing objects of an image. Here is the situation
I know the first step of doing this, and that is calculating the histogram of both the images and comparing them . If something is missing from the second image, then the histogram values will differ.
Now, how to detect that "ball" is missing? Using template matching?
Upvotes: 3
Views: 2202
Reputation: 2903
As stated in comments, you can easily subtract those 2 images. IIRC Mat has overloaded - [minus] operator. So sub = img1 - img2;
should be enough as long as imgs are cv::Mat
objects.
About the blobs take a look at following tutorials at OpenCV website:
http://docs.opencv.org/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.html
http://docs.opencv.org/doc/tutorials/imgproc/shapedescriptors/hull/hull.html
Upvotes: 3