ISOClean High ISO Image Noise Reduction


Contents

Description

Dependencies and requirements

Installing and Running

Screen shots and examples

Algorithm

Speed

Download

Operational Issues

Description

ISOClean is a small program for reducing noise in high ISO digital camera images and scanned negative and slide images.  IsoClean uses a relatively simple spatial domain algorithm to reduce noise.  In most cases, the most noticeable high ISO and scanner noise tends to be of high spatial frequency and relatively low amplitude.  ISOClean works by attenuating the low amplitude high frequency portion of the image signal space (the algorighm is described in more detail below).

Dependencies and Requirements

ISOClean is written in Java to the Java2 API.  It is not an "applet", i.e., it does not run in a web browser;  it is a standalone application and must be run autonomously on your computer.  To run ISOClean, you will need a recent-model Java Runtime Environment (JRE) which can be downloaded from Sun using the links below.  ISOClean was developed using JRE version 1.3.1 which is the current stable production JRE from Sun.  If you have an older version of the JRE installed, I recommend upgrading to 1.3.1 for the best compatability and performance.  The Java plug-in that comes with your web browser cannot be used for running ISOClean; you will need to install the full JRE.
Because ISOClean is written in Java, it is essentially platform independent.  I have been developing it under Linux, but I have tested it using the Windows JRE and it seems to work fine.  For Mac users, because ISOClean requires Java 2, you will need to have OS X in order to use it -- unfortunately Apple has not ported Java2 to older versions of MacOS.  On the positive side, OS X already comes with an up-to-date Java2 runtime environment, so you will not need to download one.  I do not have access to a Mac with OS X, so I have not tested it there; any feedback on how it works would be welcome.
Here are some links from which can be downloaded the current production JRE from Sun for Linux and Windows.  As mentioned previously, the current version of OS X already includes an up-to-date JRE.
JRE 1.3.1 for Linux
JRE 1.3.1 for Windows

Installing and Running

