本文整理匯總了Java中ij.process.ImageProcessor.createProcessor方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageProcessor.createProcessor方法的具體用法?Java ImageProcessor.createProcessor怎麽用?Java ImageProcessor.createProcessor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ij.process.ImageProcessor
的用法示例。
在下文中一共展示了ImageProcessor.createProcessor方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: pad
import ij.process.ImageProcessor; //導入方法依賴的package包/類
/**
* some parts from ij.plugin.FFT code
*
* */
ImageProcessor pad(ImageProcessor ip)
{
int originalWidth = ip.getWidth();
int originalHeight = ip.getHeight();
int maxN = Math.max(originalWidth, originalHeight);
int i = 2;
while(i<maxN) i *= 2;
if (i==maxN && originalWidth==originalHeight)
{
return ip;
}
maxN = i;
ImageStatistics stats = ImageStatistics.getStatistics(ip, ImageStatistics.MEAN, null);
ImageProcessor ip2 = ip.createProcessor(maxN, maxN);
ip2.setValue(stats.mean);
ip2.fill();
ip2.insert(ip, 0, 0);
Undo.reset();
//new ImagePlus("padded", ip2.duplicate()).show();
return ip2;
}
示例2: padzeros
import ij.process.ImageProcessor; //導入方法依賴的package包/類
ImageProcessor padzeros(ImageProcessor ip)
{
int originalWidth = ip.getWidth();
int originalHeight = ip.getHeight();
int maxN = Math.max(originalWidth, originalHeight);
int i = 2;
while(i<maxN) i *= 2;
if (i==maxN && originalWidth==originalHeight)
{
return ip;
}
maxN = i;
ImageProcessor ip2 = ip.createProcessor(maxN, maxN);
ip2.setValue(0);
ip2.fill();
ip2.insert(ip, 0, 0);
Undo.reset();
//new ImagePlus("padded", ip2.duplicate()).show();
return ip2;
}
示例3: dilate
import ij.process.ImageProcessor; //導入方法依賴的package包/類
void dilate(ImageProcessor ip, int[][] H){
if (H == null) {
IJ.error("no structuring element");
return;
}
//assume that the hot spot of se is at its center (ic,jc)
int ic = (H[0].length - 1) / 2;
int jc = (H.length - 1) / 2;
int N = H.length * H[0].length;
ImageProcessor tmp = ip.createProcessor(ip.getWidth(),ip.getHeight());
int k = 0;
IJ.showProgress(k,N);
for (int j = 0; j < H.length; j++) {
for (int i = 0; i < H[j].length; i++) {
if (H[j][i] > 0) { // this pixel is set
// copy image into position (u-ch,v-cv)
tmp.copyBits(ip, i - ic, j - jc, Blitter.MAX);
}
IJ.showProgress(k++, N);
}
}
ip.copyBits(tmp, 0, 0, Blitter.COPY);
}