diff --git a/Aim/stereo-depth-estimation-faster/configs/camera_config.py b/Aim/stereo-depth-estimation-faster/configs/camera_config.py deleted file mode 100755 index fdbf4e34e54a3a407ef5bfe0003d57f34967eaa0..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation-faster/configs/camera_config.py +++ /dev/null @@ -1,61 +0,0 @@ -# -*-coding: utf-8 -*- -import numpy as np - - -def camera_stereo(): - """Intel RealSense depth camera""" - width = 640 - height = 480 - intrinsic = np.asarray([[7.6159209686584518e+02, 0., 3.2031427422505453e+02], - [0., 7.6167321445963728e+02, 2.2467546927337131e+02], - [0., 0., 1.]]) - D1 = [3.4834574885170888e-02, -5.5261651661983137e-02, 5.7491952731614823e-04, - -4.2764224824172658e-05, 1.8477350140315381e-02] - config = {} - config["size"] = (width, height) # 图像分辨率 - config["fx"] = intrinsic[0, 0] - config["fy"] = intrinsic[1, 1] - config["cx"] = intrinsic[0, 2] - config["cy"] = intrinsic[1, 2] - config["K1"] = intrinsic # 相机内参 - config["D1"] = D1 - return config - - -def camera_realsense(): - """Intel RealSense depth camera""" - width = 1280 - height = 720 - intrinsic = np.asarray([[920.003, 0., 640.124], - [0., 919.888, 358.495], - [0., 0., 1.]]) - config = {} - config["size"] = (width, height) # 图像分辨率 - config["fx"] = intrinsic[0, 0] - config["fy"] = intrinsic[1, 1] - config["cx"] = intrinsic[0, 2] - config["cy"] = intrinsic[1, 2] - config["K1"] = intrinsic # 相机内参 - config["D1"] = None - return config - - -def camera_kinectv2(): - """kinectv2 camera""" - width = 512 - height = 424 - intrinsic = np.asarray([[364.032, 0., 258.891], - [0., 364.032, 209.32], - [0., 0., 1.]]) - # intrinsic = np.asarray([[366.3530, 0., 262.8683], - # [0., 366.7980, 208.1488], - # [0., 0., 1.]]) - config = {} - config["size"] = (width, height) # 图像分辨率 - config["fx"] = intrinsic[0, 0] - config["fy"] = intrinsic[1, 1] - config["cx"] = intrinsic[0, 2] - config["cy"] = intrinsic[1, 2] - config["K1"] = intrinsic # 相机内参 - config["D1"] = None - return config diff --git a/Aim/stereo-depth-estimation-faster/configs/lenacv-camera/left_cam.yml b/Aim/stereo-depth-estimation-faster/configs/lenacv-camera/left_cam.yml deleted file mode 100755 index d8cbd98c2bbf7334e5a7bc95857295c1747a7c5d..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation-faster/configs/lenacv-camera/left_cam.yml +++ /dev/null @@ -1,20 +0,0 @@ -%YAML:1.0 ---- -size: !!opencv-matrix - rows: 2 - cols: 1 - dt: d - data: [ 640., 480. ] -K: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ 7.6159209686584518e+02, 0., 3.2031427422505453e+02, 0., - 7.6167321445963728e+02, 2.2467546927337131e+02, 0., 0., 1. ] -D: !!opencv-matrix - rows: 1 - cols: 5 - dt: d - data: [ 3.4834574885170888e-02, -5.5261651661983137e-02, - 5.7491952731614823e-04, -4.2764224824172658e-05, - 1.8477350140315381e-02 ] diff --git a/Aim/stereo-depth-estimation-faster/configs/lenacv-camera/right_cam.yml b/Aim/stereo-depth-estimation-faster/configs/lenacv-camera/right_cam.yml deleted file mode 100755 index 17c66a2d6db8fbade03c43cfd056e7138b6b441e..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation-faster/configs/lenacv-camera/right_cam.yml +++ /dev/null @@ -1,20 +0,0 @@ -%YAML:1.0 ---- -size: !!opencv-matrix - rows: 2 - cols: 1 - dt: d - data: [ 640., 480. ] -K: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ 7.6327773941976670e+02, 0., 2.8768149948082271e+02, 0., - 7.6350419442870850e+02, 2.1897333598636970e+02, 0., 0., 1. ] -D: !!opencv-matrix - rows: 1 - cols: 5 - dt: d - data: [ 3.5020972475517692e-02, -4.0770660841280497e-02, - -4.4231087565750534e-04, -1.0552562170995372e-03, - -9.7749906830348537e-02 ] diff --git a/Aim/stereo-depth-estimation-faster/configs/lenacv-camera/stereo_cam.yml b/Aim/stereo-depth-estimation-faster/configs/lenacv-camera/stereo_cam.yml deleted file mode 100755 index 85266bb6abf716af8f98ab45fae302f8ff2736b9..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation-faster/configs/lenacv-camera/stereo_cam.yml +++ /dev/null @@ -1,104 +0,0 @@ -%YAML:1.0 ---- -size: !!opencv-matrix - rows: 2 - cols: 1 - dt: d - data: [ 640., 480. ] -K1: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ 7.6159209686584518e+02, 0., 3.2031427422505453e+02, 0., - 7.6167321445963728e+02, 2.2467546927337131e+02, 0., 0., 1. ] -D1: !!opencv-matrix - rows: 1 - cols: 5 - dt: d - data: [ 3.4834574885170888e-02, -5.5261651661983137e-02, - 5.7491952731614823e-04, -4.2764224824172658e-05, - 1.8477350140315381e-02 ] -K2: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ 7.6327773941976670e+02, 0., 2.8768149948082271e+02, 0., - 7.6350419442870850e+02, 2.1897333598636970e+02, 0., 0., 1. ] -D2: !!opencv-matrix - rows: 1 - cols: 5 - dt: d - data: [ 3.5020972475517692e-02, -4.0770660841280497e-02, - -4.4231087565750534e-04, -1.0552562170995372e-03, - -9.7749906830348537e-02 ] -R: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ 9.9999370552351063e-01, 7.8563885326366346e-04, - 3.4600122760633780e-03, -7.9503151737356746e-04, - 9.9999600079883766e-01, 2.7140949167922721e-03, - -3.4578661403601796e-03, -2.7168286517956050e-03, - 9.9999033095517087e-01 ] -T: !!opencv-matrix - rows: 3 - cols: 1 - dt: d - data: [ -6.0005833133148414e+01, 1.7047017063672587e-01, - 6.0300223404957642e-01 ] -E: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ -1.1005724987007073e-04, -6.0346296076620343e-01, - 1.6883191705475561e-01, 3.9550629985097430e-01, - -1.6255182474732952e-01, 6.0007339329190145e+01, - -1.2276256904913259e-01, -6.0005727085740176e+01, - -1.6345135556766910e-01 ] -F: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ -6.7250769136371160e-10, -3.6870834234286016e-06, - 1.6143104894409041e-03, 2.4160347372858321e-06, - -9.9287680075344234e-07, 2.7862421257891157e-01, - -1.1014218394645766e-03, -2.7856049650040260e-01, 1. ] -R1: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ 9.9997618806974742e-01, -2.0278309638726887e-03, - -6.5963016213173775e-03, 2.0367881225372914e-03, - 9.9999701250432615e-01, 1.3514719999064883e-03, - 6.5935413581266105e-03, -1.3648750875444691e-03, - 9.9997733090723306e-01 ] -R2: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ 9.9994547731576255e-01, -2.8407384289991728e-03, - -1.0048512373976153e-02, 2.8270879178959596e-03, - 9.9999506202764499e-01, -1.3724045434755307e-03, - 1.0052361397026631e-02, 1.3439216883706559e-03, - 9.9994857062992937e-01 ] -P1: !!opencv-matrix - rows: 3 - cols: 4 - dt: d - data: [ 7.3741438842621210e+02, 0., 3.1126281356811523e+02, 0., 0., - 7.3741438842621210e+02, 2.2189782714843750e+02, 0., 0., 0., 1., - 0. ] -P2: !!opencv-matrix - rows: 3 - cols: 4 - dt: d - data: [ 7.3741438842621210e+02, 0., 3.1126281356811523e+02, - -4.4251577456670653e+04, 0., 7.3741438842621210e+02, - 2.2189782714843750e+02, 0., 0., 0., 1., 0. ] -Q: !!opencv-matrix - rows: 4 - cols: 4 - dt: d - data: [ 1., 0., 0., -3.1126281356811523e+02, 0., 1., 0., - -2.2189782714843750e+02, 0., 0., 0., 7.3741438842621210e+02, 0., - 0., 1.6664137886344466e-02, 0. ] diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_000.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_000.png deleted file mode 100755 index cf87ae0a18a7af47af01d0fb1f1b0e12f343af3d..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_000.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_001.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_001.png deleted file mode 100755 index e245e79e2a187ef73390cbe350f31a04c0b4e45c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_001.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_002.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_002.png deleted file mode 100755 index 9be3155db8b18d2955b324025322e80bc3d70f0e..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_002.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_003.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_003.png deleted file mode 100755 index 70208af2bb312eff008f039a98ecc971e9ec6cc5..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_003.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_004.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_004.png deleted file mode 100755 index 336f654b1433e23fc271489e028dca6da6cc1ce4..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_004.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_005.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_005.png deleted file mode 100755 index 470fb4200d0c6fe488641848184ac03b37ec9b70..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_005.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_006.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_006.png deleted file mode 100755 index d37e05728f91ad2c4de3bacbbe9872971c319d27..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_006.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_008.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_008.png deleted file mode 100755 index f1730ce981cc3a2100f7b51c6f32bfbc6142d74c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_008.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_009.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_009.png deleted file mode 100755 index a85f89d43be2a9653849c43e5c4f411a6d4c024c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_009.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_010.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_010.png deleted file mode 100755 index 1a53d2f68e9ca3f9860d7ff0b2821c93141cb3d4..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_010.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_011.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_011.png deleted file mode 100755 index b11d7dbf3fc85b0eb5c5999778268f5d550e938c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_011.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_012.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_012.png deleted file mode 100755 index 5360b2c1beeb32b9c9b89c4e755e403e1f3402a2..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_012.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_013.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_013.png deleted file mode 100755 index f30ad65fc930fb0d99af954289a163d18e49b9ad..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_013.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_014.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_014.png deleted file mode 100755 index a1dd0eace7595667a72ff87f7c6e3ce6a2e97a08..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_014.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_015.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_015.png deleted file mode 100755 index e1d40184d7f6391521c0e7ccda3c4a43d3b55adc..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_015.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_016.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_016.png deleted file mode 100755 index 76a075c25cad8a221a3af9882883ed78d715ec53..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_016.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_017.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_017.png deleted file mode 100755 index 7c67048a534689fc4bde2069784e70e2f1e1b253..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_017.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_018.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_018.png deleted file mode 100755 index a7fee1809cccba5bea2f3661aef0cf8207694757..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_018.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_019.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_019.png deleted file mode 100755 index d6bd9b5ac99dd18c227f47aa69b56d73f29372b1..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_019.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_020.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_020.png deleted file mode 100755 index 8ab04317efdc14d48d25a37fe734a233b716844c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_020.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_021.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_021.png deleted file mode 100755 index 95ceec31d1924966516b1a711ede642e3e01bab8..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_021.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_022.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_022.png deleted file mode 100755 index 25458613ab7966049b8e133fd558e4bca8b5c1b4..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_022.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_023.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_023.png deleted file mode 100755 index d27534105a87500cb9a03b0e632777e4d848c5d2..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_023.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_024.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_024.png deleted file mode 100755 index a4a23c239d87197faa0f0f6acc18f7b18e0b6e1c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_024.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_025.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_025.png deleted file mode 100755 index c6aa31f694f3c251a2d275db0878f23b959a9869..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_025.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_026.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_026.png deleted file mode 100755 index 395420cb6d626a4166d59e7eb70a2411c087850f..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_026.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_027.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_027.png deleted file mode 100755 index b8506826876d36c04df56ddb7810b4ab6a639c4b..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_027.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_028.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_028.png deleted file mode 100755 index 2521df9aacc674221d1e5caa5c4e31a34c644d1c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_028.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_029.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_029.png deleted file mode 100755 index 8ebd9c31e396c3bdaf138a1921c8ff05bc9f2186..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_029.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_030.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_030.png deleted file mode 100755 index 961af7cb6b3fd31b9453c7c3b3fb239776a8a232..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_030.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_031.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_031.png deleted file mode 100755 index 42588ad444ae65f69fc6b9dfc38f63d81861aef9..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/left_031.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_000.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_000.png deleted file mode 100755 index d42097beb0e0a27a5a3a6aa368eaaecdbcd7061e..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_000.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_001.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_001.png deleted file mode 100755 index a1a5bd317e1abe4071d80123d23bc28cc77d0698..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_001.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_002.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_002.png deleted file mode 100755 index 1d0563129ba89b2a04784f395c7b94e6c2e0b173..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_002.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_003.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_003.png deleted file mode 100755 index f68771d32748cb16473dec49b6eef672dda165b9..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_003.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_004.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_004.png deleted file mode 100755 index c20bf49e3e77751c728490dd0f05a3cf3c8a5fa1..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_004.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_005.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_005.png deleted file mode 100755 index 2895cf54fc36139d729d3d57fa4ac405183eafbd..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_005.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_006.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_006.png deleted file mode 100755 index 98b087b7e70bb15b52fffe23784f1a15b655f117..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_006.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_008.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_008.png deleted file mode 100755 index 8331aad3871f0b5c763cfff9625d8d0f3368664a..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_008.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_009.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_009.png deleted file mode 100755 index cbeeb14efd466f6adeca25d7778e1cc2c2ef1e85..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_009.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_010.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_010.png deleted file mode 100755 index ec72f7766001f1f328369c8606dab93866b1a1c7..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_010.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_011.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_011.png deleted file mode 100755 index ff86ee66c82dcd7e53ef7de74b7424b5ded98799..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_011.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_012.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_012.png deleted file mode 100755 index bf6ceb458bc6514df88b4e9cd6acbb169945faf5..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_012.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_013.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_013.png deleted file mode 100755 index 85a8fbbf2917073ba7d2cfad63e66a2e3483dba7..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_013.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_014.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_014.png deleted file mode 100755 index d666f918152ffb55a07dc2b6b1b16ca4ad3aa566..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_014.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_015.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_015.png deleted file mode 100755 index b729ab894e0efbe1a1bc5628634dd15b813f7ac0..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_015.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_016.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_016.png deleted file mode 100755 index 9a9615a567492b5cb179ecac8ed41511bd8dff0b..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_016.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_017.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_017.png deleted file mode 100755 index 08fd08321413985036cd16c589363f2b36c29a91..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_017.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_018.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_018.png deleted file mode 100755 index d8110ba1412f52d1032eb902883eb3e5281596fa..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_018.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_019.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_019.png deleted file mode 100755 index 3d6631e15c064e54c1be6540fe4418b0395239a4..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_019.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_020.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_020.png deleted file mode 100755 index 23f16104dc02479b2a141fe4613308e6e13ab3ed..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_020.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_021.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_021.png deleted file mode 100755 index 3956e94f61e3f3fe1d297774c9487d1a1ebd0022..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_021.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_022.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_022.png deleted file mode 100755 index c34780c6e6245640cfa97ee5e0164fee2ddf8fa0..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_022.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_023.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_023.png deleted file mode 100755 index 132d975cf6c0f367c06077027bac49743b04685d..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_023.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_024.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_024.png deleted file mode 100755 index 2703055ed46b25ea2ebff04640eb5afd9241d42c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_024.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_025.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_025.png deleted file mode 100755 index 4cdacd11b9d3d866fbccc3402b0bc4ca9732036c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_025.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_026.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_026.png deleted file mode 100755 index fbb1448e3da1c9e4327f1dd0666a03534b6bcbae..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_026.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_027.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_027.png deleted file mode 100755 index e9bf32ab13d9f0b0fdf7b10855e66b1a2133ee72..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_027.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_028.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_028.png deleted file mode 100755 index 367dc015f5aebba11b9e1aaaf884ce17af2c77cc..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_028.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_029.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_029.png deleted file mode 100755 index 2c0851c8cc1c5920ea83652ceeb46938214a22a8..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_029.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_030.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_030.png deleted file mode 100755 index 885e17d891d2d59cb9ccc5ddd138228f35654a4b..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_030.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_031.png b/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_031.png deleted file mode 100755 index ba3fafad9f6976a21e6b9de1d8d67ff7db0d0426..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-camera/right_031.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-video/left_video.avi b/Aim/stereo-depth-estimation-faster/data/lenacv-video/left_video.avi deleted file mode 100755 index b21e3181f3788a86be30bf449d4426960659c3c9..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-video/left_video.avi and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/data/lenacv-video/right_video.avi b/Aim/stereo-depth-estimation-faster/data/lenacv-video/right_video.avi deleted file mode 100755 index 8339a8e4cba00df472ea777c93244fd8a28d59b9..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/data/lenacv-video/right_video.avi and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/docs/3d-points.png b/Aim/stereo-depth-estimation-faster/docs/3d-points.png deleted file mode 100755 index 48332be39e82ed7a39e255d90a95ef43d4e845c2..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/docs/3d-points.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/docs/demo.gif b/Aim/stereo-depth-estimation-faster/docs/demo.gif deleted file mode 100755 index 530d03cb462dd2ea9bb2a87fbe1559d56ec57357..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/docs/demo.gif and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/docs/depth.png b/Aim/stereo-depth-estimation-faster/docs/depth.png deleted file mode 100755 index 07dc45c811cb1ca1b96be8a98546c0e55ffff166..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/docs/depth.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/docs/depth_filter.png b/Aim/stereo-depth-estimation-faster/docs/depth_filter.png deleted file mode 100755 index e04b2051fc0b328043d528455e05edbfdd15f17e..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/docs/depth_filter.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/docs/disparity.png b/Aim/stereo-depth-estimation-faster/docs/disparity.png deleted file mode 100755 index 0e01be9772714cc468439a1781aeff6611490687..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/docs/disparity.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/docs/disparity_filter.png b/Aim/stereo-depth-estimation-faster/docs/disparity_filter.png deleted file mode 100755 index 9d91c1dfa6acdb0cc2ad516c94add1b5c463a6fc..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/docs/disparity_filter.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/docs/left.png b/Aim/stereo-depth-estimation-faster/docs/left.png deleted file mode 100755 index 706bda222554320a92a5a40c6215d9c34d21dca9..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/docs/left.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/docs/left_chess.png b/Aim/stereo-depth-estimation-faster/docs/left_chess.png deleted file mode 100755 index 18a1b5eb05cca326098064f1774d1c27d21adbab..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/docs/left_chess.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/docs/open3d.png b/Aim/stereo-depth-estimation-faster/docs/open3d.png deleted file mode 100755 index e78ecb78afea8a5d01f4e4a59fbb0e753d9a4126..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/docs/open3d.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/docs/pcl.png b/Aim/stereo-depth-estimation-faster/docs/pcl.png deleted file mode 100755 index 6466de1778ec7866baf1745ab96712139be50c17..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/docs/pcl.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/docs/pjq.png b/Aim/stereo-depth-estimation-faster/docs/pjq.png deleted file mode 100755 index c9fcac956de1b499a0eb6dd82f39ea4c8265926a..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/docs/pjq.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/docs/rgb.png b/Aim/stereo-depth-estimation-faster/docs/rgb.png deleted file mode 100755 index feabd1ad9476ce67d6a84377221e4127d62260b5..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/docs/rgb.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/docs/right.png b/Aim/stereo-depth-estimation-faster/docs/right.png deleted file mode 100755 index 017a9eb7f2efd12bc5a3aa59ceae0da08f2d339b..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/docs/right.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/docs/right_chess.png b/Aim/stereo-depth-estimation-faster/docs/right_chess.png deleted file mode 100755 index 6eb02b9b3a95c4b0833f8618c595287af7f9ca9e..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation-faster/docs/right_chess.png and /dev/null differ diff --git "a/Aim/stereo-depth-estimation-faster/docs/\345\217\214\347\233\256\346\265\213\350\267\235Demo\350\247\206\351\242\221(C++).MP4" "b/Aim/stereo-depth-estimation-faster/docs/\345\217\214\347\233\256\346\265\213\350\267\235Demo\350\247\206\351\242\221(C++).MP4" deleted file mode 100755 index 9f130f0610fbf10e5873120a1a32fed432b3a23b..0000000000000000000000000000000000000000 Binary files "a/Aim/stereo-depth-estimation-faster/docs/\345\217\214\347\233\256\346\265\213\350\267\235Demo\350\247\206\351\242\221(C++).MP4" and /dev/null differ diff --git "a/Aim/stereo-depth-estimation-faster/docs/\345\217\214\347\233\256\346\265\213\350\267\235Demo\350\247\206\351\242\221(C++).gif" "b/Aim/stereo-depth-estimation-faster/docs/\345\217\214\347\233\256\346\265\213\350\267\235Demo\350\247\206\351\242\221(C++).gif" deleted file mode 100755 index 293c2f465dbd3832c7177069d023918400ec6e75..0000000000000000000000000000000000000000 Binary files "a/Aim/stereo-depth-estimation-faster/docs/\345\217\214\347\233\256\346\265\213\350\267\235Demo\350\247\206\351\242\221(C++).gif" and /dev/null differ diff --git a/Aim/stereo-depth-estimation-faster/get_stereo_images.py b/Aim/stereo-depth-estimation-faster/get_stereo_images.py deleted file mode 100644 index e5313681523a1e7d5ab6e7851ea71885d8ab850a..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation-faster/get_stereo_images.py +++ /dev/null @@ -1,186 +0,0 @@ -import os -import argparse -import cv2 - - -class StereoCamera(object): - """采集双目标定图片,按键盘【c】或【s】保存图片""" - - def __init__(self, chess_width, chess_height, detect=False): - """ - :param chess_width: chessboard width size,即棋盘格宽方向黑白格子相交点个数, - :param chess_height: chessboard height size,即棋盘格长方向黑白格子相交点个数 - :param detect: 是否实时检测棋盘格,方便采集数据 - """ - self.chess_width = chess_width - self.chess_height = chess_height - self.detect = detect - self.criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) - - def detect_chessboard(self, image): - """检测棋盘格""" - gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) - ret, corners = cv2.findChessboardCorners(gray, (self.chess_width, self.chess_height), None) - if ret: - # 角点精检测 - corners2 = cv2.cornerSubPix(gray, corners, (11, 11), (-1, -1), self.criteria) - # Draw and display the corners - image = cv2.drawChessboardCorners(image, (self.chess_width, self.chess_height), corners2, ret) - return image - - def capture2(self, left_video, right_video, save_dir): - """ - 用于采集双USB连接线的双目摄像头 - :param left_video:int or str,左路视频路径或者摄像头ID - :param right_video:int or str,右视频路径或者摄像头ID - :param save_dir: str,保存左右图片的路径 - :return: - """ - self.create_file(save_dir) - capL = cv2.VideoCapture(left_video) - capR = cv2.VideoCapture(right_video) - widthL, heightL, numFramesL, fpsL = self.get_video_info(capL) - widthR, heightR, numFramesR, fpsR = self.get_video_info(capR) - print("capL:\n", widthL, heightL, numFramesL, fpsL) - print("capR:\n", widthR, heightR, numFramesR, fpsR) - save_videoL = self.create_file(save_dir, "video", "left_video.avi") - save_videoR = self.create_file(save_dir, "video", "right_video.avi") - writerL = self.get_video_writer(save_videoL, widthL, heightL, fpsL) - writerR = self.get_video_writer(save_videoR, widthR, heightR, fpsR) - i = 0 - while True: - isuccessL, frameL = capL.read() - isuccessR, frameR = capR.read() - if not (isuccessL and isuccessR): - print("No more frames") - break - if self.detect: - l = self.detect_chessboard(frameL.copy()) - r = self.detect_chessboard(frameR.copy()) - else: - l = frameL.copy() - r = frameR.copy() - cv2.imshow('left', l) - cv2.imshow('right', r) - key = cv2.waitKey(10) - if key == ord('q'): - break - elif key == ord('c') or key == ord('s'): - print("save image:{:0=3d}".format(i)) - cv2.imwrite(os.path.join(save_dir, "left_{:0=3d}.png".format(i)), frameL) - cv2.imwrite(os.path.join(save_dir, "right_{:0=3d}.png".format(i)), frameR) - i += 1 - writerL.write(frameL) - writerR.write(frameR) - capL.release() - capR.release() - cv2.destroyAllWindows() - - def capture1(self, video, save_dir): - """ - 用于采集单USB连接线的双目摄像头(左右摄像头被拼接在同一个视频中显示) - :param video:int or str,视频路径或者摄像头ID - :param save_dir: str,保存左右图片的路径 - """ - self.create_file(save_dir) - cap = cv2.VideoCapture(video) - width, height, numFrames, fps = self.get_video_info(cap) - print("capL:\n", width, height, numFrames, fps) - save_videoL = self.create_file(save_dir, "video", "left_video.avi") - save_videoR = self.create_file(save_dir, "video", "right_video.avi") - writerL = self.get_video_writer(save_videoL, int(width / 2), height, fps) - writerR = self.get_video_writer(save_videoR, int(width / 2), height, fps) - i = 0 - while True: - isuccess, frame = cap.read() - if not isuccess: - print("No more frames") - break - # 分离左右摄像头 - frameL = frame[:, :int(width / 2), :] - frameR = frame[:, int(width / 2):, :] - if self.detect: - l = self.detect_chessboard(frameL.copy()) - r = self.detect_chessboard(frameR.copy()) - else: - l = frameL.copy() - r = frameR.copy() - cv2.imshow('left', l) - cv2.imshow('right', r) - key = cv2.waitKey(10) - if key == ord('q'): - break - elif key == ord('c') or key == ord('s'): - print("save image:{:0=3d}".format(i)) - cv2.imwrite(os.path.join(save_dir, "left_{:0=3d}.png".format(i)), frameL) - cv2.imwrite(os.path.join(save_dir, "right_{:0=3d}.png".format(i)), frameR) - i += 1 - writerL.write(frameL) - writerR.write(frameR) - cap.release() - cv2.destroyAllWindows() - - @staticmethod - def get_video_info(video_cap): - width = int(video_cap.get(cv2.CAP_PROP_FRAME_WIDTH)) - height = int(video_cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) - numFrames = int(video_cap.get(cv2.CAP_PROP_FRAME_COUNT)) - fps = int(video_cap.get(cv2.CAP_PROP_FPS)) - return width, height, numFrames, fps - - @staticmethod - def get_video_writer(save_path, width, height, fps): - if not os.path.exists(os.path.dirname(save_path)): - os.makedirs(os.path.dirname(save_path)) - fourcc = cv2.VideoWriter_fourcc(*'XVID') - frameSize = (int(width), int(height)) - video_writer = cv2.VideoWriter(save_path, fourcc, fps, frameSize) - print("video:width:{},height:{},fps:{}".format(width, height, fps)) - return video_writer - - @staticmethod - def create_file(parent_dir, dir1=None, filename=None): - out_path = parent_dir - if dir1: - out_path = os.path.join(parent_dir, dir1) - if not os.path.exists(out_path): - os.makedirs(out_path) - if filename: - out_path = os.path.join(out_path, filename) - return out_path - - -def str2bool(v): - return v.lower() in ('yes', 'true', 't', 'y', '1') - - -def get_parser(): - width = 8 - height = 11 - left_video = -1 - right_video = 0 - save_dir = "data/camera" - parser = argparse.ArgumentParser(description='Camera calibration') - parser.add_argument('--width', type=int, default=width, help='chessboard width size') - parser.add_argument('--height', type=int, default=height, help='chessboard height size') - parser.add_argument('--left_video', type=int, default=left_video, help='left video file or camera ID') - parser.add_argument('--right_video', type=int, default=right_video, help='right video file or camera ID') - parser.add_argument('--detect', type=str2bool, nargs='?', const=True, help='detect chessboard ') - parser.add_argument('--save_dir', type=str, default=save_dir, help='YML file to save calibrate matrices') - return parser - - -if __name__ == '__main__': - args = get_parser().parse_args() - stereo = StereoCamera(args.width, args.height, detect=args.detect) - if args.left_video > -1 and args.right_video > -1: - # 双USB连接线的双目摄像头 - stereo.capture2(left_video=args.left_video, right_video=args.right_video, save_dir=args.save_dir) - elif args.left_video > -1: - # 单USB连接线的双目摄像头(左右摄像头被拼接在同一个视频中显示) - stereo.capture1(video=args.left_video, save_dir=args.save_dir) - elif args.right_video > -1: - # 单USB连接线的双目摄像头(左右摄像头被拼接在同一个视频中显示) - stereo.capture1(video=args.right_video, save_dir=args.save_dir) - else: - raise Exception("Error: Check your camera{}".format(args.left_video, args.right_video)) \ No newline at end of file diff --git a/Aim/stereo-depth-estimation-faster/reference_output.txt b/Aim/stereo-depth-estimation-faster/reference_output.txt deleted file mode 100644 index bc8ef6e8e0fca6aa984e69efcc02c817448815c5..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation-faster/reference_output.txt +++ /dev/null @@ -1,25 +0,0 @@ -image(x,y)=[217, 297] world coords=(x,y,depth)=[-73.642, 58.6729, 631.029] -image(x,y)=[213, 315] world coords=(x,y,depth)=[-76.9548, 72.9133, 632.573] -image(x,y)=[187, 353] world coords=(x,y,depth)=[-104.75, 110.516, 680.891] -image(x,y)=[275, 367] world coords=(x,y,depth)=[-83.0969, 332.504, 1850.92] -image(x,y)=[373, 312] world coords=(x,y,depth)=[120.481, 175.836, 1576.29] -image(x,y)=[320, 300] world coords=(x,y,depth)=[17.8869, 159.892, 1653.59] -image(x,y)=[311, 232] world coords=(x,y,depth)=[-0.796035, 30.598, 2446.48] -image(x,y)=[410, 278] world coords=(x,y,depth)=[282.149, 160.316, 2308.14] -image(x,y)=[371, 392] world coords=(x,y,depth)=[57.4138, 163.486, 776.311] -image(x,y)=[492, 320] world coords=(x,y,depth)=[552.656, 299.976, 2469.86] -image(x,y)=[504, 237] world coords=(x,y,depth)=[578.299, 45.3134, 2423.55] -image(x,y)=[448, 190] world coords=(x,y,depth)=[422.147, -98.4777, 2493.68] -image(x,y)=[382, 176] world coords=(x,y,depth)=[261.223, -169.495, 2982.83] -image(x,y)=[271, 235] world coords=(x,y,depth)=[-122.336, 39.8101, 2454.22] -image(x,y)=[366, 121] world coords=(x,y,depth)=[223.641, -412.241, 3300.15] -image(x,y)=[363, 240] world coords=(x,y,depth)=[156.704, 54.8288, 2446.48] -image(x,y)=[347, 330] world coords=(x,y,depth)=[67.9463, 205.532, 1535.71] -image(x,y)=[456, 387] world coords=(x,y,depth)=[442.576, 504.848, 2469.86] -image(x,y)=[416, 270] world coords=(x,y,depth)=[300.188, 137.866, 2315.03] -image(x,y)=[333, 238] world coords=(x,y,depth)=[65.8387, 48.7711, 2446.48] -image(x,y)=[333, 238] world coords=(x,y,depth)=[65.8387, 48.7711, 2446.48] -image(x,y)=[266, 246] world coords=(x,y,depth)=[-131.296, 69.9142, 2343.01] -image(x,y)=[266, 246] world coords=(x,y,depth)=[-131.296, 69.9142, 2343.01] - - diff --git a/Aim/stereo-depth-estimation/CMakeLists.txt b/Aim/stereo-depth-estimation/CMakeLists.txt deleted file mode 100644 index 4923dc0534f1c8c2cd234bf28607bd96dde2034e..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(Project) - -add_compile_options(-fPIC) # fix Bug: can not be used when making a shared object -set(CMAKE_CXX_FLAGS "-Wall -std=c++11 -pthread") - -if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - # -DCMAKE_BUILD_TYPE=Debug - # -DCMAKE_BUILD_TYPE=Release - message(STATUS "No build type selected, default to Release") - set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default Debug)" FORCE) -endif () - -# opencv set -find_package(OpenCV REQUIRED) -include_directories(${OpenCV_INCLUDE_DIRS} ./src/) -#MESSAGE(STATUS "OpenCV_INCLUDE_DIRS = ${OpenCV_INCLUDE_DIRS}") - -include_directories(src) -set(SRC_LIST src/stereo_reconstruct.cpp) -add_library(camera SHARED ${SRC_LIST}) -target_link_libraries(camera ${OpenCV_LIBS}) -MESSAGE(STATUS "DIR_SRCS = ${SRC_LIST}") - -add_executable(Demo main.cpp) -target_link_libraries(Demo camera) diff --git a/Aim/stereo-depth-estimation/README.md b/Aim/stereo-depth-estimation/README.md deleted file mode 100644 index c9c237b95081780fd6deb74953a992f6504abf7a..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation/README.md +++ /dev/null @@ -1,50 +0,0 @@ -## 双目解析算法 - -### 1. 相机标定 - -相机标定过程即为根据双目相机拍摄的照片来求出相机的内参数的一个过程。目前相机的标定过程已经有成熟的解决方案,常见的两种解决方案为MatLab所自带的计算机视觉工具包来进行标定;另一种是使用opencv自带的工具库来进行相机的标定。在这里,我们使用MatLab来进行相机的标定。 - -MatLab进行相机标定的过程比较繁琐,在这里不展开说明,请参考这个博客:https://blog.csdn.net/qq_42118719/article/details/112471107?utm_medium=distribute.pc_feed_404.none-task-blog-2~default~BlogCommendFromBaidu~Rate-3-112471107-blog-null.pc_404_mixedpudn&depth_1-utm_source=distribute.pc_feed_404.none-task-blog-2~default~BlogCommendFromBaidu~Rate-3-112471107-blog-null.pc_404_mixedpud - -进行标定之后即可得到相机的内参数。需要注意的一点就是,在得出相机的畸变系数的时候,D矩阵是五维的一个向量,对应了径向畸变和切向畸变。在opencv(也即为我们的项目代码)之中,五个参数的排列方式为[K1, K2, D1, D2, K3](没错,就是这么诡异的一个排列过程)。MatLab则会分别得到两组畸变系数,之间的转换需要注意。 - -标定还需要注意一点,参数R对应双目摄像机的旋转矩阵,在我们的项目代码之中,这个矩阵是3*3的,但是在MatLab标定所得出来的是一个3 * 1的一个旋转向量,需要通过下列的一段代码来进行转换: - -~~~python - import cv2 - import numpy as np - - # 定义旋转矩阵R,旋转向量om - R = [[9.9999370551606337e-01, 7.8563882630048958e-04, 3.4600144345510440e-03], - [-7.9503149273969136e-04, 9.9999600080163187e-01, 2.7140938945082542e-03], - [-3.4578682997252063e-03, -2.7168276311286426e-03, 9.9999033095047696e-01]] - R = np.asarray(R) - print(f"旋转矩阵R:\n {R}") - # 把旋转矩阵R转化为旋转向量om - om, _ = cv2.Rodrigues(R) - print(f"旋转向量om:\n {om}") - # 把旋转向量om转换为旋转矩阵R - R1, _ = cv2.Rodrigues(om) - print(f"旋转矩阵R1:\n {R1}") -~~~ - -自此,标定过程结束。 - -### 2. 双目解析算法 - -有关于双目解析的相关内容都在StereoReconstruct类之中。 - -其中task方法接收参数为两个图像,分别为左目和右目相机传递进来的图像。经过task进行双目测距任务之后,得到了像素坐标的三维重建信息,存储在cv::Mat xyz_coord之中。如果需要打印信息,可以类似于下列代码来得到更详细的信息。 - -会得到[x, y, depth]格式的三维坐标,即为世界坐标系下的三维坐标。**世界坐标系的中心为左目相机的光心**。 - -~~~cpp - cv::Point start; - start = Point(203, 200); - cout << " world coords=(x,y,depth)=" << detector->xyz_coord.at(start) << endl; - -~~~ - -### 3. 缺陷 - -本双目解析算法依据SGBM算法来进行三维重建,一般来说,误差较小。但是遇到光线变化不强烈的地方,重建效果并不好。还有一点需要注意的是,选择像素的时候尽量不要选择在边缘地点。 \ No newline at end of file diff --git a/Aim/stereo-depth-estimation/build.sh b/Aim/stereo-depth-estimation/build.sh deleted file mode 100755 index f50b07f04b42af087faaa82f638488431bc3ad3f..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation/build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -if [ ! -d "build/" ];then - mkdir "build" -else - echo "exist build" -fi -cd build -cmake .. -make -j4 -sleep 1 -./Demo - diff --git a/Aim/stereo-depth-estimation/configs/camera_config.py b/Aim/stereo-depth-estimation/configs/camera_config.py deleted file mode 100644 index fdbf4e34e54a3a407ef5bfe0003d57f34967eaa0..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation/configs/camera_config.py +++ /dev/null @@ -1,61 +0,0 @@ -# -*-coding: utf-8 -*- -import numpy as np - - -def camera_stereo(): - """Intel RealSense depth camera""" - width = 640 - height = 480 - intrinsic = np.asarray([[7.6159209686584518e+02, 0., 3.2031427422505453e+02], - [0., 7.6167321445963728e+02, 2.2467546927337131e+02], - [0., 0., 1.]]) - D1 = [3.4834574885170888e-02, -5.5261651661983137e-02, 5.7491952731614823e-04, - -4.2764224824172658e-05, 1.8477350140315381e-02] - config = {} - config["size"] = (width, height) # 图像分辨率 - config["fx"] = intrinsic[0, 0] - config["fy"] = intrinsic[1, 1] - config["cx"] = intrinsic[0, 2] - config["cy"] = intrinsic[1, 2] - config["K1"] = intrinsic # 相机内参 - config["D1"] = D1 - return config - - -def camera_realsense(): - """Intel RealSense depth camera""" - width = 1280 - height = 720 - intrinsic = np.asarray([[920.003, 0., 640.124], - [0., 919.888, 358.495], - [0., 0., 1.]]) - config = {} - config["size"] = (width, height) # 图像分辨率 - config["fx"] = intrinsic[0, 0] - config["fy"] = intrinsic[1, 1] - config["cx"] = intrinsic[0, 2] - config["cy"] = intrinsic[1, 2] - config["K1"] = intrinsic # 相机内参 - config["D1"] = None - return config - - -def camera_kinectv2(): - """kinectv2 camera""" - width = 512 - height = 424 - intrinsic = np.asarray([[364.032, 0., 258.891], - [0., 364.032, 209.32], - [0., 0., 1.]]) - # intrinsic = np.asarray([[366.3530, 0., 262.8683], - # [0., 366.7980, 208.1488], - # [0., 0., 1.]]) - config = {} - config["size"] = (width, height) # 图像分辨率 - config["fx"] = intrinsic[0, 0] - config["fy"] = intrinsic[1, 1] - config["cx"] = intrinsic[0, 2] - config["cy"] = intrinsic[1, 2] - config["K1"] = intrinsic # 相机内参 - config["D1"] = None - return config diff --git a/Aim/stereo-depth-estimation/configs/lenacv-camera/left_cam.yml b/Aim/stereo-depth-estimation/configs/lenacv-camera/left_cam.yml deleted file mode 100644 index d8cbd98c2bbf7334e5a7bc95857295c1747a7c5d..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation/configs/lenacv-camera/left_cam.yml +++ /dev/null @@ -1,20 +0,0 @@ -%YAML:1.0 ---- -size: !!opencv-matrix - rows: 2 - cols: 1 - dt: d - data: [ 640., 480. ] -K: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ 7.6159209686584518e+02, 0., 3.2031427422505453e+02, 0., - 7.6167321445963728e+02, 2.2467546927337131e+02, 0., 0., 1. ] -D: !!opencv-matrix - rows: 1 - cols: 5 - dt: d - data: [ 3.4834574885170888e-02, -5.5261651661983137e-02, - 5.7491952731614823e-04, -4.2764224824172658e-05, - 1.8477350140315381e-02 ] diff --git a/Aim/stereo-depth-estimation/configs/lenacv-camera/right_cam.yml b/Aim/stereo-depth-estimation/configs/lenacv-camera/right_cam.yml deleted file mode 100644 index 17c66a2d6db8fbade03c43cfd056e7138b6b441e..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation/configs/lenacv-camera/right_cam.yml +++ /dev/null @@ -1,20 +0,0 @@ -%YAML:1.0 ---- -size: !!opencv-matrix - rows: 2 - cols: 1 - dt: d - data: [ 640., 480. ] -K: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ 7.6327773941976670e+02, 0., 2.8768149948082271e+02, 0., - 7.6350419442870850e+02, 2.1897333598636970e+02, 0., 0., 1. ] -D: !!opencv-matrix - rows: 1 - cols: 5 - dt: d - data: [ 3.5020972475517692e-02, -4.0770660841280497e-02, - -4.4231087565750534e-04, -1.0552562170995372e-03, - -9.7749906830348537e-02 ] diff --git a/Aim/stereo-depth-estimation/configs/lenacv-camera/stereo_cam.yml b/Aim/stereo-depth-estimation/configs/lenacv-camera/stereo_cam.yml deleted file mode 100644 index 85266bb6abf716af8f98ab45fae302f8ff2736b9..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation/configs/lenacv-camera/stereo_cam.yml +++ /dev/null @@ -1,104 +0,0 @@ -%YAML:1.0 ---- -size: !!opencv-matrix - rows: 2 - cols: 1 - dt: d - data: [ 640., 480. ] -K1: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ 7.6159209686584518e+02, 0., 3.2031427422505453e+02, 0., - 7.6167321445963728e+02, 2.2467546927337131e+02, 0., 0., 1. ] -D1: !!opencv-matrix - rows: 1 - cols: 5 - dt: d - data: [ 3.4834574885170888e-02, -5.5261651661983137e-02, - 5.7491952731614823e-04, -4.2764224824172658e-05, - 1.8477350140315381e-02 ] -K2: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ 7.6327773941976670e+02, 0., 2.8768149948082271e+02, 0., - 7.6350419442870850e+02, 2.1897333598636970e+02, 0., 0., 1. ] -D2: !!opencv-matrix - rows: 1 - cols: 5 - dt: d - data: [ 3.5020972475517692e-02, -4.0770660841280497e-02, - -4.4231087565750534e-04, -1.0552562170995372e-03, - -9.7749906830348537e-02 ] -R: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ 9.9999370552351063e-01, 7.8563885326366346e-04, - 3.4600122760633780e-03, -7.9503151737356746e-04, - 9.9999600079883766e-01, 2.7140949167922721e-03, - -3.4578661403601796e-03, -2.7168286517956050e-03, - 9.9999033095517087e-01 ] -T: !!opencv-matrix - rows: 3 - cols: 1 - dt: d - data: [ -6.0005833133148414e+01, 1.7047017063672587e-01, - 6.0300223404957642e-01 ] -E: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ -1.1005724987007073e-04, -6.0346296076620343e-01, - 1.6883191705475561e-01, 3.9550629985097430e-01, - -1.6255182474732952e-01, 6.0007339329190145e+01, - -1.2276256904913259e-01, -6.0005727085740176e+01, - -1.6345135556766910e-01 ] -F: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ -6.7250769136371160e-10, -3.6870834234286016e-06, - 1.6143104894409041e-03, 2.4160347372858321e-06, - -9.9287680075344234e-07, 2.7862421257891157e-01, - -1.1014218394645766e-03, -2.7856049650040260e-01, 1. ] -R1: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ 9.9997618806974742e-01, -2.0278309638726887e-03, - -6.5963016213173775e-03, 2.0367881225372914e-03, - 9.9999701250432615e-01, 1.3514719999064883e-03, - 6.5935413581266105e-03, -1.3648750875444691e-03, - 9.9997733090723306e-01 ] -R2: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ 9.9994547731576255e-01, -2.8407384289991728e-03, - -1.0048512373976153e-02, 2.8270879178959596e-03, - 9.9999506202764499e-01, -1.3724045434755307e-03, - 1.0052361397026631e-02, 1.3439216883706559e-03, - 9.9994857062992937e-01 ] -P1: !!opencv-matrix - rows: 3 - cols: 4 - dt: d - data: [ 7.3741438842621210e+02, 0., 3.1126281356811523e+02, 0., 0., - 7.3741438842621210e+02, 2.2189782714843750e+02, 0., 0., 0., 1., - 0. ] -P2: !!opencv-matrix - rows: 3 - cols: 4 - dt: d - data: [ 7.3741438842621210e+02, 0., 3.1126281356811523e+02, - -4.4251577456670653e+04, 0., 7.3741438842621210e+02, - 2.2189782714843750e+02, 0., 0., 0., 1., 0. ] -Q: !!opencv-matrix - rows: 4 - cols: 4 - dt: d - data: [ 1., 0., 0., -3.1126281356811523e+02, 0., 1., 0., - -2.2189782714843750e+02, 0., 0., 0., 7.3741438842621210e+02, 0., - 0., 1.6664137886344466e-02, 0. ] diff --git a/Aim/stereo-depth-estimation/data/left.png b/Aim/stereo-depth-estimation/data/left.png deleted file mode 100644 index 6ac8d626fa1ccc8d5e55c2172bedc7882b925de3..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/left.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_000.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_000.png deleted file mode 100644 index cf87ae0a18a7af47af01d0fb1f1b0e12f343af3d..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_000.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_001.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_001.png deleted file mode 100644 index e245e79e2a187ef73390cbe350f31a04c0b4e45c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_001.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_002.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_002.png deleted file mode 100644 index 9be3155db8b18d2955b324025322e80bc3d70f0e..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_002.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_003.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_003.png deleted file mode 100644 index 70208af2bb312eff008f039a98ecc971e9ec6cc5..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_003.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_004.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_004.png deleted file mode 100644 index 336f654b1433e23fc271489e028dca6da6cc1ce4..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_004.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_005.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_005.png deleted file mode 100644 index 470fb4200d0c6fe488641848184ac03b37ec9b70..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_005.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_006.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_006.png deleted file mode 100644 index d37e05728f91ad2c4de3bacbbe9872971c319d27..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_006.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_008.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_008.png deleted file mode 100644 index f1730ce981cc3a2100f7b51c6f32bfbc6142d74c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_008.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_009.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_009.png deleted file mode 100644 index a85f89d43be2a9653849c43e5c4f411a6d4c024c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_009.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_010.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_010.png deleted file mode 100644 index 1a53d2f68e9ca3f9860d7ff0b2821c93141cb3d4..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_010.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_011.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_011.png deleted file mode 100644 index b11d7dbf3fc85b0eb5c5999778268f5d550e938c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_011.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_012.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_012.png deleted file mode 100644 index 5360b2c1beeb32b9c9b89c4e755e403e1f3402a2..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_012.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_013.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_013.png deleted file mode 100644 index f30ad65fc930fb0d99af954289a163d18e49b9ad..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_013.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_014.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_014.png deleted file mode 100644 index a1dd0eace7595667a72ff87f7c6e3ce6a2e97a08..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_014.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_015.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_015.png deleted file mode 100644 index e1d40184d7f6391521c0e7ccda3c4a43d3b55adc..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_015.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_016.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_016.png deleted file mode 100644 index 76a075c25cad8a221a3af9882883ed78d715ec53..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_016.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_017.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_017.png deleted file mode 100644 index 7c67048a534689fc4bde2069784e70e2f1e1b253..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_017.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_018.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_018.png deleted file mode 100644 index a7fee1809cccba5bea2f3661aef0cf8207694757..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_018.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_019.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_019.png deleted file mode 100644 index d6bd9b5ac99dd18c227f47aa69b56d73f29372b1..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_019.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_020.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_020.png deleted file mode 100644 index 8ab04317efdc14d48d25a37fe734a233b716844c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_020.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_021.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_021.png deleted file mode 100644 index 95ceec31d1924966516b1a711ede642e3e01bab8..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_021.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_022.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_022.png deleted file mode 100644 index 25458613ab7966049b8e133fd558e4bca8b5c1b4..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_022.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_023.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_023.png deleted file mode 100644 index d27534105a87500cb9a03b0e632777e4d848c5d2..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_023.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_024.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_024.png deleted file mode 100644 index a4a23c239d87197faa0f0f6acc18f7b18e0b6e1c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_024.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_025.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_025.png deleted file mode 100644 index c6aa31f694f3c251a2d275db0878f23b959a9869..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_025.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_026.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_026.png deleted file mode 100644 index 395420cb6d626a4166d59e7eb70a2411c087850f..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_026.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_027.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_027.png deleted file mode 100644 index b8506826876d36c04df56ddb7810b4ab6a639c4b..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_027.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_028.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_028.png deleted file mode 100644 index 2521df9aacc674221d1e5caa5c4e31a34c644d1c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_028.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_029.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_029.png deleted file mode 100644 index 8ebd9c31e396c3bdaf138a1921c8ff05bc9f2186..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_029.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_030.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_030.png deleted file mode 100644 index 961af7cb6b3fd31b9453c7c3b3fb239776a8a232..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_030.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/left_031.png b/Aim/stereo-depth-estimation/data/lenacv-camera/left_031.png deleted file mode 100644 index 42588ad444ae65f69fc6b9dfc38f63d81861aef9..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/left_031.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_000.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_000.png deleted file mode 100644 index d42097beb0e0a27a5a3a6aa368eaaecdbcd7061e..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_000.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_001.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_001.png deleted file mode 100644 index a1a5bd317e1abe4071d80123d23bc28cc77d0698..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_001.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_002.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_002.png deleted file mode 100644 index 1d0563129ba89b2a04784f395c7b94e6c2e0b173..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_002.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_003.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_003.png deleted file mode 100644 index f68771d32748cb16473dec49b6eef672dda165b9..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_003.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_004.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_004.png deleted file mode 100644 index c20bf49e3e77751c728490dd0f05a3cf3c8a5fa1..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_004.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_005.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_005.png deleted file mode 100644 index 2895cf54fc36139d729d3d57fa4ac405183eafbd..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_005.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_006.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_006.png deleted file mode 100644 index 98b087b7e70bb15b52fffe23784f1a15b655f117..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_006.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_008.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_008.png deleted file mode 100644 index 8331aad3871f0b5c763cfff9625d8d0f3368664a..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_008.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_009.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_009.png deleted file mode 100644 index cbeeb14efd466f6adeca25d7778e1cc2c2ef1e85..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_009.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_010.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_010.png deleted file mode 100644 index ec72f7766001f1f328369c8606dab93866b1a1c7..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_010.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_011.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_011.png deleted file mode 100644 index ff86ee66c82dcd7e53ef7de74b7424b5ded98799..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_011.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_012.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_012.png deleted file mode 100644 index bf6ceb458bc6514df88b4e9cd6acbb169945faf5..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_012.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_013.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_013.png deleted file mode 100644 index 85a8fbbf2917073ba7d2cfad63e66a2e3483dba7..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_013.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_014.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_014.png deleted file mode 100644 index d666f918152ffb55a07dc2b6b1b16ca4ad3aa566..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_014.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_015.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_015.png deleted file mode 100644 index b729ab894e0efbe1a1bc5628634dd15b813f7ac0..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_015.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_016.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_016.png deleted file mode 100644 index 9a9615a567492b5cb179ecac8ed41511bd8dff0b..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_016.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_017.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_017.png deleted file mode 100644 index 08fd08321413985036cd16c589363f2b36c29a91..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_017.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_018.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_018.png deleted file mode 100644 index d8110ba1412f52d1032eb902883eb3e5281596fa..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_018.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_019.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_019.png deleted file mode 100644 index 3d6631e15c064e54c1be6540fe4418b0395239a4..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_019.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_020.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_020.png deleted file mode 100644 index 23f16104dc02479b2a141fe4613308e6e13ab3ed..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_020.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_021.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_021.png deleted file mode 100644 index 3956e94f61e3f3fe1d297774c9487d1a1ebd0022..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_021.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_022.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_022.png deleted file mode 100644 index c34780c6e6245640cfa97ee5e0164fee2ddf8fa0..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_022.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_023.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_023.png deleted file mode 100644 index 132d975cf6c0f367c06077027bac49743b04685d..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_023.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_024.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_024.png deleted file mode 100644 index 2703055ed46b25ea2ebff04640eb5afd9241d42c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_024.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_025.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_025.png deleted file mode 100644 index 4cdacd11b9d3d866fbccc3402b0bc4ca9732036c..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_025.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_026.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_026.png deleted file mode 100644 index fbb1448e3da1c9e4327f1dd0666a03534b6bcbae..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_026.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_027.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_027.png deleted file mode 100644 index e9bf32ab13d9f0b0fdf7b10855e66b1a2133ee72..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_027.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_028.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_028.png deleted file mode 100644 index 367dc015f5aebba11b9e1aaaf884ce17af2c77cc..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_028.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_029.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_029.png deleted file mode 100644 index 2c0851c8cc1c5920ea83652ceeb46938214a22a8..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_029.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_030.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_030.png deleted file mode 100644 index 885e17d891d2d59cb9ccc5ddd138228f35654a4b..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_030.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-camera/right_031.png b/Aim/stereo-depth-estimation/data/lenacv-camera/right_031.png deleted file mode 100644 index ba3fafad9f6976a21e6b9de1d8d67ff7db0d0426..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-camera/right_031.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-video/left_video.avi b/Aim/stereo-depth-estimation/data/lenacv-video/left_video.avi deleted file mode 100644 index b21e3181f3788a86be30bf449d4426960659c3c9..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-video/left_video.avi and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/lenacv-video/right_video.avi b/Aim/stereo-depth-estimation/data/lenacv-video/right_video.avi deleted file mode 100644 index 8339a8e4cba00df472ea777c93244fd8a28d59b9..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/lenacv-video/right_video.avi and /dev/null differ diff --git a/Aim/stereo-depth-estimation/data/right.png b/Aim/stereo-depth-estimation/data/right.png deleted file mode 100644 index 2bd1c73a4b27020de108f1e6e090f8fccb6ab42b..0000000000000000000000000000000000000000 Binary files a/Aim/stereo-depth-estimation/data/right.png and /dev/null differ diff --git a/Aim/stereo-depth-estimation/main.cpp b/Aim/stereo-depth-estimation/main.cpp deleted file mode 100644 index 7bd816261b2fd9f44001108ca64aba12a5c7f6df..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation/main.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// -// 双目测距Demo -// -#include -#include -#include "stereo_reconstruct.h" - -/*** - * 测试demo视频文件 - * @return - */ -int test_video_file() { - CameraParam camera = camera1;//双目相机参数 - bool use_wls = true; //是否使用WLS滤波器对视差图进行滤波 - StereoReconstruct *detector = new StereoReconstruct(camera, use_wls); - int imageWidth = camera1.width; //单目图像的宽度 - int imageHeight = camera1.height; //单目图像的高度 - string left_video = "../data/lenacv-video/left_video.avi"; - string right_video = "../data/lenacv-video/right_video.avi"; - VideoCapture capL, capR; - bool retL = get_video_capture(left_video, capL, imageWidth, imageHeight); - bool retR = get_video_capture(right_video, capR, imageWidth, imageHeight); - Mat frameL, frameR; - while (retL && retR) { - capL >> frameL; - capR >> frameR; - if (frameL.empty() or frameR.empty()) break; - detector->task(frameL, frameR, 20); - } - capL.release(); //释放对相机的控制 - capR.release(); //释放对相机的控制 - delete detector; - return 0; - -} - - -/*** - * 测试双目摄像头(双USB连接线的双目摄像头) - * @return - */ -int test_camera() { - CameraParam camera = camera1;//双目相机参数 - bool use_wls = true; //是否使用WLS滤波器对视差图进行滤波 - StereoReconstruct *detector = new StereoReconstruct(camera, use_wls); - int imageWidth = camera1.width; //单目图像的宽度 - int imageHeight = camera1.height; //单目图像的高度 - int camera1 = 0; //左摄像头ID号(请修改成自己左摄像头ID号) - int camera2 = 1; //右摄像头ID号(请修改成自己右摄像头ID号) - VideoCapture capL, capR; - bool retL = get_video_capture(camera1, capL, imageWidth, imageHeight); - bool retR = get_video_capture(camera2, capR, imageWidth, imageHeight); - Mat frameL, frameR; - while (retL && retR) { - capL >> frameL; - capR >> frameR; - if (frameL.empty() or frameR.empty()) break; - detector->task(frameL, frameR, 20); - } - capL.release(); //释放对相机的控制 - capR.release(); //释放对相机的控制 - delete detector; - return 0; -} - -/*** - * 测试一对左右图像 - * @return - */ -int test_pair_image_file() { - CameraParam camera = camera1;//双目相机参数 - bool use_wls = true; //是否使用WLS滤波器对视差图进行滤波 - StereoReconstruct *detector = new StereoReconstruct(camera, use_wls); - Mat frameL = imread("../data/left.png", IMREAD_COLOR); - Mat frameR = imread("../data/right.png", IMREAD_COLOR); - detector->task(frameL, frameR, 0); - cv::Point start; - start = Point(203, 200); - cout << " world coords=(x,y,depth)=" << detector->xyz_coord.at(start) << endl; - delete detector; - return 0; -} - - -int main() { - //测试一对左右图像 - test_pair_image_file(); - // //测试demo视频文件 - // test_video_file(); - // //测试双目摄像头(双USB连接线的双目摄像头) - // test_camera(); - // while(1); - return 0; -} diff --git a/Aim/stereo-depth-estimation/rebuild.sh b/Aim/stereo-depth-estimation/rebuild.sh deleted file mode 100755 index ede2e62e59f171f9c0fac104590dc3bc24d093a9..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation/rebuild.sh +++ /dev/null @@ -1,2 +0,0 @@ -rm -rf build -./build.sh diff --git a/Aim/stereo-depth-estimation/src/stereo_reconstruct.cpp b/Aim/stereo-depth-estimation/src/stereo_reconstruct.cpp deleted file mode 100644 index 587ceb625c7fcd79e4a9eaf90330020cc81f5c0e..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation/src/stereo_reconstruct.cpp +++ /dev/null @@ -1,206 +0,0 @@ -#include "stereo_reconstruct.h" -#include "opencv2/ximgproc.hpp" - - -StereoReconstruct::StereoReconstruct(CameraParam camera, bool use_wls) { - this->use_wls = use_wls; - this->image_size = Size(camera.width, camera.height); - //Mat rec = (Mat_(3, 1) << -0.01688, -0.00781, -0.00766); //rec旋转向量 - //Rodrigues(rec, R); //Rodrigues变换:将旋转向量转为旋转矩阵R - //立体校正 - stereoRectify(camera.cameraMatrixL, camera.distCoeffL, - camera.cameraMatrixR, camera.distCoeffR, - image_size, camera.R, - camera.T, Rl, Rr, Pl, Pr, Q, - CALIB_ZERO_DISPARITY, - 0, image_size, - &validROIL, &validROIR); - initUndistortRectifyMap(camera.cameraMatrixL, camera.distCoeffL, Rl, Pl, image_size, CV_32FC1, mapLx, mapLy); - initUndistortRectifyMap(camera.cameraMatrixR, camera.distCoeffR, Rr, Pr, image_size, CV_32FC1, mapRx, mapRy); - - //SGBM算法初始化 - int mindisparity = 0; //最小视差 - int blockSize = 3; //窗口的大小 - int numDisparities = 5 * 16; //最大的视差,要被16整除 - //int P1 = 4 * rectifyImageL.channels() * SADWindowSize* SADWindowSize; //惩罚系数1 - //int P2 = 32 * rectifyImageL.channels() * SADWindowSize* SADWindowSize; //惩罚系数2 - int P1 = 8 * 3 * blockSize; //惩罚系数1 - int P2 = 32 * 3 * blockSize; //惩罚系数2 - sgbm = cv::StereoSGBM::create(mindisparity, numDisparities, blockSize); - sgbm->setP1(P1); - sgbm->setP2(P2); - sgbm->setDisp12MaxDiff(12); //视差图的像素点检查 - sgbm->setUniquenessRatio(10); //代价方程概率因子 - sgbm->setSpeckleWindowSize(50); //针对散斑滤波的窗口大小 - sgbm->setSpeckleRange(32); //相邻像素点的视差值浮动范围 - sgbm->setPreFilterCap(63); //滤波系数 - //sgbm->setMode(cv::StereoSGBM::MODE_HH); - sgbm->setMode(cv::StereoSGBM::MODE_SGBM_3WAY); - -} - - -StereoReconstruct::~StereoReconstruct() { - mapLx.release(); - mapLy.release(); - mapRx.release(); - mapRy.release(); - Rl.release(); - Rr.release(); - Pl.release(); - Pr.release(); - Q.release(); - sgbm.release(); -} - -void StereoReconstruct::task(Mat frameL, Mat frameR, int delay) { - // 畸变校正和立体校正 - Mat rectifiedL, rectifiedR; - this->get_rectify_image(frameL, frameR, rectifiedL, rectifiedR); - // 绘制等间距平行线,检查立体校正的效果 - this->show_rectify_result(rectifiedL, rectifiedR); - // Get the disparity map 获得视差图 - Mat dispL; - this->get_disparity(rectifiedL, rectifiedR, dispL, this->use_wls); - //用于存放每个像素点距离相机镜头的三维坐标 - Mat points_3d; - this->get_3dpoints(dispL, points_3d); - xyz_coord = points_3d; - // 显示视差图效果 - this->show_2dimage(frameL, frameR, points_3d, dispL, delay); -} - -void StereoReconstruct::get_rectify_image(Mat &imgL, Mat &imgR, Mat &rectifiedL, Mat &rectifiedR) { - //经过remap之后,左右相机的图像已经共面并且行对准 - //remap(grayL, rectifyImageL, mapLx, mapLy, INTER_LINEAR); - //remap(grayR, rectifyImageR, mapRx, mapRy, INTER_LINEAR); - remap(imgL, rectifiedL, mapLx, mapLy, INTER_LINEAR); - remap(imgR, rectifiedR, mapRx, mapRy, INTER_LINEAR); -} - -void StereoReconstruct::show_rectify_result(cv::Mat rectifiedL, cv::Mat rectifiedR) { - //把校正结果显示出来 - //show_image("ImageL After Rectify", rectifiedL, 1); - //show_image("ImageR After Rectify", rectifiedR, 1); - //显示在同一张图上 - Mat canvas; - double sf; - int w, h; - sf = 600. / MAX(image_size.width, image_size.height); - w = cvRound(image_size.width * sf); - h = cvRound(image_size.height * sf); - canvas.create(h, w * 2, CV_8UC3); - - //左图像画到画布上 - Mat canvasPart = canvas(Rect(w * 0, 0, w, h)); //得到画布的一部分 - resize(rectifiedL, canvasPart, canvasPart.size(), 0, 0, INTER_AREA); //把图像缩放到跟canvasPart一样大小 - Rect vroiL(cvRound(validROIL.x * sf), cvRound(validROIL.y * sf), //获得被截取的区域 - cvRound(validROIL.width * sf), cvRound(validROIL.height * sf)); - //rectangle(canvasPart, vroiL, Scalar(0, 0, 255), 3, 8); - //cout << "Painted ImageL" << endl; - - //右图像画到画布上 - canvasPart = canvas(Rect(w, 0, w, h)); //获得画布的另一部分 - resize(rectifiedR, canvasPart, canvasPart.size(), 0, 0, INTER_LINEAR); - Rect vroiR(cvRound(validROIR.x * sf), cvRound(validROIR.y * sf), - cvRound(validROIR.width * sf), cvRound(validROIR.height * sf)); - //rectangle(canvasPart, vroiR, Scalar(0, 0, 255), 3, 8); - //cout << "Painted ImageR" << endl; - //画上对应的线条 - for (int i = 0; i < canvas.rows; i += 16) - line(canvas, Point(0, i), Point(canvas.cols, i), Scalar(0, 255, 0), 1, 8); - // show_image("rectified", canvas, 1); -} - -void StereoReconstruct::get_disparity(Mat &imgL, Mat &imgR, Mat &dispL, bool use_wls) { - //https://blog.csdn.net/nayuanxiu8089/article/details/126227633 - //Mat rectifyImageL, rectifyImageR; - cvtColor(imgL, imgL, COLOR_BGR2GRAY); - cvtColor(imgR, imgR, COLOR_BGR2GRAY); - sgbm->compute(imgL, imgR, dispL); - if (use_wls) { - //RightMatcher 初始化 - int lmbda = 80000; - float sigma = 1.3; - Ptr matcherR = cv::ximgproc::createRightMatcher(sgbm); - cv::Mat dispR; - matcherR->compute(imgR, imgL, dispR); - auto filter = cv::ximgproc::createDisparityWLSFilter(sgbm); - filter->setLambda(lmbda); - filter->setSigmaColor(sigma); - filter->filter(dispL, imgL, dispL, dispR); - } - //除以16得到真实视差(因为SGBM算法得到的视差是×16的) - //clip_min(dispL,0,0); - dispL.convertTo(dispL, CV_32F, 1.0 / 16); -} - -void StereoReconstruct::get_3dpoints(Mat &disp, Mat &points_3d, float scale) { - //在实际求距离时ReprojectTo3D出来 - reprojectImageTo3D(disp, points_3d, Q, true); - points_3d = points_3d * scale; -} - -void StereoReconstruct::show_2dimage(Mat &frameL, Mat &frameR, Mat &points_3d, Mat &disp, int delay) { - //显示结果 - vector xy_depth; - split(points_3d, xy_depth); //分离出深度通道 - cv::Mat depth = xy_depth[2]; - - // show_image("left", frameL, 1); - // show_image("right", frameR, 1); - // 可视化视差图 - Mat disp_colormap(disp.size(), CV_8UC3); - get_visual_depth(disp, disp_colormap); - // show_image("disparity-color", disp_colormap, 1); - - // 可视化深度图 - Mat depth_colormap(depth.size(), CV_8UC3); - get_visual_depth(depth, depth_colormap); - //鼠标响应函数setMouseCallback - // namedWindow(depth_windows, WINDOW_AUTOSIZE); - // setMouseCallback(depth_windows, onMouse, 0); - // show_image(depth_windows, depth_colormap, delay); -} - -void StereoReconstruct::get_visual_depth(cv::Mat &depth, cv::Mat &colormap, float clip_max) //颜色变换 -{ - clip(depth, 0.0, clip_max); - Mat int8disp = Mat(depth.rows, depth.cols, CV_8UC1); //用于显示 - normalize(depth, int8disp, 0, 255, NORM_MINMAX, CV_8UC1); - //medianBlur(int8disp, int8disp, 9); //中值滤波 - cv::applyColorMap(int8disp, colormap, cv::COLORMAP_JET); -} - -void StereoReconstruct::clip(cv::Mat &src, float vmin, float vmax) { - int h = src.rows; - int w = src.cols; - if (src.isContinuous() && src.isContinuous()) { - h = 1; - w = w * src.rows * src.channels(); - } - for (int i = 0; i < h; i++) { - float *sptr = src.ptr(i); - for (int j = 0; j < w; j++) { - //*dptr++ = *sptr++; - sptr[j] = sptr[j] < vmax ? sptr[j] : vmax; - sptr[j] = sptr[j] > vmin ? sptr[j] : vmin; - } - } -} - -void StereoReconstruct::clip_min(cv::Mat &src, float th, float v) { - int h = src.rows; - int w = src.cols; - if (src.isContinuous() && src.isContinuous()) { - h = 1; - w = w * src.rows * src.channels(); - } - for (int i = 0; i < h; i++) { - float *sptr = src.ptr(i); - for (int j = 0; j < w; j++) { - //*dptr++ = *sptr++; - sptr[j] = sptr[j] < th ? v : sptr[j]; - } - } -} \ No newline at end of file diff --git a/Aim/stereo-depth-estimation/src/stereo_reconstruct.h b/Aim/stereo-depth-estimation/src/stereo_reconstruct.h deleted file mode 100644 index 94daa6a7bdb461a39d12c30acb7abba1b42a79d4..0000000000000000000000000000000000000000 --- a/Aim/stereo-depth-estimation/src/stereo_reconstruct.h +++ /dev/null @@ -1,211 +0,0 @@ -#ifndef CAMERA_CALIBRATION_RECONSTRUCT_CPP_STEREO_RECONSTRUCT_H -#define CAMERA_CALIBRATION_RECONSTRUCT_CPP_STEREO_RECONSTRUCT_H - -#include -#include - -using namespace std; -using namespace cv; - - -/** - * 双目摄像头的相机参数 - */ -struct CameraParam { - int width; //图像的宽度width - int height; //图像的高度height - Mat cameraMatrixL; //左相机内参K1(3×3) - Mat distCoeffL; //左相机畸变系数D1(5×1) - Mat cameraMatrixR; //右相机内参K2(3×3) - Mat distCoeffR; //右相机畸变系数D2(5×1) - Mat T; //平移向量T(3×1) - Mat R; //旋转矩阵R(3×3),如果是(3×1)旋转向量,请使用cv::Rodrigues()进行变换转为(3×3)旋转矩阵R -}; - -/*** - * 设置摄像头参数,需要根据双目摄像头标定结果进行填写 - */ -static CameraParam camera1 = {640,//width - 480,//height - (Mat_(3, 3) - << 7.6159209686633153e+02, 0., 3.2031427422691633e+02, 0., 7.6167321446015626e+02, 2.2467546926913309e+02, 0., 0., 1.),//cameraMatrixL - (Mat_(5, 1) - << 3.4834574887256914e-02, -5.5261651680159028e-02, 5.7491952534806736e-04, -4.2764223950233445e-05, 1.8477350164208820e-02),//distCoeffL - (Mat_(3, 3) - << 7.6327773983796783e+02, 0., 2.8768149776326379e+02, 0., 7.6350419482215057e+02, 2.1897333669573928e+02, 0., 0., 1.), - (Mat_(5, 1) - << 3.5020967512300320e-02, -4.0770565902033332e-02, -4.4231049297594003e-04, -1.0552565496142535e-03, -9.7750314807571667e-02), - (Mat_(3, 1) - << -6.0005833075452117e+01, 1.7047023105446815e-01, 6.0300273851103448e-01), - (Mat_(3, 3) - << 9.9999370551606337e-01, 7.8563882630048958e-04, 3.4600144345510440e-03, -7.9503149273969136e-04, 9.9999600080163187e-01, 2.7140938945082542e-03, -3.4578682997252063e-03, -2.7168276311286426e-03, 9.9999033095047696e-01), -}; - -// /*** -// * 显示图像 -// * @param winname 窗口名称 -// * @param image 图像 -// * @param delay 显示延迟,0表示阻塞显示 -// * @param flags 显示方式 -// */ -// static void show_image(const string &winname, cv::Mat &image, int delay = 0, int flags = cv::WINDOW_AUTOSIZE) { -// cv::namedWindow(winname, flags); -// cv::imshow(winname, image); -// cv::waitKey(delay); -// } - -// /*** -// * 读取视频文件 -// * @param video_file 视频文件 -// * @param cap 视频流对象 -// * @param width 设置图像的宽度 -// * @param height 设置图像的高度 -// * @param fps 设置视频播放频率 -// * @return -// */ -// bool get_video_capture(string video_file, cv::VideoCapture &cap, int width = -1, int height = -1, int fps = -1) { -// //VideoCapture video_cap; -// cap.open(video_file); -// if (width > 0 && height > 0) { -// cap.set(cv::CAP_PROP_FRAME_WIDTH, width); //设置图像的宽度 -// cap.set(cv::CAP_PROP_FRAME_HEIGHT, height); //设置图像的高度 -// } -// if (fps > 0) { -// cap.set(cv::CAP_PROP_FPS, fps); -// } -// if (!cap.isOpened())//判断是否读取成功 -// { -// return false; -// } -// return true; -// } - -// /*** -// * 读取摄像头 -// * @param camera_id 摄像头ID号,默认从0开始 -// * @param cap 视频流对象 -// * @param width 设置图像的宽度 -// * @param height 设置图像的高度 -// * @param fps 设置视频播放频率 -// * @return -// */ -// bool get_video_capture(int camera_id, cv::VideoCapture &cap, int width = -1, int height = -1, int fps = -1) { -// //VideoCapture video_cap; -// cap.open(camera_id); //摄像头ID号,默认从0开始 -// if (width > 0 && height > 0) { -// cap.set(cv::CAP_PROP_FRAME_WIDTH, width); //设置捕获图像的宽度 -// cap.set(cv::CAP_PROP_FRAME_HEIGHT, height); //设置捕获图像的高度 -// } -// if (fps > 0) { -// cap.set(cv::CAP_PROP_FPS, fps); -// } -// if (!cap.isOpened()) //判断是否成功打开相机 -// { -// return false; -// } -// return true; -// } - -class StereoReconstruct { -public: - cv::Mat xyz_coord; //用于存放每个像素点距离相机镜头的三维坐标 - - /*** - * 构造函数,初始化StereoReconstruct - * @param camera 双目相机参数 - * @param use_wls 是否使用WLS滤波器对视差图进行滤波 - */ - StereoReconstruct(CameraParam camera, bool use_wls = true); - - /*** - * release - */ - ~StereoReconstruct(); - - /*** - * 开始双目测距任务 - * @param frameL - * @param frameR - */ - void task(Mat frameL, Mat frameR, int delay = 0); - - /*** - * 畸变校正和立体校正 - * @param imgL 左视图 - * @param imgR 右视图 - * @param rectifiedL 校正后左视图 - * @param rectifiedR 校正后右视图 - */ - void get_rectify_image(Mat &imgL, Mat &imgR, Mat &rectifiedL, Mat &rectifiedR); - - /*** - * 获得视差图 - * @param imgL 畸变校正和立体校正后的左视图 - * @param imgR 畸变校正和立体校正后的右视图 - * @param dispL 返回视差图 - * @param use_wls 是否使用WLS滤波器对视差图进行滤波 - */ - void get_disparity(Mat &imgL, Mat &imgR, Mat &dispL, bool use_wls = true);//SGBM匹配算法 - - /*** - * 计算像素点的3D坐标(左相机坐标系下) - * @param disp 视差图 - * @param points_3d 返回三维坐标points_3d,三个通道分布表示(X,Y,Z),其中Z是深度图depth, 即距离,单位是毫米(mm) - * @param scale 单位变换尺度,默认scale=1.0,单位为毫米 - */ - void get_3dpoints(Mat &disp, Mat &points_3d, float scale = 1.0); - - /*** - * 将输入深度图转换为伪彩色图,方面可视化 - * @param depth - * @param colormap - */ - void get_visual_depth(cv::Mat &depth, cv::Mat &colormap, float clip_max = 6000.0); - - /*** - * 显示矫正效果 - * @param rectifiedL - * @param rectifiedR - */ - void show_rectify_result(cv::Mat rectifiedL, cv::Mat rectifiedR); - - /*** - * 可视化视差图和深度图 - * @param frameL - * @param frameR - * @param points_3d - * @param disp - * @param delay - */ - void show_2dimage(Mat &frameL, Mat &frameR, Mat &points_3d, Mat &disp, int delay); - - /*** - * 显示Mat的最大最小值 - * @param src - * @param vmin 最小值下限 - * @param vmax 最大值下限 - */ - void clip(cv::Mat &src, float vmin, float vmax); - - /*** - * 显示Mat的最大最小值 - * @param src - * @param th - * @param vmin - */ - void clip_min(cv::Mat &src, float th, float vmin); - - -public: - string depth_windows = "depth-color"; // 深度图的窗口名称 - int use_wls; // 是否使用WLS滤波器对视差图进行滤波 - Size image_size; // 图像宽高(width,height) - Rect validROIL; // 图像校正之后,会对图像进行裁剪,这里的左视图裁剪之后的区域 - Rect validROIR; // 图像校正之后,会对图像进行裁剪,这里的右视图裁剪之后的区域 - Mat mapLx, mapLy, mapRx, mapRy; // 映射表 - Mat Rl, Rr, Pl, Pr, Q; // 校正后的旋转矩阵R,投影矩阵P, 重投影矩阵Q - cv::Ptr sgbm; -}; - - -#endif //CAMERA_CALIBRATION_RECONSTRUCT_CPP_STEREO_RECONSTRUCT_H diff --git a/Aim/stereo-depth-estimation-faster/.gitignore b/Aim/stereobased-depth-estimation/.gitignore similarity index 100% rename from Aim/stereo-depth-estimation-faster/.gitignore rename to Aim/stereobased-depth-estimation/.gitignore diff --git a/Aim/stereo-depth-estimation-faster/CMakeLists.txt b/Aim/stereobased-depth-estimation/CMakeLists.txt similarity index 100% rename from Aim/stereo-depth-estimation-faster/CMakeLists.txt rename to Aim/stereobased-depth-estimation/CMakeLists.txt diff --git a/Aim/stereo-depth-estimation-faster/build.sh b/Aim/stereobased-depth-estimation/build.sh similarity index 100% rename from Aim/stereo-depth-estimation-faster/build.sh rename to Aim/stereobased-depth-estimation/build.sh diff --git a/Aim/stereo-depth-estimation-faster/data/left.png b/Aim/stereobased-depth-estimation/data/left.png similarity index 100% rename from Aim/stereo-depth-estimation-faster/data/left.png rename to Aim/stereobased-depth-estimation/data/left.png diff --git a/Aim/stereo-depth-estimation-faster/data/left12.png b/Aim/stereobased-depth-estimation/data/left12.png similarity index 100% rename from Aim/stereo-depth-estimation-faster/data/left12.png rename to Aim/stereobased-depth-estimation/data/left12.png diff --git a/Aim/stereo-depth-estimation-faster/data/right.png b/Aim/stereobased-depth-estimation/data/right.png similarity index 100% rename from Aim/stereo-depth-estimation-faster/data/right.png rename to Aim/stereobased-depth-estimation/data/right.png diff --git a/Aim/stereo-depth-estimation-faster/data/right12.png b/Aim/stereobased-depth-estimation/data/right12.png similarity index 100% rename from Aim/stereo-depth-estimation-faster/data/right12.png rename to Aim/stereobased-depth-estimation/data/right12.png diff --git a/Aim/stereobased-depth-estimation/lefttest.png b/Aim/stereobased-depth-estimation/lefttest.png new file mode 100644 index 0000000000000000000000000000000000000000..4f4ff05de4768d6e684986b9988b94b9f8fdab6d Binary files /dev/null and b/Aim/stereobased-depth-estimation/lefttest.png differ diff --git a/Aim/stereo-depth-estimation-faster/main.cpp b/Aim/stereobased-depth-estimation/main.cpp similarity index 39% rename from Aim/stereo-depth-estimation-faster/main.cpp rename to Aim/stereobased-depth-estimation/main.cpp index 3eb058febdeb2c72f7b685017524aa70eb9069a2..0f09d203a11935536d08afd00520e5673f030aae 100755 --- a/Aim/stereo-depth-estimation-faster/main.cpp +++ b/Aim/stereobased-depth-estimation/main.cpp @@ -15,17 +15,22 @@ int test_pair_image_file() { bool use_wls = true; //是否使用WLS滤波器对视差图进行滤波 auto start_time = std::chrono::high_resolution_clock::now(); StereoReconstruct *detector = new StereoReconstruct(camera, use_wls); - Mat frameL = imread("../data/left12.png", IMREAD_COLOR); - Mat frameR = imread("../data/right12.png", IMREAD_COLOR); + Mat frameL = imread("../lefttest.png", IMREAD_COLOR); + Mat frameR = imread("../righttest.png", IMREAD_COLOR); int test_batch = 100; - for(auto i=0; itask(frameL, frameR, 0);} - auto end_time = std::chrono::high_resolution_clock::now(); - auto duration = std::chrono::duration_cast(end_time - start_time); - std::cout << "处理100张图片需要时间 " << duration.count() << " 秒" << std::endl; - int total_time = duration.count(); - double time_for_sigle_pic = double(total_time) / double(test_batch); - std::cout << "处理一张图片所需要的时间 " << time_for_sigle_pic << std::endl; - std::cout << "每秒处理 " << 1 / time_for_sigle_pic << " 张" << std::endl; + detector->task(frameL, frameR, 0); + // for(auto i=0; itask(frameL, frameR, 0);} + // auto end_time = std::chrono::high_resolution_clock::now(); + // auto duration = std::chrono::duration_cast(end_time - start_time); + // std::cout << "处理100张图片需要时间 " << duration.count() / 1000000 << " 秒" << std::endl; + // int total_time = duration.count(); + // double time_for_sigle_pic = (double(total_time) / double(test_batch)) / 1000000; + // std::cout << "处理一张图片所需要的时间 " << time_for_sigle_pic << std::endl; + // std::cout << "每秒处理 " << 1 / time_for_sigle_pic << " 张" << std::endl; + auto x = 108 * 8; + auto y = 84 * 8; + auto point = detector->get_depth(x, y); + cout << " world coords=(x,y,depth)=" << point << endl; delete detector; return 0; } diff --git a/Aim/stereobased-depth-estimation/righttest.png b/Aim/stereobased-depth-estimation/righttest.png new file mode 100644 index 0000000000000000000000000000000000000000..0b423ac8529d2543b8c78267289018f78075e53f Binary files /dev/null and b/Aim/stereobased-depth-estimation/righttest.png differ diff --git a/Aim/stereo-depth-estimation-faster/scripts/stereo_camera_calibration.sh b/Aim/stereobased-depth-estimation/scripts/stereo_camera_calibration.sh similarity index 100% rename from Aim/stereo-depth-estimation-faster/scripts/stereo_camera_calibration.sh rename to Aim/stereobased-depth-estimation/scripts/stereo_camera_calibration.sh diff --git a/Aim/stereo-depth-estimation-faster/src/stereo_reconstruct.cpp b/Aim/stereobased-depth-estimation/src/stereo_reconstruct.cpp similarity index 91% rename from Aim/stereo-depth-estimation-faster/src/stereo_reconstruct.cpp rename to Aim/stereobased-depth-estimation/src/stereo_reconstruct.cpp index a9d548815f5d07342dcb499a9f9f5c11a2f8d0be..f13d3f69d4950e501c010f8f2e24163bcdab0816 100755 --- a/Aim/stereo-depth-estimation-faster/src/stereo_reconstruct.cpp +++ b/Aim/stereobased-depth-estimation/src/stereo_reconstruct.cpp @@ -21,7 +21,7 @@ StereoReconstruct::StereoReconstruct(CameraParam camera, bool use_wls) { //SGBM算法初始化 int mindisparity = 0; //最小视差 int blockSize = 3; //窗口的大小 - int numDisparities = 5 * 16; //最大的视差,要被16整除 + int numDisparities = 2 * 16; //最大的视差,要被16整除 //int P1 = 4 * rectifyImageL.channels() * SADWindowSize* SADWindowSize; //惩罚系数1 //int P2 = 32 * rectifyImageL.channels() * SADWindowSize* SADWindowSize; //惩罚系数2 int P1 = 8 * 3 * blockSize; //惩罚系数1 @@ -29,11 +29,11 @@ StereoReconstruct::StereoReconstruct(CameraParam camera, bool use_wls) { sgbm = cv::StereoSGBM::create(mindisparity, numDisparities, blockSize); sgbm->setP1(P1); sgbm->setP2(P2); - sgbm->setDisp12MaxDiff(12); //视差图的像素点检查 + sgbm->setDisp12MaxDiff(6); //视差图的像素点检查 sgbm->setUniquenessRatio(10); //代价方程概率因子 sgbm->setSpeckleWindowSize(50); //针对散斑滤波的窗口大小 sgbm->setSpeckleRange(32); //相邻像素点的视差值浮动范围 - sgbm->setPreFilterCap(63); //滤波系数 + sgbm->setPreFilterCap(10); //滤波系数 //sgbm->setMode(cv::StereoSGBM::MODE_HH); sgbm->setMode(cv::StereoSGBM::MODE_SGBM_3WAY); @@ -55,8 +55,12 @@ StereoReconstruct::~StereoReconstruct() { void StereoReconstruct::task(Mat frameL, Mat frameR, int delay) { // 畸变校正和立体校正 - cv::resize(frameL, frameL, cv::Size(640, 480)); - cv::resize(frameR, frameR, cv::Size(640, 480)); + resize(frameL, frameL, Size(160, 120),0, 0, INTER_AREA); + resize(frameR, frameR, Size(160, 120),0, 0, INTER_AREA); + auto alpha = 3.0; + auto beta = 10; + cv::addWeighted( frameL, alpha, 0, beta, 0.0, frameL); + cv::addWeighted( frameR, alpha, 0, beta, 0.0, frameR); Mat rectifiedL, rectifiedR; this->get_rectify_image(frameL, frameR, rectifiedL, rectifiedR); // Get the disparity map 获得视差图 @@ -68,11 +72,6 @@ void StereoReconstruct::task(Mat frameL, Mat frameR, int delay) { this->xyz_coord = points_3d; // 显示视差图效果 this->show_2dimage(frameL, frameR, points_3d, dispL, delay); - auto x = 217; - auto y = 297; - auto start = Point(x, y); - cout << "image(x,y)=" << start; - cout << " world coords=(x,y,depth)=" << this->xyz_coord.at(start) << endl; } void StereoReconstruct::get_rectify_image(Mat &imgL, Mat &imgR, Mat &rectifiedL, Mat &rectifiedR) { @@ -90,8 +89,8 @@ void StereoReconstruct::get_disparity(Mat &imgL, Mat &imgR, Mat &dispL, bool use sgbm->compute(imgL, imgR, dispL); if (use_wls) { //RightMatcher 初始化 - int lmbda = 80000; - float sigma = 1.3; + int lmbda = 70000; + float sigma = 1.5; Ptr matcherR = cv::ximgproc::createRightMatcher(sgbm); cv::Mat dispR; matcherR->compute(imgR, imgL, dispR); @@ -171,8 +170,8 @@ void StereoReconstruct::clip_min(cv::Mat &src, float th, float v) { Vec3f StereoReconstruct::get_depth(int x, int y) { - x = x / 2; - y = y / 2; + x = x / 8; + y = y / 8; auto start = Point(x, y); return this->xyz_coord.at(start); } \ No newline at end of file diff --git a/Aim/stereo-depth-estimation-faster/src/stereo_reconstruct.h b/Aim/stereobased-depth-estimation/src/stereo_reconstruct.h similarity index 80% rename from Aim/stereo-depth-estimation-faster/src/stereo_reconstruct.h rename to Aim/stereobased-depth-estimation/src/stereo_reconstruct.h index 03bbac888dfa539452b15ab9a5938689f4a00dad..16bab3ed97cf60190f7ecd9e6d382bf732ebf3f9 100755 --- a/Aim/stereo-depth-estimation-faster/src/stereo_reconstruct.h +++ b/Aim/stereobased-depth-estimation/src/stereo_reconstruct.h @@ -24,20 +24,20 @@ struct CameraParam { /*** * 设置摄像头参数,需要根据双目摄像头标定结果进行填写 */ -static CameraParam camera1 = {640,//width - 480,//height +static CameraParam camera1 = {160,//width + 120,//height (Mat_(3, 3) - << 7.6159209686633153e+02, 0., 3.2031427422691633e+02, 0., 7.6167321446015626e+02, 2.2467546926913309e+02, 0., 0., 1.),//cameraMatrixL + << 308.7855094131674, 0.31091498774504506 , 69.9341238179575 , 0., 310.76672955190173 , 59.36337990463306 , 0., 0., 1.), (Mat_(5, 1) - << 3.4834574887256914e-02, -5.5261651680159028e-02, 5.7491952534806736e-04, -4.2764223950233445e-05, 1.8477350164208820e-02),//distCoeffL + << -0.5329432856272157, 4.1576440944457, 0.008862956474550227, 0.01660031454360939, -18.731896260188506), (Mat_(3, 3) - << 7.6327773983796783e+02, 0., 2.8768149776326379e+02, 0., 7.6350419482215057e+02, 2.1897333669573928e+02, 0., 0., 1.), + << 311.12058270514814, 1.1740173821284094, 93.19436456135558, 0.0, 312.5017211301807, 59.46962409347001,0.0, 0.0, 1.0),//cameraMatrixL (Mat_(5, 1) - << 3.5020967512300320e-02, -4.0770565902033332e-02, -4.4231049297594003e-04, -1.0552565496142535e-03, -9.7750314807571667e-02), - (Mat_(3, 1) - << -6.0005833075452117e+01, 1.7047023105446815e-01, 6.0300273851103448e-01), + << -0.381910460742849, 3.2818028571489686, 0.001006863019038812, -0.0056844462721264855, -25.189893989686563),//distCoeffL + (Mat_(3, 1) + << -1.641527515043756e+02, -4.992500853571420, -4.677436778048536), (Mat_(3, 3) - << 9.9999370551606337e-01, 7.8563882630048958e-04, 3.4600144345510440e-03, -7.9503149273969136e-04, 9.9999600080163187e-01, 2.7140938945082542e-03, -3.4578682997252063e-03, -2.7168276311286426e-03, 9.9999033095047696e-01), + << 0.9942866471026351, -0.04316417351155671, -0.09762641813804525, 0.04320981684857618, 0.9990646610204853, -0.001647673491775584, 0.09760622480821969, -0.0025801598956700232, 0.9952217680766432), }; /***