Decode boundingBoxGrid
AnsweredHi!
I'm trying to create some sort of tracked objects heat map on top of NX Witness analytics database. I've got detection list from the API (/ec2/analyticsLookupObjectTracks) but can't find any clues on object position in time. As far as I understand from previous posts it's coded within boundingBoxGrid object as a bit mask but there is no information how to decode it. Could you please provide some specifics on this parameter? How could I get the bounding box for object in track for each position in time?
-
It's base64-encoded 44x32 bitmap of motion grid cells intersected by the object. Decode base64 and interpret the resulting bytes as a sequence of 44 big-endian 32-bit unsigned integers. Each integer corresponds to a column of motion-grid cells, from the left to right. Bits in each integer, from least to most-significant correspond to cells within the column, from bottom to top.
-
Thank you for prompt response, I successfully decoded the string. But effectively it represents the overall 'spot' of object movement in the track and not the sequence of detected positions. It seems that this sequence should be accessible from objectPositionSequence array but it's empty. Does it depend on plugin metadata implementation and can I obtain this sequence somewhere in API if it's still there?
-
Hello!
objectPositionSequence field is 'heavy', because this details are not written to the database but placed inside media files only as a separate track. So VMS fill it if and only if a single track is requested and addition parameter 'needFullTrack' is set. Another option is to open RTSP connection to the camera, and add url parameter 'enable_analytics_objects'. VMS will send metadata stream that contains all attributes and bounding boxes.
As I understand both methods are not effetient (slow) to calculate heatmap. Probably we can introduce some effecient extension: field boundingBoxGrid is a bit field array, we could extend it to a bytes array: each cell could contains value in range 0.255 or 0..65535 for a track (it could contains a value how many times rect covered this cell for a track). Will it help?
-
Thank you for your comment. As I move through my project I see there is no need to keep detailed movement data in VMS (i.e. object standing in front of camera will produce enormous amount of data without any meaningful information). What I would really appreciate is an API to read and modify analytics data. Hope it's on the roadmap
Please sign in to leave a comment.
Comments
5 comments