This commit is contained in:
2022-11-28 17:43:34 +08:00
parent ce1e0350f3
commit 0137354db8
2 changed files with 7 additions and 11 deletions

View File

@ -64,7 +64,7 @@ def analysis_video(model, video_path, result_path, uuid_barcode, maskpath=None,
if not ret:break if not ret:break
frame_show = frame frame_show = frame
nn += 1 nn += 1
if flag: #MOG2过滤为入侵画面 if flag: #过滤为入侵画面
if nn%2==0 or nn%3==0:continue #跳帧 if nn%2==0 or nn%3==0:continue #跳帧
flag = img_filter(frame, oriimg, fgbg, nn) flag = img_filter(frame, oriimg, fgbg, nn)
if flag: continue if flag: continue
@ -92,10 +92,9 @@ def analysis_video(model, video_path, result_path, uuid_barcode, maskpath=None,
flag, nu, Result = detect(match, affd, net, result, transform, ms, search_r, nn, nu, Result) flag, nu, Result = detect(match, affd, net, result, transform, ms, search_r, nn, nu, Result)
if flag: break if flag: break
Addimg_content(uuid_barcode, frame_show)#图片上传 Addimg_content(uuid_barcode, frame_show)#图片上传
#if not Result=='03':
if result is not None: if result is not None:
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_show) #give ocr img cv2.imwrite(os.sep.join([cfg.Ocrimg, uuid_barcode+'_'+str(nu)+'_'+coordinate+'.jpg']), frame) #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
@ -111,13 +110,10 @@ def detect(match, affd, net, result, transform, ms, search_r, nn, nu, Result):
Result += str(res)+',' Result += str(res)+','
else: else:
Result += str(res)+',' Result += str(res)+','
if res<cfg.THRESHOLD: if res<cfg.THRESHOLD:
#Result ='04'
flag = True flag = True
nu += 1 nu += 1
if nu>cfg.NUM_RAFT: if nu>cfg.NUM_RAFT:
#Result = '02'
flag = True flag = True
if nn>100 and nu>2: if nn>100 and nu>2:
flag = True flag = True

View File

@ -51,9 +51,9 @@ _C.fgbgmask_old = '../module/ieemoo-ai-searchv2/model/now/ori_old.jpg'
_C.URL = 'https://api.ieemoo.com/emoo-api/intelligence' #online _C.URL = 'https://api.ieemoo.com/emoo-api/intelligence' #online
#_C.URL = 'http://api.test.ieemoo.com/emoo-api/intelligence' #_C.URL = 'http://api.test.ieemoo.com/emoo-api/intelligence'
_C.Vre = 'http://api.test2.ieemoo.cn/emoo-api/intelligence/queryVideoCompareResult.do' #_C.Vre = 'http://api.test2.ieemoo.cn/emoo-api/intelligence/queryVideoCompareResult.do'
#_C.Vre = 'http://192.168.1.98:8088/emoo-api/intelligence/queryVideoCompareResult.do' _C.Vre = 'https://api.ieemoo.com/emoo-api/intelligence/queryVideoCompareResult.do' #online
_C.Ocrimg = '../module/ieemoo-ai-ocr/imgs'#post ocr img _C.Ocrimg = '../module/ieemoo-ai-assist/imgs'#post ocr img
_C.Ocrtxt = '../module/ieemoo-ai-ocr/document'#post ocr txts _C.Ocrtxt = '../module/ieemoo-ai-assist/document'#post ocr txts
_C.Ocrvideo = '../module/ieemoo-ai-ocr/videos'#post ocr video _C.Ocrvideo = '../module/ieemoo-ai-assist/videos'#post ocr video