Search in sources :

Example 1 with DescribeDenseHogFastAlg

use of boofcv.alg.feature.dense.DescribeDenseHogFastAlg in project BoofCV by lessthanoptimal.

the class ExampleDenseImageFeatures method LowLevelHOG.

public static void LowLevelHOG(GrayF32 input) {
    DescribeDenseHogFastAlg<GrayF32> describer = FactoryDescribeImageDenseAlg.hogFast(new ConfigDenseHoG(), ImageType.single(GrayF32.class));
    // The low level API gives you access to more information about the image. You can explicitly traverse it
    // by rows and columns, and access the histogram for a region. The histogram has an easy to understand
    // physical meaning.
    describer.setInput(input);
    describer.process();
    // Let's print a few parameters just because we can. They can be modified using the configuration class passed in
    System.out.println("\n------------------- HOG Low Level");
    System.out.println("HOG pixels per cell " + describer.getPixelsPerCell());
    System.out.println("HOG region width " + describer.getRegionWidthPixelX());
    System.out.println("HOG region height " + describer.getRegionWidthPixelY());
    System.out.println("HOG bins " + describer.getOrientationBins());
    for (int i = 0; i < describer.getCellRows(); i++) {
        for (int j = 0; j < describer.getCellCols(); j++) {
            DescribeDenseHogFastAlg.Cell c = describer.getCell(i, j);
        // this is where you could do processing on an individual cell
        }
    }
}
Also used : GrayF32(boofcv.struct.image.GrayF32) ConfigDenseHoG(boofcv.factory.feature.dense.ConfigDenseHoG) DescribeDenseHogFastAlg(boofcv.alg.feature.dense.DescribeDenseHogFastAlg)

Aggregations

DescribeDenseHogFastAlg (boofcv.alg.feature.dense.DescribeDenseHogFastAlg)1 ConfigDenseHoG (boofcv.factory.feature.dense.ConfigDenseHoG)1 GrayF32 (boofcv.struct.image.GrayF32)1