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


Java ImageProcessor.putPixel方法代碼示例

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


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

示例1: showFilter

import ij.process.ImageProcessor; //導入方法依賴的package包/類
public void showFilter(int[][] filter, String title){
	int w = filter[0].length;
	int h = filter.length;
	ImageProcessor ip = new ByteProcessor(w,h);
	for (int v = 0; v < h; v++) {
		for (int u = 0; u < w; u++) {
			if (filter[v][u] == 1)
				ip.putPixel(u, v, 255);
			else
				ip.putPixel(u, v, 0);
		}
	}
	ip.invertLut();
	ImagePlus win = new ImagePlus(title,ip);
	win.show();
}
 
開發者ID:imagingbook,項目名稱:imagingbook-common,代碼行數:17,代碼來源:BinMorpher.java

示例2: copyResultToImage

import ij.process.ImageProcessor; //導入方法依賴的package包/類
void copyResultToImage(ImageProcessor ip) {
	final int[] pixel = new int[K];
	if (ip instanceof ColorProcessor) {
		for (int u = 0; u < M; u++) {
			for (int v = 0; v < N; v++) {
				for (int k = 0; k < K; k++) {
					int c = params.useLinearRgb ? 
							Math.round(rgbToSrgb(I[k][u][v])) : 
							Math.round(I[k][u][v]);
					if (c < 0) c = 0;
					if (c > 255) c = 255;
					pixel[k] = c;
				}
				ip.putPixel(u,v,pixel);
			}
		}
	}
	else { 	// 8-bit, 16-bit or 32-bit (float) processor
		for (int u = 0; u < M; u++) {
			for (int v = 0; v < N; v++) {
				ip.setf(u, v, I[0][u][v]);
			}
		}
	}
}
 
開發者ID:imagingbook,項目名稱:imagingbook-common,代碼行數:26,代碼來源:TschumperleDericheFilter.java

示例3: copyResultToImage

import ij.process.ImageProcessor; //導入方法依賴的package包/類
private void copyResultToImage(float[][] imgData, ImageProcessor ip) {
	if (ip instanceof FloatProcessor) {
		FloatProcessor cp = (FloatProcessor) ip;
		for (int v = 0; v < N; v++) {
			for (int u = 0; u < M; u++) {
				cp.putPixelValue(u, v, imgData[u][v]);
			}
		}
	}
	else {
		for (int v = 0; v < N; v++) {
			for (int u = 0; u < M; u++) {
				ip.putPixel(u, v, (int) Math.round(imgData[u][v]));
			}
		}
	}
}
 
開發者ID:imagingbook,項目名稱:imagingbook-common,代碼行數:18,代碼來源:PeronaMalikFilter.java

示例4: show

import ij.process.ImageProcessor; //導入方法依賴的package包/類
public void show(int[][] matrix, String title) {
	int w = matrix[0].length;
	int h = matrix.length;
	ImageProcessor ip = new ByteProcessor(w, h);
	for (int v = 0; v < h; v++) {
		for (int u = 0; u < w; u++) {
			if (matrix[v][u] == 1)
				ip.putPixel(u, v, 255);
			else
				ip.putPixel(u, v, 0);
		}
	}
	ip.invertLut();
	(new ImagePlus(title, ip)).show();
}
 
開發者ID:imagingbook,項目名稱:imagingbook-common,代碼行數:16,代碼來源:BinaryMorphologyFilter.java


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