SoFunction
Updated on 2024-11-13

opencv change imshow window size, window position methods

As shown below:


("enhanced",0);
("enhanced", 640, 480);
("enhanced",lines)
(0)

When creating a window, change the parameters to change the size of the window by dragging the mouse.

cv::namedWindow("camera", CV_WINDOW_NORMAL);//CV_WINDOW_NORMAL is 0.
cv::imshow("camera", frame);
(imgpath, 0);
(imgpath, int(width*(height-80)/ pheight),height-80);
(imgpath, img)

This will distort the image, e.g. the width will be small and the height will be big.

# ('image', cv2.WINDOW_NORMAL)

Change window position: left top

("trans:"+filename,1000,100)

Above this opencv change imshow window size, window position is the method I share with you all the content, I hope to be able to give you a reference, but also hope that you support me more.