After color thresholding, Limelight generates a list of contours. After that, each contour is wrapped in a tightest-fit bounding rectangle, an "unrotated" rectangle, and a "convex hull". These are passed through a series of filters to determine the "best" contour. If multiple contours pass through all filters, Limelight chooses the best contour using the "Sort Mode" Control. Show
Sort ModesControls how contours are sorted after they are passed through all other filters. In 2019, the "closest" sort mode was added. This mode will select the target that is closest to the configurable crosshair. Target AreaControls the range of acceptable bounding-rectangle areas, as percentages of the screen. You can increase the minimum area to help filter-out stadium lights, and decrease the maximum value to help filter-out things like large displays near the field. The area slider is not linearly scaled, but quarticly scaled. This is done to provide extra precision near the lower-end of area values, where many FRC targets lie. The area of a square scales quadratically with its side length, but x^4 scaling provides even greater precision where it is needed. Target FullnessFullness is the percentage of "on" pixels in the chosen contour's bounding rectangle. A solid rectangle target will have a near-1.0 fullness, while a U-shaped target will have a low fullness. Target Aspect RatioAspect ratio is defined by the width of the bounding rectangle of the chosen contour divided by its height. A low aspect ratio describes a "tall" rectangle, while a high aspect ratio describes a "wide" rectangle. The aspect ratio slider is also quadratically scaled. Direction FilterRejects contours on the basis of their orientation. Smart Speckle RejectionRejects relatively small (as opposed to absolutely small w/ the area filter) contours that have passed through all other filters. This is essential if a target must remain trackable from short-range and long-range. This feature was introduced in the 2019 season to reject Limelight's LED reflections when robots were very close to targets. Target GroupingControls target "grouping". Set to dual mode to look for "targets" that consist of two shapes, or tri mode to look for targets that consist of three shapes. Smart Target Grouping can group a variable number of targets and reject outliers. It was added in 2022 to help track the upper hub target. Intersection Filter (Dual Targets Only)Rejects groups of contours based on how they would intersect if extended to infinity. Smart Target GroupingAutomatically group targets that pass all individual target filters.
Outlier Rejection
OutputThis tab controls what happens during the last stage of the vision pipeline Targeting RegionControls the point of interest of the chosen contour's bounding rectangle. By default, the tracking parameters tx and ty represent the offsets from your crosshair to the center of the chosen rectangle. You can use another option if a target changes in size, or is comprised of two targets that sometimes blend together. Send Raw Corners?Set this control to "yes" to submit raw corners over network tables. Tune the number of corners submitted by adjusting the "Contour Simplification" value in the "Contour Filtering" page. Send Raw Contours?Set this control to "yes" to submit raw contours over network tables. The top 3 passing contours will be submitted. Crosshair CalibrationControls the "origin" of your targeting values. Let's say a shooter on your robot needs to be calibrated such that it always points a bit left-of-center. You can line up your robot, click "calibrate," and all of your targeting values will be sent relative to your new crosshair. See the calibration page for more details! 3DExperiment with PnP point-based pose estimation here. Compute 3DControls whether pose estimation is enabled. You must enable the 960x720 high-res mode for this to work.
How do you sort contours?We first compute the bounding boxes of each contour, which is simply the starting (x, y)-coordinates of the bounding box followed by the width and height. The boundingBoxes enable us to sort the actual contours. We return the (now sorted) list of bounding boxes and contours. What is the contour approximation method?Contour ApproximationIt approximates a contour shape to another shape with less number of vertices depending upon the precision we specify. It is an implementation of Douglas-Peucker algorithm. Check the wikipedia page for algorithm and demonstration. How to find contours in OpenCV Java?So before finding contours, apply threshold or canny edge detection. Since OpenCV 3.2, findContours() no longer modifies the source image but returns a modified image as the first of three return parameters. In OpenCV, finding contours is like finding white object from black background. What does cv2 arcLength do?cv2. arcLength() is used to calculate the perimeter of the contour. If the second argument is True then it considers the contour to be closed. |