UPDATE Vision 新增料袋数量检测
This commit is contained in:
@ -10,6 +10,8 @@ from Trace.handeye_calibration import *
|
||||
from Vision.tool.utils import get_disk_space
|
||||
from Vision.tool.utils import remove_nan_mean_value
|
||||
from Vision.detect_person import DetectionPerson
|
||||
from Vision.detect_bag_num import DetectionBagNum
|
||||
from Vision.tool.CameraHIK import camera_HIK
|
||||
import platform
|
||||
import cv2
|
||||
import os
|
||||
@ -61,6 +63,28 @@ def detectionPerson_test():
|
||||
else:
|
||||
break
|
||||
|
||||
def HIK_Camera_test():
|
||||
MY_CAMERA = camera_HIK("192.168.1.121", 554, "admin", "zlzk.123")
|
||||
while True:
|
||||
ret, frame = MY_CAMERA.get_img()
|
||||
if ret:
|
||||
img = cv2.resize(frame, (800, 600))
|
||||
cv2.imshow('img', img)
|
||||
cv2.waitKey(1)
|
||||
def detectionBagNum_test():
|
||||
detectionBagNum = DetectionBagNum()
|
||||
video_path = ''.join([os.getcwd(), '/Vision/model/data/2.mp4'])
|
||||
cam = cv2.VideoCapture(video_path)
|
||||
while cam.isOpened():
|
||||
ret, frame = cam.read()
|
||||
if ret:
|
||||
num, img = detectionBagNum.get_BagNum(frame)
|
||||
print(num)
|
||||
cv2.imshow('img', img)
|
||||
cv2.waitKey(1)
|
||||
else:
|
||||
break
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
detectionPosition_test()
|
||||
detectionBagNum_test()
|
||||
Reference in New Issue
Block a user