projects
/
3501
/
OpenCVShowImage
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
84bd6f9
)
Put some documentation/javadoc comments on playing with some color filters and thresh...
author
EvanYap
<evanyap.14@gmail.com>
Tue, 4 Oct 2016 03:46:40 +0000
(20:46 -0700)
committer
EvanYap
<evanyap.14@gmail.com>
Tue, 4 Oct 2016 03:46:40 +0000
(20:46 -0700)
GoalTracker.java
patch
|
blob
|
blame
|
history
diff --git
a/GoalTracker.java
b/GoalTracker.java
index ec627d0da9235c9f6190243137ed87acfa7e8e9c..90d8be3c28e1177476b20dc448d832cbfda77917 100644
(file)
--- 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<MatOfPoint> contours = new ArrayList<MatOfPoint>();
*/
public static void processImage() {
ArrayList<MatOfPoint> contours = new ArrayList<MatOfPoint>();
@@
-89,12
+92,12
@@
public class GoalTracker {
while (FrameCount < 1) {
contours.clear();
while (FrameCount < 1) {
contours.clear();
- matOriginal = Imgcodecs.imread("
goal.jp
g");
+ matOriginal = Imgcodecs.imread("
imgs/test.pn
g");
Imgproc.cvtColor(matOriginal, matHSV, Imgproc.COLOR_BGR2HSV);
Core.inRange(matHSV, LOWER_BOUNDS, UPPER_BOUNDS, matThresh);
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);
Imgproc.findContours(matThresh, contours, matHeirarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);
@@
-139,7
+142,7
@@
public class GoalTracker {
}
FrameCount++;
}
FrameCount++;
-
// Imgcodecs.imwrite("output.png", matOriginal
);
+
Imgcodecs.imwrite("output.png", matThresh
);
}
shouldRun = false;
}
}
shouldRun = false;
}