This commit is contained in:
2022-11-28 20:44:51 +08:00
parent 0137354db8
commit 33ae07e140

View File

@ -93,8 +93,10 @@ def analysis_video(model, video_path, result_path, uuid_barcode, maskpath=None,
if flag: break if flag: break
Addimg_content(uuid_barcode, frame_show)#图片上传 Addimg_content(uuid_barcode, frame_show)#图片上传
if result is not None: if result is not None:
frame_show = cv2.GaussianBlur(frame_show,(5,5),0)
frame_show = cv2.resize(frame_show, (int(width/2), int(height/2)), interpolation=cv2.INTER_CUBIC)
coordinate = str(coordination[0])+'_'+str(coordination[1])+'_'+str(coordination[2])+'_'+str(coordination[3]) coordinate = str(coordination[0])+'_'+str(coordination[1])+'_'+str(coordination[2])+'_'+str(coordination[3])
cv2.imwrite(os.sep.join([cfg.Ocrimg, uuid_barcode+'_'+str(nu)+'_'+coordinate+'.jpg']), frame) #give ocr img cv2.imwrite(os.sep.join([cfg.Ocrimg, uuid_barcode+'_'+str(nu)+'_'+coordinate+'.jpg']), frame_show) #give ocr img
else: else:
cv2.imwrite(os.sep.join([cfg.Ocrimg, uuid_barcode+'_'+str(nu)+'_0_0_0_0'+'.jpg']), frame_show) #give ocr img cv2.imwrite(os.sep.join([cfg.Ocrimg, uuid_barcode+'_'+str(nu)+'_0_0_0_0'+'.jpg']), frame_show) #give ocr img
return Result return Result