开发者

cvWarpPerspective, having transformation matrix, how to extract the quad points?

开发者 https://www.devze.com 2022-12-31 01:24 出处:网络
I have the 3x3 transformation matrix that goes through the cvWarpPerspective, I would like to extract the four corner coordinates value.

I have the 3x3 transformation matrix that goes through the cvWarpPerspective, I would like to extract the four corner coordinates value.

CvMat* M;

M = xxxxxxxxxxx ;开发者_JS百科// Matrix was generated by a certain process

cvWarpPerspective( img, transformed, M, CV_INTER_LINEAR + CV_WARP_FILL_OUTLIERS, cvScalarAll( 0 ) ); // 

this creates a complete black new image transformed, from this image i would like to know the 4 corner coordinates


Just multiply each of your pre-warped corner values in homogeneous format (e.g. (0,0,0,1) (width,0,0,1) (0,height,0,1), (width,height,0,1)) by the perspective matrix to get the transformed coordinates.

0

精彩评论

暂无评论...
验证码 换一张
取 消