Ask Your Question

Revision history [back]

The fourth parameter your are passing to wrapAffine is the size of destination image you are going to wrap, and you are passing it like Size(len, len) where int len = std::max(src.cols, src.rows). So just change the wrapAffine call to

cv::warpAffine(src, dst, r, src.size());

Also see the answer here might be helpful.

The fourth parameter your are passing to wrapAffine is the size of destination image you are going to after wrap, and you are passing it like Size(len, len) where int len = std::max(src.cols, src.rows). So just change the wrapAffine call to

cv::warpAffine(src, dst, r, src.size());

Also see the answer here might be helpful.