diff --git a/.gitignore b/.gitignore index 3e759b7..8ba4f56 100644 --- a/.gitignore +++ b/.gitignore @@ -328,3 +328,4 @@ ASALocalRun/ # MFractors (Xamarin productivity tool) working folder .mfractor/ +/1.png diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..5a243ac --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + + { + "name": "Python: 当前文件", + "type": "python", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal" + } + ] +} \ No newline at end of file diff --git a/Stereo.py b/Stereo.py new file mode 100644 index 0000000..8d782b5 --- /dev/null +++ b/Stereo.py @@ -0,0 +1,17 @@ + +import numpy as np +import matplotlib +import cv2 +import os +from matplotlib import pyplot as plt + + + +img = cv2.imread("1.png", 0) + +imgL = np.split(img, 2, 1)[0] +imgR = np.split(img, 2, 1)[1] +stereo = cv2.StereoBM_create(numDisparities=32, blockSize=25) +disparity = stereo.compute(imgL, imgR) +plt.imshow(disparity) +plt.show() diff --git a/StereoVidComfort.py b/StereoVidComfort.py new file mode 100644 index 0000000..716ca02 --- /dev/null +++ b/StereoVidComfort.py @@ -0,0 +1,23 @@ +import ffmpeg +import numpy as np +import matplotlib +import cv2 +import os +from matplotlib import pyplot as plt + + +imgDirs = os.listdir("./pic_en") + + + +for imgDir in imgDirs: + dir = "./pic_en/"+imgDir + print (dir) + img = cv2.imread(dir, 0) + + imgL = np.split(img, 2, 1)[0] + imgR = np.split(img, 2, 1)[1] + stereo = cv2.StereoBM_create(numDisparities=64, blockSize=11) + disparity = stereo.compute(imgL, imgR) + plt.imshow(disparity) + plt.show() diff --git a/pic_cn/小巷.jpg b/pic_cn/小巷.jpg new file mode 100644 index 0000000..5b941be Binary files /dev/null and b/pic_cn/小巷.jpg differ diff --git a/pic_cn/恐龙.jpg b/pic_cn/恐龙.jpg new file mode 100644 index 0000000..a519b09 Binary files /dev/null and b/pic_cn/恐龙.jpg differ diff --git a/pic_cn/林中小径.jpg b/pic_cn/林中小径.jpg new file mode 100644 index 0000000..dee5616 Binary files /dev/null and b/pic_cn/林中小径.jpg differ diff --git a/pic_cn/校园.jpg b/pic_cn/校园.jpg new file mode 100644 index 0000000..8814a7a Binary files /dev/null and b/pic_cn/校园.jpg differ diff --git a/pic_cn/楼梯.jpg b/pic_cn/楼梯.jpg new file mode 100644 index 0000000..e094f92 Binary files /dev/null and b/pic_cn/楼梯.jpg differ diff --git a/pic_cn/渡口.jpg b/pic_cn/渡口.jpg new file mode 100644 index 0000000..2457db4 Binary files /dev/null and b/pic_cn/渡口.jpg differ diff --git a/pic_cn/白鸽.jpg b/pic_cn/白鸽.jpg new file mode 100644 index 0000000..1d74f22 Binary files /dev/null and b/pic_cn/白鸽.jpg differ diff --git a/pic_cn/花.jpg b/pic_cn/花.jpg new file mode 100644 index 0000000..130e573 Binary files /dev/null and b/pic_cn/花.jpg differ diff --git a/pic_cn/铁塔.jpg b/pic_cn/铁塔.jpg new file mode 100644 index 0000000..2956a74 Binary files /dev/null and b/pic_cn/铁塔.jpg differ diff --git a/pic_cn/雪花.jpg b/pic_cn/雪花.jpg new file mode 100644 index 0000000..7232ffe Binary files /dev/null and b/pic_cn/雪花.jpg differ diff --git a/pic_en/1.jpg b/pic_en/1.jpg new file mode 100644 index 0000000..1d74f22 Binary files /dev/null and b/pic_en/1.jpg differ diff --git a/pic_en/10.jpg b/pic_en/10.jpg new file mode 100644 index 0000000..8814a7a Binary files /dev/null and b/pic_en/10.jpg differ diff --git a/pic_en/2.jpg b/pic_en/2.jpg new file mode 100644 index 0000000..2457db4 Binary files /dev/null and b/pic_en/2.jpg differ diff --git a/pic_en/3.jpg b/pic_en/3.jpg new file mode 100644 index 0000000..130e573 Binary files /dev/null and b/pic_en/3.jpg differ diff --git a/pic_en/4.jpg b/pic_en/4.jpg new file mode 100644 index 0000000..a519b09 Binary files /dev/null and b/pic_en/4.jpg differ diff --git a/pic_en/5.jpg b/pic_en/5.jpg new file mode 100644 index 0000000..dee5616 Binary files /dev/null and b/pic_en/5.jpg differ diff --git a/pic_en/6.jpg b/pic_en/6.jpg new file mode 100644 index 0000000..e094f92 Binary files /dev/null and b/pic_en/6.jpg differ diff --git a/pic_en/7.jpg b/pic_en/7.jpg new file mode 100644 index 0000000..7232ffe Binary files /dev/null and b/pic_en/7.jpg differ diff --git a/pic_en/8.jpg b/pic_en/8.jpg new file mode 100644 index 0000000..2956a74 Binary files /dev/null and b/pic_en/8.jpg differ diff --git a/pic_en/9.jpg b/pic_en/9.jpg new file mode 100644 index 0000000..5b941be Binary files /dev/null and b/pic_en/9.jpg differ