setup things, not really sure what happened. oh yeah fix opencv master
authorEvanYap <evanyap.14@gmail.com>
Tue, 18 Oct 2016 01:49:15 +0000 (18:49 -0700)
committerEvanYap <evanyap.14@gmail.com>
Tue, 18 Oct 2016 01:49:15 +0000 (18:49 -0700)
GoalTracker.java
ShowImage.java
imgs/test.png [deleted file]
imgs/testpicture.png [new file with mode: 0644]
lib/opencv-310.jar [deleted file]

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;
        }
index 91c307253dc2bb2356629ef826fca995adde042e..8a0adc7c4bc5af9ebd4e6bdb2a8ad379d4336a2e 100644 (file)
@@ -9,51 +9,51 @@ import javax.imageio.ImageIO;
 import javax.swing.JFrame;
 
 public class ShowImage extends Panel {
-    BufferedImage image;
-
-    public ShowImage() {
-        try {
-            // image file
-            // name is
-            // test.png
-            URL input = this.getClass().getResource(("test.png"));
-            // this will read the image to save
-            // into a BufferedImage variable
-            image = ImageIO.read(input);
-        } catch (IOException ie) {
-            // this is to spill
-            // out a message
-            // saying
-            // something
-            // doesn't work
-            System.out.println("Error: " + ie.getMessage());
-        }
-    }
-
-    public void paint(Graphics g) {
-        // This is to actually draw the image out,
-        // necessary.
-
-        // Input of a bufferedimage, x, y, then
-        // an observer in this case null.
-        g.drawImage(image, 0, 0, null);
-    }
-
-    static public void main(String args[]) throws Exception {
-        // Creates a window to
-        // display the image
-        JFrame frame = new JFrame("Display image");
-
-        // Gets the image from ShowImage() method
-        Panel panel = new ShowImage();
-
-        // Adds the image to the new window
-        // panel
-        frame.getContentPane().add(panel);
-
-        // sets the size of the panel
-        frame.setSize(500, 500);
-        // makes it visible
-        frame.setVisible(true);
-    }
+       BufferedImage image;
+
+       public ShowImage() {
+               try {
+                       // image file
+                       // name is
+                       // test.png
+                       URL input = this.getClass().getResource(("imgs/test.png"));
+                       // this will read the image to save
+                       // into a BufferedImage variable
+                       image = ImageIO.read(input);
+               } catch (IOException ie) {
+                       // this is to spill
+                       // out a message
+                       // saying
+                       // something
+                       // doesn't work
+                       System.out.println("Error: " + ie.getMessage());
+               }
+       }
+
+       public void paint(Graphics g) {
+               // This is to actually draw the image out,
+               // necessary.
+
+               // Input of a bufferedimage, x, y, then
+               // an observer in this case null.
+               g.drawImage(image, 0, 0, null);
+       }
+
+       static public void main(String args[]) throws Exception {
+               // Creates a window to
+               // display the image
+               JFrame frame = new JFrame("Display image");
+
+               // Gets the image from ShowImage() method
+               Panel panel = new ShowImage();
+
+               // Adds the image to the new window
+               // panel
+               frame.getContentPane().add(panel);
+
+               // sets the size of the panel
+               frame.setSize(500, 500);
+               // makes it visible
+               frame.setVisible(true);
+       }
 }
diff --git a/imgs/test.png b/imgs/test.png
deleted file mode 100644 (file)
index e679e12..0000000
Binary files a/imgs/test.png and /dev/null differ
diff --git a/imgs/testpicture.png b/imgs/testpicture.png
new file mode 100644 (file)
index 0000000..46ba1cb
Binary files /dev/null and b/imgs/testpicture.png differ
diff --git a/lib/opencv-310.jar b/lib/opencv-310.jar
deleted file mode 100644 (file)
index 86c14b0..0000000
Binary files a/lib/opencv-310.jar and /dev/null differ