Hi @Lion66
Here is how to do it
Local $ptemp = _cveImreadAndCheck("wally3.jpg")
_cveImshowMat("Original", $ptemp)
Local $angle = 10 ; Rotation angle in degrees. Positive values mean counter-clockwise rotation
Local $scale = 1 ; Isotropic scale factor
; grab the dimensions of the image and calculate the center of the image
Local $size = _cvSize()
_cveMatGetSize($ptemp, $size)
Local $center = DllStructCreate($tagCvPoint2D32f)
$center.x = $size.width / 2
$center.y = $size.height / 2
; rotate our image by $angle degrees around the center of the image
; this is done by computing the rotation matrix with _cveGetRotationMatrix2DMat
; then apply the rotation matrix on the image with _cveWarpAffineMat
#Region compute the rotation matrix
Local $rot_mat = _cveMatCreate()
_cveGetRotationMatrix2DMat($center, $angle, $scale, $rot_mat)
#EndRegion compute the rotation matrix
#Region apply the rotation matrix
; The rotated image width is below max(width, height) * $scale
; The rotated image height is below max(width, height)$angle
; For simplicity, put the image in a matrix of size { width, height}
; Otherwise, we should apply $rot_mat on each corner the image,
; then compute the rotated image size from the rotated corners
Local $rotated = _cveMatCreate()
_cveWarpAffineMat($ptemp, $rotated, $rot_mat, $size, $CV_INTER_LINEAR)
#EndRegion apply the rotation matrix
; display the rotated imgage
_cveImshowMat("Rotated", $rotated)
_cveWaitKey()