opencv旋轉攝像頭
- 打開攝像頭
- 順時針旋轉90°
- 順時針旋轉180°
- 順時針旋轉270°
打開攝像頭
VideoCapture capture(cameraID);
if (!capture.isOpened())
{
return S_FALSE;
}
capture >> frame;
imwrite("src.jpg", frame);
順時針旋轉90°
transpose(frame, frame);
flip(frame, frame, 1);
imwrite("dest1.jpg", frame);
順時針旋轉180°
flip(frame, frame, -1);
imwrite("dest2.jpg", frame);
順時針旋轉270°
transpose(frame, frame);
flip(frame, frame, 0);
imwrite("dest3.jpg", frame);