imageSegmentation
imageSegmentation copied to clipboard
currTotalPixels is 0 in function regionMerge giving rise to core dumped when I run the main.cpp
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
change:
float rat = nextTotalPixels/currTotalPixels;
to:
float rat;
if(currTotalPixels==0)
{
rat = 2;
} else
{
rat = nextTotalPixels/currTotalPixels;
}
change:float rat = nextTotalPixels/currTotalPixels;
to:
float rat; if(currTotalPixels==0) { rat = 2; } else { rat = nextTotalPixels/currTotalPixels; }
e... still can't work