juangallostra / augmented-reality

Augmented reality proof of concept project with Python and OpenCV
MIT License
335 stars 118 forks source link

Standard size of the model image and video ? #4

Closed anujchoudhury closed 5 years ago

anujchoudhury commented 6 years ago

Hi, When i run this code on a standard visiting card, it is not quite able to recognize it. The video is not input via webcam, but pre recorded and input using cv2.VideoCapture() . Is there a set dimension of image or something ? Thanks!

juangallostra commented 6 years ago

@anujchoudhury Dimensions should not be an issue. Just to make sure, did you add an image of the visiting card under the reference folder and named it model.jpg?

If so, the problem could be that the visiting card you are using as a reference doesn't have enough singular points and hence no correspondences are found.You can try using a different card to see if that makes any difference.

anujchoudhury commented 6 years ago

@juangallostra Yes,I added the model.jpg image. Could you upload a sample video and a sample template perhaps ? It would be super helpful. Also, I read your blog and about your idea of object tracking rather than per frame object detection. Do you know of what features in OpenCV could be used for the same ?

juangallostra commented 6 years ago

@anujchoudhury it is a good idea to add to the repo sample video and template. I'll try to find some time to do it soon.

juangallostra commented 6 years ago

@anujchoudhury RE tracking, I think that a good first approach (before trying with a different set of features) to implement a tracking system would be to filter the output of the detection algorithm with a Kalman filter. I'm quite sure that would reduce shakiness.

anujchoudhury commented 6 years ago

@juangallostra Thanks ! I'd really love it if you could upload the sample video and template quickly. I had a hard time reproducing results as good as those which appeared on your uploaded video, and hence wanted to know what I could be doing wrong. I think my model template did have many singular points, but openCV is not able to recognize it when i change the inclination of the image in the video.

juangallostra commented 5 years ago

@anujchoudhury Did you manage to solve the problems you were facing? You could try running the code with only the visualization of matches being active (without rendering the model) to see if indeed matches are good.

juangallostra commented 5 years ago

Closing due to inactivity.