How to find the center of a template matching rectangle

asked 2016-10-05 11:39:47 -0500

adnandani gravatar image

I have tried the following template matching OpenCV code. It works well for my application.

I just want to know how I can find the center position or location of template matching rectangle . Can anyone please help me. Thank you

edit retag flag offensive close merge delete


I don't understand your question. matchLoc is best match location. It means that you will find template in your image in rectangle (matchLoc.x,mathcLoc.y,template.width,template.height) and previous rectangle center is at location (matchLoc.x+template.width/2,mathcLoc.y+template.height/2

LBerger gravatar imageLBerger ( 2016-10-05 13:27:07 -0500 )edit