List of homographies as a JSON formatted string without spaces or newlines. The homography list can be store in a JSON file and used in the pipeline with the following format:
List of homographies as a JSON formatted string without spaces or newlines. The homography list can be store in a JSON file and used in the pipeline with the following format:
Line 27:
Line 26:
The [[Image_Stitching_for_NVIDIA_Jetson/User_Guide/Gstreamer#JSON_file| JSON file section]] provides a detailed explanation of the JSON file format for the homography list.
The [[Image_Stitching_for_NVIDIA_Jetson/User_Guide/Gstreamer#JSON_file| JSON file section]] provides a detailed explanation of the JSON file format for the homography list.
*'''stitcher.sink'''
*'''pads'''
The pads crops the image of the respective stitcher sink to crop the overlap area. Use ''right'' to crop the image that overlaps from the right and ''left'' for the image that overlaps from the left. The pads are used in the pipelines with the following format:
The sink marks the end of each camera capture pipeline and maps each of the cameras to the respective image index of the homography list.
The indices of the stitcher's sinks (sink_0, for example) are mapped directly to the image index we use in the homography list.
== Pipeline Basic Example ==
*'''camera-matrix'''
The pipelines construction examples assume that the homographies matrices are stored in the <code> homographies.json</code> file and contains 1 homography for 2 images.
Definition of the camera matrix (only if undistort is necessary). The format is the following:
=== Case: 2 Cameras ===
To perform and display image stitching from two camera sources the pipeline should look like:
# '''Image indices from 0 to N-1''': if you have N images, you have to use consecutive numbers from '''0''' to '''N-1''' for the target and reference indices. It means that you cannot declare something like <code>target: 6</code> if you have 6 images; the correct index for your last image is '''5'''.
# '''Image indices from 0 to N-1''': if you have N images, you have to use consecutive numbers from '''0''' to '''N-1''' for the target and reference indices. It means that you cannot declare something like <code>target: 6</code> if you have 6 images; the correct index for your last image is '''5'''.
== Basic Pipelines ==
The following tool will provide simple pipelines according to the selected elements.
The generated pipelines use our '''perf element''' to measure the performance of the stitcher. It can be downloaded from
= Projector =
[https://github.com/RidgeRun/gst-perf this repository], otherwise, the element can be removed from the pipeline without any problem. In case of performance issues, consider executing the '''/usr/bin/jetson_clocks''' binary.
{{Ambox
| type = notice;
| style = width: 80%;
| textstyle = color: black;
| text = Watch the input resolution so that the ''nvv4l2hh264enc'' encoder can handle the stitching result. This element works with inputs no larger than 4096x4096.
Please follow the [[CUDA Accelerated GStreamer Camera Undistort/User Guide/Camera Calibration | Camera Calibration section]]
For more information on how to use the cuda-undistort please follow the [[CUDA Accelerated GStreamer Camera Undistort/User Guide/Camera Calibration | Camera Calibration section]]
This page provides a basic description of the parameters to build a cudastitcher pipeline.
Cuda-Stitcher
To build a cudastitcher pipeline use the following parameters:
homography-list
List of homographies as a JSON formatted string without spaces or newlines. The homography list can be store in a JSON file and used in the pipeline with the following format:
The JSON file section provides a detailed explanation of the JSON file format for the homography list.
pads
The pads crops the image of the respective stitcher sink to crop the overlap area. Use right to crop the image that overlaps from the right and left for the image that overlaps from the left. The pads are used in the pipelines with the following format:
The sink marks the end of each camera capture pipeline and maps each of the cameras to the respective image index of the homography list.
Pipeline Basic Example
The pipelines construction examples assume that the homographies matrices are stored in the homographies.json file and contains 1 homography for 2 images.
Case: 2 Cameras
To perform and display image stitching from two camera sources the pipeline should look like:
The homography list is a JSON formatted string that defines the transformations and relationships between the images. Here we will explore (with examples) how to create this file in order to stitch the corresponding images.
Case: 2 Images
Let's assume we only have 2 images (with indices 0 and 1). These 2 images are related by a homography which can be computed using the Homography Estimation Tool. The computed homography transforms the Target image from the Reference image perspective.
This way, to fully describe a homography, we need to declare 3 parameters:
Matrix: the 3x3 transformation matrix.
Target: the index of the target image (i.e. the image to be transformed).
Reference: the index of the reference image (i.e. the image used as a reference to transform the target image).
Having this information, we build the Homography JSON file:
With this file, we are describing a pair of images (0 and 1), where the given matrix will transform the image 1 based on 0.
Case: 3 Images
Similar to the 2 images case, we use homographies to connect the set of images. The rule is to use N-1 homographies, where N is the number of images.
One panoramic use case is to compute the homographies for both left (0) and right (2) images, using the center image (1) as the reference.
The hoography list JSON file would look like this:
You can create your own homography list, using the other cases as a guide. Just keep in mind these rules:
N images, N-1 homographies: if you have N input images, you only need to define N-1 homographies.
Reference != Target: you can't use the same image as a target and as a reference for a given homography.
No Target duplicates: an image can be a target only once.
Image indices from 0 to N-1: if you have N images, you have to use consecutive numbers from 0 to N-1 for the target and reference indices. It means that you cannot declare something like target: 6 if you have 6 images; the correct index for your last image is 5.
Projector
For more information on how to use the rr-projector please follow the Projector User Guide