diff --git a/__pycache__/detect.cpython-37.pyc b/__pycache__/detect.cpython-37.pyc new file mode 100644 index 0000000..e3b3072 Binary files /dev/null and b/__pycache__/detect.cpython-37.pyc differ diff --git a/build/temp.linux-armv7l-3.7/detect.o b/build/temp.linux-armv7l-3.7/detect.o new file mode 100644 index 0000000..1ccd81e Binary files /dev/null and b/build/temp.linux-armv7l-3.7/detect.o differ diff --git a/detect.cpython-37m-arm-linux-gnueabihf.so b/detect.cpython-37m-arm-linux-gnueabihf.so new file mode 100755 index 0000000..de0f09a Binary files /dev/null and b/detect.cpython-37m-arm-linux-gnueabihf.so differ diff --git a/run_detect.py b/run_detect.py index 51e8040..6a80bcb 100644 --- a/run_detect.py +++ b/run_detect.py @@ -5,20 +5,23 @@ calibration_width = 0.75 image = "img7.jpg" images = ("img.jpg", "img2.jpg", "img3.jpg", "img4.jpg", "img5.jpg", "img6.jpg", "img7.jpg", "img8.jpg") show = False +video = False def go(): #for file in images: detect.detect(calibration_width, "img7.jpg", show) -#elapsed_time = timeit.timeit(go, number=100)/100 -#print(elapsed_time) -capture = cv2.VideoCapture('tcpclientsrc host=192.168.43.152 port=5000 ! queue ! decodebin ! appsink', cv2.CAP_GSTREAMER) -while True: - ret,frame = capture.read() +if not video: + elapsed_time = timeit.timeit(go, number=3)/3 + print(elapsed_time) +else : + capture = cv2.VideoCapture('tcpclientsrc host=192.168.43.152 port=5000 ! queue ! decodebin ! appsink', cv2.CAP_GSTREAMER) + while True: + ret,frame = capture.read() - if not ret: - print('empty frame') - break - print('frame') - cv2.imshow('receive', frame) - if cv2.waitKey(1)&0xFF == ord('q'): - break + if not ret: + print('empty frame') + break + print('frame') + cv2.imshow('receive', frame) + if cv2.waitKey(1)&0xFF == ord('q'): + break