Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
800 views
in Technique[技术] by (71.8m points)

iphone - OpenCV IOS real-time template matching

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 the place of where it is found and tracking it!

It is a markless AR with OpenCV!

I read some docs and books and Q&A-s here, but sadly

actually i'd like to create something like this or something like this.

If anyone can send to me some source code or a really useful tutorial (step by step) i'd really be happy!!!

Thank you!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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:

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...