简体   繁体   English

边界框注释,从 4 点到 8 点

[英]Bounding box annotation,going from 4 points to 8

I am using the synth text dataset, and the word level bounding box annotation are given in the form of 4 points, here is what the doc says我使用的是合成文本数据集,词级边界框注释以4点的形式给出,这里是doc所说的

               - the first dimension is 2 for x and y respectively,
               - the second dimension corresponds to the 4 points
                 (clockwise, starting from top-left), and

so they have given the points, ymin, ymax, xmin,max.所以他们给出了点,ymin,ymax,xmin,max。

These are 4 points, which correspond to top-left and bottom right.这些是 4 个点,分别对应于左上角和右下角。

But the network i am trying to train takes in 8 points as input,但是我试图训练的网络需要 8 个点作为输入,

x1,y1,x2,y2,x3,y3,x4,y4

Is there a way to go from my 4 points to 8 points.有没有办法把我的4分变成8分。

Thanks in advance.提前致谢。

Use this (Assuming the coordinates are taken in clockwise order):使用这个(假设坐标按顺时针顺序):

x1 = top_left['x']
y1 = top_left['y']
x2 = bottom_right['x']
y2 = top_left['y']
x3 = bottom_right['x']
y3 = bottom_right['y']
x4 = top_left['x']
y4 = bottom_right['y']

The idea is quite simple: The x coordinate changes for the second point to the one in bottom right and y coordinate changes for the fourth point to that of bottom right.这个想法很简单:第二个点的 x 坐标更改为右下角的点,第四个点的 y 坐标更改为右下角的点。 The third point albeit, is the same as coordinates of bottom right.第三点虽然与右下角的坐标相同。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM