-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add pixel group and contour expand ops #993
Conversation
Codecov Report
@@ Coverage Diff @@
## master #993 +/- ##
==========================================
+ Coverage 64.61% 64.75% +0.14%
==========================================
Files 152 154 +2
Lines 9817 9858 +41
Branches 1784 1791 +7
==========================================
+ Hits 6343 6384 +41
Misses 3144 3144
Partials 330 330
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
fcad204
to
b2f9f51
Compare
b9502b1
to
ff52c6c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi
Variable names like q_n
kernel_cv
p_res
are a little hard to understand, better use more meaningful ones.
And loops with a single assign statement could be replaced with std::transform, faster and more readable.
Point2d point(tmp_x, tmp_y); | ||
queue.push(point); | ||
text_line[tmp_x][tmp_y] = label; | ||
is_edge = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About this is_edge
flag.
The point does not need to be revisited if all direction has been labeled or out of bound. Is that right? Would it be better to avoid feeding these points to next_queue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given a pixel, if its all neighbors are labelled or out of bound, it indicates it is on edge. Therefore, it is the start point to expanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't understand, for example:
label_map=[
[0,1,0],
[1,1,1],
[0,1,0],
]
label_map[1,1] is not on edge but it will be passed to next_queue
in every loop cause text_line[tmp_x][tmp_y] > 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(1,1) can not be in the queue. because the queue is initialized with edge pixels and re-initialized with queue_next.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(1,1) can not be in the queue. because the queue is initialized with pixels on edge and re-initialized with queue_next, which are again pixels on edge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label_map can not be=[
[0,1,0],
[1,1,1],
[0,1,0],
]
It can be
label_map=[
[0,1,0],
[1,0,1],
[0,1,0],
]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks for the explanation.
|
ddeab53
to
aa2b4c5
Compare
Kindly ping @hellock |
Motivation
The pixel group and contour expand operation are usually used in text detection.
They are now in mmocr, which result in installation difficulty.
Put them in mmcv so that mmocr is compilation-free and can be installed more smoothly.
Modification
Add pixel group op and its unit test.
Add contour expand op and its unit test.