【发布时间】:2023-04-09 18:22:01
【问题描述】:
我正在使用 java 进行数字图像处理,最近我正在用 java 实现一篇论文,这篇论文的一部分是这样的:
我从中了解到的是,G(i,j) 将是应用 soble operator 后在位置 (i, j) 处的图像强度,是这个意思还是别的意思,
我已经使用下面的代码来计算 wG,
public void weightedGCalc() {
BufferedImage sobelIm = this.getSobelImage();
int width = sobelIm.getWidth();
int height = sobelIm.getHeight();
weightedG = new double[width][height];
for (int row = 0; row < width; row++) {
for (int col = 0; col < height; col++) {
int imgPix = new Color(sobelIm.getRGB(row, col)).getRed();
float val = -(float) (Math.pow(imgPix, 2) / (2 * Math.pow(SIGMA_G[5], 2)));
weightedG[row][col] = (float) Math.exp(val);
}
}
}
这里 this.getSobelImage(); 会给我一个给定图像的 sobel Image。我正在处理 灰度级 图像,因此我只考虑一个平面 (RED)。这里 SIGMA_G[5] 包含 Author 建议的 sigmaG 的值。
【问题讨论】:
-
这个问题基本上需要编程部分的帮助,所以这不是题外话,选民或希望结束这个问题的人,请提及您的 cmets...
-
+1 为您的公告。 :)
-
反对的选民或希望结束此问题的人,请提及您的 cmets
标签: java image image-processing gradient