kylemcdonald / ofxCv

Alternative approach to interfacing with OpenCv from openFrameworks.
Other
657 stars 276 forks source link

contour order is flipped on android #252

Closed ofZach closed 6 years ago

ofZach commented 6 years ago

sorry if this issue is a little incoherent but on android when I use contour finder and sort by size it returns the smaller contours to the largest one -- not the largest to the smallest one

grabberImage.setFromPixels(grabber.getPixels());
    finder.setFindHoles(false);
    finder.setMinAreaRadius(40);
    finder.setSortBySize(true);
    finder.setThreshold(threshold);
finder.findContours(grabber);

my intuition is that somehow the contour area is negative (like how opencv gives negative values when it finds holes) but I am not sure -- going to dig into it more. For me, switching the operator in the comparison function fixes things to sort biggest to smallest.

ofZach commented 6 years ago

sorry it may be that sort by size just doesn't work... I am going to research this more and close this issue until I understand more.