opencv改变imshow窗口大小,窗口位置的方法

yipeiwu_com6年前Python基础

如下所示:

cv2.HoughLinesP
cv2.namedWindow("enhanced",0);
cv2.resizeWindow("enhanced", 640, 480);
cv2.imshow("enhanced",lines)
cv2.waitKey(0)

创建窗口时候改变下参数就可以鼠标随意拖动窗口改变大小啦

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

这个会让图像变形,比如宽度很小高度变大

# cv2.namedWindow('image', cv2.WINDOW_NORMAL)

改变窗口位置:left top

cv2.moveWindow("trans:"+filename,1000,100)

以上这篇opencv改变imshow窗口大小,窗口位置的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持【听图阁-专注于Python设计】。

相关文章

python实现探测socket和web服务示例

操作系统:linux软件环境:Python 2.7.3 用法:复制代码 代码如下:$ ./MonSocket.py # This is check the URI or Socket...

Python基于有道实现英汉字典功能

本文实例讲述了Python基于有道实现英汉字典功能的方法。分享给大家供大家参考。具体如下: import re,urllib aa="http://dict.youdao.com/s...

Pytorch模型转onnx模型实例

如下所示: import io import torch import torch.onnx from models.C3AEModel import PlainC3AENetCBA...

python解析模块(ConfigParser)使用方法

测试配置文件test.conf内容如下: 复制代码 代码如下:[first]w = 2v: 3c =11-3 [second] sw=4test: hello 测试配置文件中有两个区域,...

pandas中遍历dataframe的每一个元素的实现

假如有一个需求场景需要遍历一个csv或excel中的每一个元素,判断这个元素是否含有某个关键字 那么可以用python的pandas库来实现。 方法一: pandas的dataframe...