283
edits
No edit summary |
|||
Line 149: | Line 149: | ||
# '''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'''. | ||
= Controlling the Overlap Area through | = Controlling the Overlap Area through Cropping = | ||
You can set | You can set cropping areas for each stitcher input (sink pad). This will allow you to: | ||
# Crop an input image without requiring a previous cropping stage to avoid consuming more resources. | # Crop an input image without requiring a previous cropping stage to avoid consuming more resources. | ||
# Reduce the overlapping area between the images to avoid ghosting effects. | # Reduce the overlapping area between the images to avoid ghosting effects. | ||
Each input to the stitcher (or sink pad) has 4 properties (<code>left right top bottom</code>). Each of these defines the amount of pixels to be cropped in each direction. Say you want to configure the first pad (<code>sink_0</code>), and also want to crop 64 pixels of the bottom, then you can do it as follows inside your pipeline: | |||
<pre> | |||
gst-launch-1.0 cudastitcher sink_0::left=64 ... | |||
</pre> | |||
Now let's take a look at more visual examples. | |||
'''Example 1: No Cropping''' | |||
Let's start with a case with no ROIs. We won't configure any pad in this case since 0 is the default of each property (meaning no cropping is done) | |||
<pre> | |||
gst-launch-1.0 cudastitcher ! ... | |||
</pre> | |||
[[File:Stitching blocks without ROI.png|800px|frameless|center|No Cropping]] | |||
'''Example 2: left/right Cropping''' | |||
This hypothetical case shows how to reduce the overlap between two images. So let's crop 200 pixels from the blue image and 200 pixels from the red image. | |||
<pre> | |||
gst-launch-1.0 cudastitcher sink_0::right=200 sink_1::left=200 ! ... | |||
</pre> | |||
[[File:Stitching blocks left-right ROIs.png|800px|frameless|center|Left / Right Cropping]] | |||
'''Example 3: top/bottom Cropping''' | |||
In this case, we are cropping the 200 bottom pixels of the red image, and 200 top pixels of the blue image | |||
<pre> | |||
gst-launch-1.0 cudastitcher sink_0::bottom=200 sink_1::top=200 ! ... | |||
</pre> | |||
[[File:Stitching blocks top-bottom ROIs.png|800px|frameless|center|Top / Bottom cropping]] | |||
= Projector = | = Projector = |