Skip to content

improve the remove link area related code in craft_utils.py#111

Open
wolfryu wants to merge 1 commit into
clovaai:masterfrom
wolfryu:remove_link_area_plus
Open

improve the remove link area related code in craft_utils.py#111
wolfryu wants to merge 1 commit into
clovaai:masterfrom
wolfryu:remove_link_area_plus

Conversation

@wolfryu
Copy link
Copy Markdown

@wolfryu wolfryu commented Aug 12, 2020

hi
Thank you for the excellent work and share!!!

I just find that the remove link area process takes a lot of time to process:

segmap[np.logical_and(link_score==1, text_score==0)] = 0 # remove link area

but, if link_threshold is too high to detect character, link_score is full of ZEROs, we do not need to remove line area process.
and, if we do need to remove line area process, we can do it on the area of cv2.connectedComponentsWithStats' stats area, do not have to do it on the full picture.

So, I did some improvment on remove line area related code.
1, if link_threshold is too high and link_score is full of ZEROs, do not do remove link area process.
2, if link_score is not full of ZEROs, do remove link area process on the area of stats[k]

Thank you !

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

Successfully merging this pull request may close these issues.

1 participant