1

I have template of size 100*100 px and image of 800*800. I don't want to search every possible region of size 100*100 in that image. Instead I want to check whether my template exist in specific regions or not, to make it time efficient.
Let us consider 800*800 image in form of 2d grid of 8*8. I just want to check it in these 64 regions (8*8) not (701*701) regions.
Is there any possible way to do so?

xcepti0n
  • 41
  • 1
  • 1
  • 4
  • The Sikuli library by MIT makes this easy. It can plug into python. Is that an option for you? – Chris Halcrow Nov 23 '16 at 19:55
  • May be you can make your stride value variable where if the matching score is high then you will decrease the stride value otherwise you will increase it(upto a max threshold). This will surely compare more than 64 regions but it's a point to start. – Optimus 1072 Nov 24 '16 at 06:16
  • Use setRoi(64 times) and absDiff(or similar methods) to find if template matches with one of the 8x8 grid objects. – saurabheights Nov 24 '16 at 12:19
  • @ChrisHalcrow actually i am working on a project for that i have to do my task only on cv2 , but i still keep that one in my list for my further projects. – xcepti0n Jan 13 '17 at 08:08
  • @Optimus1072 as i am a beginner so I don't know much about how to achieve what you are suggesting, may be a link will work. – xcepti0n Jan 13 '17 at 08:11
  • Thanks @saurabheights I will try that one, – xcepti0n Jan 13 '17 at 08:12
  • Possible duplicate of [Compare histograms of specific areas of two images? OpenCV](https://stackoverflow.com/questions/12750889/compare-histograms-of-specific-areas-of-two-images-opencv) – Sufian Oct 17 '18 at 11:24

0 Answers0