Skip to content

Daily Archives: Thursday September 29th, 2011

  • Blurring and Unsharp Masking in Java

    This java code loads an image and blurs it using a very simple boxcar (rectangular) blurring method. Then it sharpens the image using unsharp mask technique. for more information on unsharp masking see Wikipedia article.

    Parameters you can play with:

    (left, top), (right, bottom) defines a selection of original image
    usmAmount and usmThreshold defines the unsharp mask parameters
    (boxWidth, boxHeight) defines the small box for boxcar filter kernel

    Please note: This code is written in the C-like procedural manner using java static methods. Apart from loading and saving images using java Image API functions all the processing is done within the code. Therefore the code can be converted any programming language very easily.

    Continue reading