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

currTotalPixels is 0 in function regionMerge giving rise to core dumped when I run the main.cpp #4

Open
manketon opened this issue May 22, 2018 · 2 comments

Comments

@manketon
Copy link

manketon commented May 22, 2018

I run the official demo, but there is a core-dumped.
int seedTotalPixels = pixelsInArea[seedSegment-1];
When seedSegment is 0, core dump with OpenCV 3.3.1

@zisuina
Copy link

zisuina commented Jul 4, 2019

       change:

float rat = nextTotalPixels/currTotalPixels;

to:

        float rat;
        if(currTotalPixels==0)
        {
            rat = 2;
        } else
        {
            rat = nextTotalPixels/currTotalPixels;
        }

@liaoksn
Copy link

liaoksn commented Apr 15, 2022

       change:

float rat = nextTotalPixels/currTotalPixels;

to:

        float rat;
        if(currTotalPixels==0)
        {
            rat = 2;
        } else
        {
            rat = nextTotalPixels/currTotalPixels;
        }

e... still can't work

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

3 participants