Search in sources :

Example 51 with PathLabel

use of boofcv.io.PathLabel in project BoofCV by lessthanoptimal.

the class SelectAlgorithmAndInputPanel method loadInputData.

/**
 * Loads a standardized file for input references
 *
 * @param fileName path to config file
 */
@Override
public void loadInputData(String fileName) {
    Reader r = media.openFile(fileName);
    List<PathLabel> refs = new ArrayList<>();
    try {
        BufferedReader reader = new BufferedReader(r);
        String line;
        while ((line = reader.readLine()) != null) {
            String[] z = line.split(":");
            String[] names = new String[z.length - 1];
            for (int i = 1; i < z.length; i++) {
                names[i - 1] = baseDirectory + z[i];
            }
            refs.add(new PathLabel(z[0], names));
        }
        setInputList(refs);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : PathLabel(boofcv.io.PathLabel) ArrayList(java.util.ArrayList) BufferedReader(java.io.BufferedReader) Reader(java.io.Reader) BufferedReader(java.io.BufferedReader) IOException(java.io.IOException)

Aggregations

PathLabel (boofcv.io.PathLabel)51 ArrayList (java.util.ArrayList)48 GrayF32 (boofcv.struct.image.GrayF32)14 File (java.io.File)10 ImageType (boofcv.struct.image.ImageType)7 GrayU8 (boofcv.struct.image.GrayU8)4 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)3 BufferedImage (java.awt.image.BufferedImage)3 BufferedReader (java.io.BufferedReader)2 IOException (java.io.IOException)2 SquareImage_to_FiducialDetector (boofcv.abst.fiducial.SquareImage_to_FiducialDetector)1 LensDistortionRadialTangential (boofcv.alg.distort.radtan.LensDistortionRadialTangential)1 ConfigFiducialBinary (boofcv.factory.fiducial.ConfigFiducialBinary)1 ConfigFiducialImage (boofcv.factory.fiducial.ConfigFiducialImage)1 ConfigThreshold (boofcv.factory.filter.binary.ConfigThreshold)1 StereoParameters (boofcv.struct.calib.StereoParameters)1 ActionListener (java.awt.event.ActionListener)1 FileReader (java.io.FileReader)1 Reader (java.io.Reader)1 List (java.util.List)1