本文整理了Java中ij.plugin.filter.GaussianBlur.<init>()
方法的一些代码示例,展示了GaussianBlur.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GaussianBlur.<init>()
方法的具体详情如下:
包路径:ij.plugin.filter.GaussianBlur
类名称:GaussianBlur
方法名:<init>
暂无
代码示例来源:origin: stackoverflow.com
importClass(Packages.ij.plugin.filter.GaussianBlur);
var imp = IJ.openImage("http://imagej.nih.gov/ij/images/clown.jpg");
IJ.run(imp, "8-bit", "");
var ip = imp.getProcessor();
var gs = new GaussianBlur();
gs.blurGaussian(ip,20,20,0.01);
imp.show();
代码示例来源:origin: net.imagej/ij
/** Since most computing time is spent in GaussianBlur, forward the
* information about the number of passes to Gaussian Blur. The
* ProgressBar will be handled by GaussianBlur. */
public void setNPasses(int nPasses) {
if (gb == null) gb = new GaussianBlur();
gb.setNPasses(nPasses);
}
}
代码示例来源:origin: sc.fiji/TrakEM2_
@Override
public ImageProcessor process(ImageProcessor ip) {
ij.plugin.filter.GaussianBlur g = new ij.plugin.filter.GaussianBlur();
g.blurGaussian(ip, sigmaX, sigmaY, accuracy);
return ip;
}
代码示例来源:origin: imagej/ImageJA
/** Since most computing time is spent in GaussianBlur, forward the
* information about the number of passes to Gaussian Blur. The
* ProgressBar will be handled by GaussianBlur. */
public void setNPasses(int nPasses) {
if (gb == null) gb = new GaussianBlur();
gb.setNPasses(nPasses);
}
}
代码示例来源:origin: sc.fiji/bUnwarpJ_
/**
* Smooth with a Gaussian kernel that represents downsampling at a given
* scale factor and sourceSigma.
*/
final static public void smoothForScale(
final ImageProcessor source,
final float scale,
final float sourceSigma,
final float targetSigma )
{
if ( scale >= 1.0f ) return;
float s = targetSigma / scale;
float sigma = ( float )Math.sqrt( s * s - sourceSigma * sourceSigma );
new GaussianBlur().blurGaussian( source, sigma, sigma, 0.01 );
}
代码示例来源:origin: stackoverflow.com
@Override
public void start(Stage primaryStage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("/views/main.fxml"));
Scene scene = new Scene(root);
scene.getStylesheets().add(this.getClass().getResource("/style/main.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
windowMain = primaryStage;
root.setEffect(new GaussianBlur());
loginWindow.display();
root.setEffect(null);
}
代码示例来源:origin: net.imagej/ij
int[] smooth(int[] a, int n) {
FloatProcessor fp = new FloatProcessor(n, 1);
for (int i=0; i<n; i++)
fp.putPixelValue(i, 0, a[i]);
GaussianBlur gb = new GaussianBlur();
gb.blur1Direction(fp, 2.0, 0.01, true, 0);
for (int i=0; i<n; i++)
a[i] = (int)Math.round(fp.getPixelValue(i, 0));
return a;
}
代码示例来源:origin: net.imagej/ij
/** Blurs the image by convolving with a Gaussian function. */
public void blurGaussian(double sigma) {
resetRoi();
GaussianBlur gb = new GaussianBlur();
gb.showProgress(false);
gb.blurGaussian(this, sigma);
}
代码示例来源:origin: imagej/ImageJA
int[] smooth(int[] a, int n) {
FloatProcessor fp = new FloatProcessor(n, 1);
for (int i=0; i<n; i++)
fp.putPixelValue(i, 0, a[i]);
GaussianBlur gb = new GaussianBlur();
gb.blur1Direction(fp, 2.0, 0.01, true, 0);
for (int i=0; i<n; i++)
a[i] = (int)Math.round(fp.getPixelValue(i, 0));
return a;
}
代码示例来源:origin: net.imagej/ij
/** Unsharp Mask filtering of a float image. 'fp' must have a valid snapshot. */
public void sharpenFloat(FloatProcessor fp, double sigma, float weight) {
if (gb == null) gb = new GaussianBlur();
gb.blurGaussian(fp, sigma, sigma, 0.01);
if (Thread.currentThread().isInterrupted()) return;
float[] pixels = (float[])fp.getPixels();
float[] snapshotPixels = (float[])fp.getSnapshotPixels();
int width = fp.getWidth();
Rectangle roi = fp.getRoi();
for (int y=roi.y; y<roi.y+roi.height; y++)
for (int x=roi.x, p=width*y+x; x<roi.x+roi.width; x++,p++)
pixels[p] = (snapshotPixels[p] - weight*pixels[p])/(1f - weight);
}
代码示例来源:origin: imagej/ImageJA
/** Blurs the image by convolving with a Gaussian function. */
public void blurGaussian(double sigma) {
resetRoi();
GaussianBlur gb = new GaussianBlur();
gb.showProgress(false);
gb.blurGaussian(this, sigma);
}
代码示例来源:origin: imagej/ImageJA
/** Unsharp Mask filtering of a float image. 'fp' must have a valid snapshot. */
public void sharpenFloat(FloatProcessor fp, double sigma, float weight) {
if (gb == null) gb = new GaussianBlur();
gb.blurGaussian(fp, sigma, sigma, 0.01);
if (Thread.currentThread().isInterrupted()) return;
float[] pixels = (float[])fp.getPixels();
float[] snapshotPixels = (float[])fp.getSnapshotPixels();
int width = fp.getWidth();
Rectangle roi = fp.getRoi();
for (int y=roi.y; y<roi.y+roi.height; y++)
for (int x=roi.x, p=width*y+x; x<roi.x+roi.width; x++,p++)
pixels[p] = (snapshotPixels[p] - weight*pixels[p])/(1f - weight);
}
代码示例来源:origin: fiji/Trainable_Segmentation
public ImagePlus call(){
ImageProcessor ip = originalImage.getProcessor().duplicate();
GaussianBlur gs = new GaussianBlur();
//gs.blur(ip, sigma);
gs.blurGaussian(ip, 0.4 * sigma, 0.4 * sigma, 0.0002);
return new ImagePlus (availableFeatures[GAUSSIAN] + "_" + sigma, ip);
}
};
代码示例来源:origin: net.imagej/ij
float[] smooth(float[] a, int n) {
FloatProcessor fp = new FloatProcessor(n, 1);
for (int i=0; i<n; i++)
fp.setf(i, 0, a[i]);
GaussianBlur gb = new GaussianBlur();
gb.blur1Direction(fp, 2.0, 0.01, true, 0);
for (int i=0; i<n; i++)
a[i] = fp.getf(i, 0);
return a;
}
代码示例来源:origin: sc.fiji/Trainable_Segmentation
public ImagePlus call(){
ImageProcessor ip = originalImage.getProcessor().duplicate();
GaussianBlur gs = new GaussianBlur();
//gs.blur(ip, sigma);
gs.blurGaussian(ip, 0.4 * sigma, 0.4 * sigma, 0.0002);
return new ImagePlus (availableFeatures[GAUSSIAN] + "_" + sigma, ip);
}
};
代码示例来源:origin: sc.fiji/TrakEM2_
/** WARNING will resize the FloatProcessorT2 source in place, unlike ImageJ standard FloatProcessor class. */
static final private byte[] gaussianBlurResizeInHalf(final FloatProcessorT2 source)
{
new GaussianBlur().blurFloat( source, SIGMA_2, SIGMA_2, 0.01 );
source.halfSizeInPlace();
return (byte[])source.convertToByte(false).getPixels(); // no scaling
}
代码示例来源:origin: imagej/ImageJA
float[] smooth(float[] a, int n) {
FloatProcessor fp = new FloatProcessor(n, 1);
for (int i=0; i<n; i++)
fp.setf(i, 0, a[i]);
GaussianBlur gb = new GaussianBlur();
gb.blur1Direction(fp, 2.0, 0.01, true, 0);
for (int i=0; i<n; i++)
a[i] = fp.getf(i, 0);
return a;
}
代码示例来源:origin: sc.fiji/Trainable_Segmentation
/**
* Add Gaussian blur slice to current stack
* @param sigma Gaussian radius
*/
public void addGaussianBlur(float sigma)
{
ImageProcessor ip = originalImage.getProcessor().duplicate();
GaussianBlur gs = new GaussianBlur();
//gs.blur(ip, sigma);
gs.blurGaussian(ip, 0.4 * sigma, 0.4 * sigma, 0.0002);
wholeStack.addSlice(availableFeatures[GAUSSIAN] + "_" + sigma, ip);
}
/**
代码示例来源:origin: fiji/Trainable_Segmentation
/**
* Add Gaussian blur slice to current stack
* @param sigma Gaussian radius
*/
public void addGaussianBlur(float sigma)
{
ImageProcessor ip = originalImage.getProcessor().duplicate();
GaussianBlur gs = new GaussianBlur();
//gs.blur(ip, sigma);
gs.blurGaussian(ip, 0.4 * sigma, 0.4 * sigma, 0.0002);
wholeStack.addSlice(availableFeatures[GAUSSIAN] + "_" + sigma, ip);
}
/**
代码示例来源:origin: sc.fiji/TrakEM2_
/**
* Gaussian-downsample to the target dimensions
* @param ip
* @return
*/
protected FloatProcessor gaussianDownsampled( final FloatProcessor ip )
{
loader.releaseToFit( ( (float[])ip.getPixels() ).length * 2 );
// Gaussian-downsample
final double sigma = computeSigma( ip.getWidth(), ip.getHeight() );
Utils.log("Gaussian downsampling. If this is slow, check the number of threads in the plugin preferences.");
new GaussianBlur().blurFloat( ip, sigma, sigma, 0.0002 );
ip.setInterpolationMethod( ImageProcessor.NEAREST_NEIGHBOR );
return (FloatProcessor) ip.resize( ( int ) Math.ceil( finalBox.width * scale ) );
}
内容来源于网络,如有侵权,请联系作者删除!