Created
November 3, 2020 20:04
-
-
Save jabbate19/6e3e01111a1a4d7d44baf39a417db61c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imgproc.cvtColor( input, input, Imgproc.COLOR_RGB2HSV ); | |
Core.inRange( input, new Scalar( hueMin, satMin, valMin ), | |
new Scalar( hueMax, satMax, valMax ), input ); | |
Mat target = input.submat( new Rect( topLeft, bottomRight ) ); | |
double avg = (int) Core.mean( target ).val[ 0 ]; | |
Imgproc.rectangle( input, topLeft, bottomRight, new Scalar( 0, 250, 0 ), 2 ); | |
telemetry.addData("Average", avg); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment