X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=GoalTracker.java;h=bab65e8aff6a77344f998616377a80d0b2a82b8d;hb=b0441b26916beaddbd3ce54d2cf9148fb18ab933;hp=90d8be3c28e1177476b20dc448d832cbfda77917;hpb=eea7473f4df5860f76fc7f5ef219c76cb10b3efe;p=3501%2FOpenCVShowImage diff --git a/GoalTracker.java b/GoalTracker.java index 90d8be3..bab65e8 100644 --- a/GoalTracker.java +++ b/GoalTracker.java @@ -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; }