0

I know how to check if a small image is inside a bigger one but my problem is :

I need to check if a small image (with difference in color) is inside a big image?

As you can see in the picture, the small image is exactly part of big image.

I know i can convert both to black-white image to check but what if there is difference in color depth also?

Any solution for this?

enter image description here

Community
  • 1
  • 1
GarretLR
  • 55
  • 7
  • If color doesn't have large difference, you can make problem really simple. Make them gray-scale and do binning of 5-6 levels. If color diff can be very large, consider edge/contour based analysis. – Pervez Alam Jul 07 '15 at 12:06

2 Answers2

1

AForge has the ability to do this using the ExhaustiveTemplateMatching class.

Previously discussed here.

Community
  • 1
  • 1
Spike
  • 2,016
  • 12
  • 27
0

You could try an Edge Detection algorithm. If the sub-image has not been skewed or scaled, it should just be a simple matter of finding the edges of both images and comparing different sections of the bigger picture with the small one.

This looks like a good reference implementation of a simple edge detection algorithm.

Jay
  • 21
  • 4