Draw rectangle on ViewItem and get coordinates

Hello, We want to know whether add a button on ToolBar to start drawing the rectangle on ViewItem and get the coordinates of the rectangle.

It similar to digital zoom function, but we want to link other cameras to zoom.

Hello there,

As far as I can see you need to solve two problems:

First one is how to direct PTZ camera in position where the car is, and the second one is the level of zoom that should be applied for that location. Her I mean digital and “classic” PTZ cameras.

Since you have problem in your hand that needs to be solved I would suggest practical approach in solving it and that is “PTZ camera calibration”.

Place 4 markers on the street (orange dots). Move PTZ camera in first marker position and then adjust the level of zoom. Save these values. Do this for all 4 points.

Since road is flat, and your cameras are mounted in fixed positions, you can use geometry to calculate PTZ values for every point in the image based upon these “reference” values. Red point in this case.

I can write a book on this subject, regarding wide angle lenses, panoramic cameras and problems of extracting geo coordinates from video stream and how to direct several PTZ cameras in one location using live video stream. But, based upon my experience, and the image you provided, I believe that 4 points simple calibration and geometry will do the trick for you here.

Best regards,

Hrvoje