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

Question about the post processing. #4

Open
zeng-hello-world opened this issue May 24, 2019 · 1 comment
Open

Question about the post processing. #4

zeng-hello-world opened this issue May 24, 2019 · 1 comment

Comments

@zeng-hello-world
Copy link

zeng-hello-world commented May 24, 2019

Hi,
TextField is a great work, but I'm confused about the post processing:

We apply a simple dilation δ (with 3 × 3 structuring element) to group the representatives of the same text instance. This is followed by a connected component labeling that forms candidate text instances. The text superpixel grouping is depicted in line 17- 21 of Algorithm 1.

and I found these in your post processing code:

for (int row = 0; row < rows_; row++)
        {
            float* ending_p = ending.ptr<float>(row);
            float* parent_p = parent.ptr<float>(row);
            float* dict_p = dict.ptr<float>(row);
            for (int col = 0; col < cols_; col++)
            {
                if (ending_p[col] == 1)
                {
                    for (int dilDepth = 1; dilDepth <= min((int)(1*dict_p[2*col+1]-16), 12); dilDepth++)  //
                    {
                        p.x = row+(int)parent_p[2*col]*dilDepth;
                        p.y = col+(int)parent_p[2*col+1]*dilDepth;
                        if (p.x >= 0 && p.x <= rows_-1 && pt.y >= 0 && pt.y <= cols_-1)
                        {
                            float* merged_ending_p = merged_ending.ptr<float>(p.x);
                            merged_ending_p[p.y] = 1;
                        }
                    }
                }
            }
        }

I understand that the dilate element kernel_size = 3x3 is for grouping the representatives of text instance, and the above code is for grouping the rest children pixels belonging to this instance, but I don't understand this: for (int dilDepth = 1; dilDepth <= min((int)(1*dict_p[2*col+1]-16), 12); dilDepth++) , and dilDepth stands for the deepest depth, but the magic numbers 16 and 12 represent for what meaning?

Thanks in advance for your reply!

@YukangWang
Copy link
Owner

Sorry for replying late.

These lines are added for robustness since the representatives may not quite close to each other for some large text instances. Here, dict_p also stores the depth (the number of child nodes) of each representative. I use another dilation-like operation only in its direction and dilDepth limits the dilation depth. For the two hyper-parameters 16 and 12, they are coarsely chosen actually. I am sorry for these missing details in our paper.

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

2 participants