当前位置:首页 >> 编程语言 >> 【pyqt5学习】——graphicView显示opencv图像,鼠标肘

【pyqt5学习】——graphicView显示opencv图像,鼠标肘

0evadmin 编程语言 1
文件名:【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) # 将场景添加至视图

协助本站SEO优化一下,谢谢!
关键词不能为空
同类推荐
«    2025年12月    »
1234567
891011121314
15161718192021
22232425262728
293031
控制面板
您好,欢迎到访网站!
  查看权限
网站分类
搜索
最新留言
文章归档
网站收藏
友情链接