imageSegmentation icon indicating copy to clipboard operation
imageSegmentation copied to clipboard

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

Open manketon opened this issue 7 years ago • 2 comments

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

manketon avatar May 22 '18 07:05 manketon

       change:

float rat = nextTotalPixels/currTotalPixels;

to:

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

zisuina avatar Jul 04 '19 01:07 zisuina

       change:

float rat = nextTotalPixels/currTotalPixels;

to:

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

e... still can't work

liaoksn avatar Apr 15 '22 08:04 liaoksn