opencv - Triangulation to find distance to the object- Image to world coordinates -


             localization of object specified in image. 

i working on project of computer vision find distance of object using stereo images.i followed following steps using opencv achieve objective 1. calibration of camera 2. surf matching find fundamental matrix 3. rotation , translation vector using svd method described in zisserman , hartley book. 4. stereorectify projection matrix p1, p2 , rotation matrices r1, r2. rotation matrices can find using homography r=cameramatrix.inv() h camera matrix.

problems: triangulated point using least square triangulation method find real distance object. returns value in form of [ 0.79856 , .354541 .258] . how map real world coordinates find distance object.

http://www.morethantechnical.com/2012/01/04/simple-triangulation-with-opencv-from-harley-zisserman-w-code/

alternative approach: find disparity between object in 2 images , find depth using given formula depth= ( focal length * baseline ) / disparity

for disparity have perform rectification first , points must undistorted. rectification images black.

please me out.it important

here detail explanation of how implemented code.

  • calibration of camera using circles grid camera matrix , distortion coefficient. code given on github (andriod).

    2.take 2 pictures of car. first left , other right. take sub-image , calculate -fundmental matrix- essential matrix- rotation matrix- translation matrix....

    3.i have tried projection in 2 ways.

  • take first image projection identity matrix , make second project 3x4d through rotation , translation matrix , perform triangulation.

  • get projection matrix p1 , p2 stereo rectify perform triangulation.

my object 65 meters away camera , dont know how calculate true based on result of triangulation in form of [ 0.79856 , .354541 .258]

question: have calibration result. code not based know detail of geometric size of object.

so computed triangulation? well, have points in camera coordinates, i.e. in coordinate frame centered on 1 of cameras (the left or right 1 depending on how code written , order in feed images it).

what more want? vector length (square root of sum of square coordinates) of points is estimated distance same camera. if want position in other "world" coordinate system, need give coordinate transform between system , camera - presumably through calibration procedure.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -