当前位置: 首页>>代码示例>>Java>>正文


Java GConvertImage类代码示例

本文整理汇总了Java中boofcv.core.image.GConvertImage的典型用法代码示例。如果您正苦于以下问题:Java GConvertImage类的具体用法?Java GConvertImage怎么用?Java GConvertImage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GConvertImage类属于boofcv.core.image包,在下文中一共展示了GConvertImage类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: BenchmarkDescribe

import boofcv.core.image.GConvertImage; //导入依赖的package包/类
public BenchmarkDescribe( Class<I> imageType ) {

		this.imageType = imageType;

		derivType = GImageDerivativeOps.getDerivativeType(imageType);
		integralType = GIntegralImageOps.getIntegralType(imageType);

		colorMS = new MultiSpectral<I>(imageType,width,height,3);
		GImageMiscOps.fillUniform(colorMS, rand, 0, 100);

		gray = GConvertImage.average(colorMS,gray);

		pts = new Point2D_I32[ NUM_POINTS ];
		scales = new double[ NUM_POINTS ];
		yaws = new double[ NUM_POINTS ];
		int border = 20;
		for( int i = 0; i < NUM_POINTS; i++ ) {
			int x = rand.nextInt(width-border*2)+border;
			int y = rand.nextInt(height-border*2)+border;
			pts[i] = new Point2D_I32(x,y);
			scales[i] = rand.nextDouble()*3+1;
			yaws[i] = 2.0*(rand.nextDouble()-0.5)*Math.PI;
		}

	}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:26,代码来源:BenchmarkDescribe.java

示例2: process

