Put some documentation/javadoc comments on playing with some color filters and thresh...
authorEvanYap <evanyap.14@gmail.com>
Tue, 4 Oct 2016 03:46:40 +0000 (20:46 -0700)
committerEvanYap <evanyap.14@gmail.com>
Tue, 4 Oct 2016 03:46:40 +0000 (20:46 -0700)
GoalTracker.java

index ec627d0da9235c9f6190243137ed87acfa7e8e9c..90d8be3c28e1177476b20dc448d832cbfda77917 100644 (file)
@@ -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<MatOfPoint> contours = new ArrayList<MatOfPoint>();
@@ -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;
        }