pyqt5多线程,ERIC6,连接四个USB摄像头,都不一样规格,而且同时拼接

使用PyQT5和多线程技术,在ERIC6环境中成功连接了四个规格各异的USB摄像头,并实现了同时显示。博客中包含详细代码和作者的感谢声明。
摘要由CSDN通过智能技术生成

pyqt5多线程,ERIC6,连接四个USB摄像头,都不一样规格,而且同时拼接

不废话,上图
左边是四个摄像头的分画面,右边是拼接的
感谢CSDN所有人的协助,上代码,里面有注解,UI很简单,就不上了

# -*- coding: utf-8 -*-
import sys#, time
from PyQt5 import QtWidgets
from PyQt5.QtCore import QTimer, QThread, pyqtSignal
from Ui_cv2ui_thread import Ui_MainWindow
import cv2 as cv
from PyQt5.QtGui import QImage, QPixmap
from PyQt5.QtWidgets import (QApplication, QDialog, QFileDialog, QGridLayout,
                           QLabel, QPushButton,  QColorDialog)
import numpy as np
class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent=parent)
        self.setupUi(self) #这个一定要在这个最前面位置
        # define the slot for pushbutton to save the merged image
        self.pushButton.clicked.connect(self.savemergeimage) 
        self.img = np.ndarray(())    #空的numpy array
        self.img1 = np.ndarray(())
        self.img2= np.ndarray(())
        self.img3= np.ndarray(())
        self.img4= np.ndarray(())
        self.img4= np.empty([960,1280, 3], int)
        self.cap = cv.VideoCapture(3) #注意,由大开到小,很重要
        self.cap.set(3, 640) # setup the resolution of CCD
        self.cap.set(4, 480)
        ret, self.img=self.cap.read()
        self.cap1 = cv.VideoCapture
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值