當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。