Quote:
Originally Posted by SamCarlberg
FWIW you could also write that as
Code:
public static void sortContoursByArea(List<MatOfPoint> contours) {
Collections.sort(contours, Comparator.comparingDouble(Imgproc::contourArea));
}
|
That's a really interesting syntax.
Is there a name for what is hapening with "Imgproc::contourArea" ?
I'd like to look up the explanation of how that works...
Clearly it's getting expanded internally into Imgprog.contourArea(contours[n]) for the comparison.... but I don't know how/why.....
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org
FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor