本文整理汇总了Java中boofcv.struct.image.ImageFloat32.clone方法的典型用法代码示例。如果您正苦于以下问题:Java ImageFloat32.clone方法的具体用法?Java ImageFloat32.clone怎么用?Java ImageFloat32.clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boofcv.struct.image.ImageFloat32
的用法示例。
在下文中一共展示了ImageFloat32.clone方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import boofcv.struct.image.ImageFloat32; //导入方法依赖的package包/类
@Override
public void init(RunConfig config) throws InvalidTestFormatException {
super.init(config);
File file = new File(GR.getGoldenDir(), goldenFileName);
try {
rnd = new Random(repeats);
InputStream inImageStream = MTTestResourceManager.openFileAsInputStream(file.getPath());
ImageUInt8 inImage = UtilImageIO.loadPGM_U8(inImageStream, (ImageUInt8) null);
ImageFloat32 convImage = ConvertImage.convert(inImage,
(ImageFloat32) null);
levels = 4;
denoiser = FactoryImageDenoise.waveletBayes(ImageFloat32.class,
levels, 0, 255);
noisy = convImage.clone();
denoisy = convImage.clone();
} catch (IOException e) {
throw new GoldenFileNotFoundException(file, this.getClass());
}
}
示例2: init
import boofcv.struct.image.ImageFloat32; //导入方法依赖的package包/类
@Override
public void init(RunConfig config) throws InvalidTestFormatException {
super.init(config);
File file = new File(GR.getGoldenDir(), goldenFileName);
try {
rnd = new Random(repeats);
InputStream inImageStream = MTTestResourceManager.openFileAsInputStream(file.getPath());
ImageUInt8 inImage = UtilImageIO.loadPGM_U8(inImageStream, (ImageUInt8) null);
ImageFloat32 convImage = ConvertImage.convert(inImage, (ImageFloat32) null);
levels = 4;
denoiser = FactoryImageDenoise.waveletSure(ImageFloat32.class, levels, 0, 255);
noisy = convImage.clone();
denoisy = convImage.clone();
} catch (IOException e) {
throw new GoldenFileNotFoundException(file, this.getClass());
}
}
示例3: init
import boofcv.struct.image.ImageFloat32; //导入方法依赖的package包/类
@Override
public void init(RunConfig config) throws InvalidTestFormatException {
super.init(config);
File file = new File(GR.getGoldenDir(), goldenFileName);
try {
rnd = new Random(repeats);
InputStream inImageStream = MTTestResourceManager.openFileAsInputStream(file.getPath());
ImageUInt8 inImage = UtilImageIO.loadPGM_U8(inImageStream, (ImageUInt8) null);
ImageFloat32 convImage = ConvertImage.convert(inImage,
(ImageFloat32) null);
levels = 4;
denoiser = FactoryImageDenoise.waveletVisu(ImageFloat32.class,
levels, 0, 255);
noisy = convImage.clone();
denoisy = convImage.clone();
} catch (IOException e) {
throw new GoldenFileNotFoundException(file, this.getClass());
}
}
示例4: intensity
import boofcv.struct.image.ImageFloat32; //导入方法依赖的package包/类
public ImageFloat32 intensity( int which ) {
ImageFloat32 a = new ImageFloat32();
setShape(which,a);
if( which == 0 ) {
a.data = inten0;
} else if( which == 1 ) {
a.data = inten1;
} else if( which == 2 ) {
a.data = inten2;
} else if( which == 3 ) {
a.data = inten3;
} else if( which == 4 ) {
a.data = inten4;
}
return a.clone();
}
示例5: main
import boofcv.struct.image.ImageFloat32; //导入方法依赖的package包/类
public static void main( String args[] ) {
// load the input image, declare data structures, create a noisy image
Random rand = new Random(234);
String dir = new File(".").getAbsolutePath();
File file = new File("/Users/mehdibenchoufi/Downloads/Example_lena_denoise_noisy.jpg");
ImageFloat32 input = UtilImageIO.loadImage(file.getAbsolutePath(), ImageFloat32.class);
ImageFloat32 noisy = input.clone();
GImageMiscOps.addGaussian(noisy, rand, 20, 0, 255);
ImageFloat32 denoised = new ImageFloat32(input.width, input.height);
// How many levels in wavelet transform
int numLevels = 4;
// Create the noise removal algorithm
WaveletDenoiseFilter<ImageFloat32> denoiser =
FactoryImageDenoise.waveletBayes(ImageFloat32.class, numLevels, 0, 255);
// remove noise from the image
denoiser.process(noisy,denoised);
// display the results
ListDisplayPanel gui = new ListDisplayPanel();
gui.addImage(ConvertBufferedImage.convertTo(input, null),"Input");
gui.addImage(ConvertBufferedImage.convertTo(noisy,null),"Noisy");
gui.addImage(ConvertBufferedImage.convertTo(denoised,null),"Denoised");
ShowImages.showWindow(input, "With noise", true);
ShowImages.showWindow(denoised, "Without noise", true);
}
示例6: process
import boofcv.struct.image.ImageFloat32; //导入方法依赖的package包/类
@Override
public void process(ImageFloat32 source, ImageFloat32 destination, ImageFlow flow) {
InputSanityCheck.checkSameShape(source,destination);
int nx = source.width;
int ny = source.height;
// Set the number of scales according to the size of the
// images. The value N is computed to assure that the smaller
// images of the pyramid don't have a size smaller than 16x16
int nscales = this.nscales;
final int N = (int)(1 + Math.log(Math.hypot(nx, ny)/16) / Math.log(1/zfactor));
if(N < nscales)
nscales = N;
// it can't handle sub-images
if( source.isSubimage() )
source = source.clone();
if( destination.isSubimage() )
destination = destination.clone();
u.reshape(source.width,source.height);
v.reshape(source.width,source.height);
alg.brox_optic_flow(source, destination, u, v, alpha, gamma, nscales, nu, TOL, inner_iter, outer_iter, false);
for( int y = 0; y < flow.height; y++ ) {
for( int x = 0; x < flow.width; x++ ) {
ImageFlow.D f = flow.unsafe_get(x,y);
f.x = u.unsafe_get(x,y);
f.y = v.unsafe_get(x,y);
}
}
}
示例7: process
import boofcv.struct.image.ImageFloat32; //导入方法依赖的package包/类
@Override
public void process(ImageFloat32 source, ImageFloat32 destination, ImageFlow flow) {
InputSanityCheck.checkSameShape(source,destination);
int nx = source.width;
int ny = source.height;
// Set the number of scales according to the size of the
// images. The value N is computed to assure that the smaller
// images of the pyramid don't have a size smaller than 16x16
int nscales = this.nscales;
final int N = (int)(1 + Math.log(Math.hypot(nx, ny)/16) / Math.log(1/zfactor));
if(N < nscales)
nscales = N;
// it can't handle sub-images
if( source.isSubimage() )
source = source.clone();
if( destination.isSubimage() )
destination = destination.clone();
u.reshape(source.width,source.height);
v.reshape(source.width,source.height);
alg.horn_schunck_pyramidal(source,destination,u,v,alpha,nscales,zfactor,warps,TOL,maxIter,false);
for( int y = 0; y < flow.height; y++ ) {
for( int x = 0; x < flow.width; x++ ) {
ImageFlow.D f = flow.unsafe_get(x,y);
f.x = u.unsafe_get(x,y);
f.y = v.unsafe_get(x,y);
}
}
}
开发者ID:lessthanoptimal,项目名称:IpolOpticalFlow,代码行数:36,代码来源:IpolHornSchunkPyramid_to_DenseOpticalFlow.java
示例8: main
import boofcv.struct.image.ImageFloat32; //导入方法依赖的package包/类
public static void main( String args[] ) {
// load the input image, declare data structures, create a noisy image
Random rand = new Random(234);
ImageFloat32 input = UtilImageIO.loadImage("../data/evaluation/standard/lena512.bmp",ImageFloat32.class);
ImageFloat32 noisy = input.clone();
GImageMiscOps.addGaussian(noisy, rand, 20, 0, 255);
ImageFloat32 denoised = new ImageFloat32(input.width,input.height);
// How many levels in wavelet transform
int numLevels = 4;
// Create the noise removal algorithm
WaveletDenoiseFilter<ImageFloat32> denoiser =
FactoryImageDenoise.waveletBayes(ImageFloat32.class,numLevels,0,255);
// remove noise from the image
denoiser.process(noisy,denoised);
// display the results
ListDisplayPanel gui = new ListDisplayPanel();
gui.addImage(ConvertBufferedImage.convertTo(input,null),"Input");
gui.addImage(ConvertBufferedImage.convertTo(noisy,null),"Noisy");
gui.addImage(ConvertBufferedImage.convertTo(denoised,null),"Denoised");
ShowImages.showWindow(gui,"Wavelet Noise Removal Example");
}
示例9: testIntensityInvariance
import boofcv.struct.image.ImageFloat32; //导入方法依赖的package包/类
/**
* Vary the intensity of the input image and see if the description changes.
*/
@Test
public void testIntensityInvariance() {
ImageFloat32 input = createImage(width,height);
ImageFloat32 mod = input.clone();
GPixelMath.multiply(input, 2, mod);
DescribePointBriefSO<ImageFloat32> alg = createAlg();
TupleDesc_B desc1 = alg.createFeature();
TupleDesc_B desc2 = alg.createFeature();
// compute the image from the same image but different intensities
alg.setImage(input);
alg.process(input.width/2,input.height/2,0,1,desc1);
alg.setImage(mod);
alg.process(input.width/2,input.height/2,0,1,desc2);
// compare the descriptions
int count = 0;
for( int i = 0; i < desc1.numBits; i++ ) {
count += desc1.isBitTrue(i) == desc2.isBitTrue(i) ? 1 : 0;
}
// blurring the image can cause some bits to switch in the description
assertTrue( count > desc1.numBits-3);
}
示例10: compareToWaveletTransformOps
import boofcv.struct.image.ImageFloat32; //导入方法依赖的package包/类
@Test
public void compareToWaveletTransformOps() {
ImageFloat32 orig = new ImageFloat32(width,height);
GImageMiscOps.fillUniform(orig, rand, 0, 20);
ImageFloat32 origCopy = orig.clone();
int N = 3;
ImageDimension dimen = UtilWavelet.transformDimension(orig,N);
ImageFloat32 found = new ImageFloat32(dimen.width,dimen.height);
ImageFloat32 expected = new ImageFloat32(dimen.width,dimen.height);
WaveletDescription<WlCoef_F32> desc = FactoryWaveletDaub.biorthogonal_F32(5, BorderType.REFLECT);
ImageFloat32 storage = new ImageFloat32(dimen.width,dimen.height);
WaveletTransformOps.transformN(desc,orig.clone(),expected,storage,N);
WaveletTransformFloat32 alg = new WaveletTransformFloat32(desc,N,0,255);
alg.transform(orig,found);
// make sure the original input was not modified like it is in WaveletTransformOps
BoofTesting.assertEquals(origCopy,orig, 1e-4);
// see if the two techniques produced the same results
BoofTesting.assertEquals(expected,found, 1e-4);
// test inverse transform
ImageFloat32 reconstructed = new ImageFloat32(width,height);
alg.invert(found,reconstructed);
BoofTesting.assertEquals(orig,reconstructed, 1e-4);
// make sure the input has not been modified
BoofTesting.assertEquals(expected,found, 1e-4);
}