How to save Matlab Video Labeller bounding box coordinates as integers

4 views (last 30 days)
I am trying to use automation techniques to label bounding box coordinates in a video. The problem is that Video Labeller saves all the coordinates in form of float values. How can I get the Video Labeller app to store all the coordinates in form of uint8?

Answers (1)

Kiran Felix Robert
Kiran Felix Robert on 4 Nov 2020
Hi Nitin,
It is my understanding that you are trying to store the bounding box coordinate data, returned by the video labeller app, to unsigned 8-bit integer data.
The position field of ‘gtruth.labelData’ can be used to access the Coordinate values, as show in the Get Started with the Video Labeler document
You can convert a floating value to integer by using the uint8() type conversion as shown below,
K = 1.908;
int_K = uint8(K);
To increase precision you may try the following,
K = 1.908; % Initial Value
precisionK = 10*K; % 1 decimal precision with 10;
intPresK = uint8(precisionK)
Kiran Felix Robert

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!