"The use of passive stereo camera to reconstruct depth for a very large distance application"
Setup
- Install Python 3.10 and Packages
pip install -r requirements.txt
How to run the code using PyCharm?
Open the terminal on PyCharm
- Active Camera and Take images from both cameras
python take_images.py
- Calculate the distance and disparity
python stereo_vision.py
- Calculate the disparity
python stereo_vision.py
All the given steps followed from the key-paper to perform the proposed approach. Following key-points are mentioned below and whole model divided into the milestones.
The first milestone contains the following points:
- Arrange a dataset to test the model, (left-side camera, right-side camera images of the objects)
- There are no public datasets available. So, we have created the dataset for testing the model we will be using in this project. Chessboard used to capture their left and right camera images.
- Data Pre-processing (remove noise, enhance images, and prepare images for model)
- Two cameras set for the stereo calibration (Logitech C270 Webcams)
- Calibration code added in which first it reads the images and gives calibration matrix
- A GitHub repo is created where these data and descriptions uploaded for version control
- Performed multiple options to set the stereo calibration
Here are the camera settings for this dataset acquisition:
Camera Specification
Logitech C270 WebCameras
These cameras have some specification:
Dimensions including fixed mounting clip
- Height: 2.87 in (72.91 mm)
- Width: 1.26 in (31.91 mm)
- Depth: 2.62 in (66.64 mm)
- Cable length: 5 ft (1.5 m)
- Weight: 2.65 oz (75 g)
Camera Technical Specifications
- Max Resolution: 720p/30fps
- Camera megapixel: 0.9
- Focus type: fixed focus
- Built-in mic: Mono
- Mic range: Up to 3 ft (1 m)
- The diagonal field of view (dFoV): 55°
- Universal mounting clip fits laptops, LCDs or monitors
The second milestone contains the following points:
- Input the left image (left cam) and right image (right cam)
- Stereo Rectification performed
- Logistic regression applied in the model and get best results
- Machine Learning (More algorithms are In-Progress)
- Deep Learning Algorithms Training (In-Progress)
- Obtained the left rectified and right rectified images
- Parameters for Distortion Calibration
- Stereo Matching
- Distance Measurement
- Model Evaluation
Suggest to improve by the following points:
- Processing time reduced (it's realtime distance calculation)
- New algorithm used (polynomial regression)
- Tune the algorithm's parameters(Done)
- Any change as compared to the key paper(Key paper uses simple formula to calculate the distance using z = f*B/d, but in our approach we are using polynomial regression of order 3 based on disparity)
Test 1
Disparity vs Distance results
Graphical Representation
Test 2
Dataset
Proposed Model Prediction