Mayank Tiwari
Mayank Tiwari

Reputation: 3020

What does image gradient mean in the following paper?

I am working in digital image processing using java, recently I am implementing a paper in java, One portion of this paper is this: enter image description here

What I have understood from that is, G(i,j) would be intensity of image at location (i, j) after applying soble operator on it, does it mean so or anything else,

I have used the following code to compute 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);
        }
    }
}

Here this.getSobelImage(); will give me sobel Image of a given image. I am working with gray level images hence i am considering only one plane (RED). Here SIGMA_G[5] contains value of sigmaG as suggested by Author.

Upvotes: 0

Views: 802

Answers (2)

Preeti Mishra
Preeti Mishra

Reputation: 11

Here gradient means the results obtained by the Sobel operator. Means the final outcome of the Sobel operators processing on the given image.

So after applying the Sobel function on a floating point image. The resultant image will be the gradient image.

Upvotes: 0

Papouh
Papouh

Reputation: 514

Your implementation is correct. By gradient, I think the author actually means the gradient magnitude of the image. Convolution with sobel operators is one way of calculating the gradient of an image.

enter image description here

and

enter image description here

(Gx,Gy), an image of vectors is the gradient of the image.

enter image description here

This G is the gradient magnitude of the image and is what you get from this.getSobelImage(), which is what you want.

Upvotes: 2

Related Questions