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?
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
http://docs.opencv.org/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With