stereo-calibration | : camera : : camera : Stereo camera calibration | Camera library
kandi X-RAY | stereo-calibration Summary
kandi X-RAY | stereo-calibration Summary
This repository contains some sources to calibrate the intrinsics of individual cameras and also the extrinsics of a stereo pair.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of stereo-calibration
stereo-calibration Key Features
stereo-calibration Examples and Code Snippets
Community Discussions
Trending Discussions on stereo-calibration
QUESTION
This is a problem concerning stereo calibration and rectification using openCV (vers. 4.5.1.48) and Python (vers. 3.8.5).
I have two cameras placed on the same axis as shown on the image below:
The left (upper) camera is taking pictures with 640x480 resolution, while the right (lower) camera is taking pictures with 320x240 resolution. The goal is to find an object on the right image (320x240) and crop out the same object on the left image (640x480). In other words; To transfer the rectangle that makes up the object in the right image, to the left image. This idea is sketched below.
A red object is found on the right image and I need to transfer it's location to left image and crop it out. The objects is placed on a flat plane 30cm from the camera lenses. In other words; The distance (depth) from the two cameras lenses to the flat plane is constant (30cm).
This main question is about how transfer a location from one image to another, when two cameras are placed side by side, when the images are of different resolutions and when the depth is (fairly) constant. It's not a question about finding objects.
To solve this problem, as far as I know, stereo calibration must be used, and I have found the following articles/code, among other things:
- https://github.com/bvnayak/stereo_calibration/blob/master/camera_calibrate.py
- https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_calib3d/py_calibration/py_calibration.html
- https://python.plainenglish.io/the-depth-i-stereo-calibration-and-rectification-24da7b0fb1e0
Below are an example of a calibration pattern that I used:
I have 25 photos of the calibration pattern with the left and right camera. The pattern is 5x9 and the square sizes is 40x40 mm.
Based on my knowledge, I have written the following code:
...ANSWER
Answered 2021-Apr-26 at 19:02I solved this problem by using the following openCV functions:
cv2.findChessboardCorners()
cv2.cornerSubPix()
cv2.findHomography()
cv2.warpPerspective()
I used the calibration plate at a distance of 30cm to calculate the perspective transformation matrix, H. Because of this, I can map an object from the right image to the left image. The depth has to be constant (30 cm) though, which is a bit problematic, but it is acceptable in my case.
Thanks to @Micka for the great answers.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install stereo-calibration
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page