Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctpn项目中,为什么所有anchor的bottom坐标都比top坐标要大 #60

Closed
Nobody0321 opened this issue Jul 26, 2019 · 1 comment

Comments

@Nobody0321
Copy link

Nobody0321 commented Jul 26, 2019

您好,我最近在研读你的ctpn项目代码,有一个小小的疑问,为什么所有anchor的bottom坐标都比
top坐标要大?比如./lib/generate_gt_anchor.py 第37行,
h = y_bottom[i] - y_top[i] + 1 # the height of anchor box
高度的计算默认bottom比top大,下面的cal_y_top_and_bottom()函数中,y_top明显是从下往上找到的,而y_bottom是从上往下找到的。
相同的情况在./lib/tag_anchor.py文件的cal_y()函数中也出现了。
我对cv领域不太了解,想请问一下这个是后面训练有要求还是cv领域特有的讲究?

@Nobody0321
Copy link
Author

在ctpn/infer.py中

        b1 = line[6] - line[7] / 2  # 根据高度和文本行中心线,求取文本行上下两条线的b值
        b2 = line[6] + line[7] / 2
        x1 = line[0]
        y1 = line[5] * line[0] + b1  # 左上
        x2 = line[2]
        y2 = line[5] * line[2] + b1  # 右上
        x3 = line[0]
        y3 = line[5] * line[0] + b2  # 左下
        x4 = line[2]
        y4 = line[5] * line[2] + b2  # 右下

按理说,b1小于b2吧,y1应该是左下,y2是右下,y3是左上,y4是右上才对

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant