0

I'm working with OpenCv API on an augmented reality project using one camera.I have :

  • The 3D point of my 3D object( i get 4 points from MeshLab)
  • The 2D points which i want to follow ( i have 4 points):these points are not the projection of the 3D points.
  • Intrinsic camera parameters.

Using these parameters, i have the extrinsic parameters( rotation and translation using the cvFindExtrinsicParam function) which i have used to render my model and set the modelView matrix. My problem is that the 3D model are not shown in particular position: it has been shown in différent location on my image. How can i fix the model location and then the modelView matrix? In other forums they told me that i should do the correspondance 2D-3D to get the extrinsic parameters but i don't know how to correspond my 2D points with the 3D points?

Dev DOS
  • 1,018
  • 4
  • 18
  • 45
  • "these points are **not** the projection of the 3D points" What else would they be? Is that a typo? "not shown in particular position" Do you mean they're not in the correct position? – Andreas Haferburg May 01 '13 at 14:21
  • i used **cvgoodPointToTrack** function to get the points and then i used **calcOpticalFlowPyrLK** to track them. – Dev DOS May 02 '13 at 10:00

1 Answers1

1

Typically you would design the points you want to track in such a fashion that the 2d-3d correspondence is immediately clear. The easiest way to do this is to have points with different colors. You could also go with some sort of pattern (google augmented reality cards) which you would then have to analyze in order to find out how it is rotated in the image. The pattern of course can not be rotation symmetric.

If you can't do that, you can try out all the different permutations of the points, plug them into OpenCV to get a matrix, then project your 3D points to 2D points with those matrices, and then see which one fits best.

Andreas Haferburg
  • 5,189
  • 3
  • 37
  • 63
  • Could you please explain the second point.What do you mean with the different permutations of the points??? – Dev DOS May 02 '13 at 09:57
  • Check out http://stackoverflow.com/questions/15776105/find-2d-3d-correspondence-of-4-non-coplanar-points?rq=1 I think you need to tell us a little more about your 4 points. – Andreas Haferburg May 02 '13 at 17:21
  • I have fixed **5** points of eyes position then I track this points with optical flow algorithm.I used `findextrinsicparameters2`to get the **rotation/translation** matrix.My problem is how can I get the 3D points which match my 2D points? How can I get the **3D points** coordinate? – Dev DOS May 12 '13 at 15:39
  • I have now the 3d object not rendering in the right position: it 's far away from the eyes. – Dev DOS May 12 '13 at 15:41