How to save Matlab Video Labeller bounding box coordinates as integers

조회 수: 1 (최근 30일)
Nitin Kumar
Nitin Kumar 2020년 10월 28일
답변: Kiran Felix Robert 2020년 11월 4일
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?

답변 (1개)

Kiran Felix Robert
Kiran Felix Robert 2020년 11월 4일
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!

Translated by