matchTemplate with multi-rectangular template

asked 2017-10-26 15:37:46 -0600

jjg gravatar image

I have shapes that tend to be composites of rectangles what I need to detect position. Here is an example of one such shape. image description

Lighting is very consistent between reference object and image being searched.

I can't use matchTemplate with a rectangular template because the nozzle holding the part can be at different locations. The nozzle sometimes cover the pins, othertimes not. The black nozzle is highlighted by red markings. image description

My thought is to do multiple matchTemplates and shift their results so their xy represent same coordinates of the original object. The following gives and example of the multiple templates.

image description

In this solution, the user would select the multiple rectangles. Before I reinvent the wheel, is there such an implementation available. Is there a better solution?

Regards, John

edit retag flag offensive close merge delete


take a look at this i think train_HOG.cpp is worth trying.

sturkmen gravatar imagesturkmen ( 2017-10-26 16:44:26 -0600 )edit

perhaps template matching with transparency could be an alternative idea

Sanchopanza gravatar imageSanchopanza ( 2017-10-28 04:02:42 -0600 )edit