Image Stitching for NVIDIA Jetson/User Guide/Homography estimation: Difference between revisions

m
no edit summary
mNo edit summary
Tag: Manual revert
mNo edit summary
 
Line 88: Line 88:
A new folder will be created with the name ''ENV_NAME''. To activate the virtual environment, run the following command:
A new folder will be created with the name ''ENV_NAME''. To activate the virtual environment, run the following command:


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
source $ENV_NAME/bin/activate
source $ENV_NAME/bin/activate
</syntaxhighlight>
</syntaxhighlight>
Line 94: Line 94:
Source the virtual environment each time you want to use it. To install the packages in the virtual environment:
Source the virtual environment each time you want to use it. To install the packages in the virtual environment:


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
pip install numpy
pip install numpy
pip install opencv-contrib-python
pip install opencv-contrib-python
Line 179: Line 179:
These are the complete options of the script.
These are the complete options of the script.


<syntaxhighlight>
<syntaxhighlight lang="bash">
python homography_estimation.py --help
python homography_estimation.py --help
usage: ./homography_estimation.py [-h] [--config CONFIG] --reference_image
usage: ./homography_estimation.py [-h] [--config CONFIG] --reference_image
Line 240: Line 240:
The following example will estimate the homography of two images, with the left one fixed in multiple modes. In all cases, the following configuration file is used:
The following example will estimate the homography of two images, with the left one fixed in multiple modes. In all cases, the following configuration file is used:


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
// config.json
// config.json


Line 266: Line 266:
The command to perform the estimation is:
The command to perform the estimation is:


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
python homography_estimation.py left_fixed --config /path/to/config.json --reference_image /path/to/cam1.png --target_image /path/to/cam2.png
python homography_estimation.py left_fixed --config /path/to/config.json --reference_image /path/to/cam1.png --target_image /path/to/cam2.png
</syntaxhighlight>
</syntaxhighlight>
Line 272: Line 272:
The output will be something like this:
The output will be something like this:


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
matches: 69
matches: 69
"matrix":{"h00":1.1762953900821504,"h01":0.18783005980813444, "h02":1382.1180307642137, "h10":0.019908986235761796, "h11":1.0951514369488284, "h12":0.6427298229101379, "h20":6.676211791348554e-05, "h21":8.14441129307644e-05, "h22":1.0}
"matrix":{"h00":1.1762953900821504,"h01":0.18783005980813444, "h02":1382.1180307642137, "h10":0.019908986235761796, "h11":1.0951514369488284, "h12":0.6427298229101379, "h20":6.676211791348554e-05, "h21":8.14441129307644e-05, "h22":1.0}
Line 287: Line 287:
The command to perform the estimation is:
The command to perform the estimation is:


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
python homography_estimation.py left_fixed --config /path/to/config.json --reference_image /path/to/cam1.png --target_image /path/to/cam2.png --pattern
python homography_estimation.py left_fixed --config /path/to/config.json --reference_image /path/to/cam1.png --target_image /path/to/cam2.png --pattern
</syntaxhighlight>
</syntaxhighlight>
Line 293: Line 293:
The output will be something like this:
The output will be something like this:


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
"matrix":{"h00":1.0927425025492448, "h01":0.023052134950741838, "h02":1424.5561222498761, "h10":-0.0004828679916927615, "h11":0.9910972565366281, "h12":26.804866722848878, "h20":6.0874737519702665e-05, "h21":-2.0064071552078915e-05, "h22":1.0}
"matrix":{"h00":1.0927425025492448, "h01":0.023052134950741838, "h02":1424.5561222498761, "h10":-0.0004828679916927615, "h11":0.9910972565366281, "h12":26.804866722848878, "h20":6.0874737519702665e-05, "h21":-2.0064071552078915e-05, "h22":1.0}
</syntaxhighlight>
</syntaxhighlight>
Line 306: Line 306:
The command to perform the estimation is:
The command to perform the estimation is:


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
python homography_estimation.py left_fixed --config /path/to/config.json --reference_image /path/to/cam1.png --target_image /path/to/cam2.png --pattern --interactive
python homography_estimation.py left_fixed --config /path/to/config.json --reference_image /path/to/cam1.png --target_image /path/to/cam2.png --pattern --interactive
</syntaxhighlight>
</syntaxhighlight>