私はdepth map with OpenCV
で作業しています。私はそれを得ることができますが、左カメラ原点から再構成され、この後者の小さな傾きがあり、図でわかるように、奥行きは「シフト」します(奥行きは近く、水平勾配なし)。Python - 回転角度からのOpenCVの透視変換
、
P = np.dot(cam,np.dot(Transl,np.dot(Rot,A1)))
dst = cv2.warpPerspective(depth, P, (2048, 2048))
と...私はあなたが以下を参照できるようワープ透視機能を試みるが、私はヌルフィールドを取得します。
#Projection 2D -> 3D matrix
A1 = np.zeros((4,3))
A1[0,0] = 1
A1[0,2] = -1024
A1[1,1] = 1
A1[1,2] = -1024
A1[3,2] = 1
#Rotation matrice around the Y axis
theta = np.deg2rad(5)
Rot = np.zeros((4,4))
Rot[0,0] = np.cos(theta)
Rot[0,2] = -np.sin(theta)
Rot[1,1] = 1
Rot[2,0] = np.sin(theta)
Rot[2,2] = np.cos(theta)
Rot[3,3] = 1
#Translation matrix on the X axis
dist = 0
Transl = np.zeros((4,4))
Transl[0,0] = 1
Transl[0,2] = dist
Transl[1,1] = 1
Transl[2,2] = 1
Transl[3,3] = 1
#Camera Intrisecs matrix 3D -> 2D
cam = np.concatenate((C1,np.zeros((3,1))),axis=1)
cam[2,2] = 1
P = np.dot(cam,np.dot(Transl,np.dot(Rot,A1)))
dst = cv2.warpPerspective(Z0_0, P, (2048*3, 2048*3))
LATER
EDIT:https://filex.ec-lille.fr/get?k=cCBoyoV4tbmkzSV5bi6:
はあなたがここに32MBのフィールドのデータセットをダウンロードすることができます。次に、画像をロードして表示します:
from matplotlib import pyplot as plt
import numpy as np
img = np.load('testZ0.npy')
plt.imshow(img)
plt.show()
なぜあなたはあなたの答えを削除しましたか? – user3601754
[この回答](http://stackoverflow.com/q/33497736/1510289)があなたに役立つかもしれません。 –
ありがとう私はそれをチェック;) – user3601754