Search in sources :

Example 26 with ImageType

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

the class GenericBackgroundMovingGaussianChecks method performStationaryTests.

@Test
public void performStationaryTests() {
    GenericBackgroundStationaryGaussianChecks stationary = new GenericBackgroundStationaryGaussianChecks() {

        @Override
        public BackgroundModelStationary create(ImageType imageType) {
            BackgroundModelMoving moving = GenericBackgroundMovingGaussianChecks.this.create(imageType);
            return new MovingToStationary((BackgroundMovingGaussian) moving, new Homography2D_F32());
        }
    };
    stationary.initialVariance();
    stationary.minimumDifference();
    stationary.learnRate();
    stationary.checkBandsUsed();
}
Also used : BackgroundModelMoving(boofcv.alg.background.BackgroundModelMoving) GenericBackgroundStationaryGaussianChecks(boofcv.alg.background.stationary.GenericBackgroundStationaryGaussianChecks) Homography2D_F32(georegression.struct.homography.Homography2D_F32) ImageType(boofcv.struct.image.ImageType) Test(org.junit.Test)

Example 27 with ImageType

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

the class TestBlurStorageFilter method median.

@Test
public void median() {
    for (ImageType c : imageTypes) {
        ImageBase input = c.createImage(width, height);
        ImageBase found = c.createImage(width, height);
        ImageBase expected = c.createImage(width, height);
        GImageMiscOps.fillUniform(input, rand, 0, 100);
        BlurStorageFilter alg = new BlurStorageFilter<>("median", c, 2);
        GBlurImageOps.median(input, found, 2);
        alg.process(input, expected);
        BoofTesting.assertEquals(expected, found, 1e-4);
    }
}
Also used : ImageBase(boofcv.struct.image.ImageBase) ImageType(boofcv.struct.image.ImageType) Test(org.junit.Test)

Example 28 with ImageType

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

the class TestBlurStorageFilter method mean.

@Test
public void mean() {
    for (ImageType c : imageTypes) {
        ImageBase input = c.createImage(width, height);
        ImageBase found = c.createImage(width, height);
        ImageBase expected = c.createImage(width, height);
        ImageBase storage = c.createImage(width, height);
        GImageMiscOps.fillUniform(input, rand, 0, 100);
        BlurStorageFilter alg = new BlurStorageFilter<>("mean", c, 2);
        GBlurImageOps.mean(input, found, 2, storage);
        alg.process(input, expected);
        BoofTesting.assertEquals(expected, found, 1e-4);
    }
}
Also used : ImageBase(boofcv.struct.image.ImageBase) ImageType(boofcv.struct.image.ImageType) Test(org.junit.Test)

Example 29 with ImageType

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

the class TestBlurStorageFilter method gaussian.

@Test
public void gaussian() {
    for (ImageType c : imageTypes) {
        ImageBase input = c.createImage(width, height);
        ImageBase found = c.createImage(width, height);
        ImageBase expected = c.createImage(width, height);
        ImageBase storage = c.createImage(width, height);
        GImageMiscOps.fillUniform(input, rand, 0, 100);
        BlurStorageFilter alg = new BlurStorageFilter<>("gaussian", c, -1, 2);
        GBlurImageOps.gaussian(input, found, -1, 2, storage);
        alg.process(input, expected);
        BoofTesting.assertEquals(expected, found, 1e-4);
    }
}
Also used : ImageBase(boofcv.struct.image.ImageBase) ImageType(boofcv.struct.image.ImageType) Test(org.junit.Test)

Example 30 with ImageType

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

the class GenericFiducialDetectorChecks method modifyInput.

/**
 * Makes sure the input is not modified
 */
@Test
public void modifyInput() {
    for (ImageType type : types) {
        ImageBase image = loadImage(type);
        ImageBase orig = image.clone();
        FiducialDetector detector = createDetector(type);
        detector.setLensDistortion(loadDistortion(true), image.width, image.height);
        detector.detect(image);
        BoofTesting.assertEquals(image, orig, 0);
    }
}
Also used : ImageBase(boofcv.struct.image.ImageBase) ImageType(boofcv.struct.image.ImageType) Test(org.junit.Test)

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