Tutorial 6 – Zoom Box PTZing

Requirements:
Tutorial 5 – Joystick PTZing


In the previous tutorial, we learned how to center relative PTZ.

In this tutorial, we’ll learn how to Zoom Box PTZ. Zoom Box PTZing involves creating a box consisting of two points, top-left and bottom-right, in the current field of view and PTZing so that the new field of view matches the box’s top-left and bottom-right coordinates.

Like every PTZ action, a connection to the camera is required:

OCAdapter.OCCamera’s method GetDynamicLiveURL forces a connection to the NVR. A connection to the NVR is required prior to issuing PTZ commands.

Let’s create a PTZ Zoom Box that is the same as our current field of view:

Ocularis.ICamera’s method SetPanTiltZoomBox takes four floats which represent two points: a point for the top-left corner of the zoom box, and one for the bottom-right. Each point ranges from 0.0 to 1.0, with 0.0 representing top and left, and 1.0 representing bottom and right, respectively.

In the above example you’ll notice that we create a zoom box that is the current field of view, and in this case you will see no PTZing action.

Let’s see another example:

In this example, we create a zoom box that is half the width and height of the field of view with its center, as the center of the field of view.

Finally, we have another example:

In this final example, we create a zoom box for the top-left quadrant of the field of view.

Movie of the final program:
Series-6-Tutorial-6

That’s it, you can now create PTZ using PTZ Zoom Boxes.


Next:
Tutorial 7 – PTZ Preset