imageSegmentation icon indicating copy to clipboard operation
imageSegmentation copied to clipboard

always loop question

Open zisuina opened this issue 6 years ago • 0 comments

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<Vec4b>(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);

zisuina avatar Jul 29 '19 01:07 zisuina