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.
精彩评论