|
Re: Sort array in filterContours
Quote:
Originally Posted by SamCarlberg
That's called a method reference.
This article explains it quite well
Also, you don't even need a special method for sorting a list. The List interface defines a method "sort(Comparator)" that you can use inline like
Code:
contours.sort(Comparator.comparingDouble(Imgproc::contourArea));
|
Dang... As an "vintage" programmer, it's sometimes scary when I realize how much I don't know about the "newer" languages. That's pretty darn powerful.
__________________
Phil Malone
Garrett Engineering And Robotics Society (GEARS) founder.
http://www.GEARSinc.org
FRC1629 Mentor, FTC2818 Coach, FTC4240 Mentor, FLL NeXTGEN Mentor
|