public void run(ImageProcessor ip) { if (canceled) return; if (isLineRoi) ip.resetRoi(); if (!kernelError) convolve(ip, kernel, kw, kh); }
public void run(ImageProcessor ip) { if (canceled) return; if (isLineRoi) ip.resetRoi(); if (!kernelError) convolve(ip, kernel, kw, kh); }
/** * smoothing by 3*3 box filter */ private void smooth(float[] dIdu, int size) { float[] kernel = {1f / 3f, 1f / 3f, 1f / 3f}; Convolver convolver = new Convolver(); FloatProcessor imp = new FloatProcessor(size - 1, size - 1, dIdu, null); convolver.convolve(imp, kernel, kernel.length, 1); convolver.convolve(imp, kernel, 1, kernel.length); }
/** Performs a convolution operation using the specified kernel. */ public void convolve(float[] kernel, int kernelWidth, int kernelHeight) { snapshot(); new ij.plugin.filter.Convolver().convolve(this, kernel, kernelWidth, kernelHeight); }
/** Performs a convolution operation using the specified kernel. */ public void convolve(float[] kernel, int kernelWidth, int kernelHeight) { snapshot(); new ij.plugin.filter.Convolver().convolve(this, kernel, kernelWidth, kernelHeight); }
/** Performs a convolution operation using the specified kernel. */ public void convolve(float[] kernel, int kernelWidth, int kernelHeight) { ImageProcessor ip2 = convertToFloat(); ip2.setRoi(getRoi()); new ij.plugin.filter.Convolver().convolve(ip2, kernel, kernelWidth, kernelHeight); ip2 = ip2.convertToByte(false); byte[] pixels2 = (byte[])ip2.getPixels(); System.arraycopy(pixels2, 0, pixels, 0, pixels.length); }
/** Performs a convolution operation using the specified kernel. */ public void convolve(float[] kernel, int kernelWidth, int kernelHeight) { ImageProcessor ip2 = convertToFloat(); ip2.setRoi(getRoi()); new ij.plugin.filter.Convolver().convolve(ip2, kernel, kernelWidth, kernelHeight); ip2 = ip2.convertToByte(false); byte[] pixels2 = (byte[])ip2.getPixels(); System.arraycopy(pixels2, 0, pixels, 0, pixels.length); }
/** Performs a convolution operation using the specified kernel. */ public void convolve(float[] kernel, int kernelWidth, int kernelHeight) { ImageProcessor ip2 = convertToFloat(); ip2.setRoi(getRoi()); new ij.plugin.filter.Convolver().convolve(ip2, kernel, kernelWidth, kernelHeight); ip2 = ip2.convertToShort(false); short[] pixels2 = (short[])ip2.getPixels(); System.arraycopy(pixels2, 0, pixels, 0, pixels.length); }
/** Performs a convolution operation using the specified kernel. */ public void convolve(float[] kernel, int kernelWidth, int kernelHeight) { ImageProcessor ip2 = convertToFloat(); ip2.setRoi(getRoi()); new ij.plugin.filter.Convolver().convolve(ip2, kernel, kernelWidth, kernelHeight); ip2 = ip2.convertToShort(false); short[] pixels2 = (short[])ip2.getPixels(); System.arraycopy(pixels2, 0, pixels, 0, pixels.length); }