EnoxSoftware / OpenCVForUnity

OpenCV for Unity (Untiy Asset Plugin)
https://assetstore.unity.com/packages/tools/integration/opencv-for-unity-21088
550 stars 172 forks source link

Transform MatOfPoint3f using Rotation Matrix? #172

Open mattycorbett opened 8 months ago

mattycorbett commented 8 months ago

I have a rotation matrix from face landmarks using solvePnP called rvec (below). I have tested the the resultant rotation is accurate to estimate head pose. However, I want to use this matrix to rotate the MatOfPoint3f object containing the landmarks back to a "forward facing" direction. I have tried using OpenCVForUnity.CoreModule.Core.transform(MatLandmarks, MatLandmarks, rmat.inv()) but the transformed values still are effected by the movement of the head. Any ideas?

Calib3d.solvePnP(object_points, image_points, camMatrix, distCoeffs, rvec, tvec);