Helpful Posts Helpful Posts:  0
Results 1 to 6 of 6

Thread: Question about "Guide to Image Sharpening"

  1. #1

    Question about "Guide to Image Sharpening"

    I need to know how to apply the "sharpening mask" explained in this article: Guide to Image Sharpening

    I understand the idea of decrease the noise with this technique because the usual way to sharp an image introduce a lot of noise, i.e. in matlab I filtered it with the "unsharp mask". But I dont know how to do it, maybe calculating the diference of the original and the sharpened w/ noise, aplying a threshold to this layer and then adding it again??
    Last edited by McQ; 15th April 2011 at 09:35 PM.

  2. #2

    Join Date
    Dec 2008
    Location
    New Zealand
    Posts
    17,660
    Real Name
    Have a guess :)

    Re: Question about "Guide to Image Sharpening"

    Lots of ways to do this, but the simplist is probably just to create a selection around the area(s) you want to sharpen, before you apply the USM (assuming Photoshop).

    Another way is to apply the usm - revert back to the previous unsharpened state, and then use the history brush to "roll forward" the bits you want sharpened.

  3. #3

    Join Date
    Nov 2009
    Location
    Provence, France
    Posts
    990
    Real Name
    Remco

    Re: Question about "Guide to Image Sharpening"

    I think the sharpening mask OP was referring to is the one using a mask showing the edges.

    One way of doing this might be:
    - copy the original layer
    - sharpen this copy
    - create a mask from the original layer using edge-detection, use this as a layer mask on the sharpened copy, in such a way that the edges are opaque.

    By varying the edge-detection and layer transparency you have a lot of ways to influence the final result.

    The method Colin refers to is what I would use to sharpen selectively a region of the image (but again using a sharpened layer with a layer mask)

    Remco

  4. #4

    Re: Question about "Guide to Image Sharpening"

    Yes revi, that's the idea, but I cant do it with photoshop, I have to do it manually, operating with matrices, so I think that the best way is substracting the original to the sharpened image, so I get the "edge detection layer" and we can limit it with an threshold (i.e. if pixel=1-255, threshold=10), below the threshold all the pixels are zero and then we add our "fixed layer" to the original image again.

    My problem was how to construct the "edge detection layer" or "sharpening mask" seen in the article:

    Question about "Guide to Image Sharpening"

  5. #5

    Join Date
    Nov 2009
    Location
    Provence, France
    Posts
    990
    Real Name
    Remco

    Re: Question about "Guide to Image Sharpening"

    Quote Originally Posted by esehacker View Post
    Yes revi, that's the idea, but I cant do it with photoshop, I have to do it manually, operating with matrices, so I think that the best way is substracting the original to the sharpened image, so I get the "edge detection layer" and we can limit it with an threshold (i.e. if pixel=1-255, threshold=10), below the threshold all the pixels are zero and then we add our "fixed layer" to the original image again.

    My problem was how to construct the "edge detection layer" or "sharpening mask" seen in the article:
    Ah yes, you mentioned matlab...
    can you do a Gaussian blur there easily? The GIMP has 'difference of gaussians' as an edge detect algorithm: create two copies of the base image, blur each (with different radii, e.g. 7 and 3) and take the difference. You'll probably have to adjust contrast in result. The line width and 'clarity' depends on the tonal difference on the edge. Using two blurred copies should also eliminate noise problems as the blurring will hide noise.

    Otherwise, there are other methods for edge detection using matrix operations (have a look in Wikipedia, for 'edge detection' and 'sobel operator' for instance).

    You'll still need your original image and a sharpened version (unsharp mask or other) in addition to your edge layer. To combine the three, you use a linear combination of original and sharpened image, using the edge image as a mask (i.e. mask pixel is black => use original pixel; mask white => sharpened, mask gray => linear combination of original and sharpened).

    One disadvantage I see with the method you describe has to do with the edge you get from an USM-sharpened image, it's a kind of Lorenzt signal, with one positive and one negative wing, with a very steep gradient near the zero crossing (hard to describe otherwise).

    I hope this helps,

    Remco

    NB: using 'difference of Gaussians' for edge detection, means you are dealing with three to six times your original image data (original, blurred1, blurred2, edge mask, sharpened, final) depending on what you want to do as extra intermediate treatments. As you didn't tell us why you have to use Matlab, hard to get an idea where to optimise and where not (in some application artifacts aren't a problem, for creating beatiful photos, they are...)

  6. #6

    Re: Question about "Guide to Image Sharpening"

    I am the same user as esehacker, I had to enter with other account...

    "Difference of gaussians" works very well, thanks.

    My method had the issue you explain, but I solve it powering the layer insted limiting with a threshold.
    Basically the idea is: if pixel=0-255 and my layer has a value of 10 and other of 100, powering both is equal to 100 and 10000 respectively, so normalizing values again to (0-255), we have 0 and 39, so the lower values are more decimated than the higher values.

    Both methods work well anyway.

    And the lineal combination of 3 layers seems to be complicated, but it's a good idea.

    I also have to make a deblocking filter and I think its the correct way to do it, with an adaptive filter. I have to use matlab as I'm doing a project in my University...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •