Is it a bug?
I replaced the teapot with a square which covered exactly the marker in the video. If the transformation is correct, the square should always covers the marker no matter how I rotated the iPhone. I have tested it with the 640x480 video preview, it passed the test. But with the 1280x720 video preview, if I rotated iPhone int the x or y direction with big angles, there will be blank space of the square in y direction and the square exceeds in the x direction, as the picture shows.
the marker in the video: http://www.imageurlhost.com/images/oz264enc4lgtdlk27c1s.jpg
the square cover the marker in the 640x480 video: http://www.imageurlhost.com/images/o4a6hie7kpmw0furc6oj.jpg
the square cover the marker the 1280x720 video: http://www.imageurlhost.com/images/l9ex352qnkqtmfwtsbrq.jpg
Do I need to change opengl projection matrix while changing the video preset?
Thank you.
I'm not sure my implementation of rendering and overlaying using OpenGL. The aspect ratio of 1280x720 is different from 640x480. I estimate that aspect ratio can cause such kind of problems. And, I can't support very aspect ratio's problem.
Thank you very much for your reply. But It seemed that coding the matrix of the transformation has already normalized with the width and height of the image. And in the opengl rendering set up, the framesize is changed with the video preview setup. So I guessed it may not be the aspect ratio problems. Also , would you please tell me the how did you get the XFocalLength or YFocalLength value? Maybe changing the video preview setup also changed the camera's intrinsic parameter of the projection.
Cheers, Bin Zhang
On Mon, Apr 22, 2013 at 7:30 AM, sonson [email protected] wrote:
I'm not sure my implementation of rendering and overlaying using OpenGL. The aspect ratio of 1280x720 is different from 640x480. I estimate that aspect ratio can cause such kind of problems. And, I can't support very aspect ratio's problem.
— Reply to this email directly or view it on GitHubhttps://github.com/sonsongithub/CoreAR/issues/6#issuecomment-16748708 .
I got focal length by using Camera Calibration Toolbox for Matlab. http://www.vision.caltech.edu/bouguetj/calib_doc/htmls/parameters.html Recently, I heard that OpenCV provides such as functions, too.