/**
*
- * 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>();
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);
}
FrameCount++;
- // Imgcodecs.imwrite("output.png", matOriginal);
+ Imgcodecs.imwrite("output.png", matThresh);
}
shouldRun = false;
}