Since this program is still in the early stages of development, there are not yet any automated install routines.  It is, however, not very difficult to set up manually, although it requires some familiarity with the command prompt for Windows or Linux and the ability to use a text editor like NOTEPAD or vi to create a launch file (I'm not sure how it would work on a Mac where there is no command prompt).

The first step is do download the ISOClean JAR file (see Download section further down page) and the Sun JRE 1.3.1 (see above).  Install the JRE according to the instructions provided with the JRE  (if you are using Linux or UNIX, make sure you modify your shell startup script so that the appropriate JRE binary directories are in your path).

The next steps are somewhat platform dependent:

Linux/UNIX:

  1. Place the JAR file in a directory of your choice

  2.  
  3. Go to a directory that is in your PATH (/usr/local/bin or ~/bin work fine) and create an executable shell script called isoclean that has the following line in it:

  4. java -jar -Xmx128m <path to jar file>/isoclean_XXXXXXXX.jar
     
  5. Run ISOClean by typing isoclean at a command prompt.  If you use a GUI desktop environment like GNOME or KDE, you may wish to add a launcher to your desktop or taskbar.

Windows

  1. Place the JAR file in a directory of your choice

  2.  
  3. Go to a directory that is in the Windows system PATH (for example c:\windows or c:\windows\command on a Windows98 system) and use NOTEPAD or some other text editor to create a bat file called isoclean.bat that has the following line in it:

  4. java -jar -Xmx128m <path to jar file>\isoclean_XXXXXXXX.jar
     
  5. Run ISOClean by typing isoclean in an MSDOS command prompt window, or if you wish, create a shortcut to isoclean.bat on your desktop.

Mac OS X

    I don't have access to a Mac with OS X, nor am I very familiar with them.  The process may be as simple as just clicking on the isoclean_XXXXXXXX.jar file.  If someone provides me with the appropriate instructions, I will post them here.

Screenshots and Examples

ISOClean main window

Algorithm

Since noise in images is a random process, it is not possible to determine exactly how much of a given pixel's value is noise and how much is signal.  In the spatial domain, the digital image consists of samples at a set of X and Y coordinates.  In the frequency domain, the image consists of components at various frequencies and amplitudes (spatial frequencies, not time frequencies as in audio).  Since noise is a random process, it has no particular set of predetermined frequencies and amplitudes.  It does, however have statistical characteristics which can help us determine at which frequencies and amplitudes the bulk of the noise is likely to be.  The best that can then be done is to use the overall spectral and amplitude characteristics of the noise and attenuate that portion of the image's frequency and amplitude space that most closely matches that of the noise.  As a result, any noise removal process on an existing image will be lossy to the degree that it is not possible to distinguish the noise from a real signal that "looks" like the noise, i.e., a signal that happens to have a spectral and amplitude characteristic similar to that of the noise.  Even though the algorithm in IsoClean attenuates some frequencies more than others, it operates directly on the pixel data without computing any complex transforms such as the FFT, and as such is a spatial domain algorithm.   As such, it is likely to be a little bit more lossy than a frequency domain algorighm which can more accurately isolate and process individual frequency bands and amplitude ranges, but the tradeoff is that it is much faster.  (Keep in mind that even a frequency domain algorithm will be lossy, just perhaps a little bit less so.)  For lightly and moderately noisy images, like the kind that result from using higher ISO settings on digital cameras,  the amount of detail loss is minimal and the results are very usable.  For extremely noisy or grainy images, a more advanced approach may be warranted, although it may take a half hour or more to process a single image.
IsoClean uses a relatively simple algorithm to remove high-iso noise from images.   The most noticable noise components in images are those that are high in frequency (with a period of 2-5 pixels or so).  To reduce the effects of the noise, the program basically attenuates high frequency components that are low in amplitude.  High frequency components that are large in amplitude are only slightly affected, so sharp edges in the image generally remain sharp and un-blurred.  The program also adapts to image content, attenuating less in areas where the image appears to contain a lot of detail and attenuating more in areas where the image appears flat.  In addition, less attenuation may be applied in the highlight areas since noise is generally not as pronounced there.
The program works by first flattening the image by applying a standard or recursive median filter.  The flattened image is then subtracted from the original image.  What remains are all of the high frequency components of the image, including the noise.  The high frequency components are then clipped to a maximum amplitude which depends on the user settings -- by default, this is around 1.7 times the standard deviation of the noise in flat areas and 0.6 times the standard deviation of the noise in detail areas.  The clipped high frequency components are then subtracted from the original image to yield the noise reduced image.  By first clipping the high frequency components, only the low amplitude high frequency information is subtracted from the image, which tends to leave sharp edges relatively intact.

Speed

Speed is one of the main issues with noise reduction.  Once you go beyond simple filtering like blurring and median filtering and begin adding more intelligence, the process begins to slow down.  IsoClean uses a relatively simple spatial domain algorighm, which means the program does not have to compute FFTs or other complex transforms.  This helps quite a bit, but there is still a fair amount of analysis and computation that must be done.  The speed will depend primarily on the flattening radius, the processor speed, whether all of the image buffers can be held in physical RAM, and perhaps to some degree on the version of the Java Runtime Environment (JRE).  For reasonable performance with 4-5Mp images, a 500MHz PIII with 128Mb of RAM would be about the smallest machine one would want to use;  this type of system should result in processing times of around four minutes, even with the radius set to 3.  The following table shows the processing time on two representative machines for a 5Mp image:
500MHz PIII Laptop w/192Mb RAM, Sun Linux JRE 1.3.1 866MHz PIII Desktop w/256Mb RAM, Sun Linux JRE 1.3.1
2 Pixel Radius 2 min., 10 sec. 1 min., 20 sec.
3 Pixel Radius 4 min., 10 sec. 2 min., 10 sec.

Download

IsoClean is still in an early stage of development.  As such, there are no automated installation procedures and no desktop Icons or menu entries will be automatically created, even under operating systems like Windows or MacOS where these things are normally expected.  At this time, the app consists of a JAR file (Java ARchive) which can be directly run by the Java Runtime Environment (JRE) which must already exist on your system (see above links).  Download the JAR file below and set it up according to the "Installing and Running" instructions above.

The JAR file below does not yet contain the source code.  My intent is for this to be an open source program and I will release the source code as soon as I get the code cleaned up a bit and get all of the appropriate open source license verbage included.

NOTE: With many browsers, you may need to shift-click on the link below, since they may attempt to execute the JAR file directly or interpret it as an ASCII file.

IsoClean Build 20011230

Operational Issues

Java Virtual Machine (JVM) Memory

The most important operational issue is memory.  If your images are large (> 2Mp), a lot of memory will be required to process them.  At a minimum, for fast operation, two image buffers would be required - one to hold the input image and one to hold the output image.  Because the flattening step can be recursive, another buffer is required if the input image is to remain unchanged, resulting in three image buffers.  In addition, the image data is stored with the R, G, and B bytes packed into integers (32-bit), so that each pixel actually requires 4 bytes of memory.  As a result, the amount of image buffer memory required will be:  M = 3 x 4 x [no. of image pixels].  In addition to this, the Java virtual machine (JVM) requires some additional memory to operate.  As a result, the bare minimum amount of memory that should be allocated to the JVM should be in the range of:

M = 25Mb + 12 x [no. of pixels] + 25Mb

So, for example, if you have a 5Mp image, you would have to make sure that the JVM is allocated 12 x 5 + 25 = 85Mb.  Clearly, the process will be more efficient if all of this memory is physical memory, so to process 5Mp images, it would be desirable to have a machine with at least 92Mb of RAM.

One problem with this is that by default, most JVMs will only allocate a maximum of 64Mb when they start up.  This can be changed, however, by passing a parameter to the JVM when it start up.  For Sun JVMs, the parameter is "-XmxNNNm" where NNN is the maximum amount of memory in Mb.  For example to run IsoClean with a 92Mb memory limit, the java command would look like: "java -Xmx92m -jar isoclean.jar".  How this command is run is platform dependent.  On UNIX or Linux, it is stored in a script in your path, or it is run directly from the command line depending on your preference.  On Windows, the command is stored in a .BAT file, or it can also be run from a command prompt (MSDOS prompt).

To Do List

Bugs, etc.

If you find bugs or have other comments or suggestions for improvement, please send them to me at d_rosky@nccn.net.