setup things, not really sure what happened. oh yeah fix opencv
[3501/OpenCVShowImage] / GoalTracker.java
index 90d8be3c28e1177476b20dc448d832cbfda77917..bab65e8aff6a77344f998616377a80d0b2a82b8d 100644 (file)
@@ -97,7 +97,7 @@ public class GoalTracker {
                        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);
 
@@ -131,18 +131,14 @@ public class GoalTracker {
                                Point center = new Point(rec.br().x - rec.width / 2 - 15, rec.br().y - rec.height / 2);
                                Point centerw = new Point(rec.br().x - rec.width / 2 - 15, rec.br().y - rec.height / 2 - 20);
 
-                               // Imgproc.putText(matOriginal, "hello" + (int) distance,
-                               // center,
-                               // Core.FONT_HERSHEY_PLAIN, 20, BLACK);
-                               // Imgproc.putText(matOriginal, "hello2" + (int) azimuth,
-                               // centerw,
-                               // Core.FONT_HERSHEY_PLAIN, 20, BLACK);
+                               Imgproc.putText(matOriginal, "hello" + (int) distance, center, Core.FONT_HERSHEY_PLAIN, 20, BLACK);
+                               Imgproc.putText(matOriginal, "hello2" + (int) azimuth, centerw, Core.FONT_HERSHEY_PLAIN, 20, BLACK);
 
                                System.out.println(distance + "m, " + azimuth + " degrees     " + center.x + ", " + center.y);
 
                        }
                        FrameCount++;
-                       Imgcodecs.imwrite("output.png", matThresh);
+                       // Imgcodecs.imwrite("output.png", matThresh);
                }
                shouldRun = false;
        }