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

always loop question #6

Open
zisuina opened this issue Jul 29, 2019 · 0 comments
Open

always loop question #6

zisuina opened this issue Jul 29, 2019 · 0 comments

Comments

@zisuina
Copy link

zisuina commented Jul 29, 2019

in texture.cpp a function named: Mat segmentTexture() has a loop question:
do
{
seedPoint.x=rng.uniform(0, texture.cols);
seedPoint.y=rng.uniform(0, texture.rows);
seed=texture.at(seedPoint.y, seedPoint.x);
}
while(mark.at(seedPoint.y, seedPoint.x) !=0 );
if this region are all 0, it will not end. So could add a conditon:

    int cout_num = 0;
    do
    {
        seedPoint.x=rng.uniform(0, texture.cols);
        seedPoint.y=rng.uniform(0, texture.rows);
        seed=texture.at<Vec4b>(seedPoint.y, seedPoint.x);
        cout_num++;

    }
    while(mark.at<uchar>(seedPoint.y, seedPoint.x) !=0 && cout_num <= 50);
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