Find the location of the camera from a object using opencv

asked 2014-03-12 21:17:47 -0500

stranger123 gravatar image

updated 2014-03-13 02:08:09 -0500

berak gravatar image


I am new to opencv. For my project i am trying to find a way to find the location of the camera (x and y). If I could figure out the locations then it will be possible to figure out which is the best position to capture images to detect the reference point.

Please help me with it. If anyone needs more information please do not hestitate to ask. Thank you in advance.

edit retag flag offensive close merge delete


if what the camera is looking at has targets and you know where the targets are located it is possible to work backwards and figure out where the camera is located.

GrumbleLion gravatar imageGrumbleLion ( 2014-03-13 03:04:46 -0500 )edit

i am using a raspberry pi camera... i have four triangles on a A0 page as the reference points. I know the center coordinates of the triangle. so what would be the method I could use to find the location.

stranger123 gravatar imagestranger123 ( 2014-03-13 05:52:42 -0500 )edit

first you have to calibrate the spherical distortion of the camera. this only has to be done once. See the calib3D examples. Then you would use object recognition to find the triangles. from there you have to use some math and find the camera's location.

GrumbleLion gravatar imageGrumbleLion ( 2014-03-13 12:33:06 -0500 )edit

see when you mean by spherical distortion... I could use the check board calibration provided by opencv.. Do you have any examples you have done before that i could refer too.

stranger123 gravatar imagestranger123 ( 2014-03-19 12:17:52 -0500 )edit