新文件夹
def show_camera3(self):
"""
显示视频的右边检测结果
"""
flag, self.image1 = self.cap_video.read()
# 检测一次帧数加一
self.frame_s += 1
if flag == True:
# 对视频抽帧得出的图片进行测试,在处理左侧视频时已经获得了抽帧图片
label, im0 = self.myv5.detect(self.image1)
# print("imo",im0)
# print(label)
if label == 'debug':
print("labelkong")
# print("debug")
# im0, label = slef.detect()
# print("debug1")
width = im0.shape[1]
height = im0.shape[0]
# 设置新的图片分辨率框架
width_new = 700
height_new = 500
# 判断图片的长宽比率
if width / height >= width_new / height_new:
show = cv2.resize(im0, (width_new, int(height * width_new / width)))
else:
show = cv2.resize(im0, (int(width * height_new / height), height_new))
im0 = cv2.cvtColor(show, cv2.COLOR_RGB2BGR)
# print("debug2")
showImage = QtGui.QImage(im0, im0.shape[1], im0.shape[0], 3 * im0.shape[1], QtGui.QImage.Format_RGB888)
self.label_show_camera1.setPixmap(QtGui.QPixmap.fromImage(showImage))