All Projects → thien → stereo.vision

thien / stereo.vision

Licence: LGPL-3.0 license
planar fitting computation using stereo vision techniques

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to stereo.vision

edge-computer-vision
Edge Computer Vision Course
Stars: ✭ 41 (+115.79%)
Mutual labels:  computer, vision
frc-score-detection
A program to detect FRC match scores from their livestream.
Stars: ✭ 15 (-21.05%)
Mutual labels:  vision
Chimera
System Remote Control Discord Bot written in Python discord.py
Stars: ✭ 77 (+305.26%)
Mutual labels:  computer
ebook
Third edition of the Computer Networking: Principles, Protocols and Practice ebook
Stars: ✭ 64 (+236.84%)
Mutual labels:  computer
SBTCVM-Gen2-9
SBTCVM is a virtual machine implementation of a balanced ternary (base 3) computer. Features several compiled languages for ternary software development.
Stars: ✭ 32 (+68.42%)
Mutual labels:  computer
Cs Books
📚 Computer Science Books 计算机技术类书籍 PDF
Stars: ✭ 2,915 (+15242.11%)
Mutual labels:  computer
book
计算机书籍整理
Stars: ✭ 63 (+231.58%)
Mutual labels:  computer
sam-textvqa
Official code for paper "Spatially Aware Multimodal Transformers for TextVQA" published at ECCV, 2020.
Stars: ✭ 51 (+168.42%)
Mutual labels:  vision
Grocery-Product-Detection
This repository builds a product detection model to recognize products from grocery shelf images.
Stars: ✭ 73 (+284.21%)
Mutual labels:  vision
IT-Terms-EN-CN
English to Chinese Translation Table for IT Terminologies , ITEC (IT術語及計算機科學術語中英文對照表)
Stars: ✭ 53 (+178.95%)
Mutual labels:  computer
awesome-gamedev
A compilation of game dev related media (podcasts, Youtube, article, books, etc..)
Stars: ✭ 49 (+157.89%)
Mutual labels:  computer
ccpu
A 8-bit computer made of 74xx series logic gates and memory ICs.
Stars: ✭ 31 (+63.16%)
Mutual labels:  computer
Learnable-Image-Resizing
TF 2 implementation Learning to Resize Images for Computer Vision Tasks (https://arxiv.org/abs/2103.09950v1).
Stars: ✭ 48 (+152.63%)
Mutual labels:  vision
asm-simulator
16-bit Assembler Simulator
Stars: ✭ 46 (+142.11%)
Mutual labels:  computer
autonomous-delivery-robot
Repository for Autonomous Delivery Robot project of IvLabs, VNIT
Stars: ✭ 65 (+242.11%)
Mutual labels:  vision
bcomp-extended
Emulator of basic computer
Stars: ✭ 21 (+10.53%)
Mutual labels:  computer
Prototypical-Networks
A novel method for few shot learning
Stars: ✭ 47 (+147.37%)
Mutual labels:  computer
Hardware.Info
Battery, BIOS, CPU - processor, storage drive, keyboard, RAM - memory, monitor, motherboard, mouse, NIC - network adapter, printer, sound card - audio card, graphics card - video card. Hardware.Info is a .NET Standard 2.0 library and uses WMI on Windows, /dev, /proc, /sys on Linux and sysctl, system_profiler on macOS.
Stars: ✭ 238 (+1152.63%)
Mutual labels:  computer
pybv
A lightweight I/O utility for the BrainVision data format, written in Python.
Stars: ✭ 18 (-5.26%)
Mutual labels:  vision
nested-transformer
Nested Hierarchical Transformer https://arxiv.org/pdf/2105.12723.pdf
Stars: ✭ 174 (+815.79%)
Mutual labels:  vision

Stereo Vision

Loop

The task was to find the plane on the images, and find the visible road. Bonus points for detecting objects on the road, and for drawing the normal of the plane. A video of the full lap can be found at https://www.youtube.com/watch?v=cNyDkLB4jSc.

Run:

Assuming you have access to the data, this program can be run with:

python3 loop.py

1. Pre Filtering

When both images are loaded, they are faced with gamma corrections followed by a greyscale conversion. Afterwards, the greyscale images are faced with histogram equalisation to counter any defects on colours ranges.

2. Disparity Processing

The left and right greyscale image channels are then used to create the disparity. In the event that there is information missing, black points in the disparity image (produced as a result of noise from the input channels) are filled using the values from the previous disparity through overlaying. This improves in quality over time as more information is stored, and works especially well when the car is not travelling fast.

Disparity before and after filling

3. Disparity Post-Processing

A heuristic is used where the majority of the road tends to fit within a certain area within the image. A mask that fits the road is used as our guide, and make a masked disparity image from it.

View Range Mask

4. Disparity to Point Clouds

We convert the disparities (both the original disparity, and the masked disparity) to point clouds. To improve the performance, we increment the step counter by 2 (such that it skips a point per iteration). For the original disparity, we also store rgb values of image_L.

This reduces the number of operations whilst retaining sufficient points needed to compute an accurate plane. Other step counters have been considered but during experiments it is found to lose too much information.

The ZMax cap is no longer used (from the original code), but we use the disparity value of a given point to calculate the Z Position:

Z = f*B/disparity(y,x).

5. Plane Finding with RANSAC

RANSAC is used to compute a plane using 3 random points from the point cloud of the original disparity. We iterate this 600 times, storing the best plane throughout the iterations. We measure the performance of the plane by calculating the mean error from our random sample of points from a random sample (400 points) of the masked disparity point cloud. The lower the mean error, the better the plane fitting.

Computing the plane using the disparity image has been trialed (to bypass computing a 3d point cloud), but this has shown to be less precise due to the disparity range. Increasing the max_disparity variable does not improve this.

6. Generating Road Points

For each point in the original disparity we calculate its distance from the plane using the plane coefficients. We threshold points if they are far enough.

A histogram is then calculated for the remaining points, using the HSV Hue value of each point. With this histogram, we remove points that are not within the most populous colours using a colour threshold.

The remaining points from the cloud are projected back to 2D image points.

7. Cleaning Road Points

From the road image, we perform a series of image manipulation operations:

  • Morphological closing to fill small holes within the road image
  • Eroding with a 9x9 kernel
  • Capping the road image view by masking it upon a road threshold mask
  • Performing another morphological closing
  • Removing noisy/small pixels again through contour detection

Green points represents points on the plane.

8. Obstacle Detection

With Obstacle detection, we look at the points within the convex hull of the remaining road image. Points that are not recognised as the road but are within the confines of the hull are treated as obstacles on the road.

This is performed by:

  • creating a convex hull of the road image
  • creating a mask using the convex hull
  • inverting the original road image to show the obstacle spots and overlaying the mask created prior
  • colouring the corresponding points yellow
  • overlaying the obstacle points onto the resulting image

9. Drawing Road and Normal Shapes

This is done by drawing the convex hull on the image. Then, the centre point is calculated from the points generated from the hull. A normal vector line is generated by converting the centre point into a 3D coordinate, and using the normal vector, we calculate a new point by adjusting the Y point, keeping the X point and using the vector equation to calculate the new Z point. The new 3d point is then converted back to a 2D point and the pair of points is sent back to be drawn on the image.

Yellow represents obstacles in the image; Blue line represents normal direction.

Performance

Pre-Plane Filtering Accuracy. Red Line represents line of best fit. We average 97% of road pixels on the plane.

Time Histogram.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].