1
votes

The code is:

CvMat *rotMapMat = cvCreateMat(2, 3, CV_32SC1);
cv2DRotationMatrix(center, angle, 1, rotMapMat);
cvWarpAffine(image, dst, rotMapMat);

First problem: The cv2DRotationMatrix is not correctly computing the matrix. Then I've changed that function by my version cv2DRotationMatrixOwn But there is another problem, the second: The cvWarpAffine always fails with unhandled exception error.

And I can't use debugger and call stack doesn't show the needed functions called before the place when an error occured. Why does it happen? Size of st image is made big enough.

EDIT1: Opencv version 2.2

1

1 Answers

1
votes

rotMapMat has to be floating-point matrix. CV_32S type is not supported by cv2DRotationMatrix and cvWarpAffine. Change it to CV_32F to fix your problems.