Skip to content

A straightforward Siamese network designed for block matching to generate a disparity map

License

Notifications You must be signed in to change notification settings

farhad-dalirani/Siamese-Net-Stereo-Depth

Repository files navigation

Siamese CNN for Block Matching in Stereo Images Depth Mapping

Stereo image depth mapping often involves rectifying images and then establishing corresponding points between the left and right images. Patch matching is a common method for finding these corresponding points, where a neighborhood of pixels in both images is compared. Many computer vision libraries offer simple methods like Sum of Absolute Differences (SAD) for comparing patch similarity.

This repository contains a Siamese Convolutional Neural Network trained using Hinge loss. The network is trained on a subset of the KITTI 2015 disparity dataset.

The following figures illustrate the Siamese network architecture and its comparison with the OpenCV block matching algorithm. As depicted, the Siamese network produces higher-quality disparity images.

Siamese vs OpenCV

Model Architecture

To experiment with more complex neural networks, modify the PyTorch model in model.py.

For more intricate models, you can augment the KITTI_disparity_subset dataset with more samples of KITTI.

To generate disparity maps, utilize the functions in disparity_map.py, and refer to the example in example_disparity_KITTI_siamese.py.

About

A straightforward Siamese network designed for block matching to generate a disparity map

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages