Welcome

Welcome To:
Image Analyzer
Help
Copyright (C) 2000-2003
Developer: Michael Vinther | admin@meesoft.com Company: MeeSoft | http://www.meesoft.com

Software Development:
FlushedSector: flushedsector@meesoft.com
Programming Homepage: [ http://www.student.dtu.dk/~c973431 ]
JAVA, Delphi, Pascal, C++, filesystems etc.

Solo: solo@logicnet.dk
Technical Reports [ http://www.logicnet.dk/reports/ ]
EEG, PCA, ICA, Artificial Intelligence
Programming Homepage [ http://www.logicnet.dk/lib ]
Delphi and C++ libraries

 Installer Wizard/Help File Creation Support:
Email: installersupport@meesoft.com
KShare [ http://kshare.myispnet.net ]
My ISP Network: [ http://www.myispnet.net ]
Support Forum:
http://www.meesoft.com/support

This software includes a library created by Anders Melander.
Thanks to Markus Oberhumer and Laszlo Molnar for their
brilliant EXE compressor UPX. (See http://upx.sourceforge.net/)

 Please Support Image Analyzer
 You must be ONLINE when using these links

Special Note:
There is currently no complete documentation for ImageAnalyzer,
but, as you can see, with this file, it is a work in progress.
This help file will serve more or less as a short tutorial,
it should answer most questions.
Don't forget to join our NEW Support Forum, URL above:


description

 About Image Analyzer:

Description:

 Advanced image editing, enhancement and analysis software.
The program contains most image enhancement features found
in conventional image editors, plus a number of advanced features
not even available in professional photo suites.

This is one of the first programs that includes the new
JPEG 2000 image compression standard.

 Example applications:

. Easy red-eye removal
. Noise reduction
. Automatic brightness, contrast, gamma and saturation adjustment
. Test of methods for automatic image processing


features

 Features:

Some Image Analyzer features are:

· Reads/writes BMP, ICO, CUR, WMF, EMF, JPEG, PNG, PCX and JPEG 2000 images

· Reads RAS, PNM, PGM, PPM, HIPS and Matlab files

· Scanner and printer support

· Build-in conventional and adaptive filters

· User specified filters in spatial and frequency domain

· Distance, Fourier and discrete cosine transformation

· Color model conversion: RGB, CMY, HSI, Lab, YCbCr and YIQ

· Morpheological operations

· Resize, rotate, crop and warping

· Math expression module for creating and transforming images

· Advanced "pocket" calculator with equation solver

· Image Processing Plugin system for adding more specialized features

· More than 60 new filters (click Load in the User defined filter dialog)

· More than 20 new palettes


history

 Version History:

Note:
Version history is incomplete.
It does not include all changes
in all versions.

Changes in version 1.01 (2001-03-15):
PNG transparency supported

Changes in version 1.02 (2001-03-18):
PNG transparency bug corrected
More keyboard shortcuts
Support for loading multiple files

Changes in version 1.03 (2001-04-23):
Auto window resizing
Statistics map
JPEG filter

Changes in version 1.04 (2001-05-15):
Adaptive noise filter
Auto color correction
More keyboard shortcuts

(Version 1.05 never released)

Changes in version 1.06 (2001-08-16):
Adaptive noise filter improved
JPEG 2000 support

Changes in version 1.07 (2001-09-03):
Improved JPEG 2000 support
Expression evaluator in all edit boxes
Improved color mapper
Improved combine images
Median filter optimized

Changes in version 1.08 (2002-01-16):
Lapp filter now preserve colors
Windows ICO and CUR file support
Frequency domain filter
Selective smooth filter
Rotate grayscale bug fixed

Changes in version 1.09 (2002-07-01):
Auto adjust black/white point
Fixed bug in combine grayscale images
Fixed bug in resize
Improved printing

Changes in version 1.10 (2003-01-01):
Image warping

Changes in version 1.11 (2003-02-13):
JPEG 2000 support improved
Reading of Sun Rasterfiles (*.ras)
Image resizing using spline interpolation for better quality
PNG gamma, transparency, and alpha channel handling improved
Expression evaluator improved
Lab color space support
Morphological operations on color images

Changes in version 1.12 (2003-03-08):
Restoration by deconvolution (see example page)
JPEG desired file size specification
Improved help
Filtering of float maps
Color mapper can now work on luminance plane (Y in YCbCr)

Changes in version 1.13 (2003-03-31):
Open, save and color mapper dialogs improved
The amount of smoothing can be specified in "Smooth image"
Highpass filter in "Edge detection" menu

Changes in version 1.14 (2003-04-17):
Three different methods for automatic color correction
Feature list in help menu
Some bugfixes
Texture synthesis (see example page)
Mouse selection editing
Added an installer wizard version
Added help/tutorial file, in CHM format.

Changes in version 1.15 (2003-05-24):
Improved PCA and reconstruction from components
Paste to selection in insert menu
Lossless PNG compression ratio improved by about 20%
Lossy PNG compression introduced
Writing of large JPEG files (greater than 1 MB) fixed
Test button in file format options for lossy JPEG and PNG
Deconvolution filter can be specified in a Matlab, text or MAP file
Open and save dialogs updated
EMF/WMF reading fixed
Texture synthesis improved

Changes in version 1.17 (2003-06-22):
Image processing plugin system
Texture synthesis by averaging
Copy/paste of floating point maps (can be used as simple undo feature)
Pixel drawing feature

Changes in version 1.17.3 (2003-07-27):
Frequency domain filter improved
Better image resize quality
Paste to selection improved
24 to 8 bit conversion improved
Local histogram equalization quality improved
Option to register image file formats
More advanced sharpening method

Changes in version 1.18 (2003-09-13):
Blind deconvolution
16 bit grayscale PNGs and TIFFs now read to floating point map
Split planes color correction improved
Filtering of floating point map with filter from file
Frequency domain filter improved + bugfix
Expression evaluator improved
More than 60 new filters (click Load in the User defined filter dialog)
More than 20 new palettes

Changes in version 1.19 (2003-12-29):
Problem with large JPEG 2000 images and temporary files fixed
Improved de-interlacing method
MNG image file support
Fixed mouse selection bug
Language module


Image Analyzer

Image Analyzer 3D plugin

3D modeling

The 3D modeling plugin can produce models from either a depth map or a lathe profile, and a texture can be assigned to the model. Below is a few examples/tutorial pictures created with the plugin. Note that you can create these models yourself using only the images available from this page.

Top of Z-stack
 Bottom of Z-stack

Result of combining serial images
 Depth map

The example images presented here were made availabe by Dr. C.H. Weischer of Biomedical Innovation.

IMAGE NOTES:
The red square marks the part of the coin that we are interested in. Six images was acquired at different Z values and combined using the MultiFocus plugin. Note that the original images are 3 megapixels but have been decimated to reduce download time.

Instructions:
Based on the six images of the copper coin [shown above] it is possible to produce a depth map. A depth map is either a grayscale image or a float map. Lathe profiles can be given either as a grayscale image (see BishopProfile.png or LampProfile.png; inside the programs install folder) or an expression.

To use an expression, open the expression evaluator (F11), enter an expression like "sqrt(1-y^2)" (this is a semicircle) and select "Generate from lathe profile" in the plugin menu. Here a texture can be assigned to the model. The semicircle will result in a 3D ball.

To change the appearence of the model, change the rendering method or surface reflection in the menu. The light source can be moved using the right mouse button. Note that the light source is modelled as light comming from very far away (like sunlight on earth) and the distance cannot be changed - only the angle.

Both the rendered model and a distance map (the Z-buffer) can be returned to Image Analyzer for file export.
Using this depth map and the combined image as texture, the following 3D model was constructed:

3D model from lathe profile and texture:
Profile
 Texture
 Result

Another way of creating a 3D model is to enter an expression for the lathe profile in the expression evaluator of Image Analyzer:

The following is the expression for a semicircle:
sqrt(1-y^2)

Combined with a world map, this produces a globe.

www.meesoft.com Last updated 2003-06-14 Michael Vinther


Image Analyzer Batch Processing help

The Image Analyzer batch processing language is an extension of the math language used in the Expression evaluator (Help menu or F11). Below is a list of the extended commands. The command arguments correspond to the parameters you can choose in the Image Analyzer program.

To try the following batch processing programs, copy them from your browser and paste to the Process script window in Image Batch.

Image processing commands:
AdaptiveNoiseReduction(Strength,WindowSize)
AddText(X,Y,Text,Font,Size,#Color)
AutoColorCorrection(Saturation | Luminance | RGB)
AutoBlackWhitePoint
Deinterlace(Odd | Even,Level)
Invert
JPEGFilter
MakeGrayscale
Make8bit
Make24bit
MaxSize(MaxWidth,MaxHeight)
MedianFilter(WindowSize)
Mirror
Resize(Width,Height)
ResizeCanvas(Width,Height,X,Y,#Color)
Rotate(AngleDeg)
Sharpen
Smooth(Range)
Stamp(X,Y,FileName)

Output control commands:
SetJPEGQuality(Quality)
SetJPEGSizeLimit(ByteSize)
SetPNGQuality(Quality)
SetPNGFilter(MinSum | Runs | TryAll | None)
SetPluginOptions(OptionString)

Script flow control:
SkipNextIf(Condition)
goto(@Label)

Image defines:
Width, Height
BPP
FileName
InputFileSize
OutputFileSize

A script can be started from the command line, a .BAT file or a Windows shortcut by executing the batch processing program with the script name as argument, e.g.:
c:\Program Files\MeeSoft\ImageAnalyzer\ProcessingPlugins\ImageBatch script.bsc
 When all images has been processed, the program will close.

Noise reduction and color correction

This program will apply the adaptive noise reduction filter with Image Analyzer's default parameters, and then do color correction:
AdaptiveNoiseReduction(20,3)
AutoColorCorrection(Saturation)

Reducing images to half size

Resize(round(Width/2),round(Height/2))

Generating thumbnails for web page

When presenting a large number of images on a website, it is often desirable to make a thumbnail preview of the images. This command will resize the images so that the size is max. 128 x 128 while preserving the height/width ratio.
MaxSize(128,128)
SetJPEGSizeLimit(8*kb)
Furthermore, the HTML code for presenting the images can be generated: If the Log string format is set to a string like

<A HREF="|f"><IMG SRC="thumbnails/|f" BORDER=0></A>

the program will generate the corresponding code in the log window which you can copy to your HTML editor:

<A HREF="PICT0001.JPG"><IMG SRC="thumbnails/PICT0001.JPG" BORDER=0></A>
<A HREF="PICT0002.JPG"><IMG SRC="thumbnails/PICT0002.JPG" BORDER=0></A>
<A HREF="PICT0003.JPG"><IMG SRC="thumbnails/PICT0003.JPG" BORDER=0></A>
Every occurrence of |f in the format string is replaced by the file name.

Limiting the size of compressed images to a specified number of bits

The following two programs will force the images to be compressed so that only 0.5 bits are used per pixel.

For JPEG output: For JPEG 2000 output:
:MaxBitsPerPixel = 0.5
:Pixels = Width*Height
Pixels
:MaxBits = Pixels*MaxBitsPerPixel
MaxBits
SetJPEGSizeLimit(ceil(MaxBits/8))

:MaxBitsPerPixel = 0.5
SetPluginOptions("rate=" MaxBitsPerPixel/BPP)
These programs can also be used to compare the image quality of JPEG and JPEG 2000. For natural images, 0.5 bits per pixel is sufficient for JPEG 2000, whereas some artefacts are often visible in JPEG images.

Making loops

In the example above the file size was limited by reducing the image quality. Another way of producing smaller files is to reduce the image size. This program uses a loop to repeatedly half the image size until the file size is less than 60 kb.
@Retry
SkipNextIf(OutputFileSize>(60*kb))
  goto(@Done)
Resize(floor(Width/2),floor(Height/2))
goto(@Retry)

@Done

Rotate large images

This (probably quite useless) program will rotate all images with a width of 1000 pixels or above 90° clockwise:
SkipNextIf(Width<1000)
  Rotate(-90)

Adding text

To write text in the center of an image with the system font, use the command:
AddText(Center,Center,"Test!")
This next text example will add yellow text with a black shadow in the upper left corner. The text will be printed in bold Arial size 20:
AddText(11,11,"Test!",Arial Bold,20,#000000)
AddText(10,10,"Test!",Arial Bold,20,#F8AA07)
Numeric values can also be printed in the image. This program will write four lines of text with the image width, height and file size in kb before and after the recompression.
AddText(4,1*16,"File name: " FileName)
AddText(4,2*16,"Width: " Width)
AddText(4,3*16,"Height: " Height)
AddText(4,4*16,"Source file size: " round(InputFileSize/kb) " kb")
AddText(4,5*16,"New file size: " round(OutputFileSize/kb) " kb")

Adding a logo to the images

The Stamp command will place an image from a specified file in the images processed. If the the stamp image is in PNG format, transparency can be used.
Stamp(Center,8,"c:\graphics\logo.png")

meesoft.logicnet.dk Last updated 2003-09-09 Michael Vinther


Image Analyzer

Image Analyzer examples

For Most Help, look in the status bar in the bottom of the program window for hints on what the tools do. Some features are described with examples in this page. It is a work in progress, and answers to questions I receive might be added.

Adaptive noise removal
Auto color correction
Fourier transformation
PNG versus GIF and JPEG
Red eye removal
Restoration by deconvolution
Texture synthesis

Please support Image Analyzer
You Must be ONLINE to use the support link

Auto color correction

Auto color correction adjusts black/white point, gamma and saturation. This will improve the contrast and enhance details in the image. Black/white point and gamma are adjusted in the same way as when you press the Auto button in Color mapper. The adjustment is based on an analysis of the image. By making a selection before clicking Auto color correction you can tell the program to only analyze that part of the image. You would probably want to do that when correcting a picture with e.g. a black background.

Original
Corrected

Red eye removal

Make a selection around the red part and click Red eye removal (Alt-E). The selection does not have to be very accurate, but making it too large might result in loss of color around the eye.

Restoration by deconvolution

This feature will allow advanced reconstruction of blurred images. Both motion blur, out-of-focus blur and other errors are handled. In the example below, the camera was moved what correspond to about 17 pixels while the picture was taken. This distance can be estimated by looking at the details in the background: A tree is approximately 17 pixels wide. Note that the bird is moving, and therefore cannot be reconstructed using the same model as the background.
If the motion is neither horizontal nor vertical, the picture must be rotated before deconvolution. This might, however, reduce the quality of the reconstruction somewhat.

Clip from original photograph from Ching-Kuang Shene

Restoration after 8 CGLS iterations.

For out-of-focus blur, the Circular blur model will probably give the best results. The default setting will sharpen an image which is slightly unsharp. To find out which radius gives the best result use the Test button. This will produce a number of reconstructions with different filter radius. Enter an iteration count (~12), click Test, enter the lower and upper bound for the radius and the number of reconstructions to generate. If the result is too grainy then reduce the number of iterations.

Original
Corrected, circular blur
12 iterations, radius=3.6

If the convolution filter matrix is known it can be given when selecting Matrix filter or Matrix file:

F is a matrix and F(r,c,d) is the expression for the element (r,c) where (0,0) is the center. d is the distance from the center, d=||r-c||. This makes it easier making circular symmetric filters.

If you are wondering what interp() is you can just use the Expression evaluator (in help menu or F11) to plot it using the command "plot(interp(x),x)". Note that you should open the deconvolution window first to get the function defined. It just a very simple function used for interpolation when constructing the circular convolution filter.

Matrix files should be in either MAP, Matlab MAT or text format.
An example of a filter file can be found here:

5star.txt
You Must be ONLINE to use this link

When used for deconvolution, this matrix will result in sharpening
of the image.

Very short mathematical description of the algorithm
You Must be ONLINE to use this link

Adaptive noise removal

Adaptive noise removal (Alt-A) can remove high-frequency noise from most images. Unlike the smoothing algorithm for noise reduction found in many image processing programs, Adaptive noise removal works without unsharpening edges in the image.
Not only will noise reduction improve the visual impression of an image, it will also make JPEG compression more effective producing smaller files with the same quality selection.
The example is the result of applying the filter to the deconvolution image above using the default options.

Texture synthesis

Texture synthesis (Special menu) is a tool for generating textures from a sample or filling holes in an image.
Texture generation is performed by creating a blank image (File | New) and opening one or more sample images and selecting them in the Texture sources box. Destination mask tells the program what part of the image is known. In texture generation we say that only the center pixel is known and all other pixels should be synthesized. Method should be Source match and the Texel size the approximate size of the pattern features. In the example below a large brick is about 45 pixels wide. If the random error is set larger than 0, some more computation time is required but the program might be better at synthesizing high-frequency elements.

Sample | Sample
Synthesized texture | Synthesized texture

If part of an image is covered (e.g. by text) or contains an unwanted object, texture synthesis can sometimes be used for restoration. The traditional way of solving such a problem is by cloning and retouching by hand, but texture synthesis can do it automatically. In the example the bird from above was removed by synthesis using a texture sample taken from the image itself. A selection around the bird was made, Destination mask set to Selection and Target to Inside. The Source match method and Texel size equal to 9 was used.

Texture sample | Fixed image

The other two methods are also for hole filling. Instead of sample textures they only use the border of the hole for the synthesis. These methods are much faster but will only produce good results if the texture is very simple. If you want to define the target area more precise than it is possible with a rectangular selection you can make a grayscale image the same size as the synthesis image and mark the target area with white. This mask image will then appear in the Destination mask list.
A note about computation time: Texture synthesis can be very time consuming. To speed up the process use textures as small as possible (maybe 64 x 64 pixels) and select a small texel size. Using grayscale images and textures is the fastest and will reduce the time of experiments. Also turn the progress display off while synthesizing large textures.

Fourier transformation

I have been asked about saving the result of the Fourier transform and editing it in another program. It is simply not possible to save the result of a Fourier transform to a standard image file. A Fourier transform produces complex numbers whereas e.g. BMP files can only contain ordinary integer numbers in the range [0; 255]. If you want to edit the Fourier image and be able to do an inverse transform, you have to either use the editing function in Image Analyzer or edit the MAP file you get when saving the Fourier transform. In Image Analyzer you can use the eraser tool or make a selection and hit Ctrl-Delete to remove frequency components, or you can use the Frequency domain filter option in the Filters menu.

PNG versus GIF and JPEG

Why is there no GIF under File format options so that I can make transparent GIFs etc.?
Most people only use GIF because of ignorance. There is really no reason to use the old GIF format anymore. Use PNG instead! All modern browsers and graphics programs support PNG, it has better compression (produces smaller files) and it supports more color formats (e.g. 24 bit). The 256 x 256 grayscale image in the top of this page takes up 63 kb as GIF and only 41 kb as PNG. This means 30% disk space saved and 30% less download time.

If using the lossy version of PNG the size reduction is even greater. With a quality setting of -7 the PNG file size is 21 kb - only one third of the GIF file and without significant visual quality loss. Lossy JPEG can produce even smaller files, and is in most cases better for photographic images. But JPEG does not support transparency, and is not very good at compressing images with sharp edges like diagrams and screenshots.
Note that the lossy PNG compression is not as effective with 256 color palette images as with grayscale and 24 bit images.

www.meesoft.com Last updated 2003-05-18 Michael Vinther


Polishing Camcorder Stills with ImageAnalyzer

Polishing Digital Stills from a Camcorder
by Jonathan Byron

Most new camcorders can take still pictures and store them on tape or a removable card. The idea of a multi-function camera is attractive, but the convienence comes at a price: camcorder images are usually not as clear as images from a digital camera designed to take stills. This brief article shows how to polish camcorder stills in 3 easy steps, using the Image Analyzer program.

Understanding the Problem:
Part of the problem with camcorder stills can be blamed on the ancient television standards that have survived to this day. In the early days of television, the electronics to control picture tubes was primitive. To deal with slow electron guns in picture tubes, the NTSC and PAL systems painted every other line (a half frame) and then came back to paint the other half. Because the picture tube phosphors continue to glow for a fraction of a second after they are hit by the electron gun, this presents a pretty good illusion of motion. But freeze a video frame, and you will see interlace noise that detracts from the picture.

To get the best pictures from a camcorder, use the highest resolution setting that is available. The pictures will take up more space, but large memory cards are innexpensive. My 256 MB card costs well under $100, and can store over 400 stills (1.6 Megapixel, fine resolution). Use progressive mode for stills if your camcorder has this feature.

3 Easy Steps In ImageAnalyzer
Below is a corner of a raw image taken from my camcorder: You can see visible artifacts of the interlacing - the horizontal line noise is quite apparent. But this can be minimized with a de-interlace filter like the one in ImageAnalyzer.

Raw Image | Deinterlaced Image
 | deinterlaced

You can see that the line pattern is greatly reduced, especially on the mountain ridges and on the fence. So far, so good.

But the image is still less than it could be. There is a fair amount of speckle noise, and the colors seem somewhat dull and lifeless (maybe that was the camera, or maybe that was the photographer). Again, a click or two in ImageAnalyzer can fix that. The adaptive noise filter can remove speckle noise, and the auto color correction operation will turn up the color on images that seem bland or washed out.

The adaptive noise filter can be thought of as a smart smoothing filter - it only averages out a pixel if that pixel is very different from its neighbors. Choosing a smaller neighborhood usually will usually cause more smoothing, while a larger neighborhood (5x5 or 7x7) will preserve more texture. As a rule, I prefer the 5x5, but the best choice will vary from image to image.

The auto color correction is a very simple operation (from the user's standpoint) - there are no options to consider. Just click on the button and see if it improves your image. It usually makes the colors more vibrant, but if you don't like the effect, just undo (ctrl-z).

Adaptive Noise Removal | Auto Color Correct

The mountain is smoother, the grass is greener. The picture is better.

These simple steps also reduced the size of the file by about 20% - the noise that was eliminated can be thought of as useless information that is not needed or wanted. So get rid of it, and improve your images!

Below is a final side by side comparison.

Before - The Original Image | After Applying 3 Filters in ImageAnalyzer