opencv旋轉攝像頭

打開攝像頭

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);

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章