OpenCV IOS real-time template matching

后端 未结 1 1832
生来不讨喜
生来不讨喜 2020-12-16 08:35

I\'d like to create an app (on iPhone) which does this:

I have a template image (a logo or any object) and I\'d like to find that in camera view and put a layer on

相关标签:
1条回答
  • 2020-12-16 09:01

    Implementing this is not trivial - it involves Augmented Reality combined with template matching and 3D rendering.

    A rough outline:

    1. Use some sort of stable feature extraction to obtain features from the input video stream. (eg. see FAST in OpenCV).
    2. Combine these features and back-project to estimate the camera parameters and pose. (See Camera Calibration for a discussion, but note that these usually require calibration pattern such as a checkerboard.)
    3. Use template matching to scan the image for patches of your target image, then use the features and camera parameters to determine the pose of the object.
    4. Apply the camera and object transforms forward and render the replacement image into the scene.

    Implementing all this will require much research and hard work!

    There are a few articles on the web you might find useful:

    • Simple Augmented Reality for OpenCV
    • A minimal library for Augmented Reality
    • AR with NyartToolkit

    You might like to investigate some of the AR libraries and frameworks available. Wikipedia has a good list:

    • AR Software

    Notable is Qualcomm's toolkit, which is not FLOSS but appears highly capable.

    0 讨论(0)
提交回复
热议问题