Ask Your Question
0

2 Video streams from 2 different cameras->Transformation between views?

asked 2015-05-21 06:11:17 -0500

updated 2015-05-21 08:13:50 -0500

Hi guys! Let's say I have 2 cameras.They are both looking at a scene where a marker exists,however these images are not the same(there is an offset between these 2cameras,e.g one is on top of the other). Now let's say I render a virtual cube on top of the marker that is tracked by one of the cameras.Next I want to draw the same cube,in the second camera's view.However for it to work I need to apply some transformations to the original cube.Can you tell me how can I find these transformations via openCV? What steps should I do?

Update 1:

Both cameras are mounted on an oculus and they move in the same way.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2015-05-21 06:34:04 -0500

theodore gravatar image

updated 2015-05-21 06:47:58 -0500

you need to find the translation and rotation matrices. First apply a keypoints feature detector (surf, sift, etc...), extract the descriptors, match the descriptors (or you can avoid this if you use predefined points, with known coordinate points, you will need minimum 4 points), extract homography (i.e. translation and rotation matrices) and then apply warpPerspective or remap functionality as @thdrksdfthmn said in his answer.

edit flag offensive delete link more

Comments

Ok so here's the deal: Let's say I have a marker in my scene and I get 2 images of the markers(one per camera).After I find the Translation and Rotation matrices, can I apply these in a virtual object drawn in the OpenGL through the first camera and make it correctly rendered in the second camera.Also, if both cameras are moving together all the time(e.g they are connected together), do I have to calculate the Translation and Rotation matrices all the time?Or I just need it to happen only 1 time and then always apply thesame transformation to the view?

marios.b gravatar imagemarios.b ( 2015-05-21 08:30:36 -0500 )edit

@marios.b though I have not work before with such a project, I do not see any problem to draw an object appeared in one camera view to another once you have the relation between the two cameras. Moreover, I do not think that you need to extract each time the translation and rotation matrices of the two cameras, once is enough. You can perform this procedure as a calibration step in the beginning. All these of course theoretically, because practically you might come up with parameters that you do not consider now, but will affect your result. For that reason, trial and error and a thorough testing/validation phase will lead you to any conclusion/result.

theodore gravatar imagetheodore ( 2015-05-21 08:57:02 -0500 )edit

Ok thank you very much!

marios.b gravatar imagemarios.b ( 2015-05-21 09:19:51 -0500 )edit
1

answered 2015-05-21 06:25:50 -0500

thdrksdfthmn gravatar image

updated 2015-05-21 06:27:19 -0500

The functions you are looking for are

... in 2 words geometric transformations

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-05-21 06:11:17 -0500

Seen: 326 times

Last updated: May 21 '15