diff --git a/config/compound_eye.png b/config/compound_eye.png index 3e3e6b9..ef3b17b 100644 Binary files a/config/compound_eye.png and b/config/compound_eye.png differ diff --git a/demo.py b/demo.py new file mode 100644 index 0000000..d08510d --- /dev/null +++ b/demo.py @@ -0,0 +1,35 @@ +import os +os.environ["OPENCV_VIDEOIO_MSMF_ENABLE_HW_TRANSFORMS"] = "0" +import cv2 +from orisys import Sensor + + + +def main(): + global start_time + + # 打开视频 + sensor1 = Sensor("./s1.mp4",isstitch=True,cuda = True,verbose = True) + # 打开摄像头 + # sensor1 = Sensor(0,isstitch=True,cuda = True,verbose = True) + while True: + sensor1.get_img() # 提取并拼接复眼图像 + sensor1.compute_deformation() # 计算形变和分解 + # 提取信息: + # 向量场: VRAW, VNORMAL, VSHEAR: 原始,法向,切向 + # 帧率,时间戳: FPS, TIMESTAMP + # 变形量总和: FNORMAL , FSHEARX, FSHEARY : 法向,切向(X),切向(Y) + fps, fn, fx, fy, flow = sensor1.read_info(sensor1.info.FPS, sensor1.info.FNORMAL, sensor1.info.FSHEARX, sensor1.info.FSHEARY, sensor1.info.VRAW) + + + key = cv2.waitKey(1) + if key & 0xFF == ord("q"): + print("\n 停止程序") + break + + sensor1.disconnect() # 断开传感器连接 + + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/example1_basic.py b/example1_basic.py index 8fd7c36..ebda80c 100644 --- a/example1_basic.py +++ b/example1_basic.py @@ -9,9 +9,9 @@ def main(): global start_time # 打开视频 - # sensor1 = Sensor("./s1.mp4",isstitch=True,cuda = True,verbose = True) + sensor1 = Sensor("./s1.mp4",isstitch=True,cuda = True,verbose = True) # 打开摄像头 - sensor1 = Sensor(0,isstitch=True,cuda = True,verbose = True) + # sensor1 = Sensor(0,isstitch=True,cuda = True,verbose = True) while True: sensor1.get_img() # 提取并拼接复眼图像 sensor1.compute_deformation() # 计算形变和分解