View Single Post
  #5   Spotlight this post!  
Unread 07-02-2017, 13:12
SamCarlberg's Avatar
SamCarlberg SamCarlberg is offline
GRIP, WPILib. 2084 alum
FRC #2084
Team Role: Mentor
 
Join Date: Nov 2015
Rookie Year: 2009
Location: MA
Posts: 169
SamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to behold
Re: Sort array in filterContours

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));
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote