Image Stitching for NVIDIA Jetson - Getting Started - Evaluating the Stitcher

Revision as of 23:25, 14 January 2022 by Jloaiza (talk | contribs) (Add evaluation guide link)



Previous: Getting Started Index Next: Getting Started/Getting the code





Requesting the Evaluation Binary

RidgeRun can provide you with an evaluation binary of the Stitcher to help you test it, in order to request an evaluation binary for a specific architecture, please contact us providing the following information:

  • Platform (i.e.: NVIDIA Jetson TX1/TX2, Xavier, Nano.)
  • Jetpack version
  • The number of cameras to be used with the stitcher
  • The kind of lenses to be used and whether or not you need to apply distortion correction
  • Input resolutions and frame rates
  • Expected output resolution and frame rate
  • Latency requirements

 

Features of the Evaluation

To help you test our Stitcher, RidgeRun can provide an evaluation version of the plug-in.

The following table summarizes the features available in both the professional and evaluation version of the element.

Feature Professional Evaluation
Stitcher Examples Y Y
GstStitcher Element Y Y
Unlimited Processing Time Y N (1)
Source Code Y N
Table 1. Features provided in the evaluation version

(1) The evaluation version will limit the processing to a maximum of 1800 frames.

Evaluating the Stitcher

The stitcher requires the GstCuda plugin in order to work properly, and also depending on your setup, it may require the cuda-undistort element, as represented in the diagram below.

 
Dependencies diagram for the Stitcher

RidgeRun provided you with three evaluation tarballs, one for each of the elements mentioned above. The installation should follow that specific order.



Install and test the evaluation binaries

GstCUDA

If you already own a professional version of this plugin, skip to the cuda undistort element below.
To install the evaluation binaries follow the instructions found in the GstCuda Installation guide


Cuda Undistort

This element is only required if the lenses you are using need distortion correction. If that is not the case, skip to the Stitcher element below.
In order to install the evaluation binaries for this element, follow the Undistort installation guide.


Cuda Stitcher

Install OpenCV with CUDA support from the OpenCV for Image Stitching guide.
The stitcher requires a specific version of RidgeRun's OpenCV Fork, so make sure to follow the guide above even if you already have OpenCV with CUDA support.
Install GLib JSON
sudo apt install libjsoncpp-dev
sudo apt install libjson-glib-dev
Once the requirements above are fulfilled, proceed with the installation of the tarball. RidgeRun should've provided you with the following compressed tar package/s:
cuda-stitcher-X.Y.Z-P-J-eval.tar.gz
Extract the contents of the file with the following command:
tar xvzf <path-to-evaluation-tar-file>
The provided cuda-stitcher evaluation version should have the following structure:
cuda-stitcher-X.Y.Z-P-J-eval/
├── examples
│   ├── desert_center.jpg
│   ├── desert_left.jpg
│   ├── desert_right.jpg
│   ├── ImageA.png
│   ├── ImageB.png
│   └── ocvcuda
│       ├── stitcher_example
│       └── three_image_stitcher
├── scripts
│   └── homography_estimation.py
└── usr
    └── lib
        └── aarch64-linux-gnu
            ├── gstreamer-1.0
            │   └── libgstcudastitcher.so
            ├── librrstitcher-X.Y.Z.so -> librrstitcher-X.Y.Z.so.0
            ├── librrstitcher-X.Y.Z.so.0 -> librrstitcher-X.Y.Z.so.X.Y.Z
            ├── librrstitcher-X.Y.Z.so.X.Y.Z
            └── pkgconfig
                └── rrstitcher-X.Y.Z.pc


Then copy the binaries into the standard GStreamer plug-in search path:
sudo cp -r ${PATH_TO_EVALUATION_BINARY}/usr /
Where PATH_TO_EVALUATION_BINARY is set to the location in your file system where you have stored the binary provided by RidgeRun (i.e: cuda-stitcher-X.Y.Z-P-J-eval).


Finally validate that the installation was successful with the following command, you should see the inspect output for the evaluation binary.
gst-inspect-1.0 cudastitcher


How to use the Stitcher

The process of configuring and using the stitcher is explored in depth in the Stitcher user guide.


Testing the Stitcher

You can test the stitcher by running the following example scripts, these perform a stitch between two and three images respectively. It is a great starting point to make sure the installation was successful before moving into more complex examples.

For both examples you will need to download the example images that will be stitched. You will find the image links in the next sections and an example of how to get them using curl.

Two images example

This example will get two images and stitch them together.

Get the images
 
 
ImageA Image B
https://drive.google.com/uc?export=download&id=15abfY3IM-_3d6Mb6L2EZmYknP5BHhgp_ https://drive.google.com/uc?export=download&id=1j2-zvXd7Us3nPdQwEB52bcrrNbfQz6Vm
cd ${PATH_TO_EVALUATION_BINARY}/examples
curl -L -o ImageA.png "https://drive.google.com/uc?export=download&id=15abfY3IM-_3d6Mb6L2EZmYknP5BHhgp_"
curl -L -o ImageB.png "https://drive.google.com/uc?export=download&id=1j2-zvXd7Us3nPdQwEB52bcrrNbfQz6Vm"
Execute the code
cd ${PATH_TO_EVALUATION_BINARY}/examples
./ocvcuda/stitcher_example -f ImageA.png -s ImageB.png
Result

Examine the output image and make sure the stitching was successful, it should look like the following image.

 

Three images example

This example will get three images and stitch them together.

Get the images
 
 
 
Desert left Desert center Desert right
https://drive.google.com/uc?export=download&id=1XFJu40LweGZgl1zz4ZHpTiUGjiMLSsrF https://drive.google.com/uc?export=download&id=1NS8l0sCCLeJ0ph3hZIwuCbXBlG-WTke6 https://drive.google.com/uc?export=download&id=1jlIYOiYGzmrzdXx-o1RC5uKnoxbN8Q4D
cd ${PATH_TO_EVALUATION_BINARY}/examples
curl -L -o desert_left.png "https://drive.google.com/uc?export=download&id=1XFJu40LweGZgl1zz4ZHpTiUGjiMLSsrF"
curl -L -o desert_center.png "https://drive.google.com/uc?export=download&id=1NS8l0sCCLeJ0ph3hZIwuCbXBlG-WTke6"
curl -L -o desert_right.png "https://drive.google.com/uc?export=download&id=1jlIYOiYGzmrzdXx-o1RC5uKnoxbN8Q4D"
Execute the code
cd ${PATH_TO_EVALUATION_BINARY}/examples
./ocvcuda/three_image_stitcher -l desert_left.jpg -c desert_center.jpg -r desert_right.jpg
Result

Examine the output image and make sure the stitching was successful, it should look like the following image.

 

Running more examples

The Stitcher Examples wiki has many pipeline examples to test the stitcher's functionality; however, make sure to read the Stitcher user guide first.

Troubleshooting

The first level of debugging to troubleshoot a failing evaluation binary is to inspect GStreamer debug output.

GST_DEBUG=2 gst-launch-1.0

If the output doesn't help you figure out the problem, please contact support@ridgerun.com with the output of the GStreamer debug and any additional information you consider useful.

RidgeRun also offers professional support hours that you can invest in any embedded Linux-related task you want to assign to RidgeRun, such as hardware bring-up tasks, application development, GStreamer pipeline fine-tuning, drivers, etc...


Previous: Getting Started Index Next: Getting Started/Getting the code