diff --git a/..gitignore.un~ b/..gitignore.un~ new file mode 100644 index 0000000..93c0c0f Binary files /dev/null and b/..gitignore.un~ differ diff --git a/.gitignore b/.gitignore index 748cfc0..8ecd22b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ build *.iml +.idea diff --git a/.gitignore~ b/.gitignore~ new file mode 100644 index 0000000..748cfc0 --- /dev/null +++ b/.gitignore~ @@ -0,0 +1,2 @@ +build +*.iml diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/DogeCV.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/DogeCV.java index 8983b7c..39d2634 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/DogeCV.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/DogeCV.java @@ -4,6 +4,10 @@ * Contains global values and types */ public class DogeCV { + /** + * The possible speeds for detection, the faster the less accurate and the + * slower the more accurate + */ public enum DetectionSpeed { VERY_FAST, FAST, @@ -12,18 +16,27 @@ public enum DetectionSpeed { VERY_SLOW } + /** + * The possible ways to score + */ public enum AreaScoringMethod { MAX_AREA, PERFECT_AREA, COLOR_DEVIATION } + /** + * The different cameras that can be used + */ public enum CameraMode { BACK, FRONT, WEBCAM } + /** + * The different VuMarks for the Rover Ruckus challenge + */ public enum VuMark { NONE, BLUE_ROVER, diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/BlankDetector.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/BlankDetector.java index d2e8b3c..a37a0d4 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/BlankDetector.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/BlankDetector.java @@ -8,15 +8,25 @@ /** * Created by Victo on 12/17/2017. + * + * An empty detector */ public class BlankDetector extends DogeCVDetector { + /** + * Returns the input mat + * @param input the mat to return + * @return the input mat + */ @Override public Mat process(Mat input) { // Process frame return input; } + /** + * Does nothing; in a real detector it would add the scorers + */ @Override public void useDefaults() { // Add in your scorers here. diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/DogeCVDetector.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/DogeCVDetector.java index f5f1eca..b1db0c8 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/DogeCVDetector.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/DogeCVDetector.java @@ -17,11 +17,21 @@ /** * Created by Victo on 9/10/2018. + * + * A base class for detectors */ public abstract class DogeCVDetector extends OpenCVPipeline{ - + /** + * Processes the input mat + * @param input the mat to be processed + * @return the processed mat + */ public abstract Mat process(Mat input); + + /** + * Should set the defaults, typically just the scorer + */ public abstract void useDefaults(); private List scorers = new ArrayList<>(); @@ -43,14 +53,28 @@ public DogeCVDetector(){ } + /** + * Sets the speed of the detector + * @param speed the speed to set + */ public void setSpeed(DogeCV.DetectionSpeed speed){ this.speed = speed; } + /** + * Gives the detector a new scorer + * + * @param newScorer + */ public void addScorer(DogeCVScorer newScorer){ scorers.add(newScorer); } + /** + * Calculates the score for a given input mat + * @param input the mat to calculate the score for + * @return the score of the input mat + */ public double calculateScore(Mat input){ double totalScore = 0; @@ -62,7 +86,10 @@ public double calculateScore(Mat input){ } - + /** + * Returns a frame to display on the RC phone + * @return the altered frame with version, speed, etc + */ @Override public Mat processFrame(Mat rgba, Mat gray) { initSize = rgba.size(); diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/GenericDetector.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/GenericDetector.java index 79da6e3..7c068b8 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/GenericDetector.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/GenericDetector.java @@ -20,6 +20,9 @@ /** * Created by Victo on 9/10/2018. + * + * A generic detector that works on many situations with many configuration + * options */ public class GenericDetector extends DogeCVDetector { @@ -35,13 +38,31 @@ public class GenericDetector extends DogeCVDetector { private Point screenPosition = new Point(); // Screen position of the mineral private Rect foundRect = new Rect(); // Found rect + /** + * The AreaScoringMethod to use (defaults to MAX_AREA) + */ public DogeCV.AreaScoringMethod areaScoringMethod = DogeCV.AreaScoringMethod.MAX_AREA; // Setting to decide to use MaxAreaScorer or PerfectAreaScorer //Create the default filters and scorers + /** + * The DogeCVColorFilter to use (defaults to LeviColorFilter on RED) + */ public DogeCVColorFilter colorFilter = new LeviColorFilter(LeviColorFilter.ColorPreset.RED); //Default Yellow filter + /** + * The default RatioScorer which finds perfect squares + */ public RatioScorer ratioScorer = new RatioScorer(1.0, 3); // Used to find perfect squares + + /** + * The default MaxAreaScorer which finds perfect squares + */ public MaxAreaScorer maxAreaScorer = new MaxAreaScorer( 0.01); // Used to find largest objects + + /** + * The default RatioScorer which finds objects that have an area closest to + * 5000 pixels + */ public PerfectAreaScorer perfectAreaScorer = new PerfectAreaScorer(5000,0.05); // Used to find objects near a tuned area value /** @@ -52,7 +73,11 @@ public GenericDetector() { detectorName = "Generic Detector"; // Set the detector name } - + /** + * Processes the frame by using the specified options + * @param input the Mat to process + * @return the processed Mat + */ @Override public Mat process(Mat input) { @@ -112,6 +137,9 @@ public Mat process(Mat input) { } + /** + * Runs the appropriate scorer, based on areaScoringMethod + */ @Override public void useDefaults() { addScorer(ratioScorer); diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/GoldAlignDetector.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/GoldAlignDetector.java index ad21558..0c47789 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/GoldAlignDetector.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/GoldAlignDetector.java @@ -38,18 +38,46 @@ public class GoldAlignDetector extends DogeCVDetector { private double goldYPos = 0; // Y Position (in pixels) of the gold element // Detector settings + /** + * Determines whether or not debug lines should be shown + */ public boolean debugAlignment = true; // Show debug lines to show alignment settings + + /** + * How far from the center frame the gold is + */ public double alignPosOffset = 0; // How far from center frame is aligned + + /** + * The margin for error on alignment + */ public double alignSize = 100; // How wide is the margin of error for alignment + /** + * The wanted AreaScoringMethod + */ public DogeCV.AreaScoringMethod areaScoringMethod = DogeCV.AreaScoringMethod.MAX_AREA; // Setting to decide to use MaxAreaScorer or PerfectAreaScorer //Create the default filters and scorers + /** + * The wanted DogeCVColorFilter + */ public DogeCVColorFilter yellowFilter = new LeviColorFilter(LeviColorFilter.ColorPreset.YELLOW); //Default Yellow filter + /** + * The wanted RatioScorer + */ public RatioScorer ratioScorer = new RatioScorer(1.0, 3); // Used to find perfect squares + + /** + * The wanted MaxAreaScorer + */ public MaxAreaScorer maxAreaScorer = new MaxAreaScorer( 0.01); // Used to find largest objects + + /** + * The wanted PerfectAreaScorer + */ public PerfectAreaScorer perfectAreaScorer = new PerfectAreaScorer(5000,0.05); // Used to find objects near a tuned area value /** @@ -60,7 +88,11 @@ public GoldAlignDetector() { detectorName = "Gold Align Detector"; // Set the detector name } - + /** + * Processes the input mat + * @param input the mat to process + * @return the processed mat + */ @Override public Mat process(Mat input) { @@ -153,6 +185,9 @@ public Mat process(Mat input) { } + /** + * Sets the scorer based on areaScoringMethod + */ @Override public void useDefaults() { addScorer(ratioScorer); diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/GoldDetector.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/GoldDetector.java index 5efb359..7f0eade 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/GoldDetector.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/GoldDetector.java @@ -24,6 +24,8 @@ /** * Created by Victo on 9/10/2018. + * + * Detects Gold */ public class GoldDetector extends DogeCVDetector { @@ -39,13 +41,30 @@ public class GoldDetector extends DogeCVDetector { private Point screenPosition = new Point(); // Screen position of the mineral private Rect foundRect = new Rect(); // Found rect + /** + * The wanted AreaScoringMethod + */ public DogeCV.AreaScoringMethod areaScoringMethod = DogeCV.AreaScoringMethod.MAX_AREA; // Setting to decide to use MaxAreaScorer or PerfectAreaScorer //Create the default filters and scorers + /** + * The wanted DogeCVFilter + */ public DogeCVColorFilter yellowFilter = new LeviColorFilter(LeviColorFilter.ColorPreset.YELLOW); //Default Yellow filter + /** + * The wanted RatioScorer + */ public RatioScorer ratioScorer = new RatioScorer(1.0, 3); // Used to find perfect squares + + /** + * The wanted MaxAreaScorer + */ public MaxAreaScorer maxAreaScorer = new MaxAreaScorer( 0.01); // Used to find largest objects + + /** + * The wanted PerfectAreaScorer + */ public PerfectAreaScorer perfectAreaScorer = new PerfectAreaScorer(5000,0.05); // Used to find objects near a tuned area value /** @@ -56,7 +75,11 @@ public GoldDetector() { detectorName = "Gold Detector"; // Set the detector name } - + /** + * Processes the input mat + * @param input the mat to process + * @return the processed mat + */ @Override public Mat process(Mat input) { @@ -116,6 +139,9 @@ public Mat process(Mat input) { } + /** + * Sets the scorer based on areaScoringMethod + */ @Override public void useDefaults() { addScorer(ratioScorer); diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/HoughSilverDetector.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/HoughSilverDetector.java index fa57d18..b0e6c18 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/HoughSilverDetector.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/HoughSilverDetector.java @@ -27,9 +27,19 @@ public class HoughSilverDetector extends DogeCVDetector { //The scorer used for this class. Based upon minimizing the standard deviation of color within each mineral, //I.e, if the region is actually a mineral it should be fairly flat. (Levi is op AF - Alex) + /** + * The scorer, defaulted to ColorDevScorer + */ public DogeCVScorer stdDevScorer = new ColorDevScorer(); + /** + * The sensitivity of the circle detector + */ public double sensitivity = 1.4; //Sensitivity of circle detector; between about 1.2 and 2.1; + + /** + * The minimum distance between circles + */ public double minDistance = 60; //Adjust with frame size! This is the minimum distance between circles private Mat workingMat = new Mat(); //The working mat used for internal calculations, single object to avoid memory leak @@ -46,6 +56,11 @@ public HoughSilverDetector() { this.detectorName = "Hough Silver Detector"; } + /** + * Processes the input mat + * @param input the mat to process + * @return the processed mat + */ @Override public Mat process(Mat input) { if(input.channels() < 0 || input.cols() <= 0){ @@ -105,6 +120,9 @@ public Mat process(Mat input) { return displayMat; } + /** + * Adds a ColorDevScorer as a scorer + */ @Override public void useDefaults() { addScorer(stdDevScorer); diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/SamplingOrderDetector.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/SamplingOrderDetector.java index 58ca961..4267de5 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/SamplingOrderDetector.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/SamplingOrderDetector.java @@ -33,6 +33,10 @@ public class SamplingOrderDetector extends DogeCVDetector { // Enum to describe gold location + + /** + * The possible locations for gold on the sampling field + */ public enum GoldLocation { UNKNOWN, LEFT, @@ -41,15 +45,38 @@ public enum GoldLocation { } // Which area scoring method to use + + /** + * The wanted AreaScoringMethod + */ public DogeCV.AreaScoringMethod areaScoringMethod = DogeCV.AreaScoringMethod.MAX_AREA; //Create the scorers used for the detector + + /** + * The wanted RatioScorer + */ public RatioScorer ratioScorer = new RatioScorer(1.0,5); + + /** + * The wanted MaxAreaScorer + */ public MaxAreaScorer maxAreaScorer = new MaxAreaScorer(0.01); + + /** + * The wanted PerfectAreaScorer + */ public PerfectAreaScorer perfectAreaScorer = new PerfectAreaScorer(5000,0.05); //Create the filters used + /** + * The color filter for yellow + */ public DogeCVColorFilter yellowFilter = new LeviColorFilter(LeviColorFilter.ColorPreset.YELLOW,100); + + /** + * The color filter for white + */ public DogeCVColorFilter whiteFilter = new HSVRangeFilter(new Scalar(0,0,200), new Scalar(50,40,255)); @@ -65,11 +92,19 @@ public enum GoldLocation { private Mat whiteMask = new Mat(); private Mat hiarchy = new Mat(); + /** + * A simple constructor + */ public SamplingOrderDetector() { super(); this.detectorName = "Sampling Order Detector"; } + /** + * Processes the input mat + * @param input the mat to process + * @return the processed mat + */ @Override public Mat process(Mat input) { @@ -259,6 +294,9 @@ else if(diffrenceScore < chosenWhiteScore.get(1) && diffrenceScore > chosenWhite return displayMat; } + /** + * Sets the scorer based on areaScoringMethod + */ @Override public void useDefaults() { if(areaScoringMethod == DogeCV.AreaScoringMethod.MAX_AREA){ diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/SilverDetector.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/SilverDetector.java index 4170271..96da6c4 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/SilverDetector.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/SilverDetector.java @@ -25,6 +25,8 @@ /** * Created by Victo on 9/10/2018. + * + * Detects silber */ public class SilverDetector extends DogeCVDetector { @@ -40,13 +42,30 @@ public class SilverDetector extends DogeCVDetector { private Point screenPosition = new Point(); // Screen position of the mineral private Rect foundRect = new Rect(); // Found rect + /** + * The wanted AreaScoringMethod + */ public DogeCV.AreaScoringMethod areaScoringMethod = DogeCV.AreaScoringMethod.MAX_AREA; // Setting to decide to use MaxAreaScorer or PerfectAreaScorer //Create the default filters and scorers + /** + * The white color filter + */ public DogeCVColorFilter whiteFilter = new HSVRangeFilter(new Scalar(0,0,200), new Scalar(50,40,255)); + /** + * The wanted RatioScorer + */ public RatioScorer ratioScorer = new RatioScorer(1.0, 3); // Used to find perfect squares + + /** + * The wanted MaxAreaScorer + */ public MaxAreaScorer maxAreaScorer = new MaxAreaScorer( 0.01); // Used to find largest objects + + /** + * The wanted PerfectAreaScorer + */ public PerfectAreaScorer perfectAreaScorer = new PerfectAreaScorer(5000,0.05); // Used to find objects near a tuned area value /** @@ -57,7 +76,11 @@ public SilverDetector() { detectorName = "Silver Detector"; // Set the detector name } - + /** + * Processes the input mat + * @param input the mat to process + * @return the processed mat + */ @Override public Mat process(Mat input) { @@ -117,6 +140,9 @@ public Mat process(Mat input) { } + /** + * Sets the scorer based on areaScoringMethod + */ @Override public void useDefaults() { addScorer(ratioScorer); diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/VuMarkDetector.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/VuMarkDetector.java index db88ae9..2a5d92c 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/VuMarkDetector.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/detectors/roverrukus/VuMarkDetector.java @@ -6,14 +6,25 @@ /** * Created by LeviG on 1/20/2019. + * + * An incomplete VuMark detector */ public class VuMarkDetector extends DogeCVDetector { + /** + * Returns the input frame + * @param rgba the input frame + * @return the input frame + */ @Override public Mat process(Mat rgba) { return rgba; } + + /** + * Does nothing, should set the scorer + */ @Override public void useDefaults() {} } diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/filters/DogeCVColorFilter.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/filters/DogeCVColorFilter.java index b6c2fd7..52999c4 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/filters/DogeCVColorFilter.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/filters/DogeCVColorFilter.java @@ -4,9 +4,17 @@ /** * Created by Victo on 1/1/2018. + * + * A color filter interface */ public abstract class DogeCVColorFilter { + /** + * Takes an input Mat and then puts the filtered result on the mask Mat + * + * @param input the Mat to filter + * @param mask the Mat to put things that passs the filter + */ public abstract void process(Mat input, Mat mask); } diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/filters/HSVColorFilter.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/filters/HSVColorFilter.java index d8dd6ab..1d9efca 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/filters/HSVColorFilter.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/filters/HSVColorFilter.java @@ -8,6 +8,9 @@ /** * Created by Victo on 1/1/2018. + * + * Filters out only colors that are within a certain range on the HSV color + * space */ public class HSVColorFilter extends DogeCVColorFilter{ diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/filters/HSVRangeFilter.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/filters/HSVRangeFilter.java index 2119c62..b89302e 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/filters/HSVRangeFilter.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/filters/HSVRangeFilter.java @@ -8,6 +8,8 @@ /** * Created by Victo on 1/1/2018. + * + * Filters out colors that are not within two specified HSV values */ public class HSVRangeFilter extends DogeCVColorFilter{ diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/filters/LeviColorFilter.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/filters/LeviColorFilter.java index fa9e4ac..1922857 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/filters/LeviColorFilter.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/filters/LeviColorFilter.java @@ -14,10 +14,19 @@ /** * Created by Victo on 1/1/2018. + * + * Levi's fancy color filtering: + * + * 1. Converts to CIELAB color space + * 2. Blurs the image + * 3. Retrieves the alpha component + * 4. Filters between a certain threshold and the maximum on the alpha component */ public class LeviColorFilter extends DogeCVColorFilter { - // Color presets + /** + * Color presets + */ public enum ColorPreset{ RED, BLUE, diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/math/Circle.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/math/Circle.java index cf0e8cd..822581c 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/math/Circle.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/math/Circle.java @@ -2,6 +2,8 @@ /** * Created by LeviG on 10/7/2018. + * + * Represents a circle */ public class Circle { diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/math/Line.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/math/Line.java index c6caa04..b727e1c 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/math/Line.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/math/Line.java @@ -2,6 +2,9 @@ import org.opencv.core.Point; +/** + * Represents a Line + */ public class Line implements Comparable { public Point point1; diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/math/Lines.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/math/Lines.java index 2c602ea..4d18494 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/math/Lines.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/math/Lines.java @@ -16,6 +16,9 @@ import org.opencv.imgproc.Imgproc; import org.opencv.imgproc.LineSegmentDetector; +/** + * Useful methods for lines + */ public class Lines { diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/math/MathFTC.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/math/MathFTC.java index 166fdae..f7d294a 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/math/MathFTC.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/math/MathFTC.java @@ -13,6 +13,9 @@ import java.util.ArrayList; import java.util.List; +/** + * Contains many useful math methods for FTC + */ public class MathFTC { public static final float mmPerInch = 25.4f; diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/math/Points.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/math/Points.java index ecdde3c..1838a39 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/math/Points.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/math/Points.java @@ -6,6 +6,9 @@ import java.util.List; +/** + * Useful methods for Points + */ public class Points { /** * Checks if a given point is within the bounds (size) of an image diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/ColorDevScorer.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/ColorDevScorer.java index 57c1c67..baa7e47 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/ColorDevScorer.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/ColorDevScorer.java @@ -9,6 +9,8 @@ /** * Created by LeviG on 10/7/2018. + * + * Scores based on difference from perfect color */ public class ColorDevScorer extends DogeCVScorer{ diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/DogeCVScorer.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/DogeCVScorer.java index 0159198..3baee95 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/DogeCVScorer.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/DogeCVScorer.java @@ -8,8 +8,15 @@ /** * Created by Victo on 9/10/2018. + * + * Gives a score for a given Mat for certain criteria defined in the class */ public abstract class DogeCVScorer { + /** + * Gives the score for a given Mat + * @param input the Mat to check the score of + * @return the score for the input Mat + */ public abstract double calculateScore(Mat input); } diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/MaxAreaScorer.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/MaxAreaScorer.java index b631164..410f581 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/MaxAreaScorer.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/MaxAreaScorer.java @@ -8,6 +8,8 @@ /** * Created by Victo on 9/10/2018. + * + * Scores the largest contours the highest */ public class MaxAreaScorer extends DogeCVScorer{ @@ -18,7 +20,6 @@ public class MaxAreaScorer extends DogeCVScorer{ */ public MaxAreaScorer( double weight){ this.weight = weight; - } /** diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/PerfectAreaScorer.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/PerfectAreaScorer.java index f260484..27de4cf 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/PerfectAreaScorer.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/PerfectAreaScorer.java @@ -6,6 +6,8 @@ /** * Created by Victo on 9/10/2018. + * + * Scores based on the difference from the ideal area */ public class PerfectAreaScorer extends DogeCVScorer { diff --git a/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/RatioScorer.java b/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/RatioScorer.java index e6aacb6..9c88c24 100644 --- a/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/RatioScorer.java +++ b/DogeCV/src/main/java/com/disnodeteam/dogecv/scoring/RatioScorer.java @@ -11,6 +11,8 @@ /** * Created by Victo on 9/10/2018. + * + * Scores based on the h/w and w/h ratio of the input contour */ public class RatioScorer extends DogeCVScorer{