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设计】。

相关文章

postman传递当前时间戳实例详解

postman传递当前时间戳实例详解

请求动态参数(例如时间戳) 有时我们在请求接口时,需要带上当前时间戳这种动态参数,那么postman能不能自动的填充上呢。 我们可以使用postman的pre-request scrip...

Python求均值,方差,标准差的实例

如下所示: import numpy as np arr = [1,2,3,4,5,6] #求均值 arr_mean = np.mean(arr) #求方差 arr_var = n...

对Python中gensim库word2vec的使用详解

pip install gensim安装好库后,即可导入使用: 1、训练模型定义 from gensim.models import Word2Vec model = Word2V...

python数组复制拷贝的实现方法

本文实例讲述了python数组复制拷贝的实现方法。分享给大家供大家参考。具体分析如下: python中直接通过等号赋值实际上只是引用地址的传递 如: a = [1,2,3,4,5]...

浅谈django的render函数的参数问题

hello.html 文件代码如下: HelloWorld/templates/hello.html 文件代码: <h1>{{ hello }}</h1>...