Enhancing Scanned Images
Brief description:
This section demonstrates ways of enhancing scanned monochrome images
- deskewing, filtering, and eliminating distortions using calibration
and four-point correction. Also, we give you some recommendations about
restoring poor quality images.
Deskewing
When paper is fed through a scanner the direction
of the paper often deviates from the orthogonal, therefore the resulting
scanned image is skewed, sometimes rather considerably.
The special command - Deskew is used to deskew an image.
The command works in two modes:
- Auto Deskewing - program automatically estimates the
skew value, and then performs deskewing.
Choose Deskew from the Image menu, and then
-Auto.
- Manual Deskewing - you can use this mode, if the result
of Auto Deskewing is not satisfactory. In this mode you can specify
a skew angle by specifying a line, which must be horizontal or vertical.
Choose Deskew from the Image menu, and then
-Manual.
Press the Measure Angle button in the displayed Deskew
dialog, and then specify the deskew line with two points. You can use
snap tools during this operation.
|
|
|
|
Deskew line (manual deskewing)
|
After deskewing
|
Filtering Monochrome Images
There are a number of different filters available within
WiseImage, which allow you to considerably enhance the scanned monochrome
raster image. You can apply filters to the whole image or to a fragment.
You can also apply filters to several raster images simultaneously.
Using the filters, you can:
- Remove raster speckles
- Remove holes (white points in black raster lines or filling)
- Invert images
- Smooth raster objects
- Thin and thicken raster objects
- Transform filled raster area to one-pixel contour
All commands for filtering monochrome images are located
in the Filters menu.
Speckle Remover
Choose Speckle Remover from the Filters
menu.
You can specify the size of raster speckle on the screen
using the measure buttons of the Speckle Remover dialog.
If the Auto Estimating checkbox is on, the program automatically
estimates the speckle size. You can apply the filter several times.
|
|
|
|
Before
applying Speckle Remover
|
The result
of applying Speckle Remover
|
When applying the filter to the image of very poor quality
some data may be lost. To avoid it, you can use the operation of Separation
by size.
See section Separating Monochrome Images by Size for detailed
information.
Hole Remover
Choose Hole Remover from the Filters
menu.
You can specify the size of raster speckle to remove
on the screen using the measure buttons of the Hole Remover
dialog box. If the Auto Estimating checkbox is on, the program
automatically estimates the speckle size.
|
|
|
|
|
The result of applying Hole
Remover
|
Inversion
Choose Inversion from the Filters
menu.
This filter reverses the color of the monochrome image:
After applying this filter the background dots become the image dots and
vice versa.
|
|
|
|
|
The result of applying Hole
Remover
|
Smoothing
Choose Smoothing from the Filters
menu.
This filter smoothes raster object outlines, fills edge
and inner background droplets, and partially removes raster speckles.
|
|
|
|
|
The result of applying Smoothing
|
The Smoothing filter is tuned by setting optimal values
of Medianning and Threshold. You can estimate the result before applying
the filter in the preview window.
Thinning and Thickening filters
Choose Thinning (Thickening) from the Filters
menu.
Thinning filter makes raster objects thinner
in the specified directions; by one pixel for one pass. You can specify
a number of passes.
|
|
|
|
|
The result of applying Thinning
|
If needed, you can apply the mode of thinning raster
objects up to skeleton - i.e. only pixels in the middle are left.
Thickening filter makes raster objects
thicker in the specified directions. You can specify a number of passes
and choose any combination of thickening directions.
Contour (4-coupling and 8- coupling)
Choose Contour from the Filters
menu.
Contour filters convert filled raster areas to one-pixel
contours.
|
|
|
|
|
The result of applying Contour
|
Separating Monochrome Images by Size
This operation is effective in the following cases:
- If you want to prevent
important small objects from being removed while applying the Speckle
Remover filter (e.g., dots in dashed-dotted lines; lines which consists
of multiple small fragments, delimiters, etc).
- If you work with an image of very poor quality.
The principle of the separation by size operation is
similar to speckle removing, except speckles are not removed but transferred
to a new raster layer; and then the user can select fragments incorrectly
transferred to this “speckle” layer and bring them back to the drawing.
|
|
|
|
|
The result of separating to basic
and “speckle” layers
|
|
|
|
The significant elements have been brought
back from the “speckle” layer to the basic layer; the “speckle”
layer is removed
|
Calibration for eliminating linear and non-linear distortions
using
Calibration - is applied to eliminate arbitrary
(both linear and non-linear) distortions of monochrome, grey-scale and
color raster images.
IMPORTANT: You should calibrate the raster image before vectorization
(tracing), because if you vectorize a distorted image you will obtain
distorted vector data that is impossible to correct later.
Calibration terms
The original image must contain points with known coordinates. These
points are called real points. You can use nodes of a rectangular
grid as real points (if you work with mapping materials) and/or other
points, which coordinates are known or can be calculated.
The points, which correspond to the real ones on the distorted image,
are often located with some displacement (i.e. they have different coordinates).
These points are called measured point, as their coordinates
value can be measured on the raster image.
By applying calibration, the raster image is transformed so that the measured
points coincide with, or are extremely close to the real points.
TIPS:
before applying calibration you should set the User Coordinate System
by specifying its origin and scale.
See section Document Coordinat System for
detailed information.
How to calibrate an image:
Choose Calibration from the Image
menu.
Step 1. Defining real points
We can define rectangular grid nodes and points with known (estimated)
coordinates.
Defining grid:
Grid is defined by the three parameters: start point (coordinates of lower-left
node), cell size (by X and Y axis), and grid size (by X and Y axis).
- Press Define Grid
on
the Calibration toolbar. In the Calibration
Grid dialog.
- Specify the coordinates of the lower-left grid node in Origin.
You can enter the coordinate values of the lower-left grid corner
in the corresponding field or specify it with the cursor on screen.
- Enter the number of grid cells along X and Y axis in Size
field.
- Enter the cell size along X and Y axis in Cell
field.
- If the grid is rotated about the coordinate axis, enter the skew angle
relative to X-axis in Angle field.
TIPS:
Use the Preview button to make sure that the grid is properly
specified.
Specifying points with known coordinates:
- Press Add point
button from the Calibration dialog.
Enter the point's known coordinates in Real field (use separating character
between X and Y values).
You can enter a name for the point in Label field; alternatively
the program numbers the points consecutively.
- Do the same for all points.
Step 2. Specifying measured points
To begin step 2 you can press Next Point .
WiseImage places the first point from the list in the screen center and
highlights it with grips.
|
|
|
|
|
Drag grips to the grid node on
the scanned image - so you specify the “measured” point.
|
To shift to the next (previous) point, use Next
(Previous) point.
You can also use the acceleration keys: N (Next) or Tab - to shift
to the next point and P (Previous) - to the previous.
Step 3. Choosing calibration method
Choose the optimal method from the pull-down list of
Calibration Method field.
|
What method to choose?
- If you are sure of the proper method, choose it from the list.
Estimate the accuracy of this method by pressing Estimate
button.
- If you are not sure of the proper method, select Choose
automatically from the combo-box of the calibration method
|
 |
Step 4. Running Calibration
- IMPORTANT:
If you have several raster images in your document, select one(s) that
need calibrating using the specified set of calibration pairs.
See section Raster Image Selection for detailed information.
- Run calibration by pressing the Apply button.
Four-Point Correction
You can use this operation for quick correction of scanned
technical drawings, which contain a frame. This operation assumes that
both frame and contents of the image have the same distortion.
How to correct an image by 4 points:
- IMPORTANT:
If you have several raster images in your document, select the one to
calibrate by four points.
See section Raster Image Selection for detailed information.
- Choose 4 point correction from the Image
menu.
- Enter the frame size in the Width and Height
fields of the 4 point correction dialog.
You can also choose a standard frame size from the list of Frame
Size or find the closest by pressing Find Closest paper.
The list of standard formats is set in the Properties
dialog. See information in section Customizing Program Parameters.
- Press Find Frame
-
the program finds and highlights the image frame.
If the frame is defined correctly:
Alternatively:
- Press Measure frame
button,
and then specify four points of the frame on the screen.
- Press OK.
Autocorrecting Image
Autocorrect runs a set of predefined operations.
How to apply autocorrection:
- Choose Preferences from the Tools
menu.
- Specify a set of commands to apply with autocorrection using
the Preferences dialog. Close Preferences.
- If you have several raster images in your document, select the
one(s) to apply autocorrection to.
See section Raster Image selection for detailed information.
- Choose AutoCorrect from the Image
menu.
|
 |
NOTE:
The parameters of the commands included in the autocorrection list
(except Rotate) are automatically defined. For example,
deskewing with auto definition of rotation angle, removing speckles with
auto definition of speckle size, etc. If you want to specify the parameters
of executed commands precisely, use the batch process.
See section Batch and Script for detailed
information.
Editing raster text
You can edit raster texts -original text under the defined
rectangle is erased and replaced with new text.
- From the Draw menu, choose Raster, and
then Edit Raster text.
- Draw a frame over the text to be modified.
- While drawing, you can specify the frame angle in the corresponding
field of the Inspector.
- Enter new text in the Text field of the Inspector.
You can set text parameters in the corresponding fields of the Inspector.
|
|
|
|
|
Original raster text
|
Selected text area
|
After editing
|
Restoring Images of Poor Quality
How to work with a raster image of very poor quality:
There isn't much choice - either redraw it in the document
with the corresponding program, or restore it with a hybrid editor (vectorization
of such document produces poor results).
The purpose of this section is not to discuss
the plus and minus points of these choices, but to provide you with some
methods to restore scanned documents of poor quality.
- Separating an image by size - can be used for blueprints, images on
dark backgrounds, with lots of speckles.
Detailed information is provided in section Separating
Monochrome Images by Size.
- Editing selected raster objects (modifying their properties, geometry
using «grips» and others).
Detailed information is provided in section Editing data, selected
with object selection methods.
- Tracing in smooth mode.
- Tracing in vector producing mode. Editing and rasterizing the obtained
vector object.
Detailed information is provided in section Tracing
Modes and Commands.
- Drawing missing raster lines in Raster drawing mode.
Detailed information is provided in section Raster
Drawing Mode.
- Editing raster texts.
Detailed information is provided in section Editing
raster text.
Example of restoring an image
 |
Original image fragment |
 |
Choosing and editing the axis line |
 |
Result of editing the axis line |
 |
Tracing the curve in smooth mode |
|
|
Hatch on the original raster image |
|
|
Tracing the hatch in Create Vector and Erase Raster
mode |
|
|
Rasterizing the vector hatch |
Then you can apply the following actions:
|
|
|
|
Edited raster image
|
Select the whole raster image (or fragment)
|
|
|
|
|
Delete the raster fragments you need from the
selection
|
Remove the selected speckles
|
|