tags:

views:

74

answers:

1

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 ;// 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

A: 

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.

jeff7