Search code examples
opencvsiftobject-detection

How to get a rectangle around the target object using the features extracted by SIFT in OpenCV


I'm doing project in OpenCV on object detection which consists of matching the object in template image with the reference image. Using SIFT algorithm the features get acurately detected and matched but I want a rectagle around the matched features My algorithm uses the KD-Tree est ean First technique to get the matches


Solution

  • If you want a rectangle around the detected object, here you have code example with exactly that. You just need to draw a rectangle around the homography H.

    Hope it helps. Good luck.