View Single Post
  #2   Spotlight this post!  
Unread 07-02-2017, 12:13
PhilBot's Avatar
PhilBot PhilBot is offline
Get a life? This IS my life!
AKA: Phil Malone
FRC #1629 (GaCo: The Garrett Coalition)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Maryland
Posts: 756
PhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond reputePhilBot has a reputation beyond repute
Re: Sort array in filterContours

Quote:
Originally Posted by SamCarlberg View Post
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
Reply With Quote