Search in sources :

Example 1 with ImageType

use of boofcv.struct.image.ImageType 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)

Example 2 with ImageType

use of boofcv.struct.image.ImageType in project BoofCV by lessthanoptimal.

the class TestClipAndReduce method massage_scaled.

@Test
public void massage_scaled() {
    for (ImageType type : types) {
        massage_written_to(false, type);
        massage_distorted(false, type);
    }
}
Also used : ImageType(boofcv.struct.image.ImageType) Test(org.junit.Test)

Example 3 with ImageType

use of boofcv.struct.image.ImageType in project BoofCV by lessthanoptimal.

the class TestClipAndReduce method massage_clipped.

@Test
public void massage_clipped() {
    for (ImageType type : types) {
        massage_written_to(true, type);
        massage_distorted(true, type);
    }
}
Also used : ImageType(boofcv.struct.image.ImageType) Test(org.junit.Test)

Example 4 with ImageType

use of boofcv.struct.image.ImageType in project BoofCV by lessthanoptimal.

the class TestClipAndReduce method clipInput.

@Test
public void clipInput() {
    for (ImageType type : types) {
        clipInput(type, 30, 40, 50, 30);
        clipInput(type, 50, 30, 30, 40);
    }
}
Also used : ImageType(boofcv.struct.image.ImageType) Test(org.junit.Test)

Example 5 with ImageType

use of boofcv.struct.image.ImageType in project BoofCV by lessthanoptimal.

the class DemonstrationInterpolateScaleApp method main.

public static void main(String[] args) {
    ImageType type = ImageType.pl(3, GrayF32.class);
    // ImageType type = ImageType.pl(3,GrayU8.class);
    // ImageType type = ImageType.single(GrayU8.class);
    // ImageType type = ImageType.il(3, InterleavedF32.class);
    List<String> examples = new ArrayList<>();
    examples.add(UtilIO.pathExample("eye01.jpg"));
    examples.add(UtilIO.pathExample("small_sunflower.jpg"));
    DemonstrationInterpolateScaleApp app = new DemonstrationInterpolateScaleApp(examples, type);
    app.setPreferredSize(new Dimension(500, 500));
    app.openFile(new File(examples.get(0)));
    app.display("Interpolation Enlarge");
}
Also used : ArrayList(java.util.ArrayList) File(java.io.File) ImageType(boofcv.struct.image.ImageType)

Aggregations

ImageType (boofcv.struct.image.ImageType)36 Test (org.junit.Test)19 ImageBase (boofcv.struct.image.ImageBase)14 ArrayList (java.util.ArrayList)11 File (java.io.File)10 PathLabel (boofcv.io.PathLabel)7 BackgroundModelMoving (boofcv.alg.background.BackgroundModelMoving)4 Homography2D_F32 (georegression.struct.homography.Homography2D_F32)4 Se3_F64 (georegression.struct.se.Se3_F64)4 BufferedImage (java.awt.image.BufferedImage)4 GrayU8 (boofcv.struct.image.GrayU8)3 BackgroundModelStationary (boofcv.alg.background.BackgroundModelStationary)2 ConfigBackgroundBasic (boofcv.factory.background.ConfigBackgroundBasic)2 ConfigBackgroundGaussian (boofcv.factory.background.ConfigBackgroundGaussian)2 ConfigBackgroundGmm (boofcv.factory.background.ConfigBackgroundGmm)2 ImageGridPanel (boofcv.gui.image.ImageGridPanel)2 MediaManager (boofcv.io.MediaManager)2 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)2 SimpleImageSequence (boofcv.io.image.SimpleImageSequence)2 DefaultMediaManager (boofcv.io.wrapper.DefaultMediaManager)2