Reputation: 3103
I've labelled objects on images with Google Cloud AutoML label tool. Than I've exported csv file. Here is the output:
TRAIN,gs://optik-vcm/optikic/80-2020-03-19T11:58:25.819Z.jpg,kenarcizgi,0.92590326,0.035908595,0.9589712,0.035908595,0.9589712,0.9020675,0.92590326,0.9020675
On the beauty, it's like that:
TRAIN
gs://optik-vcm/optikic/80-2020-03-19T11:58:25.819Z.jpg
kenarcizgi
0.92590326
0.035908595
0.9589712
0.035908595
0.9589712
0.9020675
0.92590326
0.9020675
I know first three columns.
I'll increase the images count by making data augmentation. I'll use OpenCV in Python for that. But I need coordinates of objects on the image.
How can I convert these decimals to pixel coordinations? Or is there any calculation for that?
Upvotes: 1
Views: 386
Reputation: 4489
These are called a NormalizedVertex.
A vertex represents a 2D point in the image. The normalized vertex coordinates are between 0 to 1 fractions relative to the original plane (image, video). E.g. if the plane (e.g. whole image) would have size 10 x 20 then a point with normalized coordinates (0.1, 0.3) would be at the position (1, 6) on that plane.
To get a pixel coordinate, you can multiply that number by your input width or length as appropriate.
The entire reference for the CSV formatting explains the following (truncated) makes up each row (one row per bounding box or per image):
TRAIN
- Which set to assign the content in this row togs://optik-vcm/...
- Google Cloud Storage URIkenarcizgi
- A label that identifies how the object is categorizedx_relative_min
, y_relative_min
, x_relative_max
, y_relative_min
, x_relative_max
, y_relative_max
, x_relative_min
, y_relative_max
Upvotes: 1