Giter Site home page Giter Site logo

semi-global-matching's Introduction

Semi-Global Matching

Implementation of the Semi-Global Matching algorithm in Python.

Dependencies

Instructions

$ git clone https://github.com/beaupreda/semi-global-matching.git
$ cd path/to/semi-global-matching

Usage

python3 sgm.py --left [LEFT IMAGE NAME] --right [RIGHT IMAGE NAME] --left_gt [LEFT GT IMAGE NAME] --right_gt [RIGHT GT IMAGE NAME] --output [OUTPUT IMAGE NAME] --disp [MAXIMUM DISPARITY] --images [TRUE OR FALSE] --eval [TRUE OR FALSE]

Example

python3 sgm.py --left cones/im2.png --right cones/im6.png --left_gt cones/disp2.png --right_gt cones/disp6.png --output disparity_map.png --disp 64 --images False --eval True

Other implementations

References

semi-global-matching's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

semi-global-matching's Issues

OverflowError: Python int too large to convert to C long

When using your example:
python sgm.py --left cones/im2.png --right cones/im6.png --left_gt cones/disp2.png --right_gt cones/disp6.png --output disparity_map.png --disp 64 --images False --eval True
I get the following logs:

Loading images...
Starting cost computation...
Computing left and right census...Traceback (most recent call last):
File "sgm.py", line 431, in
sgm()
File "sgm.py", line 392, in sgm
left_cost_volume, right_cost_volume = compute_costs(left, right, parameters, save_images)
File "sgm.py", line 261, in compute_costs
left_img_census[y, x] = np.uint8(left_census)
OverflowError: Python int too large to convert to C long

Recall function is wrong

The in the following lines of the get_recall method,

gt = np.int16(gt / np.amax(gt) * float(args.disp))
disparity = np.int16(np.float32(disparity) / np.amax(disparity) * float(args.disp))

the np.amax(...) functions should be replaced with 255.0.

Using the maximum disparity found makes no sense because it influences the value of all the other disparities.

Can't find the output image

Hey, I've tried your code with the example command. And I can't find this output image disparity_map.png, but left_disparity_map.png and right_disparity_map.png.
Besides, I wanna ask, are these two pictures under cones folder (disp2.png and disp6.png) generated before the command is executed? Because I changed the command python3 sgm.py --left cones/im2.png --right cones/im6.png --left_gt cones/dis2.png --right_gt cones/dis6.png --output disparity_map.png --disp 64 --images False --eval True and could also be executed successfully without the output image.

About post_processing

Thank you for sharing the code!
I test it on middlebury 2006 and the recall rate is about 10%, which is too low to use.
I found there is no consistency check and small patches are now removed, but I've learned they won't improve that much.
I wondered if there are some other possible explanations about this question.
Thank you!

Why the processing time is so long?

First thanks for provide the code.
I use the code to generate disparity map with with KITTI RGB stereo images, and the processing time is nearly 1800 seconds for only one pair images.
The result of stereo matching is good, but why the processing is so long? Is anywhere wrong?

How to change the cost function

I need to test 2 different descriptors (HOG and BRIEF) for my computer vision class and I'm trying to find where they could be used in the code. I believe it would be in the compute_costs function, where the census transform is used (this seems to be very similar to BRIEF).

Am I correct?

Finding Disparity Range

It's taking me quite a long time to look for the disparity range value to set in the command line to get a smooth disparity output from the code. Is there a good way to figure out what disparity range to set the "--disp" parameter to?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.