![]() Imgproc.rectangle(inputImage, secondLargest.tl(), secondLargest. Imgproc.rectangle(inputImage, largest.tl(), largest.br(), upperThreshold) If we're debugging, draw rectangles around the blobs. objects that gives the sendable a default name in the Smart Dashboard. List rects = contours.stream().map(Imgproc::boundingRect).sorted(paringDouble(Rect::area)).collect(Collectors.toCollection(() -> new ArrayList(contours.size()))) that interfaces to the hardware in the FRC control system and your robot. Imgproc.findContours(greenMask, contours, hierarchy, Imgproc.RETR_TREE, Imgproc.CHAIN_APPROX_SIMPLE) Find the areas that meet our threshold and find their contours.Ĭore.inRange(inputImage, lowerThreshold, upperThreshold, greenMask) Scalar upperThreshold = new Scalar(prefs.getInt("upper_b", UPPER_B), prefs.getInt("upper_g", UPPER_G), prefs.getInt("upper_r", UPPER_R)) Scalar lowerThreshold = new Scalar(prefs.getInt("lower_b", LOWER_B), prefs.getInt("lower_g", LOWER_G), prefs.getInt("lower_r", LOWER_R)) Preferences prefs = Preferences.getInstance() Define the lower and upper color thresholds. If (camera.getSink().grabFrame(inputImage) = 0) Check to make sure the camera is running. License : GNU General Public License v3.0
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |