Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding cropped similar images

Tags:

image

The 2 images have same color,pattern,etc. One image is cropped from the other one. The algorithms I've found mostly use location to compare difference between images, so it produces false result for cropped image. How to know those 2 images are similar?

Thanks


1 Answers

You really need to provide more information, but maybe you can use a cross-correlation algorithm? You basically slide the cropped images across every point in the image to match against, and find the similarity. If there is a point where they match above a certain threshold, you can assume that the smaller image is a subset of the larger in that location.

You can speed up the process a lot by using an FFT algorithm instead of actually sliding it along.

Wikipedia calls this "phase correlation"

MATLAB example: Registering an Image Using Normalized Cross-Correlation

alt text
(source: mathworks.com)

like image 200
endolith Avatar answered Oct 19 '25 15:10

endolith



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!