Using cvWarpAffine to crop image in openCV

676 views Asked by At

If I want to crop image center at (x,y) with window size ws using
void cvWarpAffine(const CvArr* src, CvArr* dst, const CvMat* map_matrix, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, CvScalar fillval=cvScalarAll(0) )
in openCV, how should I set the parameters of transformation matrix? I am confused about how to set the default parameters of other transformations except crop?

P.S. In my situation I also want to crop the point centre at edge and need padding in the fix window. So use cv:rect will be more complecated to deal with the edge.

0

There are 0 answers