-
Notifications
You must be signed in to change notification settings - Fork 192
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
为什么要根据y和x坐标做两次排序? #69
Comments
PaddleSharp/src/Sdcb.PaddleOCR/PaddleOcrDetector.cs Lines 144 to 159 in 99b97ec
PaddleSharp/src/Sdcb.PaddleOCR/PaddleOcrResult.cs Lines 25 to 34 in 99b97ec
#55 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PaddleOcrDetector.cs的 public RotatedRect[] Run(Mat src)函数内已经对区域做了排序
RotatedRect[] rects = contours
.Where(x => BoxScoreThreahold == null || GetScore(x, pred) > BoxScoreThreahold)
.Select(x => Cv2.MinAreaRect(x))
.Where(x => x.Size.Width > MinSize && x.Size.Height > MinSize)
.Select(rect =>
{
float minEdge = Math.Min(rect.Size.Width, rect.Size.Height);
Size2f newSize = new(
(rect.Size.Width + UnclipRatio * minEdge) * scaleRate,
(rect.Size.Height + UnclipRatio * minEdge) * scaleRate);
RotatedRect largerRect = new(rect.Center * scaleRate, newSize, rect.Angle);
return largerRect;
})
.OrderBy(v => v.Center.Y)
.ThenBy(v => v.Center.X)
.ToArray();
PaddleOcrResult.cs 为什么还要在取Text的时候重新排序?
public string Text => string.Join("\n", Regions
.OrderBy(x => x.Rect.Center.Y)
.ThenBy(x => x.Rect.Center.X)
.Select(x => x.Text));
这不是重复了么?
The text was updated successfully, but these errors were encountered: