robotology / stereo-vision

Repository containing apps for stereo vision
https://robotology.github.io/stereo-vision/
GNU General Public License v2.0
19 stars 19 forks source link

SFM refactoring #22

Closed damianomal closed 4 years ago

damianomal commented 4 years ago

There has been the need to execute a git rebase, before the rebase all the commits in my personal branch have been squashed in a single one, to ease the procedure.

This PR regards several parts in the code, which has been slightly refactored to make it easier to add novel matching algorithms.

The GUI, which has been initially developed using imgui, is now based on a different approach, a single header file cvui.h which is shipped with the repository. In this way, the repository does not need any new library, nor any new dependency has been introduced.


Last updates to the DisparityModule

The following is a brief list of the last updates to the DisparityModule code, which has been refactored a little with respect to its original state under the name of SFM. The GUI proposed in the previous iterations has changed, so to avoid additional dependencies to be added to the stereo-vision repository.

This refactoring also regards the addition of the CUDA implementations of the SGBM algorithm and of a bilateral filter for the disparity map.


Code Refactoring

In the previous versions of the SFM module, a few functionalities were spread around in the code. The StereoCamera also carried out the stereo matching phase, making the code more bloated than needed.


Handling of the Stereo Parameters

The stereo parameters were directly enforced within the code at startup. This choice didn't allow flexibility, for an user which wanted to change the default values had to recompile the whole module.

The stereo parameters are saved within the configuration file SFM.ini, and are loaded and saved at runtime. In case the parameters are not available in the configuration file (as in the case you run this new module on a PC for the first time), the usual default values are loaded.

(in addition, the name of the SFM.ini file should be updated to match the new name of the module)


GUI

The former graphical interface based on imgui has been replaced by another one , cvui, which only exploits OpenCV's draw primitives to draw the GUI and to handle the interaction with the user. In addition, the cvui header has been extended to include a radio-button like object, which is needed when selecting the matching algorithm, the filtering methods, and more.

The choice to maintain a GUI is due to the non-trivial amount of fine-tuning which might be needed to carry out every time the DisparityModule is run.

damianomal commented 4 years ago

A small part of the README.MD file has been moved to the top comment in this PR, as a sort of rough "changelog".

pattacini commented 4 years ago

Thanks @damianomal for the modifications πŸ‘ Merging πŸš€