ステレオカメラのセットアップを調整および修正するために、Python 2.7でOpenCV3.1を使用しています。cv2.remap() を使用して整流マトリックスと歪み補正マトリックスを画像に適用しようとすると、次のエラーが発生します。
Traceback (most recent call last):
File "C:\University\Year3\Third Year Project - Gaze Correction\EclipseWorkspace\PythonTest\videoCap.py", line 36, in <module>
stereoCalib.rectify(frames)
File "C:\University\Year3\Third Year Project - Gaze Correction\EclipseWorkspace\PythonTest\Calibrator.py", line 137, in rectify
borderMode=cv2.BORDER_CONSTANT )
TypeError: an integer is required
私のコードはこれです:
new_frames = []
new_img=[]
for i, side in enumerate(("left", "right")):
new_img = cv2.remap(frames[i],
new_img,
self.undistortion_map[side],
self.rectification_map[side],
cv2.INTER_CUBIC,
borderMode=cv2.BORDER_CONSTANT )
new_frames.append(new_img)
INTER_CUBIC と BORDER_CONSTANT を int(1) と int(0) に交互に設定してみました。最後に np.zeros(3) スカラーも追加しましたが、すべての試行でエラーは同じままでした。