use of boofcv.abst.feature.detect.extract.WrapperNonMaximumBlock in project BoofCV by lessthanoptimal.
the class BenchmarkExtractors method main.
public static void main(String[] args) {
intensity = new GrayF32(imgWidth, imgHeight);
corners = new QueueCorner(imgWidth * imgHeight);
// have about 1/20 the image below threshold
ImageMiscOps.fillUniform(intensity, rand, 0, threshold * 20.0f);
System.out.println("========= Profile Image Size " + imgWidth + " x " + imgHeight + " ==========");
System.out.println();
ThresholdCornerExtractor algThresh = new ThresholdCornerExtractor();
NonMaxBlockStrict algBlockStrict = new NonMaxBlockStrict.Max();
NonMaxBlockStrict algBlockStrictMinMax = new NonMaxBlockStrict.MinMax();
NonMaxExtractorNaive algNaiveStrict = new NonMaxExtractorNaive(true);
NonMaxBlockRelaxed algBlockRelaxed = new NonMaxBlockRelaxed.Max();
NonMaxExtractorNaive algNaiveRelaxed = new NonMaxExtractorNaive(true);
for (int radius = 1; radius < 20; radius += 1) {
System.out.println("Radius: " + radius);
System.out.println();
windowRadius = radius;
NM alg2 = new NM("Block Strict", new WrapperNonMaximumBlock(algBlockStrict));
NM alg3 = new NM("Block Strict MinMax", new WrapperNonMaximumBlock(algBlockStrictMinMax));
NM alg4 = new NM("Naive Strict", new WrapperNonMaximumNaive(algNaiveStrict));
NM alg5 = new NM("Block Relaxed", new WrapperNonMaximumBlock(algBlockRelaxed));
NM alg6 = new NM("Naive Relaxed", new WrapperNonMaximumNaive(algNaiveRelaxed));
ProfileOperation.printOpsPerSec(alg2, TEST_TIME);
ProfileOperation.printOpsPerSec(alg3, TEST_TIME);
// ProfileOperation.printOpsPerSec(alg4, TEST_TIME);
// ProfileOperation.printOpsPerSec(alg5, TEST_TIME);
// ProfileOperation.printOpsPerSec(alg6, TEST_TIME);
// ProfileOperation.printOpsPerSec(alg1, TEST_TIME);
}
}
use of boofcv.abst.feature.detect.extract.WrapperNonMaximumBlock in project BoofCV by lessthanoptimal.
the class VideoDetectCorners method perform.
public static <T extends ImageGray<T>, D extends ImageGray<D>> void perform(String fileName, Class<T> imageType, Class<D> derivType) {
SimpleImageSequence<T> sequence = BoofVideoManager.loadManagerDefault().load(fileName, ImageType.single(imageType));
int maxCorners = 200;
int radius = 2;
GeneralFeatureIntensity<T, D> intensity = new WrapperGradientCornerIntensity<>(FactoryIntensityPointAlg.shiTomasi(radius, false, derivType));
// GeneralFeatureIntensity<T, D> intensity =
// new WrapperFastCornerIntensity<T, D>(FactoryIntensityPointAlg.createFast12(defaultType, 8 , 12));
NonMaxSuppression extractor = new WrapperNonMaximumBlock(new NonMaxBlockStrict.Max());
// FeatureExtractor extractor = new WrapperNonMaximumBlock( new NonMaxExtractorNaive(radius+10,10f));
// FeatureExtractor extractor = new WrapperNonMaxCandidate(new NonMaxCandidateStrict(radius+10, 10f));
extractor.setIgnoreBorder(radius + 10);
extractor.setThresholdMaximum(10f);
GeneralFeatureDetector<T, D> detector = new GeneralFeatureDetector<>(intensity, extractor);
detector.setMaxFeatures(maxCorners);
VideoDetectCorners<T, D> display = new VideoDetectCorners<>(sequence, detector, derivType);
display.process();
}
Aggregations