本文整理匯總了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();
}
示例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]);
}
}
}
}
示例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]));
}
}
}
}
示例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();
}