kylemcdonald / ofxCv

Alternative approach to interfacing with OpenCv from openFrameworks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

contour order is flipped on android

ofZach opened this issue · comments

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.

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.