GStreamer Pan Tilt Zoom and Rotate Element - Pan & Tilt

From RidgeRun Developer Wiki


Previous: User Guide Index Next: Zoom




This page serves as a reference on how to adjust Pan & Tilt values on GstPTZR.

Translation Generalities

The pan & tilt effect is achieved by translating the input image origin, so that the capture region seems to be moving in the opposite direction. Applying a positive pan level will create the effect of the capture region moving to the left, and a negative pan level will produce the opposite effect. On the other hand, a positive tilt level will move the capture region upwards and a negative one downwards. To perform translations, the following parameters are used:

pan-level
The desired translation about the x axis starting from the center of the input image
tilt-level
The desired translation about the y axis starting from the center of the input image
pan-delta
The desired translation about the x axis starting from the current capture region location on the input image
tilt-delta
The desired translation about the y axis starting from the current capture region location on the input image
output-reference
The translation reference indicates whether the output or the input coordinates are used as a reference. This is specially useful after performing a rotation and determines the angle of the movement performed.
translation-normalization
A translation normalization is performed by default. In this normalization, pixel values are mapped so that -1 maps to the lower limit of the translation and 1 to the upper limit.

The following sections describe in more detail each of the possible translation configurations.

Pan & Tilt Levels

pan-level = 0, tilt-level = 0

When pan and tilt levels are set to 0, there is no translation expected. A region a region will be taken centered on the center of the input image. Figure 1 exemplifies this concept.

Figure 1. GstPTZR configured with pan-level=0 and tilt-level=0 on Bartok the Dachshund

-1 < pan-level < 0

For pan level values between -1 and 0, the image is shifted to the right, producing the effect that the capture region is moving left. With the translation normalization enabled (default) pan-level can only take values between from -1 and 1. The limit value of -1 represents the farthest to the left that the capture region can move, and it is defined as the translation that keeps the entirely of the capture region inside the input image. Figure 2 shows graphically this concept. For values in between -1 and 0, the capture region will vary accordingly.

Figure 2. GstPTZR configured with pan-level=-1 and tilt-level=0 on Bartok the Dachshund

0 < pan-level < 1

For pan level values between 0 and 1, the capture region moves to the right. The limit value of 1 represents the farthest to the right that the capture region can move. Figure 3 shows graphically this concept. For values in between 0 and 1, the capture region will vary accordingly.

Figure 3. GstPTZR configured with pan-level=1 and tilt-level=0 on Bartok the Dachshund

-1 < tilt-level < 0

Tilt level has the same behavior as pan level, except the translation is performed about the 'y' axis. A negative tilt level generates an upwards movement of the capture region, and -1 is its limit. Figure 4 illustrates this concept.

Figure 4. GstPTZR configured with pan-level=0 and tilt-level=-1 on Bartok the Dachshund

0 < tilt-level < 1

Finally, the upper limit for the tilt level is 1, an example is shown in figure 5.

Figure 5. GstPTZR configured with pan-level=0 and tilt-level=1 on Bartok the Dachshund

Pan & Tilt Deltas

pan-delta & tilt-delta

The "delta" variations of pan and tilt function almost exactly as described before. The only difference is that these parameters are used to perform movements relative to the current position on the image. For example, if the capture region is currently at tilt-level -1, and then tilt-level is changed to 1, the region will shift to the bottom of the image. On the other hand, if tilt-delta -1 is used, the region will end up on the center of the input image. This example is illustrated in figure 6.

Figure 6. GstPTZR tilt-level and tilt-delta example on Bartok the Dachshund

Translation Reference

output-reference [true | false]

The output-reference parameter defines the reference used for the translation operations. By default, output-reference is true, which means that the output coordinate system is the one used as a reference. When a rotation is performed, the input coordinate system also rotates, while the output coordinate system stays the same. This means that even on a rotated image, if a positive pan-delta is used the capture region will always move to the left. However, if the input image is used as a reference (output-reference false) the movement will be performed with the same rotation as the input axis. An example of both behaviors is shown in figure 7.

Figure 7. GstPTZR rotation-level=45 tilt-delta=400 changing output-reference on Bartok the Dachshund

Translation Normalization

normalize-translation false

the translation normalization can be turned off by setting the normalize-translation property to false. This change only affects the units of measurement used for the pan-level, tilt-level, pan-delta and tilt-delta parameters. With the property off, pixels of the input image are used instead of absolute values.


Previous: User Guide Index Next: Zoom