OpenCV findHomography transformation matrix to CATransform3D

asked 2015-08-22 12:55:08 -0600

I'm currently playing around with opencv on ios. I'm correctly calculating a homography matrix using findHomography between a captured videoframe and a known image. I've verified that this works by using this homography matrix to draw a border around the image onto the videoframe and it lines up perfectly with the image that I'm filming.

I would however like to use this homography matrix to draw using Core Animation, so I would need to build a CATransform3D from it and then apply it to a CALayer. This is where I get stuck, however, since very little documentation on this can be found and everything that I have found does not appear to work for me.

Thanks in advance,

Max

edit retag flag offensive close merge delete

Comments

1

the problem might be, that noone (outside of apple specific dev) might know, wtf CATransform3D is

berak gravatar imageberak ( 2015-08-22 12:57:20 -0600 )edit

That might be true. It is possible however, to use functions to build one based on known transformations. e.g. CATransform3DMakeRotation, MakeTranslation, MakeScale etc. Problem with this approach for me is that I've found out how to calculate rotation (in plane parallel to camera), (X,Y) translation and (X,Y) scale. However, I also need to use the "shear" transformation, and I don't know how to do that

maxsnijders gravatar imagemaxsnijders ( 2015-08-22 13:05:23 -0600 )edit