當前位置: 首頁>>代碼示例>>Java>>正文


Java ImageProcessor.copyBits方法代碼示例

本文整理匯總了Java中ij.process.ImageProcessor.copyBits方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageProcessor.copyBits方法的具體用法?Java ImageProcessor.copyBits怎麽用?Java ImageProcessor.copyBits使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ij.process.ImageProcessor的用法示例。


在下文中一共展示了ImageProcessor.copyBits方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: dilate

import ij.process.ImageProcessor; //導入方法依賴的package包/類
private void dilate(ByteProcessor 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 element 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);
	
}
 
開發者ID:imagingbook,項目名稱:imagingbook-common,代碼行數:28,代碼來源:BinaryMorphologyFilter.java

示例2: 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);
	
}
 
開發者ID:imagingbook,項目名稱:imagingbook-common,代碼行數:28,代碼來源:BinMorpher.java

示例3: outline

import ij.process.ImageProcessor; //導入方法依賴的package包/類
void outline(ImageProcessor ip){
	int[][] H = {{0,1,0},
		         {1,1,1},
		         {0,1,0}
		        };
	ImageProcessor foreground = ip.duplicate();
	erode(foreground,H);
	ip.copyBits(foreground,0,0,Blitter.DIFFERENCE);
}
 
開發者ID:imagingbook,項目名稱:imagingbook-common,代碼行數:10,代碼來源:BinMorpher.java


注:本文中的ij.process.ImageProcessor.copyBits方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。