|
How I Did My Image Processing
Simple steps that will allow
you to do it yourself - part 4
BACK
Suppose that I have a fairly
clear image, but I am not happy with the poor level of detail in it. There
are some things that can be done to enhance details, but care must be taken-
every gain comes at a cost.
|
Let's start with a picture
that has some subtle forms but the details are lacking. We can
barely make out something, or maybe we can see it fairly well, but
somebody else just doesn't see it at all. What can be done?
We can start by making a
copy of this image. It will be our work image. Think about the
picture and the data that is in it.
We know that there is image data that we can see, and lots more that we
cannot. That is because our eyes work best in a narrow range of
contrasts and brightnesses.
So, let's imagine an image that has only the changes from light to
dark that represent these details, minus the bright spots and shadows that
are present in any real-world image. Can we get that data out so we
can see it directly? |
|
 |
|
Actually, that is a very
simple process. Picture the creation of a perfect "anti-shadow"
that would erase the light and dark information and leave only the change
data- whether something was getting lighter or darker, not whether it is
light or dark in this picture.
Since this hypothetical perfect
shadow would have no fine details in it, let's see if we can create it from the
original image. We take our copied work image and we blur it a bit like
this.
You will notice that, oddly,
blurring the picture actually makes some features seem to blend together and
become a bit easier to see.
Technically, we are dealing with
something called "spatial frequency". If we blur an image we are
destroying the high spatial frequency data, and leaving the "blurry"
low frequency spatial data. This is exactly what we want.
|
|
 |
| Now that we have
this blurry picture, we want to subtract it from the good image. The
simplest method is to invert the image, like a photographic negative.
This is so far not very
different from the previous "edge enhancement" method I took you
through. But there are major differences- this method will not
cause an effect called "ringing", where small details could
appear to duplicate or echo through the image.
In fact, this method is
simpler and cleaner and can usually be used anywhere the first method
can. It can also be done many times, with various levels of
blurring, to extract the features in various spatial frequency bands.
If this is a bit technical
sounding, don't worry. The method works whether you understand it or
not. |
|
 |
| The next step is
to add this negative shadow (that anti-shadow I mentioned) to the original
picture. We will arrive at a strange looking result that has only
the details of the image, not the actual illumination data.
This image can then be
contrast-enhanced to show fine features that we could not see
originally. Our eyes just are not adapted to find such features
across the range of light and dark that we can perceive all at once.
Here is the high-frequency
difference map that will come out of this process.
One thing you will notice is
that there appears to be a lot of JPEG noise in this image. Well,
that is the consequence of the image compression method that NASA is
using. We will have to sacrifice a little detail to get rid of it,
by doing a deliberate low-level blur to the image.
Don't worry, the end results
will still be very good. |
|
 |
MORE
BACK
|