Rectified Images Show unwanted results, OpenCV with Stereo Vision
I am having trouble when trying to create depth map using OpenCV on Python. The problem is that the rectified images appears to be wrapped, or distorted. Here is the code.
https://pastebin.com/embed_js/1DHpCPgv
Long story short, the code performs a series of program begin with:
Reading image file captured from two cameras Calibrate each cameras separately Using instrict matrices and distortion values to be parameters when i call StereoCalibrate() The images folders I used contains 68 different images for each camera (136 in total). The results from calibrateCamera() are 0.77 and 0.94 for each cameras.
The retVal I collected from StereoCalibrate() was huge, 39.0. So I guessed there is problem in the codes.
The images of camera frame captured before and after rectification are shown here: original image rectified image
Now, I truly frustrated as I don't know what I have done wrong? I also tried to search this problem in Google but it's seem that the solution is to calibrate cameras more to get better instrict matrices and distortions values. Personally, I don't believe this is the core issues and think that I did choose wrong parameters for method instead. What do you think? Please gives me some advices ... ~
Thank you so much!
My images collections are something like this: https://imgur.com/a/258ldCr and https://imgur.com/a/KLQJaYU.
What do you think? I have around 600 pics (300 for each camera). I think the more images I have, the better the result be. But the processing time is so slow.
How many images you think is enough?