本文整理了Java中ij.plugin.filter.GaussianBlur.blur()
方法的一些代码示例,展示了GaussianBlur.blur()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GaussianBlur.blur()
方法的具体详情如下:
包路径:ij.plugin.filter.GaussianBlur
类名称:GaussianBlur
方法名:blur
[英]Gaussian Filtering of an ImageProcessor. This method is for compatibility with the previous code (before 1.38r) and uses a low-accuracy kernel, only slightly better than the previous ImageJ code. The 'radius' in this call is different from the one used in ImageJ 1.38r and later. Therefore, use blurGaussian(ip, sigma, sigma, accuracy), where 'sigma' is equivalent to the 'sigma (radius)' of the Menu, and accuracy should be 0.02 unless better accuracy is desired.
[中]图像处理器的高斯滤波。此方法与以前的代码(1.38r之前)兼容,并使用低精度内核,仅略优于以前的ImageJ代码。此调用中的“半径”与ImageJ 1.38r及更高版本中使用的不同。因此,使用模糊高斯(ip,sigma,sigma,Accurance),其中“sigma”等同于菜单中的“sigma(radius)”,除非需要更好的精确度,否则精确度应为0.02。
代码示例来源:origin: sc.fiji/Interactive_3D_Surface_Plot
protected void applySmoothingFilter(double rad) {
float[] pixels = new float[gridHeight*gridWidth];
for (int i=0; i < gridHeight*gridWidth; i++) {
pixels[i] = (float) plotList[i].lum;
}
ImageProcessor ip = new FloatProcessor(gridWidth, gridHeight, pixels, null);
new GaussianBlur().blur(ip, rad);
// reset progress bar (which was set by gaussian blur)
IJ.showProgress( 1.);
// ImagePlus imp2 = new ImagePlus("test", ip);
// imp2.show();
// imp2.updateAndDraw();
pixels = (float[] )ip.getPixels();
for (int i=0; i < gridHeight*gridWidth; i++) {
plotList[i].z = plotList[i].zf = pixels[i];
}
applyMinMax();
}
代码示例来源:origin: sc.fiji/Fiji_Plugins
blurImage.blur(imProcBGR[channel],(double)RetinexScales[scale]*2.5); //2.5 is the difference between IJ blur and photoshop's see ImageJ API
out=(float[]) imProcBGR[channel].getPixelsCopy();
代码示例来源:origin: sc.fiji/SPIM_Opener
public static FloatProcessor focus(FloatProcessor[] slices, double radius) {
boolean wasBatchMode = Interpreter.batchMode;
Interpreter.batchMode = true;
// calculate weights
GaussianBlur blur = new GaussianBlur();
int pixelCount = slices[0].getWidth() * slices[0].getHeight();
FloatProcessor[] weights = new FloatProcessor[slices.length];
for (int i = 0; i < slices.length; i++) {
weights[i] = (FloatProcessor)slices[i].duplicate();
blur.blur(weights[i], radius);
float[] pixels1 = (float[])slices[i].getPixels();
float[] pixels2 = (float[])weights[i].getPixels();
for (int j = 0; j < pixelCount; j++)
pixels2[j] = Math.abs(pixels2[j] - pixels1[j]);
}
FloatProcessor result = (FloatProcessor)slices[0].duplicate();
for (int j = 0; j < pixelCount; j++) {
float cumul = 0, totalWeight = 0;
for (int i = 0; i < slices.length; i++) {
float value = slices[i].getf(j);
float weight = weights[i].getf(j);
cumul += value * weight;
totalWeight += weight;
}
if (totalWeight != 0)
result.setf(j, cumul / totalWeight);
}
Interpreter.batchMode = wasBatchMode;
return result;
}
代码示例来源:origin: sc.fiji/Time_Lapse
for (int i = 0; i < slices.length; i++) {
weights[i] = (FloatProcessor)slices[i].duplicate();
blur.blur(weights[i], radius);
float[] pixels1 = (float[])slices[i].getPixels();
float[] pixels2 = (float[])weights[i].getPixels();
代码示例来源:origin: sc.fiji/Colocalisation_Analysis
if (Costes) gb.blur(ipRand, psf);
stackRand.addSlice("Correlation Plot", ipRand);
内容来源于网络,如有侵权,请联系作者删除!