import boofcv.core.image.GConvertImage; //导入依赖的package包/类
public void process(final BufferedImage buffLeft, final BufferedImage buffRight) {
	imageLeft.reshape(buffLeft.getWidth(), buffLeft.getHeight());
	imageRight.reshape(buffRight.getWidth(), buffRight.getHeight());
	grayLeft.reshape(buffLeft.getWidth(), buffLeft.getHeight());
	grayRight.reshape(buffRight.getWidth(), buffRight.getHeight());

	ConvertBufferedImage.convertFromMulti(buffLeft, imageLeft, imageType);
	ConvertBufferedImage.convertFromMulti(buffRight, imageRight, imageType);
	GConvertImage.average(imageLeft, grayLeft);
	GConvertImage.average(imageRight,grayRight);

	SwingUtilities.invokeLater(new Runnable() {
		public void run() {
			panel.setImages(buffLeft, buffRight);
			processedImage = true;
			doRefreshAll();
		}
	});
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:20,代码来源:VisualizeAssociationMatchesApp.java

示例3: grayMean

import boofcv.core.image.GConvertImage; //导入依赖的package包/类
/**
 * Converts the color image into a gray scale image by averaged each pixel across the bands
 */
public SimpleGray grayMean() {
	ImageGray out =
			GeneralizedImageOps.createSingleBand(image.imageType.getDataType(),image.width,image.height);

	GConvertImage.average(image, out);

	return new SimpleGray(out);
}
 
开发者ID:lessthanoptimal,项目名称:BoofProcessing,代码行数:12,代码来源:SimpleColor.java

示例4: convertToF32

import boofcv.core.image.GConvertImage; //导入依赖的package包/类
/**
 * Converts the internal image type into {@link GrayF32}.
 */
public void convertToF32() {
	if( image instanceof GrayF32 )
		return;

	GrayF32 a = new GrayF32(image.width,image.height);
	GConvertImage.convert(image,a);
	image = a;
}
 
开发者ID:lessthanoptimal,项目名称:BoofProcessing,代码行数:12,代码来源:SimpleGray.java

示例5: convertToU8

import boofcv.core.image.GConvertImage; //导入依赖的package包/类
/**
 * Converts the internal image type into {@link GrayU8}.
 */
public void convertToU8() {
	if( image instanceof GrayU8 )
		return;

	GrayU8 a = new GrayU8(image.width,image.height);
	GConvertImage.convert(image,a);
	image = a;
}
 
开发者ID:lessthanoptimal,项目名称:BoofProcessing,代码行数:12,代码来源:SimpleGray.java

示例6: detect

import boofcv.core.image.GConvertImage; //导入依赖的package包/类
@Override
public void detect(MultiSpectral<T> input) {
	gray.reshape(input.width,input.height);
	grayII.reshape(input.width,input.height);
	bandII.reshape(input.width,input.height);

	GConvertImage.average(input,gray);
	GIntegralImageOps.transform(gray, grayII);
	for( int i = 0; i < input.getNumBands(); i++)
		GIntegralImageOps.transform(input.getBand(i), bandII.getBand(i));

	alg.detect(grayII,bandII);
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:14,代码来源:SurfMultiSpectral_to_DetectDescribePoint.java

示例7: setImage

import boofcv.core.image.GConvertImage; //导入依赖的package包/类
@Override
public void setImage(MultiSpectral<T> image) {
	gray.reshape(image.width,image.height);
	grayII.reshape(image.width,image.height);
	bandII.reshape(image.width,image.height);

	GConvertImage.average(image, gray);
	GIntegralImageOps.transform(gray, grayII);
	for( int i = 0; i < image.getNumBands(); i++)
		GIntegralImageOps.transform(image.getBand(i), bandII.getBand(i));

	alg.setImage(grayII,bandII);
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:14,代码来源:SurfMultiSpectral_to_DescribeRegionPoint.java

示例8: convolve

import boofcv.core.image.GConvertImage; //导入依赖的package包/类
public void convolve( Method m ) throws InvocationTargetException, IllegalAccessException {
	Kernel2D_I32 kernel = new Kernel2D_I32(3, new int[]{1,1,1,2,2,2,1,1,1});
	ImageUInt8 input = new ImageUInt8(width,height);
	ImageSInt32 expected = new ImageSInt32(width,height);
	GImageMiscOps.fillUniform(input, rand, 0, 10);
	ImageBorder_I32 border = FactoryImageBorderAlgs.value( input, 0);
	ConvolveWithBorder.convolve(kernel,input,expected,border);

	Class paramType[] = m.getParameterTypes();
	Class inputType = paramType[0];
	Class outputType = paramType[2];

	ImageSingleBand inputII = GeneralizedImageOps.createSingleBand(inputType, width, height);
	ImageSingleBand integral = GeneralizedImageOps.createSingleBand(outputType, width, height);
	ImageSingleBand expectedII = GeneralizedImageOps.createSingleBand(outputType, width, height);
	ImageSingleBand found = GeneralizedImageOps.createSingleBand(outputType, width, height);

	GConvertImage.convert(input,inputII);
	GConvertImage.convert(expected,expectedII);

	GIntegralImageOps.transform(inputII, integral);

	IntegralKernel kernelII = new IntegralKernel(2);
	kernelII.blocks[0] = new ImageRectangle(-2,-2,1,1);
	kernelII.blocks[1] = new ImageRectangle(-2,-1,1,0);
	kernelII.scales = new int[]{1,1};

	m.invoke(null,integral,kernelII,found);

	BoofTesting.assertEqualsRelative(expected, found, 1e-4f);
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:32,代码来源:TestImplIntegralImageOps.java

示例9: convolveBorder

import boofcv.core.image.GConvertImage; //导入依赖的package包/类
public void convolveBorder( Method m ) throws InvocationTargetException, IllegalAccessException {
	Kernel2D_I32 kernel = new Kernel2D_I32(3, new int[]{1,1,1,2,2,2,1,1,1});
	ImageUInt8 input = new ImageUInt8(width,height);
	ImageSInt32 expected = new ImageSInt32(width,height);
	GImageMiscOps.fillUniform(input, rand, 0, 10);
	ImageBorder_I32 border = FactoryImageBorderAlgs.value( input, 0);
	ConvolveWithBorder.convolve(kernel,input,expected,border);

	Class paramType[] = m.getParameterTypes();
	Class inputType = paramType[0];
	Class outputType = paramType[2];

	ImageSingleBand inputII = GeneralizedImageOps.createSingleBand(inputType, width, height);
	ImageSingleBand integral = GeneralizedImageOps.createSingleBand(outputType, width, height);
	ImageSingleBand expectedII = GeneralizedImageOps.createSingleBand(outputType, width, height);
	ImageSingleBand found = GeneralizedImageOps.createSingleBand(outputType, width, height);

	GConvertImage.convert(input,inputII);
	GConvertImage.convert(expected,expectedII);

	GIntegralImageOps.transform(inputII, integral);

	IntegralKernel kernelII = new IntegralKernel(2);
	kernelII.blocks[0] = new ImageRectangle(-2,-2,1,1);
	kernelII.blocks[1] = new ImageRectangle(-2,-1,1,0);
	kernelII.scales = new int[]{1,1};

	m.invoke(null,integral,kernelII,found,4,5);

	BoofTesting.assertEqualsBorder(expected,found,1e-4f,4,5);
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:32,代码来源:TestImplIntegralImageOps.java

示例10: process

import boofcv.core.image.GConvertImage; //导入依赖的package包/类
@Override
public boolean process(MultiSpectral<T> input) {
	gray.reshape(input.width,input.height);
	GConvertImage.average(input, gray);
	return motion.process(gray);
}
 
开发者ID:intrack,项目名称:BoofCV-master,代码行数:7,代码来源:MsToGrayMotion2D.java


注:本文中的boofcv.core.image.GConvertImage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。