1 Star 0 Fork 2

理科疯子/Multi-Video-Process

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
MainWindow.py 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
理科疯子 提交于 2022-01-27 21:12 . Initial commit
import multiprocessing
import sys
import time
import queue
from PyQt5 import QtWidgets
from UI import Ui_MainWindow
from Emit_Image import ThreadEmitImage
class MyMainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
def __init__(self):
super(MyMainWindow, self).__init__()
self.setupUi(self)
self.initUI()
self.my_thread_queue_image_done = queue.PriorityQueue()
self.my_thread_queue_image_read = queue.PriorityQueue()
self.my_process_queue_image_processing = multiprocessing.Queue()
self.my_process_queue_image_processed = multiprocessing.Queue()
self.my_end = multiprocessing.Queue()
self.my_thread = ThreadEmitImage(self.my_thread_queue_image_done, self.my_thread_queue_image_read,
self.my_process_queue_image_processing, self.my_process_queue_image_processed,
self.my_end)
self.my_thread.my_signal_image.connect(self.show_image)
self.pushButton.clicked.connect(self.my_start)
self.last_time = time.time()
def initUI(self):
self.setWindowTitle("Video")
self.setFixedSize(self.width(), self.height())
def show_image(self, image):
this_time = time.time()
last_time = self.last_time
self.last_time = this_time
try:
self.label_fps.setText(str(1 / (this_time - last_time)))
# print(str(1 / (this_time - last_time)))
except:
pass
self.label.setPixmap(image[0])
def my_start(self):
self.my_thread.start()
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
MyUI = MyMainWindow()
MyUI.show()
sys.exit(app.exec_())
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/likefengzi/Multi-Video-Process.git
[email protected]:likefengzi/Multi-Video-Process.git
likefengzi
Multi-Video-Process
Multi-Video-Process
master

搜索帮助