c++ - 3d object overlay - augmented reality irrlicht + opencv -


i trying develop augmented reality program overlays 3d object on top of marker. model not move along(proportionately) marker. here list of things did

1) using opencv: a) used solvepnp method find rvecs , tvecs. b) used rodrigues method find rotation matrix , appended tvecs vector projection matrix. c) testing made points , lines , projected them make cube. works fine , getting output.

2) using irrlicht: a) tried place 3d model(at position(0,0,0) , rotation(0,0,0)) camera feed running in background. b) using rotation matrix found using rodrigues in opencv calculated pitch, yaw , roll values post("http://planning.cs.uiuc.edu/node103.html") , passed value onto rotation field. in position field passed tvecs values. tvecs values tvecs[0], -tvecs[1], tvecs[2].

the model moving in correct directions not moving proportionately. meaning, if move marker 100 pixels in x direction, model moves 20 pixels(the values 100 , 20 not measured, took arbitrary values illustrate example). y axis , z axis. know have introduce transformation matrix maps opencv camera coordinates irrlicht camera coordinates , 4x4 matrix. not know how find it. opencv's projections matrix [r|t] 3x4 matrix , yields 2d point projected. 4x4 matrix mapping between opencv , irrlicht requires 3d point(made homogeneous) fed 4x4 matrix. how achieve that?

the 4x4 matrix writing seems m=[ r|t; 0 1]. t 3x1 translation vector. transformed coordinates v' of 4x1 ([x y z 1]^t) point v v'=mt.

your problem scaling may caused difference in units used camera calibration in opencv , used other library.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -