package com.tom_e_white.set_game;

import com.tom_e_white.set_game.image.ImageUtils;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

public class FindCardColourFeatures implements FeatureFinder {

    @Override
    public int getLabel(String filename) {
        return CardLabel.getColourNumber(new File(filename));
    }

    @Override
    public int getLabelNumberFromLabel(String label) {
        return CardLabel.getColourNumber(label);
    }

    @Override
    public String getSummaryLine(int label, double[] features) {
        StringBuilder sb = new StringBuilder().append(label);
        for (double f : features) {
            sb.append(",").append(f);
        }
        return sb.toString();
    }

    @Override
    public String getSummaryLine(String filename, double[] features) {
        return getSummaryLine(getLabel(filename), features);
    }

    @Override
    public LabelledVector getLabelledVector(String summaryLine) {
        String[] split = summaryLine.split(",");
        double[] vector = new double[split.length - 1];
        for (int i = 0; i < split.length - 1; i++) {
            vector[i] = Double.parseDouble(split[i + 1]);
        }
        return new LabelledVector(Integer.parseInt(split[0]), vector);
    }

    @Override
    public double[] find(BufferedImage image, boolean debug) throws IOException {
        return ImageUtils.coupledHueSat(image);
    }

    @Override
    public String getFileName() {
        return "colour.csv";
    }
}

@@ -28,16 +28,52 @@
 _game;%0A%0A
+import boofcv.io.image.UtilImageIO;%0A
 import c
@@ -200,16 +200,41 @@
 ception;
+%0Aimport java.util.Arrays;
 %0A%0Apublic
@@ -1574,11 +1574,398 @@
 %22;%0A    %7D
+%0A%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        BufferedImage image = UtilImageIO.loadImage(args%5B0%5D);%0A        FindCardColourFeatures featureFinder = new FindCardColourFeatures();%0A        double%5B%5D features = featureFinder.find(image, true);%0A        System.out.println(featureFinder.getLabel(args%5B0%5D));%0A        System.out.println(Arrays.toString(features));%0A    %7D
 %0A%7D%0A

Add main method