From: EvanYap Date: Tue, 4 Oct 2016 03:46:40 +0000 (-0700) Subject: Put some documentation/javadoc comments on playing with some color filters and thresh... X-Git-Url: http://challenge-bot.com/repos/?p=3501%2FOpenCVShowImage;a=commitdiff_plain;h=fd7b42ee0acd32b5ec5f9c9768c2c5e55f1ec7bc Put some documentation/javadoc comments on playing with some color filters and threshold Mats --- diff --git a/GoalTracker.java b/GoalTracker.java index ec627d0..90d8be3 100644 --- a/GoalTracker.java +++ b/GoalTracker.java @@ -78,8 +78,11 @@ public class GoalTracker { /** * - * reads an image from a live image capture and outputs information to the - * SmartDashboard or a file + * reads an image from a live image capture and outputs information to the a + * file. It currently spits out an image that has contours of white objects, + * or filters white objects to be brighter. + * + * MatThresh = contours, MatOriginal = white filter. */ public static void processImage() { ArrayList contours = new ArrayList(); @@ -89,12 +92,12 @@ public class GoalTracker { while (FrameCount < 1) { contours.clear(); - matOriginal = Imgcodecs.imread("goal.jpg"); + matOriginal = Imgcodecs.imread("imgs/test.png"); Imgproc.cvtColor(matOriginal, matHSV, Imgproc.COLOR_BGR2HSV); Core.inRange(matHSV, LOWER_BOUNDS, UPPER_BOUNDS, matThresh); - Imgcodecs.imwrite("output.png", matThresh); + // Imgcodecs.imwrite("output.png", matThresh); Imgproc.findContours(matThresh, contours, matHeirarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE); @@ -139,7 +142,7 @@ public class GoalTracker { } FrameCount++; - // Imgcodecs.imwrite("output.png", matOriginal); + Imgcodecs.imwrite("output.png", matThresh); } shouldRun = false; }