前言
前面帖子讲过用Pyqt5以及python写的一款Azure Kinect相机的单视角图像采集软件
单视角Azure Kinect图像采集软件
也讲解了一种通过修改pyk4a库进行双Kinect相机图像采集的方式
双相机图像采集代码
本文将提供一种基于PyQt5制作的双Kinect图像采集软件
一、软件源码
1、软件主函数代码
软件提供视频流显示、图像采集、图像撤销、自定义路径等功能,具体软件功能与前述的单相机图像采集软件类似
其主函数源码如下:
# -*- coding: utf-8 -*-
from Ui_jiemian import Ui_MainWindow
from PyQt5 import QtCore, QtGui, QtWidgets
import sys
import os
from PyQt5 import QtWidgets
from Ui_jiemian import Ui_MainWindow
from PyQt5.QtWidgets import QMainWindow
import numpy as np
import cv2
import pyk4a
from pyk4a import Config, PyK4A1, connected_device_count
from PyQt5.QtGui import QImage, QPixmap
from typing import Optional, Tuple
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import QMessageBox
def color_depth(
image: np.ndarray,
clipping_range: Tuple[Optional[int], Optional[int]] = (None, None),
colormap: int = cv2.COLORMAP_HSV,
) -> np.ndarray:
if clipping_range[0] or clipping_range[1]:
img = image.clip(clipping_range[0], clipping_range[1])
else:
img = image.copy()
img = cv2.normalize(img, None, 0, 255, cv2.NORM_MINMAX, dtype=cv2.CV_8U)
img = cv2.applyColorMap(img, colormap)
return img
def display_video(self):
try:
self.cnt = connected_device_count()
print("设备数为:", self.cnt )
if self.cnt == 2:
self.cnt_label_text = self.cnt
self.label_11.setText("检测到设备数:{}".format(self.cnt))
self.k4a1 = PyK4A(
Config(
color_resolution=pyk4a.ColorResolution.RES_3072P,
depth_mode=pyk4a.DepthMode.WFOV_UNBINNED,
camera_fps =pyk4a.FPS.FPS_15
)
)
self.k4a1.start()
self.k4a2 = PyK4A1(
Config(
color_resolution=pyk4a.ColorResolution.RES_3072P,
depth_mode=pyk4a.DepthMode.WFOV_UNBINNED,
camera_fps =pyk4a.FPS.FPS_15
)
)
self.k4a2.start()
while True:
#------------------------------展示1号相机彩色与深度视频流----------------------------------------#
capture1 = self.k4a1.get_capture()
rgb_image_show = cv2.resize(capture1.color, ( 313,201))
rows, cols = rgb_image_show.shape[:2]
rgb_image_show = cv2.cvtColor(rgb_image_show, cv2.COLOR_BGR2RGB)
show_RGB = QtGui.QImage(rgb_image_show.data, cols,rows, cols*3, QImage.Format_RGB888) #说明:QImage 函数中,如果 bytesPerline 参数不设置,则会默认按照 4 字节对齐的方式显示图像(如果不满足四字节对齐要求则不会使用零填充),对于不满足四字节对齐的影像在显示的时候就会出现上述失真问题,若将 bytesPerline 参数设置为 image.cols*image.channels() (如上述代码所示)则可解决图像显示失真问题(如上图显示结果)!!!
self.label_2.setPixmap(QPixmap.fromImage(show_RGB)) # 在 GUI 界面上显示 QImage 对象
depth_image_show = cv2.resize(color_depth(capture1.transformed_depth, colormap=cv2.COLORMAP_JET), ( 313,201))
rows, cols = depth_image_show.shape[:2]
depth_image_show = cv2.cvtColor(depth_image_show, cv2.COLOR_BGR2RGB)
show_depth = QtGui.QImage(depth_image_show.data, cols,rows, cols*3, QImage.Format_RGB888)
self.label_3.setPixmap(QPixmap.fromImage(show_depth)) # 在 GUI 界面上显示 QImage 对象
#------------------------------展示2号相机彩色与深度视频流----------------------------------------#
capture2 = self.k4a2.get_capture1()
rgb_image_show2 = cv2.resize(capture2.color, ( 313,201))
rows2, cols2 = rgb_image_show2.shape[:2]
rgb_image_show2 = cv2.cvtColor(rgb_image_show2, cv2.COLOR_BGR2RGB)
show_RGB2 = QtGui.QImage(rgb_image_show2.data, cols2,rows2, cols2*3, QImage.Format_RGB888) #说明:QImage 函数中,如果 bytesPerline 参数不设置,则会默认按照 4 字节对齐的方式显示图像(如果不满足四字节对齐要求则不会使用零填充),对于不满足四字节对齐的影像在显示的时候就会出现上述失真问题,若将 bytesPerline 参数设置为 image.cols*image.channels() (如上述代码所示)则可解决图像显示失真问题(如上图显示结果)!!!
self.label_4.setPixmap(QPixmap.fromImage(show_RGB2)) # 在 GUI 界面上显示 QImage 对象
depth_image_show2 = cv2.resize(color_depth(capture2.transformed_depth, colormap=cv2.COLORMAP_JET), ( 313,201))
rows2d, cols2d = depth_image_show2.shape[:2]
depth_image_show2 = cv2.cvtColor(depth_image_show2, cv2.COLOR_BGR2RGB)
show_depth2 = QtGui.QImage(depth_image_show2.data, cols2d,rows2d, cols2d*3, QImage.Format_RGB888)
self.label_5.setPixmap(QPixmap.fromImage(show_depth2)) # 在 GUI 界面上显示 QImage 对象
cv2.waitKey(8)
if not self.k4a1.opened or not self.k4a2.opened :
print("视频流已关闭")
self.label_6.setText("视频流已关闭")
break
else:
# 当设备数量不等于2时,弹出错误消息框
QMessageBox.critical(None, "设备数异常", "请检查相机连接情况")
except Exception as e:
print(f"An error occurred: {e}")
def close_video(self):
try:
self.cnt = connected_device_count()
self.cnt_label_text == self.cnt
if self.cnt_label_text == 2:
self.label_11.setText("检测到设备数:{}".format(0))
self.k4a1.stop()
white_back1 = np.ones((self.label_2.width(), self.label_2.height(), 4), dtype=np.uint8) * 255
None_RGB = QtGui.QImage(white_back1.data, self.label_2.width(),self.label_2.height(), self.label_2.height()*3, QImage.Format_RGB888)
self.label_2.setPixmap(QPixmap.fromImage(None_RGB))
white_back2 = np.ones((self.label_3.width(), self.label_3.height(), 4), dtype=np.uint8) * 255
none_depth = QtGui.QImage(white_back2.data, self.label_3.width(),self.label_3.height(), self.label_3.height()*3, QImage.Format_RGB888)
self.label_3.setPixmap(QPixmap.fromImage(none_depth))
self.k4a2.stop()
white_back1 = np.ones((self.label_4.width(), self.label_4.height(), 4), dtype=np.uint8) * 255
None_RGB = QtGui.QImage(white_back1.data, self.label_4.width(),self.label_4.height(), self.label_4.height()*3, QImage.Format_RGB888)
self.label_4.setPixmap(QPixmap.fromImage(None_RGB))
white_back2 = np.ones((self.label_5.width(), self.label_5.height(), 4), dtype=np.uint8) * 255
none_depth = QtGui.QImage(white_back2.data, self.label_5.width(),self.label_5.height(), self.label_5.height()*3, QImage.Format_RGB888)
self.label_5.setPixmap(QPixmap.fromImage(none_depth))
print("空白背景填充")
self.label_6.setText("视频流已关闭")
else:
# 当设备数量不等于2时,弹出错误消息框
QMessageBox.critical(None, "设备数异常", "设备数异常")
except Exception as e:
# 异常处理,可以在这里记录错误或采取其他措施
QMessageBox.critical(None, "关闭方式错误", "相机未正常开启")
class MyMainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, parent=None):
super(MyMainWindow, self).__init__(parent) # 初始化父类
self.setupUi(self) # 继承 Ui_MainWindow 界面类
self.label_2.setScaledContents(True) # 调整 label 大小以适应图片大小
self.label_3.setScaledContents(True) # 调整 label 大小以适应图片大小
self.label_4.setScaledContents(True) # 调整 label 大小以适应图片大小
self.label_5.setScaledContents(True) # 调整 label 大小以适应图片大小
self.checkBox.stateChanged.connect(self.on_state_changed)
self.count = 0 # 该参数用于给所拍摄的照片进行编号
def select_folder(self):
current_dir = self.lineEdit.text()
self.savepath = QtWidgets.QFileDialog.getExistingDirectory(None, "选取文件夹", current_dir) # 起始路径为当前文本框中的路径
print(self.savepath)
# 创建view_1目录
self.view1 = os.path.join(self.savepath, "view_1")
os.makedirs(os.path.join(self.savepath, "view_1"), exist_ok=True)
# 创建view_2目录
self.view2 = os.path.join(self.savepath, "view_2")
os.makedirs(os.path.join(self.savepath, "view_2"), exist_ok=True)
self.label_6.setText("存储路径为:" + self.savepath+"\n"+"view_1、 view_2 已创建!")
self.lineEdit.setText(self.savepath) # 已修改
def closeEvent(self, event):
try:
if self.k4a1.opened:
self.k4a1.stop()
if self.k4a2.opened:
self.k4a2.stop()
except AttributeError:
event.accept()
def on_state_changed(self, state):
if state == Qt.Checked: # 选中
display_video(self)
else:
close_video(self)
def take_pictures(self):
try:
if not self.k4a1.opened or not self.k4a2.opened:
print("相机未启动,请检查")
self.label_6.setText("相机未启动,请检查")
else:
# 检查变量A是否定义
try:
self.savepath
except AttributeError:
print("请先确定存储路径")
self.label_6.setText("请先确定存储路径")
QMessageBox.information(None, "拍照失败", "请先确定存储路径")
else:
self.count += 1
#------------------------------存储1号相机图像----------------------------------------#
Kinect_rgb_filename = f"{self.savepath}/view_1/rgb-{self.count}.png"
cv2.imwrite(Kinect_rgb_filename , self.k4a1.get_capture().color)
Kinect_depth_filename = f"{self.savepath}/view_1/depth-{self.count}.png"
cv2.imwrite(Kinect_depth_filename , self.k4a1.get_capture().depth)
Kinect_ir_filename = f"{self.savepath}/view_1/ir-{self.count}.png"
cv2.imwrite(Kinect_ir_filename , self.k4a1.get_capture().ir)
Kinect_morp_filename = f"{self.savepath}/view_1/morp-{self.count}.png"
cv2.imwrite(Kinect_morp_filename , self.k4a1.get_capture().transformed_depth)
#------------------------------存储2号相机图像----------------------------------------#
Kinect_rgb_filename = f"{self.savepath}/view_2/rgb-{self.count}.png"
cv2.imwrite(Kinect_rgb_filename , self.k4a2.get_capture1().color)
Kinect_depth_filename = f"{self.savepath}/view_2/depth-{self.count}.png"
cv2.imwrite(Kinect_depth_filename , self.k4a2.get_capture1().depth)
Kinect_ir_filename = f"{self.savepath}/view_2/ir-{self.count}.png"
cv2.imwrite(Kinect_ir_filename , self.k4a2.get_capture1().ir)
Kinect_morp_filename = f"{self.savepath}/view_2/morp-{self.count}.png"
cv2.imwrite(Kinect_morp_filename , self.k4a2.get_capture1().transformed_depth)
print(f"基于Kinect的:rgb-{self.count}.png、depth-{self.count}.png、ir-{self.count}.png、morp-{self.count}.png 已保存!")
self.label_6.setText(f"基于view_1_Kinect的:rgb-{self.count}.png、depth-{self.count}.png、ir-{self.count}.png、morp-{self.count}.png 已保存!"
+"\n"+
f"基于view_2_Kinect的:rgb-{self.count}.png、depth-{self.count}.png、ir-{self.count}.png、morp-{self.count}.png 已保存!")
except Exception as e:
# 异常处理,可以在这里记录错误或采取其他措施
QMessageBox.critical(None, "错误", "未检测到相机连接")
def delete_pictures(self):
if self.count == 0 :
QMessageBox.information(None, "撤销失败", "暂无最新拍摄照片,请检查")
print("暂无最新拍摄照片,请检查")
self.label_6.setText("暂无最新拍摄照片,请检查")
else:
try:
os.remove(f"{self.savepath}/view_1/rgb-{self.count}.png")
os.remove(f"{self.savepath}/view_1/depth-{self.count}.png")
os.remove(f"{self.savepath}/view_1/ir-{self.count}.png")
os.remove(f"{self.savepath}/view_1/morp-{self.count}.png")
os.remove(f"{self.savepath}/view_2/rgb-{self.count}.png")
os.remove(f"{self.savepath}/view_2/depth-{self.count}.png")
os.remove(f"{self.savepath}/view_2/ir-{self.count}.png")
os.remove(f"{self.savepath}/view_2/morp-{self.count}.png")
print(f"基于Kinect的:rgb-{self.count}.png、depth-{self.count}.png、ir-{self.count}.png、morp-{self.count}.png 已删除!")
self.count -= 1
print("下一张图片编号为:", format(self.count+1))
self.label_6.setText(f"基于Kinect的:rgb-{self.count}.png、depth-{self.count}.png、ir-{self.count}.png、morp-{self.count}.png 已删除!"
+"\n"+
"下一张图片编号为:"+ format(self.count+1))
return True
except OSError as e:
print("删除错误!")
self.label_6.setText("删除错误!")
QMessageBox.information(None, "删除错误!", "删除错误!")
return False
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv) # 初始化界面
myWin = MyMainWindow() # 实例化 MyMainWindow 类,创建主窗口
myWin.show() # 在桌面显示控件 myWin
sys.exit(app.exec_()) # 结束进程,退出程序
2、软件主界面代码
软件UI界面代码如下:
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'd:\Python\Image_camera\2_view_Kinect - 副本\jiemian copy.ui'
#
# Created by: PyQt5 UI code generator 5.15.6
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(961, 740)
MainWindow.setMinimumSize(QtCore.QSize(850, 740))
MainWindow.setLayoutDirection(QtCore.Qt.LeftToRight)
MainWindow.setTabShape(QtWidgets.QTabWidget.Triangular)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setMinimumSize(QtCore.QSize(850, 740))
self.centralwidget.setLayoutDirection(QtCore.Qt.LeftToRight)
self.centralwidget.setAutoFillBackground(False)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setSpacing(0)
self.gridLayout.setObjectName("gridLayout")
self.frame = QtWidgets.QFrame(self.centralwidget)
self.frame.setMinimumSize(QtCore.QSize(850, 740))
self.frame.setStyleSheet("#frame {\n"
"\n"
" background-color: rgba(203, 255, 181,50);\n"
"}\n"
"QPushButton{\n"
" \n"
"}")
self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame.setObjectName("frame")
self.verticalLayout = QtWidgets.QVBoxLayout(self.frame)
self.verticalLayout.setSizeConstraint(QtWidgets.QLayout.SetMinAndMaxSize)
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.setSpacing(0)
self.verticalLayout.setObjectName("verticalLayout")
self.frame_2 = QtWidgets.QFrame(self.frame)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.frame_2.sizePolicy().hasHeightForWidth())
self.frame_2.setSizePolicy(sizePolicy)
self.frame_2.setMinimumSize(QtCore.QSize(0, 55))
self.frame_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_2.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_2.setObjectName("frame_2")
self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.frame_2)
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.label = QtWidgets.QLabel(self.frame_2)
font = QtGui.QFont()
font.setFamily("幼圆")
font.setPointSize(19)
font.setBold(True)
font.setWeight(75)
self.label.setFont(font)
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setObjectName("label")
self.horizontalLayout_4.addWidget(self.label)
self.verticalLayout.addWidget(self.frame_2)
self.frame_3 = QtWidgets.QFrame(self.frame)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(9)
sizePolicy.setHeightForWidth(self.frame_3.sizePolicy().hasHeightForWidth())
self.frame_3.setSizePolicy(sizePolicy)
self.frame_3.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_3.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_3.setObjectName("frame_3")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.frame_3)
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_2.setSpacing(0)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.frame_4 = QtWidgets.QFrame(self.frame_3)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(3)
sizePolicy.setHeightForWidth(self.frame_4.sizePolicy().hasHeightForWidth())
self.frame_4.setSizePolicy(sizePolicy)
self.frame_4.setMaximumSize(QtCore.QSize(16777215, 105))
self.frame_4.setStyleSheet("QPushButton{\n"
" \n"
" background-color: rgb(255, 255, 255);\n"
" \n"
" color: rgb(0, 0, 0);\n"
" \n"
" border-radius:15px;\n"
"\n"
"}\n"
"QPushButton:hover {\n"
" padding-bottom:2px\n"
"}\n"
"QPushButton:pressed {\n"
" padding: 2px 2px 0 0;\n"
"\n"
"}\n"
"\n"
"QPushButton:released {\n"
" padding: 0;\n"
"\n"
"}")
self.frame_4.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_4.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_4.setObjectName("frame_4")
self.horizontalLayout_6 = QtWidgets.QHBoxLayout(self.frame_4)
self.horizontalLayout_6.setContentsMargins(1, 1, 1, 1)
self.horizontalLayout_6.setSpacing(1)
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
self.frame_13 = QtWidgets.QFrame(self.frame_4)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(1)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.frame_13.sizePolicy().hasHeightForWidth())
self.frame_13.setSizePolicy(sizePolicy)
self.frame_13.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_13.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_13.setObjectName("frame_13")
self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.frame_13)
self.verticalLayout_7.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_7.setSpacing(0)
self.verticalLayout_7.setObjectName("verticalLayout_7")
self.frame_15 = QtWidgets.QFrame(self.frame_13)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.frame_15.sizePolicy().hasHeightForWidth())
self.frame_15.setSizePolicy(sizePolicy)
self.frame_15.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_15.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_15.setObjectName("frame_15")
self.label_11 = QtWidgets.QLabel(self.frame_15)
self.label_11.setGeometry(QtCore.QRect(280, 0, 101, 40))
self.label_11.setObjectName("label_11")
self.checkBox = QtWidgets.QCheckBox(self.frame_15)
self.checkBox.setGeometry(QtCore.QRect(40, 10, 71, 20))
self.checkBox.setObjectName("checkBox")
self.verticalLayout_7.addWidget(self.frame_15)
self.frame_16 = QtWidgets.QFrame(self.frame_13)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.frame_16.sizePolicy().hasHeightForWidth())
self.frame_16.setSizePolicy(sizePolicy)
self.frame_16.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_16.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_16.setObjectName("frame_16")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.frame_16)
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_2.setSpacing(0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.frame_25 = QtWidgets.QFrame(self.frame_16)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(8)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.frame_25.sizePolicy().hasHeightForWidth())
self.frame_25.setSizePolicy(sizePolicy)
self.frame_25.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_25.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_25.setObjectName("frame_25")
self.gridLayout_2 = QtWidgets.QGridLayout(self.frame_25)
self.gridLayout_2.setObjectName("gridLayout_2")
self.lineEdit = QtWidgets.QLineEdit(self.frame_25)
self.lineEdit.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.lineEdit.setObjectName("lineEdit")
self.gridLayout_2.addWidget(self.lineEdit, 0, 0, 1, 1)
self.horizontalLayout_2.addWidget(self.frame_25)
self.frame_26 = QtWidgets.QFrame(self.frame_16)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(2)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.frame_26.sizePolicy().hasHeightForWidth())
self.frame_26.setSizePolicy(sizePolicy)
self.frame_26.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_26.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_26.setObjectName("frame_26")
self.pushButton_3 = QtWidgets.QPushButton(self.frame_26)
self.pushButton_3.setGeometry(QtCore.QRect(10, 10, 60, 30))
self.pushButton_3.setObjectName("pushButton_3")
self.horizontalLayout_2.addWidget(self.frame_26)
self.verticalLayout_7.addWidget(self.frame_16)
self.horizontalLayout_6.addWidget(self.frame_13)
self.frame_14 = QtWidgets.QFrame(self.frame_4)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(1)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.frame_14.sizePolicy().hasHeightForWidth())
self.frame_14.setSizePolicy(sizePolicy)
self.frame_14.setMinimumSize(QtCore.QSize(0, 100))
self.frame_14.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_14.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_14.setObjectName("frame_14")
self.pushButton_2 = QtWidgets.QPushButton(self.frame_14)
self.pushButton_2.setGeometry(QtCore.QRect(160, 60, 61, 31))
self.pushButton_2.setObjectName("pushButton_2")
self.pushButton = QtWidgets.QPushButton(self.frame_14)
self.pushButton.setGeometry(QtCore.QRect(160, 10, 61, 31))
self.pushButton.setObjectName("pushButton")
self.horizontalLayout_6.addWidget(self.frame_14)
self.verticalLayout_2.addWidget(self.frame_4)
self.frame_6 = QtWidgets.QFrame(self.frame_3)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(10)
sizePolicy.setHeightForWidth(self.frame_6.sizePolicy().hasHeightForWidth())
self.frame_6.setSizePolicy(sizePolicy)
self.frame_6.setStyleSheet("#frame_6{\n"
" \n"
" \n"
" background-color: rgba(230, 255, 244, 100);\n"
"}\n"
"QLabel{\n"
" \n"
" background-color: rgba(168, 170, 166, 50);\n"
"}")
self.frame_6.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_6.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_6.setObjectName("frame_6")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.frame_6)
self.horizontalLayout.setContentsMargins(1, 1, 1, 1)
self.horizontalLayout.setSpacing(1)
self.horizontalLayout.setObjectName("horizontalLayout")
self.frame_28 = QtWidgets.QFrame(self.frame_6)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(2)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.frame_28.sizePolicy().hasHeightForWidth())
self.frame_28.setSizePolicy(sizePolicy)
self.frame_28.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_28.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_28.setObjectName("frame_28")
self.horizontalLayout.addWidget(self.frame_28)
self.frame_7 = QtWidgets.QFrame(self.frame_6)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(8)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.frame_7.sizePolicy().hasHeightForWidth())
self.frame_7.setSizePolicy(sizePolicy)
self.frame_7.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_7.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_7.setObjectName("frame_7")
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.frame_7)
self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_3.setSpacing(0)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.frame_9 = QtWidgets.QFrame(self.frame_7)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.frame_9.sizePolicy().hasHeightForWidth())
self.frame_9.setSizePolicy(sizePolicy)
self.frame_9.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_9.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_9.setObjectName("frame_9")
self.verticalLayout_8 = QtWidgets.QVBoxLayout(self.frame_9)
self.verticalLayout_8.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_8.setSpacing(0)
self.verticalLayout_8.setObjectName("verticalLayout_8")
self.frame_17 = QtWidgets.QFrame(self.frame_9)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(2)
sizePolicy.setHeightForWidth(self.frame_17.sizePolicy().hasHeightForWidth())
self.frame_17.setSizePolicy(sizePolicy)
self.frame_17.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_17.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_17.setObjectName("frame_17")
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.frame_17)
self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_3.setSpacing(0)
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.label_8 = QtWidgets.QLabel(self.frame_17)
self.label_8.setStyleSheet("QLabel#label_8 {\n"
" background-color: transparent;\n"
"}")
self.label_8.setAlignment(QtCore.Qt.AlignCenter)
self.label_8.setObjectName("label_8")
self.horizontalLayout_3.addWidget(self.label_8)
self.verticalLayout_8.addWidget(self.frame_17)
self.frame_18 = QtWidgets.QFrame(self.frame_9)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(9)
sizePolicy.setHeightForWidth(self.frame_18.sizePolicy().hasHeightForWidth())
self.frame_18.setSizePolicy(sizePolicy)
self.frame_18.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_18.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_18.setObjectName("frame_18")
self.verticalLayout_11 = QtWidgets.QVBoxLayout(self.frame_18)
self.verticalLayout_11.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_11.setSpacing(0)
self.verticalLayout_11.setObjectName("verticalLayout_11")
self.label_2 = QtWidgets.QLabel(self.frame_18)
self.label_2.setText("")
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
self.label_2.setObjectName("label_2")
self.verticalLayout_11.addWidget(self.label_2)
self.verticalLayout_8.addWidget(self.frame_18)
self.verticalLayout_3.addWidget(self.frame_9)
self.frame_10 = QtWidgets.QFrame(self.frame_7)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.frame_10.sizePolicy().hasHeightForWidth())
self.frame_10.setSizePolicy(sizePolicy)
self.frame_10.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_10.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_10.setObjectName("frame_10")
self.verticalLayout_9 = QtWidgets.QVBoxLayout(self.frame_10)
self.verticalLayout_9.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_9.setSpacing(0)
self.verticalLayout_9.setObjectName("verticalLayout_9")
self.frame_19 = QtWidgets.QFrame(self.frame_10)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(2)
sizePolicy.setHeightForWidth(self.frame_19.sizePolicy().hasHeightForWidth())
self.frame_19.setSizePolicy(sizePolicy)
self.frame_19.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_19.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_19.setObjectName("frame_19")
self.horizontalLayout_8 = QtWidgets.QHBoxLayout(self.frame_19)
self.horizontalLayout_8.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_8.setSpacing(0)
self.horizontalLayout_8.setObjectName("horizontalLayout_8")
self.label_10 = QtWidgets.QLabel(self.frame_19)
self.label_10.setStyleSheet("QLabel#label_10 {\n"
" background-color: transparent;\n"
"}")
self.label_10.setAlignment(QtCore.Qt.AlignCenter)
self.label_10.setObjectName("label_10")
self.horizontalLayout_8.addWidget(self.label_10)
self.verticalLayout_9.addWidget(self.frame_19)
self.frame_20 = QtWidgets.QFrame(self.frame_10)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(9)
sizePolicy.setHeightForWidth(self.frame_20.sizePolicy().hasHeightForWidth())
self.frame_20.setSizePolicy(sizePolicy)
self.frame_20.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_20.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_20.setObjectName("frame_20")
self.verticalLayout_13 = QtWidgets.QVBoxLayout(self.frame_20)
self.verticalLayout_13.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_13.setSpacing(0)
self.verticalLayout_13.setObjectName("verticalLayout_13")
self.label_4 = QtWidgets.QLabel(self.frame_20)
self.label_4.setText("")
self.label_4.setAlignment(QtCore.Qt.AlignCenter)
self.label_4.setObjectName("label_4")
self.verticalLayout_13.addWidget(self.label_4)
self.verticalLayout_9.addWidget(self.frame_20)
self.verticalLayout_3.addWidget(self.frame_10)
self.horizontalLayout.addWidget(self.frame_7)
self.frame_27 = QtWidgets.QFrame(self.frame_6)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(1)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.frame_27.sizePolicy().hasHeightForWidth())
self.frame_27.setSizePolicy(sizePolicy)
self.frame_27.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_27.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_27.setObjectName("frame_27")
self.horizontalLayout.addWidget(self.frame_27)
self.frame_8 = QtWidgets.QFrame(self.frame_6)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(8)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.frame_8.sizePolicy().hasHeightForWidth())
self.frame_8.setSizePolicy(sizePolicy)
self.frame_8.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_8.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_8.setObjectName("frame_8")
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.frame_8)
self.verticalLayout_4.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_4.setSpacing(0)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.frame_11 = QtWidgets.QFrame(self.frame_8)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.frame_11.sizePolicy().hasHeightForWidth())
self.frame_11.setSizePolicy(sizePolicy)
self.frame_11.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_11.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_11.setObjectName("frame_11")
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.frame_11)
self.verticalLayout_5.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_5.setSpacing(0)
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.frame_21 = QtWidgets.QFrame(self.frame_11)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(2)
sizePolicy.setHeightForWidth(self.frame_21.sizePolicy().hasHeightForWidth())
self.frame_21.setSizePolicy(sizePolicy)
self.frame_21.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_21.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_21.setObjectName("frame_21")
self.horizontalLayout_7 = QtWidgets.QHBoxLayout(self.frame_21)
self.horizontalLayout_7.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_7.setSpacing(0)
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
self.label_9 = QtWidgets.QLabel(self.frame_21)
self.label_9.setStyleSheet("QLabel#label_9 {\n"
" background-color: transparent;\n"
"}")
self.label_9.setAlignment(QtCore.Qt.AlignCenter)
self.label_9.setObjectName("label_9")
self.horizontalLayout_7.addWidget(self.label_9)
self.verticalLayout_5.addWidget(self.frame_21)
self.frame_22 = QtWidgets.QFrame(self.frame_11)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(9)
sizePolicy.setHeightForWidth(self.frame_22.sizePolicy().hasHeightForWidth())
self.frame_22.setSizePolicy(sizePolicy)
self.frame_22.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_22.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_22.setObjectName("frame_22")
self.verticalLayout_12 = QtWidgets.QVBoxLayout(self.frame_22)
self.verticalLayout_12.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_12.setSpacing(0)
self.verticalLayout_12.setObjectName("verticalLayout_12")
self.label_3 = QtWidgets.QLabel(self.frame_22)
self.label_3.setText("")
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
self.label_3.setObjectName("label_3")
self.verticalLayout_12.addWidget(self.label_3)
self.verticalLayout_5.addWidget(self.frame_22)
self.verticalLayout_4.addWidget(self.frame_11)
self.frame_12 = QtWidgets.QFrame(self.frame_8)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.frame_12.sizePolicy().hasHeightForWidth())
self.frame_12.setSizePolicy(sizePolicy)
self.frame_12.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_12.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_12.setObjectName("frame_12")
self.verticalLayout_10 = QtWidgets.QVBoxLayout(self.frame_12)
self.verticalLayout_10.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_10.setSpacing(0)
self.verticalLayout_10.setObjectName("verticalLayout_10")
self.frame_23 = QtWidgets.QFrame(self.frame_12)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(2)
sizePolicy.setHeightForWidth(self.frame_23.sizePolicy().hasHeightForWidth())
self.frame_23.setSizePolicy(sizePolicy)
self.frame_23.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_23.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_23.setObjectName("frame_23")
self.horizontalLayout_9 = QtWidgets.QHBoxLayout(self.frame_23)
self.horizontalLayout_9.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_9.setSpacing(0)
self.horizontalLayout_9.setObjectName("horizontalLayout_9")
self.label_12 = QtWidgets.QLabel(self.frame_23)
self.label_12.setStyleSheet("QLabel#label_12 {\n"
" background-color: transparent;\n"
"}")
self.label_12.setAlignment(QtCore.Qt.AlignCenter)
self.label_12.setObjectName("label_12")
self.horizontalLayout_9.addWidget(self.label_12)
self.verticalLayout_10.addWidget(self.frame_23)
self.frame_24 = QtWidgets.QFrame(self.frame_12)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(9)
sizePolicy.setHeightForWidth(self.frame_24.sizePolicy().hasHeightForWidth())
self.frame_24.setSizePolicy(sizePolicy)
self.frame_24.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_24.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_24.setObjectName("frame_24")
self.verticalLayout_14 = QtWidgets.QVBoxLayout(self.frame_24)
self.verticalLayout_14.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_14.setSpacing(0)
self.verticalLayout_14.setObjectName("verticalLayout_14")
self.label_5 = QtWidgets.QLabel(self.frame_24)
self.label_5.setText("")
self.label_5.setAlignment(QtCore.Qt.AlignCenter)
self.label_5.setObjectName("label_5")
self.verticalLayout_14.addWidget(self.label_5)
self.verticalLayout_10.addWidget(self.frame_24)
self.verticalLayout_4.addWidget(self.frame_12)
self.horizontalLayout.addWidget(self.frame_8)
self.frame_29 = QtWidgets.QFrame(self.frame_6)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(2)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.frame_29.sizePolicy().hasHeightForWidth())
self.frame_29.setSizePolicy(sizePolicy)
self.frame_29.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_29.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_29.setObjectName("frame_29")
self.horizontalLayout.addWidget(self.frame_29)
self.verticalLayout_2.addWidget(self.frame_6)
self.frame_5 = QtWidgets.QFrame(self.frame_3)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.frame_5.sizePolicy().hasHeightForWidth())
self.frame_5.setSizePolicy(sizePolicy)
self.frame_5.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame_5.setFrameShadow(QtWidgets.QFrame.Raised)
self.frame_5.setObjectName("frame_5")
self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.frame_5)
self.horizontalLayout_5.setContentsMargins(0, 0, 0, 2)
self.horizontalLayout_5.setSpacing(0)
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.label_7 = QtWidgets.QLabel(self.frame_5)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(2)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_7.sizePolicy().hasHeightForWidth())
self.label_7.setSizePolicy(sizePolicy)
self.label_7.setObjectName("label_7")
self.horizontalLayout_5.addWidget(self.label_7)
self.label_6 = QtWidgets.QLabel(self.frame_5)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(23)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_6.sizePolicy().hasHeightForWidth())
self.label_6.setSizePolicy(sizePolicy)
self.label_6.setText("")
self.label_6.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.label_6.setObjectName("label_6")
self.horizontalLayout_5.addWidget(self.label_6)
self.verticalLayout_2.addWidget(self.frame_5)
self.verticalLayout.addWidget(self.frame_3)
self.gridLayout.addWidget(self.frame, 0, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
self.pushButton.clicked.connect(MainWindow.take_pictures) # type: ignore
self.pushButton_2.clicked.connect(MainWindow.delete_pictures) # type: ignore
self.checkBox.clicked['bool'].connect(self.checkBox.setChecked) # type: ignore
self.pushButton_3.clicked.connect(MainWindow.select_folder) # type: ignore
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "图像采集软件"))
self.label.setText(_translate("MainWindow", "种苗3D表型检测图像采集系统"))
self.label_11.setText(_translate("MainWindow", "检测到设备数:"))
self.checkBox.setText(_translate("MainWindow", "相机开关"))
self.lineEdit.setText(_translate("MainWindow", "Path for Save:"))
self.pushButton_3.setText(_translate("MainWindow", "选定路径"))
self.pushButton_2.setText(_translate("MainWindow", "撤销"))
self.pushButton.setText(_translate("MainWindow", "拍照"))
self.label_8.setText(_translate("MainWindow", "View_1 RGB"))
self.label_10.setText(_translate("MainWindow", "View_2 RGB"))
self.label_9.setText(_translate("MainWindow", "View_1 Depth"))
self.label_12.setText(_translate("MainWindow", "View_2 Depth"))
self.label_7.setText(_translate("MainWindow", "控制台输出"))
二、软件界面展示
软件提供了彩色视频流、伪彩色深度视频流的实时显示,便于查看图像效果
三、软件封装
依旧将软件进行了封装,将AzureKinect相机的SDK以及必要的python包封装于软件中
下载路径如下:
双相机图像采集软件
仍需注意,在自定义图像存储路径时,整个路径中不能出现中文字符
总结
本文提供了一种基于python语言开发的Azure Kinect双相机图像采集软件,提供了基本的图像采集、自动编号、图像撤销、自定义路径等功能,同时对一些常见错误进行了封装(详情可见单相机图像采集软件那一篇帖子)。