Image in Alarm Preview filled the window, hence the bounding box was drawn incorrectly

Hi,

We have protocol integration program using python, our program streams the live images from ImageServer using TCP protocol using Live method. Then we send the image to our API for detection of the image and it returns bounding boxes and also the image itself with drawn bounding box.

PS: We are using Trial Version, that is why we don’t have Alarm Manager page, instead, we are using Alarm List and Alarm Preview from System Overview.

This is a sample alarm, which has been triggered by sending AnalyticsEvents.

For debugging purposes, we added a snapshot on the Event to compare how the bounding box was drawn on the image.

If you noticed, the image we retrieved from ImageServer (on the right) is smaller, when it comes to height and width, than the image on the left (coming from the Recording server?).

The reason why the bounding box was not properly drawn on the image on the left.

We expected that the bounding box should be drawn the same as the one on the right.

The dimensions of the image from ImageServer that we sent for detection and the still images exported are:

width: 2592, height: 1944

While the image from the Alarm Preview , looks like it filled to the size of the window, which could be the reason why the bounding box was not drawn properly.

If we try to go to Playback from that alarm and save the image, the dimensions are:

width: 2008, height: 2316

We already set the camera settings in Smart Client to “Maintain image aspect ratio” but no changes.

Correct me if my observations were incorrect.

Please advise

PS: This is only happening in FishEye camera, in pinhole the bounding box works perfectly.

UPDATE:

The “Maintain image aspect ratio” works after we disabled “Enable fisheye lens support” from Management client

Allow me some clarifying question.

Is this statement correct?

In the Alarm Preview you have two images; the image recorded in the Recording Server at the time of the event (the Smart Client retrieves this on Image Server protocol), and on the other side the image snapshot that you have submitted with the Analytics Event (this is actually stored in the SQL Server database with the event).

Is this statement correct?

The regular image recorded in the Recording Server is scaled wrong when presented in the Smart Client. The wrong scaling happens if “Enable fisheye lens support” is enabled. There is no wrong scaling if “Enable fisheye lens support” is disabled.

There is two ways of submitting bounding box coordinates. Either you send the coordinates in pixels or you send the coordinates in fraction. See - https://developer.milestonesys.com/s/question/0D50O00003czCBwSAM/what-are-the-proper-values-for-an-overlay-bounding-box-or-polygon

Which scheme are you using?

Yes, the first statement is correct, for debugging purposes, to compare only how the bounding box was drawn differently in both images. The image on the right is the one returned by our API after adding the bounding box. When sending AnalyticsEvent, we’ll not include the snapshot anymore, instead only the bounding boxes.

Yes, also for second statement. We checked the “Enable fisheye lens support” because we thought it is necessary for fisheye lens. When it is enabled, the live and playback video and image in Alarm Preview filled the entire window, hence the “Maintain image aspect ratio” option was disregarded.

We are using the Bounding Box scheme since our api returns the bounding box based on object detection.

Pixels or fractions?

It is fractions because the values are from 0.0 to 1.0

I tried to reproduce and failed. I fail to understand one thing: The Alarm Preview does not have a “Maintain image ratio” settings you can manipulate. Maybe you simply see a different scaling that is much similar to turning “Maintain image ratio” on and off on a regular camera view? Could I trouble you for two screen captures, so that I can see both scenarios?

What version of XProtect and Smart Client are you working on?

Finally, is it true that you reported this issue while having “Enable fisheye lens support” enabled, but have since then concluded that you don’t need this? In essence you have no issue as you will not be enabling that feature?

Sorry for the confusion, the “Maintain image aspect ratio” is on Camera View in Smart Client. Below are the screenshots when “Maintain image aspect ratio” was enabled.

Here is the screenshots of Smart Client when the “Enable fisheye lens support” was disabled.

However, the image below when it was enabled.

I created 2x1 view because the changes on other views are not quite visible.

Then this view will be the same as in Alarm Preview.

Were using XProtect 2023 R2.

Yes, for now we won’t be needing the Fisheye lens feature.