【pyqt5学习】——graphicView显示opencv图像,鼠标肘
0evadmin
编程语言
19
文件名:【pyqt5学习】——graphicView显示opencv图像,鼠标肘
【pyqt5学习】——graphicView显示opencv图像
imgpath = "result.jpg"img = cv2.imread(imgpath) # 读取图像img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) # 转换图像通道x = img.shape[1] # 获取图像大小y = img.shape[0]self.zoomscale = 1 # 图片放缩尺度frame = QImage(img, x, y, x * 3, QImage.Format_RGB888)pix = QPixmap.fromImage(frame)self.item = QGraphicsPixmapItem(pix) # 创建像素图元self.item.setScale(self.zoomscale)self.scene = QGraphicsScene() # 创建场景self.scene.addItem(self.item)self.graphicsView.setScene(self.scene) # 将场景添加至视图
同类推荐
-

【Python 标准库学习】数据科学计算库 — math,wps office 2009
查看 -

【Python 训练营】N_7 打印水仙花数,三星 s5820
查看 -

【Python_PySide6学习笔记(二十四)】菜单栏QMenuBar类的基本用法,u908e(python的菜单栏详解)
查看 -

【Python】12 GPflow安装,geak魔戒
查看 -

【Python】Matplotlib-多张图像的显示,ati stream sdk
查看 -

【Python】Python仓储管理系统(源码)【独一无二】,lg t320
查看 -

【Python】Python开发微信小程序,硕美科g945
查看 -

【Python】Ubuntu 设置默认Python,858game
查看 -

【Python】import自己的模块报错,金立a696(python importlib.import_module)
查看
控制面板
网站分类
搜索
最新留言
文章归档
网站收藏
友情链接