0

there is a command to move a window (probably showing image captured from camera) in OpenCV which is cvMoveWindow. But, is there a command in OpenCV which allows window rotation? if OpenCV does not have one, is there any library doing so?

I've googled for several days but could not find one

karlphillip
  • 92,053
  • 36
  • 243
  • 426
TSL_
  • 2,049
  • 3
  • 34
  • 55

2 Answers2

0

There is no command in opencv to rotate a window. However you can rotate the image and display it in a window. I think it will be hard to find any library which can do this because it has something to do with OS. Check this link to do away with image rotation

Community
  • 1
  • 1
bubble
  • 3,408
  • 5
  • 29
  • 51
0

You can't rotate the window itself since OpenCV provides no feature for this task, but you can rotate the image instead.

A solution that might be faster than warpAffine is: call cvTranspose() followed by cvFlip() to rotate the image 90 degrees.

The following code uses the C++ interface of OpencV to demonstrate this operation:

cv::Mat src = imread("image.png", 1);    

cv::Mat dst;
cv::transpose(src, dst);

cv::flip(dst, dst, 1);
karlphillip
  • 92,053
  • 36
  • 243
  • 426
  • 1
    Awesome, now I suggest you review all your questions and accept the answers the solved them. You do this by clicking in the checkbox near the answer to select it as the official. – karlphillip Mar 08 '12 at 12:33