可显示景深图
1
.gitignore
vendored
@ -328,3 +328,4 @@ ASALocalRun/
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
/1.png
|
||||
|
16
.vscode/launch.json
vendored
Normal file
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
17
Stereo.py
Normal file
@ -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()
|
23
StereoVidComfort.py
Normal file
@ -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()
|
BIN
pic_cn/小巷.jpg
Normal file
After Width: | Height: | Size: 238 KiB |
BIN
pic_cn/恐龙.jpg
Normal file
After Width: | Height: | Size: 922 KiB |
BIN
pic_cn/林中小径.jpg
Normal file
After Width: | Height: | Size: 924 KiB |
BIN
pic_cn/校园.jpg
Normal file
After Width: | Height: | Size: 527 KiB |
BIN
pic_cn/楼梯.jpg
Normal file
After Width: | Height: | Size: 1.0 MiB |
BIN
pic_cn/渡口.jpg
Normal file
After Width: | Height: | Size: 594 KiB |
BIN
pic_cn/白鸽.jpg
Normal file
After Width: | Height: | Size: 395 KiB |
BIN
pic_cn/花.jpg
Normal file
After Width: | Height: | Size: 165 KiB |
BIN
pic_cn/铁塔.jpg
Normal file
After Width: | Height: | Size: 653 KiB |
BIN
pic_cn/雪花.jpg
Normal file
After Width: | Height: | Size: 417 KiB |
BIN
pic_en/1.jpg
Normal file
After Width: | Height: | Size: 395 KiB |
BIN
pic_en/10.jpg
Normal file
After Width: | Height: | Size: 527 KiB |
BIN
pic_en/2.jpg
Normal file
After Width: | Height: | Size: 594 KiB |
BIN
pic_en/3.jpg
Normal file
After Width: | Height: | Size: 165 KiB |
BIN
pic_en/4.jpg
Normal file
After Width: | Height: | Size: 922 KiB |
BIN
pic_en/5.jpg
Normal file
After Width: | Height: | Size: 924 KiB |
BIN
pic_en/6.jpg
Normal file
After Width: | Height: | Size: 1.0 MiB |
BIN
pic_en/7.jpg
Normal file
After Width: | Height: | Size: 417 KiB |
BIN
pic_en/8.jpg
Normal file
After Width: | Height: | Size: 653 KiB |
BIN
pic_en/9.jpg
Normal file
After Width: | Height: | Size: 238 KiB |