Search in sources :

Example 1 with BaseDenseHog

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

the class FactoryDescribeImageDense method hog.

/**
 * Creates a dense HOG descriptor.
 *
 * @see DescribeDenseHogFastAlg
 * @see DescribeDenseHogAlg
 *
 * @param config Configuration for HOG descriptor.  Can't be null.
 * @param imageType Type of input image.  Can be single band or planar
 * @return Dense HOG extractor
 */
public static <T extends ImageBase<T>> DescribeImageDense<T, TupleDesc_F64> hog(@Nullable ConfigDenseHoG config, ImageType<T> imageType) {
    if (config == null)
        config = new ConfigDenseHoG();
    config.checkValidity();
    ImageType actualType;
    if (imageType.getDataType() != ImageDataType.F32) {
        actualType = new ImageType(imageType.getFamily(), ImageDataType.F32, imageType.getNumBands());
    } else {
        actualType = imageType;
    }
    BaseDenseHog hog;
    if (config.fastVariant) {
        hog = FactoryDescribeImageDenseAlg.hogFast(config, actualType);
    } else {
        hog = FactoryDescribeImageDenseAlg.hog(config, actualType);
    }
    DescribeImageDenseHoG output = new DescribeImageDenseHoG(hog);
    // If the data type isn't F32 convert it into that data type first
    if (actualType != imageType) {
        return new DescribeImageDense_Convert<>(output, imageType);
    } else {
        return output;
    }
}
Also used : BaseDenseHog(boofcv.alg.feature.dense.BaseDenseHog) ImageType(boofcv.struct.image.ImageType)

Aggregations

BaseDenseHog (boofcv.alg.feature.dense.BaseDenseHog)1 ImageType (boofcv.struct.image.ImageType)1