本文整理匯總了Java中ij.process.ImageProcessor.get方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageProcessor.get方法的具體用法?Java ImageProcessor.get怎麽用?Java ImageProcessor.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ij.process.ImageProcessor
的用法示例。
在下文中一共展示了ImageProcessor.get方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getmaxpositions
import ij.process.ImageProcessor; //導入方法依賴的package包/類
/** Gets x and y coordinates of maximum intensity pixel on image. */
int [] getmaxpositions(ImageProcessor ipp)
{
int [] results = new int [2];
results[0]=0;
results[1]=0;
double s;
double smax=Double.MIN_VALUE;
for (int i=0;i<ipp.getWidth();i++)
{
for (int j=0;j<ipp.getHeight();j++)
{
s=ipp.get(i, j);
if (s>smax)
{
smax=s;
results[0]=i;
results[1]=j;
}
}
}
return results;
}
示例2: process
import ij.process.ImageProcessor; //導入方法依賴的package包/類
private void process(ImageProcessor ip) {
ByteProcessor check = new ByteProcessor(M, N);
if (params.showProgress) IJ.showStatus("filling accumulator ...");
for (int v = 0; v < N; v++) {
if (params.showProgress) IJ.showProgress(v, N);
for (int u = 0; u < M; u++) {
if ((0xFFFFFF & ip.get(u, v)) != 0) { // this is a foreground (edge) pixel - use ImageAccessor??
doOnePoint(u, v);
check.putPixel(u, v, 128);
}
}
}
if (params.showProgress)
IJ.showProgress(1, 1);
if (params.showCheckImage)
(new ImagePlus("Check", check)).show();
}
示例3: process
import ij.process.ImageProcessor; //導入方法依賴的package包/類
private void process(ImageProcessor ip) {
// ByteProcessor check = new ByteProcessor(M, N);
if (params.showProgress) IJ.showStatus("filling accumulator ...");
for (int v = 0; v < N; v++) {
if (params.showProgress) IJ.showProgress(v, N);
for (int u = 0; u < M; u++) {
if ((0xFFFFFF & ip.get(u, v)) != 0) { // this is a foreground (edge) pixel - use ImageAccessor??
processPoint(u, v);
// check.putPixel(u, v, 128);
}
}
}
if (params.showProgress)
IJ.showProgress(1, 1);
// if (params.showCheckImage)
// (new ImagePlus("Check", check)).show();
}
示例4: makeDistanceMap
import ij.process.ImageProcessor; //導入方法依賴的package包/類
private float[][] makeDistanceMap(ImageProcessor I, Norm norm) {
float m1, m2;
switch (norm) {
case L1:
m1 = 1; m2 = 2; break;
case L2:
m1 = 1; m2 = (float) Math.sqrt(2); break;
default:
throw new IllegalArgumentException();
}
final int M = I.getWidth();
final int N = I.getHeight();
final float[][] D = new float[M][N];
float d0, d1, d2, d3;
// L->R pass:
for (int v = 0; v < N; v++) {
for (int u = 0; u < M; u++) {
D[u][v] = (I.get(u, v) > 0) ? 0 : Float.POSITIVE_INFINITY; // initialize
if (D[u][v] > 0) { // a background pixel
d0 = d1 = d2 = d3 = Float.POSITIVE_INFINITY;
if (u > 0) {
d0 = m1 + D[u - 1][v];
if (v > 0) {
d1 = m2 + D[u - 1][v - 1];
}
}
if (v > 0) {
d2 = m1 + D[u][v - 1];
if (u < M - 1) {
d3 = m2 + D[u + 1][v - 1];
}
}
// at this point D[u][v] == POSITIVE_INFINITY
D[u][v] = min(d0, d1, d2, d3);
}
}
}
// R->L pass:
for (int v = N - 1; v >= 0; v--) {
for (int u = M - 1; u >= 0; u--) {
if (D[u][v] > 0) { // a background pixel
d0 = d1 = d2 = d3 = Float.POSITIVE_INFINITY;
if (u < M - 1) {
d0 = m1 + D[u + 1][v];
if (v < N - 1) {
d1 = m2 + D[u + 1][v + 1];
}
}
if (v < N - 1) {
d2 = m1 + D[u][v + 1];
if (u > 0) {
d3 = m2 + D[u - 1][v + 1];
}
}
D[u][v] = min(D[u][v], d0, d1, d2, d3);
}
}
}
return D;
}