Reverse camera angle w/ aruco tracking

asked 2018-11-23 02:24:57 -0500

dakom gravatar image

updated 2018-11-23 02:25:14 -0500

I have the Aruco tracking working and from cobbling together stuff from various code samples, ended up with the code below, where final is the view matrix passed to the camera. The problem is that the rotation of the camera isn't exactly what I need... not sure exactly which axis is wrong, but you can see in the following video that I want the base of the model to be sitting on the marker- but instead it's not oriented quite right. Any tips to get it right would be great! I'm open to re-orienting it in blender too if that's the right solution. Just not sure exactly _how_ it's wrong right now.

Video example:


const inverse = cv.matFromArray(4,4, cv.CV_64F, [   
                                    1.0, 1.0, 1.0, 1.0,
                                    1.0, 1.0, 1.0, 1.0

cv.estimatePoseSingleMarkers(markerCorners, 0.1, cameraMatrix, distCoeffs, rvecs, tvecs);
cv.Rodrigues(rvecs, rout);

const tmat = tvecs.data64F;
const rmat = rout.data64F;

const viewMatrix = cv.matFromArray(4,4,cv.CV_64F, [ 

const output = cv.Mat.zeros(4,4, cv.CV_64F);
cv.multiply(inverse, viewMatrix, output);

cv.transpose(output, output);
const final = output.data64F;
edit retag flag offensive close merge delete