Académique Documents
Professionnel Documents
Culture Documents
Imaging Tools
Item-Number(s): 1005xxx
LaVision
We count on Photons
Contents
Contents
1 Introduction
2.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.1
10
2.1.2
10
2.1.3
13
2.2
14
2.3
17
2.3.1
17
2.3.2
17
23
2.4.1
23
2.4.2
23
2.4.3
25
2.4.4
26
2.4.5
28
2.4.6
29
2.4.7
30
2.4.8
33
2.4.9
Finish calibration . . . . . . . . . . . . . . . . . . . . . .
35
36
2.5.1
36
2.5.2
36
2.5.3
38
2.5.4
39
2.5.5
41
2.5.6
42
2.5.7
44
2.5.8
46
2.5.9
Finish calibration . . . . . . . . . . . . . . . . . . . . . .
48
50
2.4
2.5
2.6
Contents
2.6.1
50
2.6.2
50
2.6.3
52
2.6.4
54
2.6.5
56
2.6.6
57
2.6.7
59
2.6.8
61
2.6.9
Finish calibration . . . . . . . . . . . . . . . . . . . . . .
63
65
2.7.1
65
2.7.2
65
2.7.3
67
2.7.4
69
2.7.5
71
2.7.6
72
2.7.7
74
2.7.8
76
2.7.9
Finish calibration . . . . . . . . . . . . . . . . . . . . . .
78
80
2.8.1
80
2.8.2
80
2.8.3
Finish calibration . . . . . . . . . . . . . . . . . . . . . .
82
84
2.9.1
Preparation . . . . . . . . . . . . . . . . . . . . . . . . .
84
2.9.2
Calibration . . . . . . . . . . . . . . . . . . . . . . . . .
84
2.9.3
Stitching images . . . . . . . . . . . . . . . . . . . . . .
85
2.9.4
85
2.10 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . .
86
2.7
2.8
2.9
3 Imaging Tools
89
3.1
Mask Definition . . . . . . . . . . . . . . . . . . . . . . . . . . .
89
3.2
Overlay Editor . . . . . . . . . . . . . . . . . . . . . . . . . . .
93
3.3
95
3.4
98
3.5
3.5.2
3.5.3
Y - axis . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Contents
3.6
3.5.4
3.5.5
3.5.6
Strain
X - axis . .
Store mode
Processing .
Gauge . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
104
104
105
105
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
111
111
111
112
112
112
113
114
115
116
117
117
118
120
123
124
126
128
129
131
132
132
133
135
136
136
139
141
143
Contents
1 Introduction
The Imaging Tools manual describes different dialogs that are available in the
basic DaVis software package.
The biggest part of this manual concerns the perspective image correction.
The Calibration wizard chapter explains how to generate a calibration. The
Image distortion and correction chapter describes how to apply the calculated calibration on a single image. This functionality is also available in the
Batch Processing dialog.
Masks are often used to restrict the area of interest during processing. Theay
are defined in the Mask dialog. Overlays are painted above a image or vecter
view. The XY Plot dialog allows to extract profiles from a single or multiple
vector fields.
The Filter operations chapter explains the different possibilities of image
processing using linear or non-linear filters.
1 Introduction
Introduction
The tutorial is based on DaVis 7.1 software package (or later versions) and will
guide you to use LaVision Calibration Wizard dialog.
Doing a calibration is important because:
The results should be shown in scaled units representing the true (world)
dimensions. So the image scale pixel/mm should be determined.
The images usually show some image distortions due to perspective projection and inherent camera lens distortion. This should be corrected
(image dewarping)
for stereo measurements an internal representation for the geometrical
setup of both cameras relative to the sample is needed. This is determined.
Below you will find and example of how the image correction can correct perspective correction and lens errors:
2.1.1
To open the calibration wizard dialog press the calibration button in your
projects tool bar (see bitmap at the page margin). In Davis Classic mode you
can access the calibration wizard dialog through the menu entry Compute
Perspective calibration wizard.
A successful calibration procedure will store all acquired data and the calibration information under the Properties folder of your project in the folder
Calibration. A new calibration (imported or using the wizard) or any additional adaptations of your calibration (setting a new origin) will store the
previously active calibration in the folder Properties/Calibration History
before overwriting the Properties/Calibration files. So it is possible to restore any previous calibration done in your project : do a right mouse click
in the project manager tree view entry of the calibration in question and select import calibration. The Calibration History folder can be deleted
anytime to save up hard disk space, but it will not be possible to restore old
calibrations then (right mouse click : delete). This is not possible for the active
Calibration folder in the project manager and you should never delete the
Calibration folder of a project yourself.
In classic mode a Calibration History folder is not supported and the destination name and path for the Calibration has to be specified every time you
change the calibration.
2.1.2
Below you see the basic outline of the calibration wizard dialog.
10
2.1 Introduction
window is used for all user interactions. The reference window is only
for your convenience to compare two images for different cameras and/or
views and might be switched off without any drawbacks.
Depending on the choices you make the wizard consists of two to eight steps.
Like a program installation for your computers operation system each step
deals only with a special topic e.g. image acquisition or setting up parameters
to calculate the image dewarping function or specifying physical dimensions of
the calibration plate you are using. This should focus your attention to the
important things to be done. When you have specified all necessary selections
and entries for the current step you may proceed to the next step pressing the
next step button depicted to the side of the page or you might go to a previous
step pressing (iteratively) the previous step button also shown aside. If still
some information is missing to proceed to the next step the next step button
is disabled. Please refer to the section of that step to see how to resolve this.
When you are finished with all steps the next button will change to become
a finish button (see image aside)
Alternatively you might just press the corresponding button of the step you
want to go to in the step list labeled You are here:. Please be aware that
this view might not always be visible e.g. when you have a screen resolution
of less than 1280x1024 or when Davis is not maximized or at the minimized
version of some dialog steps to make more space for the displayed images.
Also be aware that the steps depicted might be named differently as the contents varies from calibration mode to calibration mode. Below there are for
two examples for different calibration modes.
Also it might not be possible to go to a later step because you may have to
make additional selections or perform some actions (e.g. clicking of reference
marks) in an earlier step. So it will take you as far down the list as possible and
halt automatically at the step in question. So pressing e.g. the last step will
accept all settings made in the first steps until some additional information is
required e.g. reference marks have to be specified on some images.
12
2.1 Introduction
2.1.3
All views for a camera will be stored in the corresponding set camera1 . . .
camera6. In corrected a number of corrected images are stored that hold
the summed up (corrected) images of all cameras and all views (see step eight
of your calibration mode for further details). Clicking on any of those sets
let you review all images in the data viewer on the right side of the project
manager.
Click on the calibration entry itself to show the parameters of the dewarping
function including the RMS of the fit to check the quality of the mapping
function fit. This check up is only supported for calibration sets created with
Davis 7.1 !
Every time you do a new calibration, import a new calibration or change
the current one the previously active calibration is automatically stored in the
Calibration History folder and given a postfix to its name which holds date and
time of the storage. All of the checking described above (clicking on camera1
. . . camera6, corrected and Calibration set itself) can be done one those
stored calibrations as well to compare different calibrations made.
Click on the Properties folder with the right mouse button or on any Calibration (active or in the Calibration History) to open a context menu (see
following screenshot) with the following entries:
13
2.2
After you enter the dialog a number of different calibration modes can be
selected: For some systems it is sufficient to specify the scaling of camera
pixel / mm without taking further distortions into account. Other systems
require the calculation of a dewarping function to map of camera images to
a undistorted world coordinate system. Stereo PIV or StrainMaster 3D for
example need the mapping of two cameras to a common coordinate system to
be able to calculate 3D component vectors.
To make the dialog as easy as possible for a basic experiment and still provide
all the functionality needed for complex setups you first have to define what
kind of experiment you are doing. This selection will limit the dialog items /
necessary steps to the ones you will need. The choices are the following:
14
define origin, maintain calibration Choose this option if you have already done a calibration but your are not happy with the origin of the
coordinate system. You can adapt the origin without changing the image
dewarping.
define scale, no image distortion Choose this option if you do not need
image dewarping because you do not have perspective projection errors
an small camera lens errors. You specify two points in the image and
the distance in mm between them or enter the pixel / mm ratio directly.
In either case any previously defined image dewarping function will be
overwritten and reset to no dewarping.
1 camera ( 2D ) Choose this option if you just want to calibrate one camera
to correct image distortions due to perspective projection and/or camera
lens errors. A dewarping function is calculated based on an image of
a calibration plate (which LaVision usually provides with your system)
with a regular grid of marks on it.
2 cameras (independent 2D+2D) Choose this option if you just want to
calibrate two independent cameras to correct image distortions due to
perspective projection and/or camera lens errors. A dewarping function
is calculated based on an image of a calibration plate (which LaVision
usually provides with your system) with a regular grid of marks on it.
The two resulting mapping functions are not mapped onto each other
and may have different scalings pixel/mm. So choose this if you either
look at different places of your sample (side-to-side) or if you use different
zoom factors (nested images).
2 cameras (mapped, e.g. stereo ) Choose this option if you just want to
calibrate two mapped cameras looking at the same place to correct image
distortions due to perspective projection and/or camera lens errors. A
dewarping function is calculated based on an image of a calibration plate
(which LaVision usually provides with your system) with a regular grid
of marks on it. In contrast to the previous choice the resulting mapping
functions are mapped onto each other and have the same scalings. Image
points for z=0 fall exactly into the same pixel location in the dewarped
images of both cameras. So choose this if you have a stereo system (e.g.
Stereo PIV, StrainMaster 3D, SurfaceFlow) or locked signals from two
different cameras (e.g. PIV-LIF) that you want to combine afterward.
Also the image stitching routine requires a common pixel/mm scale. to
fit overlapping camera images together.
15
advanced settings Choose this option if you have a more complex experimental setup (e.g. if you want to calibrate more than two cameras like in
a 2x Stereo PIV system or Stereo PIV-LIF experiment) or if you want a
non standard calibration using cameras other than camera 1 and camera
2.
The following sections provide a step by step walkthrough for all these different
cases.
16
2.3
You should use this option if you have (almost) no perspective or camera lens
distortions and a simple pixel/mm scaling is sufficient.
2.3.1
To do this kind of calibration you should select the second option - see left
screenshot below.
The list of available step then indicates that the total calibration process consists of two steps - see right screenshot below:
To proceed to the second step either press the next step button in the tool
bar or press the second button in the list of available steps You are here:
2.3.2
When you enter the second step the dialog looks like either of the two following
screenshots depending on whether the Maximize button has been pressed or
not see images shown aside.
17
The goal of the current step is to define conveniently the pixel / mm scale of
the image leaving any distortion untouched. This dialog requires two different
actions:
1. image acquisition or import
2. the interactive definition of the pixel / mm scale by entering numbers
directly or by definition with mouse clicks into the image.
Image acquisition
For the image acquisition you can take a new image directly from the cameras
that are currently connected to your system. To do this press the Take image
or the Grab button in the dialog.
This takes one image of the cameras that are selected in the general device
interface GDI to its right (only visible in the minimized images, maximized
dialog setting - see above). In the GDI you also set up the exposure times,
external trigger, (laser) light sources, step motor positions and other hardware
settings important to your image acquisition.
Changing the average value in the text box on the left to any other value than
1 will result in the averaging of the specified number of images to improve
image quality due to poor lighting conditions. Please make sure that neither
the camera nor the calibration sample is moving !
Import
Another option is to import one or more previously recorded files from your
hard disk by pressing the Load button. You can either load single images or
whole (Davis) sets. This opens a modal dialog that shows a preview of the
image in question (see screenshot below).
18
Here you specify which of the image frames you want to import. For images
originating from Davis you can leave the check box that follows unchecked and
read out the default camera number that is stored in each image (and shown
for the current image). For imported bitmaps (.bmp or .tif files) you have
to specify to which camera the image corresponds. If want to overwrite the
stored camera number you can also specify another (wrong) camera number.
The selection box will turn red (instead of green) to warn you that the program
recognized a discrepancy - so you should really know what you are doing.
Furthermore you need to specify if you want to append the selected file /
files to your selection of images, replace previously imported frames for the
selected camera number or start all over deleting any previously present images
and replace all images with the selected image(s) by the new selection.
Definition of pixel/mm scaling
To define the pixel/mm scale you have two options: either you scale the image interactively using the mouse (see left button shown below) or you enter
numbers directly to define the scale (see right button shown below).
After clicking on the left button in the Instruction group instructions are
given what to do: click on a first then on a second reference point in the
image. After doing so the following dialog will open:
the bottom group box contains the text field to enter the (known) distance in mm.
After pressing the return key or OK the pixel / mm scaling is calculated and
any present dewarping function is reset to unity (no dewarping).
In any case the first point you clicked will become the new origin of the coordinate system or (if you happen to do so in the Options box) the specified
reference coordinate point.
If on the other hand you select the right Scale button a dialog appears where
you can define the scaling directly:
Either you already know the pixel / mm scale or you give the position of two
reference points and the point to point distance in mm between them.
Again after accepting the new scale any previously defined image dewarping
function will be reset to no dewarping.
Definition of new origin / reference point
If you are happy with the scaling but not with the origin after such a scale
definition, you can redefine a new origin for the (already scaled) image or set
the value of any other reference point (not necessarily the origin).
Clicking into the image interactively using the mouse is done by clicking on the
left button shown above and following the instructions: click into the image to
specify the new origin / reference point.
Or you can enter numbers directly to define the position and coordinates in
the image of the new origin / reference point by clicking on the right button
shown above. This opens the dialog where you specify a pixel position and the
(new) corresponding mm coordinates.
20
After either of the two procedures the pixel / mm scaling is maintained and
only the new origin / reference point reset to the new value. Any present
dewarping function is set to unity (no dewarping).
Reset calibration to pixel scaling
To just switch back to no scaling at all and delete all previous settings press
the Reset button. This will reset the pixel/mm scaling as well as any present
dewarping function and sets the origin to the upper left (default).
When you are content with the achieved calibration press the Finish button
in the tool bar (see image aside) to accept the calibration (image dewarping
function + pixel/mm scaling) which might then be written to your project.
The following dialog opens :
Select the first choice to open a new project with the new calibration
leaving the current project untouched.
Select the second option to overwrite the calibration of the currently active project - be aware that previously recorded images and their derived
results might not be consistent with results that will be calculated with
the new calibration.
21
Select the third choice to overwrite the calibration of the currently active project and scale all previous recordings present in the root level of
your project to be consistent with the new calibration - be aware that results that have been derived before the changed calibration might not be
consistent with results that will be calculated with the new calibration.
Select the fourth choice if you want to discard everything you have done in
the calibration wizard. Then the old calibration active when you entered
the calibration wizard will be restored. Note that you might have to do
the whole calibration procedure again.
The calibration wizard dialog will close and you return to the project manager.
22
2.4
2.4.1
To do this kind of calibration you should select the third option - see left
screenshot below.
The list of available step then indicates that the total calibration process consists of eight steps - see right screenshot below:
To proceed to the second step either press the next step button in the tool
bar or press the second button in the list of available steps You are here:
2.4.2
When you enter the second step the dialog looks like the following screenshot:
In this step you define your coordinate system and the number of views you
provide for your calibration plate in different places to calculate the image
dewarping function.
On the right side in Coordinate system axis orientation you select if you
want a right handed coordinate system (z-axis orientated toward you when
you look at the images) or a left handed coordinate system (z-axis pointing
away from you).
23
On the left side you specify the number of views you will provide for the
camera defined in this coordinate system. Although in general one view is
enough to find a dewarping function to correct all distortions in your camera
images providing several views makes the result more accurate. In any case
the x yplane (and hence the z-axis ) is always defined by the orientation
of calibration plate of the first view.
In case you want to provide several views you have to specify if they are
coplanar (that is aligned in parallel among them) and if they are placed at
equidistant z- positions. Please be aware that some kind of mapping functions
require coplanar views. In case you have equidistant views you have to specify
the distance dz between two neighbor views.
Below you will find a table with the required and recommended number of
views for your experiment. Depending on the combination of the dewarping
mapping function type, your calibration plate type (2D or 3D) and the number
of mapped cameras in your coordinate system you have different limitations
and recommendations:
System type
Mapping model
for dewarping
1 camera
polynomial
or pinhole
Required
] of views
1
Recommended
] of views
1
Limitations from your experiment might force you to make special choices:
You might be forced to use a 2D calibration plate because no 3D calibration plate is available (e.g. for a microscope).
Looking through a non planar glass window which adds non radial distortions to your images might force you to use polynomial mapping as
the pinhole model does not work well in those conditions.
The measurement itself in most Davis packages implies that the sample is
located at the z = 0 mm position. If you cannot place the calibration plate at
that position you can perform the calibration in front or behind that position.
This can be done only for a pinhole calibration or for a polynomial calibration
with two or more coplanar views. To use this feature please check the option
first view not at origin and specify the z-position of the first view. The
calibration process will then take this offset into account. In any case the
coordinate system is set up so that the calibration plate position of the first
view defines the x y-plane orientation (and hence the z-axis ). To proceed
to the third step either press the next step button in the tool bar or press
the third button in the list of available steps You are here:
24
2.4.3
When you enter the third step the dialog looks like the following screenshot:
In this step you specify which calibration plate you are using. If you use a
calibration plate from LaVision it is enough to select the plate type labeled
on the plate e.g. Type ]10. This will set all plate parameters to the correct
values (see first screenshot above).
In case you want to use your own calibration plate you have to provide a number
of parameters (see second screenshot above): On the left side in Calibration
plate used you define the calibration type:
calibration plate contains marks in form of crosses or dots. Both black
marks on white background and white marks on black background are
supported and identified automatically.
calibration plate has only 1 plane = type 2D or is a two level plate =
type 3D.
On the right side in Calibration plate parameters you define several of its
parameters (dimension and sizes):
25
2.4.4
When you enter the fourth step the dialog looks like either of the two following
screenshots depending on whether the Maximize button has been pressed or
not see images shown aside.
In the fourth step you acquire the necessary images of the calibration plate for
all cameras and all views - only then you are allowed to proceed to the next
steps.
For the image acquisition you can take a new image directly from the cameras
that are currently connected to your system. To do this press the Take image
or the Grab button in the dialog.
This takes one image (or in case of Grab continuously images until you press
the stop button in the toolbar or hit the ESC key) of the cameras that are
selected in the dialog for the specified view (check box on). For views that
already contain non empty images the selection box entries are marked with
(ok). If a camera contains valid images for all views the selection box for the
view selection becomes green. If all view entries of all coordinate systems are
green then the next step button will be enabled. Pressing the button with
the red cross will delete the camera image of the selected view.
26
In the general device interface GDI to its right (only visible in the minimized images, maximized dialog setting - see above) you can set up the exposure times, external trigger, (laser) light sources, step motor positions and
other hardware settings important to your image acquisition.
Changing the average value in the text box on the left to any other value than
1 will result in the averaging of the specified number of images to improve
image quality due to poor lighting conditions. Please make sure that neither
the camera nor the calibration sample is moving !
Another option is to import one or more previously recorded files from your
hard disk by pressing the Load button. You can either load single images or
whole (Davis) sets. This opens a modal dialog that shows a preview of the
image in question (see screenshot below).
Here you specify which of the image frames you want to import. For images
originating from Davis you can leave the check box that follows unchecked and
read out the default camera number that is stored in each image (and shown
for the current image). For imported bitmaps (.bmp or .tif files) you have
to specify to which camera the image corresponds. If want to overwrite the
stored camera number you can also specify another (wrong) camera number.
The selection box will turn red (instead of green) to warn you that the program
recognized a discrepancy - so you should really know what you are doing.
In case you want to load several images at once from an image set you need
to specify which images of a set you want to import (start and end image
number and an increment) and specify the start view to which the images are
added. If during the import more than one image for a camera is found it will
automatically add it to the next view. If all views hold valid camera images
the import stops automatically.
This is a the recommended way to import old calibration images from an old
calibration.set created by Davis 6.2 or Davis 7.0 into the new format.
27
To proceed to the fifth step either press the next step button in the tool bar
or press the fifth button in the list of available steps You are here:
2.4.5
When you enter the fifth step the dialog looks like the following screenshot:
In the fifth step you define three start marks for the mark search. To start the
process you can either
click All cameras/views which automatically will show you the images
for all camera / view combinations one after another to (re)define the
start marks for all those combination or
you press Shown camera/views to (re)define the start marks in the
currently visible image in the working window or
you press a table entry in the table to the right corresponding to a
camera / view combination to (re)define the start marks for that combination.
When you do any of this instructions will appear in the Instructions field of
the dialog to guide you to the clicking process. First you have to click a start
reference mark which must be the same physical mark in all cameras and all
views ! Then you are asked to click the neighbor mark to the right (to the
left if the camera is looking onto the backside of the calibration plate) and at
last the mark to the top of the first mark you selected. Important: please
make sure that the marks you select are located on the front plane of a 3D
calibration plate ! If you clicked all 3 marks successfully the table entry for
that camera/view combination will show an okay.
You may stop the clicking process any time pressing the Stop button in the
tool bar or by pressing the ESC key on your keyboard which will abort all
further actions.
If you have defined start marks successfully on all images (all table entries show
an okay) you may proceed to the next step. To proceed to the sixth step
28
either press the next step button in the tool bar or press the sixth button in
the list of available steps You are here:
2.4.6
When you enter the sixth step the dialog looks like the following screenshot:
In the sixth step you let the program find all other marks for you. This is
an automatic process and requires no user interaction. Just press the button
Start search. Depending on the image quality and the speed of your computer
this might require several minutes, but you should see a screen update once
in a while. Usually it is enough if 20-30 marks could be identified. Please be
aware that due to the nature of the dewarping functions for a polynomial fit
marks have to be found everywhere in the image where you want to derive
result later, for pinhole calibration it is enough if only parts of the image are
covered with found marks.
In case you are not satisfied with the mark search quality you can enhance the
search changing some parameters. First you should check if you selected the
correct calibration plate type (2D or 3D) and the correct mark type (crosses
or dots).
If you think that some marks have not been found that should not pose a
problem for the mark search process you can adapt the search parameters in
the dialog accessible by pressing the button Mark search parameter....
29
In this dialog (see screenshot above) you can choose in use preset values
your impression of the image quality and ask to find more or less marks with
the slider. On these assumptions the general search parameters are changed.
In advanced settings you might change these values one by one although
this is only advisable for expert users as there are many dependences among
some parameters.
If you think that too many marks have been found e.g. due to reflexes outside
the calibration plate you can eliminate them one by one pressing the button
Delete single mark where you can click iteratively on all marks that you
think should be deleted from the list of found marks (might take a while).
Just click repeatedly very close to the center of a found mark and wait to see
the mark disappear from the display. Then either go on clicking the next mark
or press the Space bar to end this procedure.
Another way to limit the mark search is to limit the search are in the first
place. You add a masked area by pressing the red or the blue button polygon
button of Limit search using a mask. In the Status text there are some
instructions how to proceed. You can click various times to define the angles
of a polygon. Pressing the key d deletes the last point(s) repeatedly, q aborts
the whole process and c closes the polygon and accepts the mask. Using the
blue button enables all pixels inside the polygon masking out all pixels outside,
the red polygon does it the other way round. With the button showing the red
cross you delete the mask from the current camera / view selection.
Please note that a mask is defined for the currently visible image only and that
you can use different masks for images of other camera / view combinations.
In the table to the right the number of marks found in each image is shown.
In case the calibration plate has 2 planes (3D plate) the number of marks for
each plane is shown separately with the plus sign (+). When marks have been
found in all images the next button is enabled and you may proceed to the
next step.
To proceed to the seventh step either press the next step
button in the tool bar or press the seventh button in the list of available steps
You are here:
2.4.7
When you enter the seventh step the dialog looks like the following screenshot:
30
In the seventh step you fit the dewarping mapping function to the marks
found in each image. You can select between pinhole calibration and polygon
calibration. Please note that in case you have more than one view and these
are not coplanar or equidistant the polynomial calibration is not available.
To start the calculation process press the button Start calibration. The
calibration process is automatic and requires no user interaction. The average
deviation of the dewarped mark positions to the ideal regular grid is shown in
the table to the right for each image. A value lower than 1 pixel is good, a value
lower than 0.3 pixel is excellent, Values higher than 2 pixel are questionable.
Please check if you clicked the front plane of a 3D calibration plate as this
is a common source of error. You can check the result of the fit in detail by
pressing the button Show fit parameter... which opens either of the two
following dialogs depending on the kind of mapping function you selected.
In both cases you can check the size of the corrected image and the RMS
of the fit.
In case of the polynomial you can check the coefficients of the mapping function.
In case of the pinhole model you can check the physical parameters that describe your model and compare them to the real world parameters of your
experiment: focal length of your camera lens, distance Tz from camera to calibration plate. Rotation Rx and Ry around X and Y axis indicating the
angle at which the cameras see the calibration plate. All those parameters
31
should coincide with your experimental setup fairly well. The first and second
radial distortion factors are the extra distortion that are produced by that term
at a distance of 500 pixel to the center of distortion. This center of distortion
is called the principle point as is located where the optical axis of the camera
lens meet the CCD chip of your camera if you use a Scheimpflug adapter
this might not be the center center of your CCD chip! The radial distortion
contribution is usually 1 pixel or below although this strongly depends on
the camera lens you use.
If you are not happy with the fit you can adapt some general parameters of
the fit by pressing the button Fit parameters (pinhole model fit only !). It
will open the following dialog:
Here you can select which parameters should be fitted and which are just set
to fixed (known) values. Switching to default fit will reset all parameters to
their standard values and should work for most purposes (fixing the principle
point to the center of the camera CCD chip and using squared pixels, fitting
the rest starting the fit with focal length of 50 mm and distance Tz of
500 mm).
If you are not happy with this preselection or if you are using a Scheimpflug
adapter (and the assumption that the principle point is at the center of the
CCD chip is not true) you should switch to expert fit. Here you specify for
all cameras used in that coordinate system if you want to fit the focal length
or use a fixed value. In the first case the value is used as a start value for the
fit: the closer you can guess the focal length the easier it will be for the fitting
algorithm.
32
Furthermore it will help the algorithm if you can provide the rough distance of
camera to calibration plate in mm along the viewing direction of the camera.
At last you specify if your cameras are using a Scheimpflug adapter on your
cameras.
If your cameras have non square pixels you can check that option , but this is
NEVER the case with the cameras LaVision provides and should be switched
on only if you imported images from other cameras. There is the rare case
where additional distortions looking through a glass window can be corrected
by switching on this option. If in doubt you may contact LaVision to advise
you. Usually additional distortions by the optical access to your experiment
strongly suggests to use the polynomial fit.
Then you may switch between various levels of radial distortions which will
switch on the fit of first and second order terms describing radial distortions.
If you have done the fit for all cameras (and coordinate systems) you may
proceed to the last step.
To proceed to the last step either press the next
step button in the tool bar or press the last button in the list of available steps
You are here:
2.4.8
When you enter the eighth step the dialog looks like the following screenshot:
In this last step you can evaluate visually your fit results. For that purpose all
camera / view combinations are dewarped - for 3D calibration plates even for
both z positions of the upper and the lower plane. Then also images are created
where the corrected images of all cameras and all views of a coordinate system
are overlayed (summed up) to see if indeed all corrected images coincide. In
addition a grid of the ideal regular grid of marks is overlayed. Here you can
check:
in single camera images if the marks fall to the ideal regular grid
if the marks in the summed up images of different cameras (and one
view) coincide for z=0 mm position
33
if the marks in the summed up images of different views for one camera
coincide for z=0 mm position
if the marks in the summed up images of all views for all camera coincide
for z=0 mm position
In case you use a 3D calibration plate you can check furthermore:
all of the above for the position of the second plane in case you use a 3D
calibration plate
in case you use more than one camera you can check by how much a
wrong z position will move the corrected images apart. In detail: correcting for the position of the upper plane (z=0) to make the marks of
the upper plane coincide will produce ghost images for the marks in the
lower plane (e.g. at z=1 mm) due to the perspective parallax. This gives
you a direct information of the 3D resolution of a stereoscopic system.
Lets say the ghost images are 6 pixel apart. Then the vector calculation
(which can resolve 0.05 pixel shifts on the CCD images) will detect a
true shift of 1 mm /6 pixel = x mm / 0.05 pixel x = ca. 8 m
in z-direction in this experiment. You can increase this resolution by
increasing the angular separation of your system.
Changing the selection boxed for camera, view and plane (if you have used a
3D calibration plate) shows the corresponding corrected images for evaluation.
The table Fit results to the right summarizes the most important fit parameter. For a more detailed overview of the fit result you can click the button
Show all fit parameter... which opens either of the two following dialogs
which are described in detail in the section above - so please refer to the descriptions in step 7.
34
2.4.9
Finish calibration
When you are content with the achieved calibration press the Finish button
in the tool bar (see image aside) to accept the calibration (image dewarping
function + pixel/mm scaling) which might then be written to your project.
The following dialog opens :
Select the first choice to open a new project with the new calibration
leaving the current project untouched.
Select the second option to overwrite the calibration of the currently active project - be aware that previously recorded images and their derived
results might not be consistent with results that will be calculated with
the new calibration.
Select the third choice to overwrite the calibration of the currently active project and scale all previous recordings present in the root level of
your project to be consistent with the new calibration - be aware that results that have been derived before the changed calibration might not be
consistent with results that will be calculated with the new calibration.
Select the fourth choice if you want to discard everything you have done in
the calibration wizard. Then the old calibration active when you entered
the calibration wizard will be restored. Note that you might have to do
the whole calibration procedure again.
The calibration wizard dialog will close and you return to the project manager.
35
2.5
2.5.1
To do this kind of calibration you should select the fourth option - see left
screenshot below.
The list of available step then indicates that the total calibration process consists of eight steps - see right screenshot below:
To proceed to the second step either press the next step button in the tool
bar or press the second button in the list of available steps You are here:
2.5.2
When you enter the second step the dialog looks like the following screenshot:
In this step you define your coordinate system and the number of views you
provide for your calibration plate in different places to calculate the image
dewarping function.
You have to do this for all coordinate systems. You change to set up another
coordinate system clicking on the card item labeled Coordinate system 1
to Coordinate system 6 depending on what coordinate systems are used.
36
All settings are made independently so you do not have to define them all the
same.
On the right side in Coordinate system axis orientation you select if you
want a right handed coordinate system (z-axis orientated toward you when
you look at the images) or a left handed coordinate system (z-axis pointing
away from you).
On the left side you specify the number of views you will provide for the
camera defined in this coordinate system. Although in general one view is
enough to find a dewarping function to correct all distortions in your camera
images providing several views makes the result more accurate. In any case
the x yplane (and hence the z-axis ) is always defined by the orientation
of calibration plate of the first view.
In case you want to provide several views you have to specify if they are
coplanar (that is aligned in parallel among them) and if they are placed at
equidistant z- positions. Please be aware that some kind of mapping functions
require coplanar views. In case you have equidistant views you have to specify
the distance dz between two neighbor views.
Below you will find a table with the required and recommended number of
views for your experiment. Depending on the combination of the dewarping
mapping function type, your calibration plate type (2D or 3D) and the number
of mapped cameras in your coordinate system you have different limitations
and recommendations:
System type
Mapping model
for dewarping
polynomial
or pinhole
Required
] of views
1
Recommended
] of views
1
Limitations from your experiment might force you to make special choices:
You might be forced to use a 2D calibration plate because no 3D calibration plate is available (e.g. for a microscope).
Looking through a non planar glass window which adds non radial distortions to your images might force you to use polynomial mapping as
the pinhole model does not work well in those conditions.
The measurement itself in most Davis packages implies that the sample is
located at the z = 0 mm position. If you cannot place the calibration plate at
that position you can perform the calibration in front or behind that position.
This can be done only for a pinhole calibration or for a polynomial calibration
37
with two or more coplanar views. To use this feature please check the option
first view not at origin and specify the z-position of the first view. The
calibration process will then take this offset into account. In any case the
coordinate system is set up so that the calibration plate position of the first
view defines the x y-plane orientation (and hence the z-axis ). To proceed
to the third step either press the next step button in the tool bar or press
the third button in the list of available steps You are here:
2.5.3
When you enter the third step the dialog looks like the following screenshot:
In this step you specify which calibration plate you are using. If you use a
calibration plate from LaVision it is enough to select the plate type labeled
on the plate e.g. Type ]10. This will set all plate parameters to the correct
values (see first screenshot above).
In case you want to use your own calibration plate you have to provide a number
of parameters (see second screenshot above): On the left side in Calibration
plate used you define the calibration type:
38
2.5.4
When you enter the fourth step the dialog looks like either of the two following
screenshots depending on whether the Maximize button has been pressed or
not see images shown aside.
In the fourth step you acquire the necessary images of the calibration plate for
all cameras and all views - only then you are allowed to proceed to the next
steps.
For the image acquisition you can take a new image directly from the cameras
that are currently connected to your system. To do this press the Take image
or the Grab button in the dialog.
39
This takes one image (or in case of Grab continuously images until you press
the stop button in the toolbar or hit the ESC key) of the cameras that are
selected in the dialog for the specified view (check box on). For views that
already contain non empty images the selection box entries are marked with
(ok). If a camera contains valid images for all views the selection box for the
view selection becomes green. If all view entries of all coordinate systems are
green then the next step button will be enabled. Pressing the button with
the red cross will delete the camera image of the selected view.
In the general device interface GDI to its right (only visible in the minimized images, maximized dialog setting - see above) you can set up the exposure times, external trigger, (laser) light sources, step motor positions and
other hardware settings important to your image acquisition.
Changing the average value in the text box on the left to any other value than
1 will result in the averaging of the specified number of images to improve
image quality due to poor lighting conditions. Please make sure that neither
the camera nor the calibration sample is moving !
Another option is to import one or more previously recorded files from your
hard disk by pressing the Load button. You can either load single images or
whole (Davis) sets. This opens a modal dialog that shows a preview of the
image in question (see screenshot below).
Here you specify which of the image frames you want to import. For images
originating from Davis you can leave the check box that follows unchecked and
read out the default camera number that is stored in each image (and shown
for the current image). For imported bitmaps (.bmp or .tif files) you have
to specify to which camera the image corresponds. If want to overwrite the
stored camera number you can also specify another (wrong) camera number.
The selection box will turn red (instead of green) to warn you that the program
recognized a discrepancy - so you should really know what you are doing.
40
In case you want to load several images at once from an image set you need
to specify which images of a set you want to import (start and end image
number and an increment) and specify the start view to which the images are
added. If during the import more than one image for a camera is found it will
automatically add it to the next view. If all views hold valid camera images
the import stops automatically.
This is a the recommended way to import old calibration images from an old
calibration.set created by Davis 6.2 or Davis 7.0 into the new format.
To proceed to the fifth step either press the next step button in the tool bar
or press the fifth button in the list of available steps You are here:
2.5.5
When you enter the fifth step the dialog looks like the following screenshot:
In the fifth step you define three start marks for the mark search. To start the
process you can either
click All cameras/views which automatically will show you the images
for all camera / view combinations one after another to (re)define the
start marks for all those combination or
you press Shown camera/views to (re)define the start marks in the
currently visible image in the working window or
you press a table entry in the table to the right corresponding to a
camera / view combination to (re)define the start marks for that combination.
When you do any of this instructions will appear in the Instructions field of
the dialog to guide you to the clicking process. First you have to click a start
reference mark which must be the same physical mark in all cameras and all
views ! Then you are asked to click the neighbor mark to the right (to the
left if the camera is looking onto the backside of the calibration plate) and at
last the mark to the top of the first mark you selected. Important: please
41
make sure that the marks you select are located on the front plane of a 3D
calibration plate ! If you clicked all 3 marks successfully the table entry for
that camera/view combination will show an okay.
You may stop the clicking process any time pressing the Stop button in the
tool bar or by pressing the ESC key on your keyboard which will abort all
further actions.
If you have defined start marks successfully on all images (all table entries show
an okay) you may proceed to the next step. To proceed to the sixth step
either press the next step button in the tool bar or press the sixth button in
the list of available steps You are here:
2.5.6
When you enter the sixth step the dialog looks like the following screenshot:
In the sixth step you let the program find all other marks for you. This is
an automatic process and requires no user interaction. Just press the button
Start search. Depending on the image quality and the speed of your computer
this might require several minutes, but you should see a screen update once
in a while. Usually it is enough if 20-30 marks could be identified. Please be
aware that due to the nature of the dewarping functions for a polynomial fit
marks have to be found everywhere in the image where you want to derive
result later, for pinhole calibration it is enough if only parts of the image are
covered with found marks.
In case you are not satisfied with the mark search quality you can enhance the
search changing some parameters. First you should check if you selected the
correct calibration plate type (2D or 3D) and the correct mark type (crosses
or dots).
If you think that some marks have not been found that should not pose a
problem for the mark search process you can adapt the search parameters in
the dialog accessible by pressing the button Mark search parameter....
42
In this dialog (see screenshot above) you can choose in use preset values
your impression of the image quality and ask to find more or less marks with
the slider. On these assumptions the general search parameters are changed.
In advanced settings you might change these values one by one although
this is only advisable for expert users as there are many dependences among
some parameters.
If you think that too many marks have been found e.g. due to reflexes outside
the calibration plate you can eliminate them one by one pressing the button
Delete single mark where you can click iteratively on all marks that you
think should be deleted from the list of found marks (might take a while).
Just click repeatedly very close to the center of a found mark and wait to see
the mark disappear from the display. Then either go on clicking the next mark
or press the Space bar to end this procedure.
Another way to limit the mark search is to limit the search are in the first
place. You add a masked area by pressing the red or the blue button polygon
button of Limit search using a mask. In the Status text there are some
instructions how to proceed. You can click various times to define the angles
of a polygon. Pressing the key d deletes the last point(s) repeatedly, q aborts
the whole process and c closes the polygon and accepts the mask. Using the
blue button enables all pixels inside the polygon masking out all pixels outside,
the red polygon does it the other way round. With the button showing the red
cross you delete the mask from the current camera / view selection.
Please note that a mask is defined for the currently visible image only and that
you can use different masks for images of other camera / view combinations.
In the table to the right the number of marks found in each image is shown.
In case the calibration plate has 2 planes (3D plate) the number of marks for
each plane is shown separately with the plus sign (+). When marks have been
found in all images the next button is enabled and you may proceed to the
next step.
To proceed to the seventh step either press the next step
43
button in the tool bar or press the seventh button in the list of available steps
You are here:
2.5.7
When you enter the seventh step the dialog looks like the following screenshot:
In the seventh step you fit the dewarping mapping function to the marks
found in each image. You can select between pinhole calibration and polygon
calibration. Please note that in case you have more than one view and these
are not coplanar or equidistant the polynomial calibration is not available.
To start the calculation process press the button Start calibration. The
calibration process is automatic and requires no user interaction. The average
deviation of the dewarped mark positions to the ideal regular grid is shown in
the table to the right for each image. A value lower than 1 pixel is good, a value
lower than 0.3 pixel is excellent, Values higher than 2 pixel are questionable.
Please check if you clicked the front plane of a 3D calibration plate as this
is a common source of error. You can check the result of the fit in detail by
pressing the button Show fit parameter... which opens either of the two
following dialogs depending on the kind of mapping function you selected.
In both cases you can check the size of the corrected image and the RMS
of the fit.
44
In case of the polynomial you can check the coefficients of the mapping function.
In case of the pinhole model you can check the physical parameters that describe your model and compare them to the real world parameters of your
experiment: focal length of your camera lens, distance Tz from camera to calibration plate. Rotation Rx and Ry around X and Y axis indicating the
angle at which the cameras see the calibration plate. All those parameters
should coincide with your experimental setup fairly well. The first and second
radial distortion factors are the extra distortion that are produced by that term
at a distance of 500 pixel to the center of distortion. This center of distortion
is called the principle point as is located where the optical axis of the camera
lens meet the CCD chip of your camera if you use a Scheimpflug adapter
this might not be the center center of your CCD chip! The radial distortion
contribution is usually 1 pixel or below although this strongly depends on
the camera lens you use.
If you are not happy with the fit you can adapt some general parameters of
the fit by pressing the button Fit parameters (pinhole model fit only !). It
will open the following dialog:
Here you can select which parameters should be fitted and which are just set
to fixed (known) values. Switching to default fit will reset all parameters to
their standard values and should work for most purposes (fixing the principle
point to the center of the camera CCD chip and using squared pixels, fitting
the rest starting the fit with focal length of 50 mm and distance Tz of
500 mm).
45
If you are not happy with this preselection or if you are using a Scheimpflug
adapter (and the assumption that the principle point is at the center of the
CCD chip is not true) you should switch to expert fit. Here you specify for
all cameras used in that coordinate system if you want to fit the focal length
or use a fixed value. In the first case the value is used as a start value for the
fit: the closer you can guess the focal length the easier it will be for the fitting
algorithm.
Furthermore it will help the algorithm if you can provide the rough distance of
camera to calibration plate in mm along the viewing direction of the camera.
At last you specify if your cameras are using a Scheimpflug adapter on your
cameras.
If your cameras have non square pixels you can check that option , but this is
NEVER the case with the cameras LaVision provides and should be switched
on only if you imported images from other cameras. There is the rare case
where additional distortions looking through a glass window can be corrected
by switching on this option. If in doubt you may contact LaVision to advise
you. Usually additional distortions by the optical access to your experiment
strongly suggests to use the polynomial fit.
Then you may switch between various levels of radial distortions which will
switch on the fit of first and second order terms describing radial distortions.
If you have done the fit for all cameras (and coordinate systems) you may
proceed to the last step.
To proceed to the last step either press the next
step button in the tool bar or press the last button in the list of available steps
You are here:
2.5.8
When you enter the eighth step the dialog looks like the following screenshot:
In this last step you can evaluate visually your fit results. For that purpose all
camera / view combinations are dewarped - for 3D calibration plates even for
both z positions of the upper and the lower plane. Then also images are created
where the corrected images of all cameras and all views of a coordinate system
46
are overlayed (summed up) to see if indeed all corrected images coincide. In
addition a grid of the ideal regular grid of marks is overlayed. Here you can
check:
in single camera images if the marks fall to the ideal regular grid
if the marks in the summed up images of different cameras (and one
view) coincide for z=0 mm position
if the marks in the summed up images of different views for one camera
coincide for z=0 mm position
if the marks in the summed up images of all views for all camera coincide
for z=0 mm position
In case you use a 3D calibration plate you can check furthermore:
all of the above for the position of the second plane in case you use a 3D
calibration plate
in case you use more than one camera you can check by how much a
wrong z position will move the corrected images apart. In detail: correcting for the position of the upper plane (z=0) to make the marks of
the upper plane coincide will produce ghost images for the marks in the
lower plane (e.g. at z=1 mm) due to the perspective parallax. This gives
you a direct information of the 3D resolution of a stereoscopic system.
Lets say the ghost images are 6 pixel apart. Then the vector calculation
(which can resolve 0.05 pixel shifts on the CCD images) will detect a
true shift of 1 mm /6 pixel = x mm / 0.05 pixel x = ca. 8 m
in z-direction in this experiment. You can increase this resolution by
increasing the angular separation of your system.
Changing the selection boxed for camera, view and plane (if you have used a
3D calibration plate) shows the corresponding corrected images for evaluation.
The table Fit results to the right summarizes the most important fit parameter. For a more detailed overview of the fit result you can click the button
Show all fit parameter... which opens either of the two following dialogs
which are described in detail in the section above - so please refer to the descriptions in step 7.
47
2.5.9
Finish calibration
When you are content with the achieved calibration press the Finish button
in the tool bar (see image aside) to accept the calibration (image dewarping
function + pixel/mm scaling) which might then be written to your project.
The following dialog opens :
Select the first choice to open a new project with the new calibration
leaving the current project untouched.
Select the second option to overwrite the calibration of the currently active project - be aware that previously recorded images and their derived
results might not be consistent with results that will be calculated with
the new calibration.
Select the third choice to overwrite the calibration of the currently active project and scale all previous recordings present in the root level of
your project to be consistent with the new calibration - be aware that results that have been derived before the changed calibration might not be
consistent with results that will be calculated with the new calibration.
48
Select the fourth choice if you want to discard everything you have done in
the calibration wizard. Then the old calibration active when you entered
the calibration wizard will be restored. Note that you might have to do
the whole calibration procedure again.
The calibration wizard dialog will close and you return to the project manager.
49
2.6
2.6.1
To do this kind of calibration you should select the fifth option - see left
screenshot below.
The list of available step then indicates that the total calibration process consists of eight steps - see right screenshot below:
To proceed to the second step either press the next step button in the tool
bar or press the second button in the list of available steps You are here:
2.6.2
When you enter the second step the dialog looks like the following screenshot:
In this step you define your coordinate system and the number of views you
provide for your calibration plate in different places to calculate the image
dewarping function.
On the right side in Coordinate system axis orientation you select if you
want a right handed coordinate system (z-axis orientated toward you when
50
you look at the images) or a left handed coordinate system (z-axis pointing
away from you).
On the left side you specify the number of views you will provide for all cameras
defined in this coordinate system ! For the N th view you have to provide images
for all involved cameras of the calibration plate in the same position. So either
take images simultaneously later or make sure that the calibration plate will
not move while you take separate images for all cameras. Although in general
one view is enough to find a dewarping function to correct all distortions in
your camera images providing several views makes the result more accurate.
In any case the x yplane (and hence the z-axis ) is always defined by the
orientation of calibration plate of the first view.
In case you want to provide several views you have to specify if they are
coplanar (that is aligned in parallel among them) and if they are placed at
equidistant z- positions. Please be aware that some kind of mapping functions
require coplanar views. In case you have equidistant views you have to specify
the distance dz between two neighbor views.
Below you will find a table with the required and recommended number of
views for your experiment. Depending on the combination of the dewarping
mapping function type, your calibration plate type (2D or 3D) and the number
of mapped cameras in your coordinate system you have different limitations
and recommendations:
System type
Mapping model
for dewarping
Required
] of views
Recommended
] of views
polynomial
or pinhole
camera
mapped
(stereo measurements
- e.g. 3D vectors)
polynomial
2 views must
be coplanar and
equidistant
camera
mapped
(stereo measurements
- e.g. 3D vectors)
pinhole model
2
(with
2D
plates views should
be coplanar and
equidistant
Limitations from your experiment might force you to make special choices:
You might be forced to use a 2D calibration plate because no 3D calibration plate is available (e.g. for a microscope).
51
Looking through a non planar glass window which adds non radial distortions to your images might force you to use polynomial mapping as
the pinhole model does not work well in those conditions.
the use of the self calibration wizard (available in PIV projects) requires
the pinhole calibration. For more details please refer to the corresponding
chapter about self calibration.
The measurement itself in most Davis packages implies that the sample is
located at the z = 0 mm position. If you cannot place the calibration plate at
that position you can perform the calibration in front or behind that position.
This can be done only for a pinhole calibration or for a polynomial calibration
with two or more coplanar views. To use this feature please check the option
first view not at origin and specify the z-position of the first view. The
calibration process will then take this offset into account. In any case the
coordinate system is set up so that the calibration plate position of the first
view defines the x y-plane orientation (and hence the z-axis ). To proceed
to the third step either press the next step button in the tool bar or press
the third button in the list of available steps You are here:
2.6.3
When you enter the third step the dialog looks like the following screenshot:
52
In this step you specify which calibration plate you are using. If you use a
calibration plate from LaVision it is enough to select the plate type labeled
on the plate e.g. Type ]10. This will set all plate parameters to the correct
values (see first screenshot above).
In case you want to use your own calibration plate you have to provide a number
of parameters (see second screenshot above): On the left side in Calibration
plate used you define the calibration type:
calibration plate contains marks in form of crosses or dots. Both black
marks on white background and white marks on black background are
supported and identified automatically.
calibration plate has only 1 plane = type 2D or is a two level plate =
type 3D.
On the right side in Calibration plate parameters you define several of its
parameters (dimension and sizes):
distance between neighbor marks in one plane in mm
53
2.6.4
When you enter the fourth step the dialog looks like either of the two following
screenshots depending on whether the Maximize button has been pressed or
not see images shown aside.
In the fourth step you acquire the necessary images of the calibration plate for
all cameras and all views - only then you are allowed to proceed to the next
steps.
54
For the image acquisition you can take a new image directly from the cameras
that are currently connected to your system. To do this press the Take image
or the Grab button in the dialog.
This takes one image (or in case of Grab continuously images until you press
the stop button in the toolbar or hit the ESC key) of the cameras that are
selected in the dialog for the specified view (check box on). For views that
already contain non empty images the selection box entries are marked with
(ok). If a camera contains valid images for all views the selection box for the
view selection becomes green. If all view entries of all coordinate systems are
green then the next step button will be enabled. Pressing the button with
the red cross will delete the camera image of the selected view.
In the general device interface GDI to its right (only visible in the minimized images, maximized dialog setting - see above) you can set up the exposure times, external trigger, (laser) light sources, step motor positions and
other hardware settings important to your image acquisition.
Changing the average value in the text box on the left to any other value than
1 will result in the averaging of the specified number of images to improve
image quality due to poor lighting conditions. Please make sure that neither
the camera nor the calibration sample is moving !
Another option is to import one or more previously recorded files from your
hard disk by pressing the Load button. You can either load single images or
whole (Davis) sets. This opens a modal dialog that shows a preview of the
image in question (see screenshot below).
Here you specify which of the image frames you want to import. For images
originating from Davis you can leave the check box that follows unchecked and
read out the default camera number that is stored in each image (and shown
for the current image). For imported bitmaps (.bmp or .tif files) you have
to specify to which camera the image corresponds. If want to overwrite the
55
stored camera number you can also specify another (wrong) camera number.
The selection box will turn red (instead of green) to warn you that the program
recognized a discrepancy - so you should really know what you are doing.
In case you want to load several images at once from an image set you need
to specify which images of a set you want to import (start and end image
number and an increment) and specify the start view to which the images are
added. If during the import more than one image for a camera is found it will
automatically add it to the next view. If all views hold valid camera images
the import stops automatically.
This is a the recommended way to import old calibration images from an old
calibration.set created by Davis 6.2 or Davis 7.0 into the new format.
To proceed to the fifth step either press the next step button in the tool bar
or press the fifth button in the list of available steps You are here:
2.6.5
When you enter the fifth step the dialog looks like the following screenshot:
In the fifth step you define three start marks for the mark search. To start the
process you can either
click All cameras/views which automatically will show you the images
for all camera / view combinations one after another to (re)define the
start marks for all those combination or
you press Shown camera/views to (re)define the start marks in the
currently visible image in the working window or
you press a table entry in the table to the right corresponding to a
camera / view combination to (re)define the start marks for that combination.
When you do any of this instructions will appear in the Instructions field of
the dialog to guide you to the clicking process. First you have to click a start
reference mark which must be the same physical mark in all cameras and all
56
views ! Then you are asked to click the neighbor mark to the right (to the
left if the camera is looking onto the backside of the calibration plate) and at
last the mark to the top of the first mark you selected. Important: please
make sure that the marks you select are located on the front plane of a 3D
calibration plate ! If you clicked all 3 marks successfully the table entry for
that camera/view combination will show an okay.
You may stop the clicking process any time pressing the Stop button in the
tool bar or by pressing the ESC key on your keyboard which will abort all
further actions.
If you have defined start marks successfully on all images (all table entries show
an okay) you may proceed to the next step. To proceed to the sixth step
either press the next step button in the tool bar or press the sixth button in
the list of available steps You are here:
2.6.6
When you enter the sixth step the dialog looks like the following screenshot:
In the sixth step you let the program find all other marks for you. This is
an automatic process and requires no user interaction. Just press the button
Start search. Depending on the image quality and the speed of your computer
this might require several minutes, but you should see a screen update once
in a while. Usually it is enough if 20-30 marks could be identified. Please be
aware that due to the nature of the dewarping functions for a polynomial fit
marks have to be found everywhere in the image where you want to derive
result later, for pinhole calibration it is enough if only parts of the image are
covered with found marks.
In case you are not satisfied with the mark search quality you can enhance the
search changing some parameters. First you should check if you selected the
correct calibration plate type (2D or 3D) and the correct mark type (crosses
or dots).
57
If you think that some marks have not been found that should not pose a
problem for the mark search process you can adapt the search parameters in
the dialog accessible by pressing the button Mark search parameter....
In this dialog (see screenshot above) you can choose in use preset values
your impression of the image quality and ask to find more or less marks with
the slider. On these assumptions the general search parameters are changed.
In advanced settings you might change these values one by one although
this is only advisable for expert users as there are many dependences among
some parameters.
If you think that too many marks have been found e.g. due to reflexes outside
the calibration plate you can eliminate them one by one pressing the button
Delete single mark where you can click iteratively on all marks that you
think should be deleted from the list of found marks (might take a while).
Just click repeatedly very close to the center of a found mark and wait to see
the mark disappear from the display. Then either go on clicking the next mark
or press the Space bar to end this procedure.
Another way to limit the mark search is to limit the search are in the first
place. You add a masked area by pressing the red or the blue button polygon
button of Limit search using a mask. In the Status text there are some
instructions how to proceed. You can click various times to define the angles
of a polygon. Pressing the key d deletes the last point(s) repeatedly, q aborts
the whole process and c closes the polygon and accepts the mask. Using the
blue button enables all pixels inside the polygon masking out all pixels outside,
the red polygon does it the other way round. With the button showing the red
cross you delete the mask from the current camera / view selection.
Please note that a mask is defined for the currently visible image only and that
you can use different masks for images of other camera / view combinations.
In the table to the right the number of marks found in each image is shown.
In case the calibration plate has 2 planes (3D plate) the number of marks for
each plane is shown separately with the plus sign (+). When marks have been
58
found in all images the next button is enabled and you may proceed to the
next step.
To proceed to the seventh step either press the next step
button in the tool bar or press the seventh button in the list of available steps
You are here:
2.6.7
When you enter the seventh step the dialog looks like the following screenshot:
In the seventh step you fit the dewarping mapping function to the marks
found in each image. You can select between pinhole calibration and polygon
calibration. Please note that in case you have more than one view and these
are not coplanar or equidistant the polynomial calibration is not available.
To start the calculation process press the button Start calibration. The
calibration process is automatic and requires no user interaction. The average
deviation of the dewarped mark positions to the ideal regular grid is shown in
the table to the right for each image. A value lower than 1 pixel is good, a value
lower than 0.3 pixel is excellent, Values higher than 2 pixel are questionable.
Please check if you clicked the front plane of a 3D calibration plate as this
is a common source of error. You can check the result of the fit in detail by
pressing the button Show fit parameter... which opens either of the two
following dialogs depending on the kind of mapping function you selected.
59
In both cases you can check the size of the corrected image and the RMS
of the fit.
In case of the polynomial you can check the coefficients of the mapping function.
In case of the pinhole model you can check the physical parameters that describe your model and compare them to the real world parameters of your
experiment: focal length of your camera lens, distance Tz from camera to calibration plate. Rotation Rx and Ry around X and Y axis indicating the
angle at which the cameras see the calibration plate. All those parameters
should coincide with your experimental setup fairly well. The first and second
radial distortion factors are the extra distortion that are produced by that term
at a distance of 500 pixel to the center of distortion. This center of distortion
is called the principle point as is located where the optical axis of the camera
lens meet the CCD chip of your camera if you use a Scheimpflug adapter
this might not be the center center of your CCD chip! The radial distortion
contribution is usually 1 pixel or below although this strongly depends on
the camera lens you use.
If you are not happy with the fit you can adapt some general parameters of
the fit by pressing the button Fit parameters (pinhole model fit only !). It
will open the following dialog:
Here you can select which parameters should be fitted and which are just set
to fixed (known) values. Switching to default fit will reset all parameters to
their standard values and should work for most purposes (fixing the principle
point to the center of the camera CCD chip and using squared pixels, fitting
60
the rest starting the fit with focal length of 50 mm and distance Tz of
500 mm).
If you are not happy with this preselection or if you are using a Scheimpflug
adapter (and the assumption that the principle point is at the center of the
CCD chip is not true) you should switch to expert fit. Here you specify for
all cameras used in that coordinate system if you want to fit the focal length
or use a fixed value. In the first case the value is used as a start value for the
fit: the closer you can guess the focal length the easier it will be for the fitting
algorithm.
Furthermore it will help the algorithm if you can provide the rough distance of
camera to calibration plate in mm along the viewing direction of the camera.
At last you specify if your cameras are using a Scheimpflug adapter on your
cameras.
If your cameras have non square pixels you can check that option , but this is
NEVER the case with the cameras LaVision provides and should be switched
on only if you imported images from other cameras. There is the rare case
where additional distortions looking through a glass window can be corrected
by switching on this option. If in doubt you may contact LaVision to advise
you. Usually additional distortions by the optical access to your experiment
strongly suggests to use the polynomial fit.
Then you may switch between various levels of radial distortions which will
switch on the fit of first and second order terms describing radial distortions.
If you have done the fit for all cameras (and coordinate systems) you may
proceed to the last step.
To proceed to the last step either press the next
step button in the tool bar or press the last button in the list of available steps
You are here:
2.6.8
When you enter the eighth step the dialog looks like the following screenshot:
In this last step you can evaluate visually your fit results. For that purpose all
camera / view combinations are dewarped - for 3D calibration plates even for
61
both z positions of the upper and the lower plane. Then also images are created
where the corrected images of all cameras and all views of a coordinate system
are overlayed (summed up) to see if indeed all corrected images coincide. In
addition a grid of the ideal regular grid of marks is overlayed. Here you can
check:
in single camera images if the marks fall to the ideal regular grid
if the marks in the summed up images of different cameras (and one
view) coincide for z=0 mm position
if the marks in the summed up images of different views for one camera
coincide for z=0 mm position
if the marks in the summed up images of all views for all camera coincide
for z=0 mm position
In case you use a 3D calibration plate you can check furthermore:
all of the above for the position of the second plane in case you use a 3D
calibration plate
in case you use more than one camera you can check by how much a
wrong z position will move the corrected images apart. In detail: correcting for the position of the upper plane (z=0) to make the marks of
the upper plane coincide will produce ghost images for the marks in the
lower plane (e.g. at z=1 mm) due to the perspective parallax. This gives
you a direct information of the 3D resolution of a stereoscopic system.
Lets say the ghost images are 6 pixel apart. Then the vector calculation
(which can resolve 0.05 pixel shifts on the CCD images) will detect a
true shift of 1 mm /6 pixel = x mm / 0.05 pixel x = ca. 8 m
in z-direction in this experiment. You can increase this resolution by
increasing the angular separation of your system.
Changing the selection boxed for camera, view and plane (if you have used a
3D calibration plate) shows the corresponding corrected images for evaluation.
The table Fit results to the right summarizes the most important fit parameter. For a more detailed overview of the fit result you can click the button
Show all fit parameter... which opens either of the two following dialogs
which are described in detail in the section above - so please refer to the descriptions in step 7.
62
2.6.9
Finish calibration
When you are content with the achieved calibration press the Finish button
in the tool bar (see image aside) to accept the calibration (image dewarping
function + pixel/mm scaling) which might then be written to your project.
The following dialog opens :
Select the first choice to open a new project with the new calibration
leaving the current project untouched.
Select the second option to overwrite the calibration of the currently active project - be aware that previously recorded images and their derived
results might not be consistent with results that will be calculated with
the new calibration.
Select the third choice to overwrite the calibration of the currently active project and scale all previous recordings present in the root level of
your project to be consistent with the new calibration - be aware that results that have been derived before the changed calibration might not be
consistent with results that will be calculated with the new calibration.
63
Select the fourth choice if you want to discard everything you have done in
the calibration wizard. Then the old calibration active when you entered
the calibration wizard will be restored. Note that you might have to do
the whole calibration procedure again.
The calibration wizard dialog will close and you return to the project manager.
64
2.7
2.7.1
To do this kind of calibration you should select the sixth option - see left
screenshot below.
To do this kind of calibration you should select the eight option - see left
screenshot below.
To proceed to the second step either press the next step button in the tool
bar or press the second button in the list of available steps You are here:
2.7.2
When you enter the second step the dialog looks like the following screenshot:
In this step you define your coordinate system and the number of views you
provide for your calibration plate in different places to calculate the image
dewarping function.
You have to do this for all coordinate systems. You change to set up another
coordinate system clicking on the card item labeled Coordinate system 1
to Coordinate system 6 depending on what coordinate systems are used.
All settings are made independently so you do not have to define them all the
same.
65
On the right side in Coordinate system axis orientation you select if you
want a right handed coordinate system (z-axis orientated toward you when
you look at the images) or a left handed coordinate system (z-axis pointing
away from you).
On the left side you specify the number of views you will provide for all cameras
defined in this coordinate system ! For the N th view you have to provide images
for all involved cameras of the calibration plate in the same position. So either
take images simultaneously later or make sure that the calibration plate will
not move while you take separate images for all cameras. Although in general
one view is enough to find a dewarping function to correct all distortions in
your camera images providing several views makes the result more accurate.
In any case the x yplane (and hence the z-axis ) is always defined by the
orientation of calibration plate of the first view.
In case you want to provide several views you have to specify if they are
coplanar (that is aligned in parallel among them) and if they are placed at
equidistant z- positions. Please be aware that some kind of mapping functions
require coplanar views. In case you have equidistant views you have to specify
the distance dz between two neighbor views.
Below you will find a table with the required and recommended number of
views for your experiment. Depending on the combination of the dewarping
mapping function type, your calibration plate type (2D or 3D) and the number
of mapped cameras in your coordinate system you have different limitations
and recommendations:
System type
Mapping model
for dewarping
Required
] of views
Recommended
] of views
polynomial
or pinhole
polynomial
or pinhole
camera
mapped
(stereo measurements
- e.g. 3D vectors)
polynomial
2 views must
be coplanar and
equidistant
camera
mapped
(stereo measurements
- e.g. 3D vectors)
pinhole model
2
(with
2D
plates views should
be coplanar and
equidistant
continued on next page
66
Limitations from your experiment might force you to make special choices:
You might be forced to use a 2D calibration plate because no 3D calibration plate is available (e.g. for a microscope).
Looking through a non planar glass window which adds non radial distortions to your images might force you to use polynomial mapping as
the pinhole model does not work well in those conditions.
Stereo measurements (e.g. Stereo PIV) require a calibration for more
than one plane. So you would need a pinhole calibration or a polynomial
calibration using either a 3D calibration plate or two coplanar views of
a 2D plate.
Volume measurements (e.g. StrainMaster 3D and SurfaceFlow) require
a calibration for more than just the z = 0 mm plane. So you either must
use the pinhole model that by handles the mapping for every point in
space to the CCD chips. Or you need a polynomial mapping for at least
two (coplanar) views at different z-positions better is using a higher
number of planes that cover the whole volume you want to measure.
the use of the self calibration wizard (available in PIV projects) requires
the pinhole calibration. For more details please refer to the corresponding
chapter about self calibration.
The measurement itself in most Davis packages implies that the sample is
located at the z = 0 mm position. If you cannot place the calibration plate at
that position you can perform the calibration in front or behind that position.
This can be done only for a pinhole calibration or for a polynomial calibration
with two or more coplanar views. To use this feature please check the option
first view not at origin and specify the z-position of the first view. The
calibration process will then take this offset into account. In any case the
coordinate system is set up so that the calibration plate position of the first
view defines the x y-plane orientation (and hence the z-axis ). To proceed
to the third step either press the next step button in the tool bar or press
the third button in the list of available steps You are here:
2.7.3
When you enter the third step the dialog looks like the following screenshot:
67
In this step you specify which calibration plate you are using. If you use a
calibration plate from LaVision it is enough to select the plate type labeled
on the plate e.g. Type ]10. This will set all plate parameters to the correct
values (see first screenshot above).
In case you want to use your own calibration plate you have to provide a number
of parameters (see second screenshot above): On the left side in Calibration
plate used you define the calibration type:
calibration plate contains marks in form of crosses or dots. Both black
marks on white background and white marks on black background are
supported and identified automatically.
calibration plate has only 1 plane = type 2D or is a two level plate =
type 3D.
On the right side in Calibration plate parameters you define several of its
parameters (dimension and sizes):
distance between neighbor marks in one plane in mm
68
2.7.4
When you enter the fourth step the dialog looks like either of the two following
screenshots depending on whether the Maximize button has been pressed or
not see images shown aside.
In the fourth step you acquire the necessary images of the calibration plate for
all cameras and all views - only then you are allowed to proceed to the next
steps.
69
For the image acquisition you can take a new image directly from the cameras
that are currently connected to your system. To do this press the Take image
or the Grab button in the dialog.
This takes one image (or in case of Grab continuously images until you press
the stop button in the toolbar or hit the ESC key) of the cameras that are
selected in the dialog for the specified view (check box on). For views that
already contain non empty images the selection box entries are marked with
(ok). If a camera contains valid images for all views the selection box for the
view selection becomes green. If all view entries of all coordinate systems are
green then the next step button will be enabled. Pressing the button with
the red cross will delete the camera image of the selected view.
In the general device interface GDI to its right (only visible in the minimized images, maximized dialog setting - see above) you can set up the exposure times, external trigger, (laser) light sources, step motor positions and
other hardware settings important to your image acquisition.
Changing the average value in the text box on the left to any other value than
1 will result in the averaging of the specified number of images to improve
image quality due to poor lighting conditions. Please make sure that neither
the camera nor the calibration sample is moving !
Another option is to import one or more previously recorded files from your
hard disk by pressing the Load button. You can either load single images or
whole (Davis) sets. This opens a modal dialog that shows a preview of the
image in question (see screenshot below).
Here you specify which of the image frames you want to import. For images
originating from Davis you can leave the check box that follows unchecked and
read out the default camera number that is stored in each image (and shown
for the current image). For imported bitmaps (.bmp or .tif files) you have
to specify to which camera the image corresponds. If want to overwrite the
70
stored camera number you can also specify another (wrong) camera number.
The selection box will turn red (instead of green) to warn you that the program
recognized a discrepancy - so you should really know what you are doing.
In case you want to load several images at once from an image set you need
to specify which images of a set you want to import (start and end image
number and an increment) and specify the start view to which the images are
added. If during the import more than one image for a camera is found it will
automatically add it to the next view. If all views hold valid camera images
the import stops automatically.
This is a the recommended way to import old calibration images from an old
calibration.set created by Davis 6.2 or Davis 7.0 into the new format.
To proceed to the fifth step either press the next step button in the tool bar
or press the fifth button in the list of available steps You are here:
2.7.5
When you enter the fifth step the dialog looks like the following screenshot:
In the fifth step you define three start marks for the mark search. To start the
process you can either
click All cameras/views which automatically will show you the images
for all camera / view combinations one after another to (re)define the
start marks for all those combination or
you press Shown camera/views to (re)define the start marks in the
currently visible image in the working window or
you press a table entry in the table to the right corresponding to a
camera / view combination to (re)define the start marks for that combination.
When you do any of this instructions will appear in the Instructions field of
the dialog to guide you to the clicking process. First you have to click a start
reference mark which must be the same physical mark in all cameras and all
71
views ! Then you are asked to click the neighbor mark to the right (to the
left if the camera is looking onto the backside of the calibration plate) and at
last the mark to the top of the first mark you selected. Important: please
make sure that the marks you select are located on the front plane of a 3D
calibration plate ! If you clicked all 3 marks successfully the table entry for
that camera/view combination will show an okay.
You may stop the clicking process any time pressing the Stop button in the
tool bar or by pressing the ESC key on your keyboard which will abort all
further actions.
If you have defined start marks successfully on all images (all table entries show
an okay) you may proceed to the next step. To proceed to the sixth step
either press the next step button in the tool bar or press the sixth button in
the list of available steps You are here:
2.7.6
When you enter the sixth step the dialog looks like the following screenshot:
In the sixth step you let the program find all other marks for you. This is
an automatic process and requires no user interaction. Just press the button
Start search. Depending on the image quality and the speed of your computer
this might require several minutes, but you should see a screen update once
in a while. Usually it is enough if 20-30 marks could be identified. Please be
aware that due to the nature of the dewarping functions for a polynomial fit
marks have to be found everywhere in the image where you want to derive
result later, for pinhole calibration it is enough if only parts of the image are
covered with found marks.
In case you are not satisfied with the mark search quality you can enhance the
search changing some parameters. First you should check if you selected the
correct calibration plate type (2D or 3D) and the correct mark type (crosses
or dots).
72
If you think that some marks have not been found that should not pose a
problem for the mark search process you can adapt the search parameters in
the dialog accessible by pressing the button Mark search parameter....
In this dialog (see screenshot above) you can choose in use preset values
your impression of the image quality and ask to find more or less marks with
the slider. On these assumptions the general search parameters are changed.
In advanced settings you might change these values one by one although
this is only advisable for expert users as there are many dependences among
some parameters.
If you think that too many marks have been found e.g. due to reflexes outside
the calibration plate you can eliminate them one by one pressing the button
Delete single mark where you can click iteratively on all marks that you
think should be deleted from the list of found marks (might take a while).
Just click repeatedly very close to the center of a found mark and wait to see
the mark disappear from the display. Then either go on clicking the next mark
or press the Space bar to end this procedure.
Another way to limit the mark search is to limit the search are in the first
place. You add a masked area by pressing the red or the blue button polygon
button of Limit search using a mask. In the Status text there are some
instructions how to proceed. You can click various times to define the angles
of a polygon. Pressing the key d deletes the last point(s) repeatedly, q aborts
the whole process and c closes the polygon and accepts the mask. Using the
blue button enables all pixels inside the polygon masking out all pixels outside,
the red polygon does it the other way round. With the button showing the red
cross you delete the mask from the current camera / view selection.
Please note that a mask is defined for the currently visible image only and that
you can use different masks for images of other camera / view combinations.
In the table to the right the number of marks found in each image is shown.
In case the calibration plate has 2 planes (3D plate) the number of marks for
each plane is shown separately with the plus sign (+). When marks have been
73
found in all images the next button is enabled and you may proceed to the
next step.
To proceed to the seventh step either press the next step
button in the tool bar or press the seventh button in the list of available steps
You are here:
2.7.7
When you enter the seventh step the dialog looks like the following screenshot:
In the seventh step you fit the dewarping mapping function to the marks
found in each image. You can select between pinhole calibration and polygon
calibration. Please note that in case you have more than one view and these
are not coplanar or equidistant the polynomial calibration is not available.
To start the calculation process press the button Start calibration. The
calibration process is automatic and requires no user interaction. The average
deviation of the dewarped mark positions to the ideal regular grid is shown in
the table to the right for each image. A value lower than 1 pixel is good, a value
lower than 0.3 pixel is excellent, Values higher than 2 pixel are questionable.
Please check if you clicked the front plane of a 3D calibration plate as this
is a common source of error. You can check the result of the fit in detail by
pressing the button Show fit parameter... which opens either of the two
following dialogs depending on the kind of mapping function you selected.
74
In both cases you can check the size of the corrected image and the RMS
of the fit.
In case of the polynomial you can check the coefficients of the mapping function.
In case of the pinhole model you can check the physical parameters that describe your model and compare them to the real world parameters of your
experiment: focal length of your camera lens, distance Tz from camera to calibration plate. Rotation Rx and Ry around X and Y axis indicating the
angle at which the cameras see the calibration plate. All those parameters
should coincide with your experimental setup fairly well. The first and second
radial distortion factors are the extra distortion that are produced by that term
at a distance of 500 pixel to the center of distortion. This center of distortion
is called the principle point as is located where the optical axis of the camera
lens meet the CCD chip of your camera if you use a Scheimpflug adapter
this might not be the center center of your CCD chip! The radial distortion
contribution is usually 1 pixel or below although this strongly depends on
the camera lens you use.
If you are not happy with the fit you can adapt some general parameters of
the fit by pressing the button Fit parameters (pinhole model fit only !). It
will open the following dialog:
Here you can select which parameters should be fitted and which are just set
to fixed (known) values. Switching to default fit will reset all parameters to
their standard values and should work for most purposes (fixing the principle
point to the center of the camera CCD chip and using squared pixels, fitting
75
the rest starting the fit with focal length of 50 mm and distance Tz of
500 mm).
If you are not happy with this preselection or if you are using a Scheimpflug
adapter (and the assumption that the principle point is at the center of the
CCD chip is not true) you should switch to expert fit. Here you specify for
all cameras used in that coordinate system if you want to fit the focal length
or use a fixed value. In the first case the value is used as a start value for the
fit: the closer you can guess the focal length the easier it will be for the fitting
algorithm.
Furthermore it will help the algorithm if you can provide the rough distance of
camera to calibration plate in mm along the viewing direction of the camera.
At last you specify if your cameras are using a Scheimpflug adapter on your
cameras.
If your cameras have non square pixels you can check that option , but this is
NEVER the case with the cameras LaVision provides and should be switched
on only if you imported images from other cameras. There is the rare case
where additional distortions looking through a glass window can be corrected
by switching on this option. If in doubt you may contact LaVision to advise
you. Usually additional distortions by the optical access to your experiment
strongly suggests to use the polynomial fit.
Then you may switch between various levels of radial distortions which will
switch on the fit of first and second order terms describing radial distortions.
If you have done the fit for all cameras (and coordinate systems) you may
proceed to the last step.
To proceed to the last step either press the next
step button in the tool bar or press the last button in the list of available steps
You are here:
2.7.8
When you enter the eighth step the dialog looks like the following screenshot:
In this last step you can evaluate visually your fit results. For that purpose all
camera / view combinations are dewarped - for 3D calibration plates even for
76
both z positions of the upper and the lower plane. Then also images are created
where the corrected images of all cameras and all views of a coordinate system
are overlayed (summed up) to see if indeed all corrected images coincide. In
addition a grid of the ideal regular grid of marks is overlayed. Here you can
check:
in single camera images if the marks fall to the ideal regular grid
if the marks in the summed up images of different cameras (and one
view) coincide for z=0 mm position
if the marks in the summed up images of different views for one camera
coincide for z=0 mm position
if the marks in the summed up images of all views for all camera coincide
for z=0 mm position
In case you use a 3D calibration plate you can check furthermore:
all of the above for the position of the second plane in case you use a 3D
calibration plate
in case you use more than one camera you can check by how much a
wrong z position will move the corrected images apart. In detail: correcting for the position of the upper plane (z=0) to make the marks of
the upper plane coincide will produce ghost images for the marks in the
lower plane (e.g. at z=1 mm) due to the perspective parallax. This gives
you a direct information of the 3D resolution of a stereoscopic system.
Lets say the ghost images are 6 pixel apart. Then the vector calculation
(which can resolve 0.05 pixel shifts on the CCD images) will detect a
true shift of 1 mm /6 pixel = x mm / 0.05 pixel x = ca. 8 m
in z-direction in this experiment. You can increase this resolution by
increasing the angular separation of your system.
Changing the selection boxed for camera, view and plane (if you have used a
3D calibration plate) shows the corresponding corrected images for evaluation.
The table Fit results to the right summarizes the most important fit parameter. For a more detailed overview of the fit result you can click the button
Show all fit parameter... which opens either of the two following dialogs
which are described in detail in the section above - so please refer to the descriptions in step 7.
77
2.7.9
Finish calibration
When you are content with the achieved calibration press the Finish button
in the tool bar (see image aside) to accept the calibration (image dewarping
function + pixel/mm scaling) which might then be written to your project.
The following dialog opens :
Select the first choice to open a new project with the new calibration
leaving the current project untouched.
Select the second option to overwrite the calibration of the currently active project - be aware that previously recorded images and their derived
results might not be consistent with results that will be calculated with
the new calibration.
Select the third choice to overwrite the calibration of the currently active project and scale all previous recordings present in the root level of
your project to be consistent with the new calibration - be aware that results that have been derived before the changed calibration might not be
consistent with results that will be calculated with the new calibration.
78
Select the fourth choice if you want to discard everything you have done in
the calibration wizard. Then the old calibration active when you entered
the calibration wizard will be restored. Note that you might have to do
the whole calibration procedure again.
The calibration wizard dialog will close and you return to the project manager.
79
2.8
2.8.1
To do this kind of calibration you should select the first option - see left screenshot below.
The list of available step then indicates that the total calibration process consists of two steps - see right screenshot below:
To proceed to the second step either press the next step button in the tool
bar or press the second button in the list of available steps You are here:
2.8.2
When you enter the second step the dialog looks like either of the two following
screenshots depending on whether the Maximize button has been pressed or
not see images shown aside.
80
Once you have done a calibration to calculate a dewarping function you may
want to change the origin of the coordinate axis while maintaining the image
dewarping itself. You can do this here.
For the image acquisition you can take a new image directly from the cameras
that are currently connected to your system. To do this press the Take image
or the Grab button in the dialog.
This takes one image of the cameras that are selected in the general device
interface GDI to its right (only visible in the minimized images, maximized
dialog setting - see above). In the GDI you also set up the exposure times,
external trigger, (laser) light sources, step motor positions and other hardware
settings important to your image acquisition.
Changing the average value in the text box on the left to any other value than
1 will result in the averaging of the specified number of images to improve
image quality due to poor lighting conditions. Please make sure that neither
the camera nor the calibration sample is moving !
If you have acquired the images of all cameras for which you want to change
the origin you can proceed to the Action group of buttons: Pressing one of the
five buttons on the right sets the origin on the corrected images to the center
or one of the corners. Pressing one of the user defined buttons lets you select
any pixel with a mouse click into the image or by entering a specific location
manually. In that case the following dialog appears:
81
If you chose one of the 7 ways to change the origin a dialog might appear asking
you if you want to take over the changed origin for other cameras in the coordinate system. Usually you want to do this (e.g. stereoscopic measurements)
as the measurement takes place in a common coordinate system. only in the
case where you first mapped the cameras into a common coordinate system
but looking at different places you might want to define the origin separately
to be able to stitch the images together later using that scale information.
Press YES to take over the origin to all other cameras (if there are any), NO
if you do not want to do this and STOP if you want to abort this action and
do not change the origin for no camera image at all.
2.8.3
Finish calibration
When you are content with the achieved calibration press the Finish button
in the tool bar (see image aside) to accept the calibration (image dewarping
function + pixel/mm scaling) which might then be written to your project.
The following dialog opens :
82
Select the first choice to open a new project with the new calibration
leaving the current project untouched.
Select the second option to overwrite the calibration of the currently active project - be aware that previously recorded images and their derived
results might not be consistent with results that will be calculated with
the new calibration.
Select the third choice to overwrite the calibration of the currently active project and scale all previous recordings present in the root level of
your project to be consistent with the new calibration - be aware that results that have been derived before the changed calibration might not be
consistent with results that will be calculated with the new calibration.
Select the fourth choice if you want to discard everything you have done in
the calibration wizard. Then the old calibration active when you entered
the calibration wizard will be restored. Note that you might have to do
the whole calibration procedure again.
The calibration wizard dialog will close and you return to the project manager.
83
2.9
2.9.1
If you plan to stitch images or vector fields make sure that the images of both
cameras have an overlapping of at least 10% of the image area and the zoom
factors are almost the same (see sketch below). It is not necessary that the
cameras look from a perpendicular direction to the experiment, although it
helps to keep the interpoaltion errors small (smoothing effect on the images).
Refer to the following setup. It is important though that you use a continuous
calibration plate that covers the area of both images. You can NOT use two
different calibration plates that you arrange side by side in front of the cameras.
2.9.2
Calibration
To apply image or vector field stitching it is important to do a proper calibration. You choose the calibration 2 mapped cameras (e.g. stereo) (please
refer to he chapter 2.6). In step 5 you have to click the cross which are almost at the same apparent location in the camera images taken with camera
1 and 2 (e.g. the mark in the center of the image), as if the cameras were
looking at the same place of the calibration plate (like in a stereo system) - do
NOT choose the physically identical cross in the overlapping area ! Proceed
as indicated in chapter 2.6 and Finish the last step.
Now you reenter the dialog and choose the calibration define origin - maintain calibration and select the cross you first clicked in camera image 2 and
now specify its real coordinate (which is not 0,0 but maybe 200,0 if 200mm to
the right of the first physical cross you clicked in camera 1). Please refer to the
setup of the previous section. Proceed as indicated in chapter 2.8 and Finish
the last step.
84
Now you have successfully done the calibration necessary to stitch images or
vector fields.
2.9.3
Stitching images
To stich images select the set with a series of double frame images and apply
the image correction (raw->world) batch processing operation in the image mapping group. This takes out the image distortion due to perspective
distortion and camera lense errors of each camera
Then apply the shift and intensity correction batch processing operation
in the time series group which stitches the images together. In the card
General Parameter deselect all options but shift correction and go to the
card Shift and rotation correction. In this card you define a common point
in both images to help the computer find the shift automatically. You might
want to use a subpixel shift which enters another image interpolation of camera
image 2 but does not has stair artefact in the boundary region. Or deselect
the subpixel option which just copies the camera image 2 to the side of camera
image 1 to the best integral pixel shift without entering any further smoothing
artefacts. If cameras are fixed you should use the Calculate shift = relative
to first image.
Then if you want to make furhter evaluations (e.g. vector calculation) keep in
mind that the images have been already corrected so switch off any "use iamge
correction" switches if available.
2.9.4
As the vector field calculation implies image interpolation in the multi pass
process, stitching images is a bad idea as the information is degrading by
subsequent sinterpolations. To avoid additional interpolation you should interpolate vector fields instead. The recommended procedure is the following:
Do NOT do image stitching, but select sequential cross correlation mode
frame 0-1, 2-3 this time switching on the "use image correction". This implies
a vector calculation of multi pass window deformation and image correction
interpolation in one step, so the iamge quality is maintained. ! The result of
this operation is a series of doulbe frame vector fields corresponding to camera
1 and 2.
On these results apply the merge vector function in the vector mapping
group which has no parameters to set. The result is a stitched vector field
where in the overlapping region the vectors are interpolated to give a smooth
transition.
85
2.10
Troubleshooting
Step 4
The go to next step
button is not enabled
Camera
dark.
are
images
Step 5
The go to next step
button is not enabled
86
2.10 Troubleshooting
Step 6
The go to next step
button is not enabled
Step 7
The go to next step
button is not enabled
87
Step 8
88
This is the case if the RMS of the fit is too high. Please
see troubleshooting tips for step 7.
3 Imaging Tools
3.1
Mask Definition
A mask is used for specifying an arbitrary region in the image where something
should be computed. A mask buffer may be an image or a vector field. In both
cases only then a pixel or a vector is accepted or computed, if the value in the
mask buffer is non-zero at the corresponding position.
In some projects it is possible to pass any displayed image to the mask dialog
by selection of the send to mask dialog entry in the send to submenu of
the context (accessable with a click of the right mouse button in the displayed
image). If a vector file is passed via send to first the vector length will be
extracted and the resulting scalar field passed to the mask dialog.
3 Imaging Tools
image button on the upper right of the dialog. The display parameters can
be easily changed after pressing the right mouse button in the image window
and selecting Display Properties in the context menu.
There are three possible operation modes to create a mask:
load fixed mask from file simply loads a previously calculated mask
from a file. The mask can be loaded pressing the Load button
user defined mask allows to define the masked area with geometrical
elements (rectangle, circle, ellipse, polygon) In this mode the user can
create a number of objects by mouse and then use either the inside of a
single object or the outside as valid region. The intersection of all these
masked areas is defines the final masked area.
create algorithmic mask with operation pipeline taking the current image and use digital filters on it. After all operations had been
applied all the pixels with a value of 0 counts are masked out. A typical
procedure would be to smooth the image sufficiently before subtracting
a threshold, which sets all unwanted regions to zero. This can be done
easiliy using the dialog described further down in figure 3.3
create user defined + algorithmic mask first the geometrical mask
is applied to reduce the masked area to a certain region then on the
remaining pixels further pixels can be sorted out using tha algoritmic
operation pipeline.
When finishing the mask creation, the current mask can be save current
mask to file as fixed mask into a file and reloaded at the next program
start. Additionally the current dialog settings of the dialog can be stored or
loaded by the buttons near dialog settings on the upper right and reloaded
e.g. to retrieve good settings for the algorithmic operation pipeline.
Figure 3.2: Parameter settings for user defined mask in the Mask
dialog.
90
To create a user defined mask you may add new elements to refine your mask
by pressing first one of the blue or red buttons representing the graphical
elements rectangle, circle, ellipse and polygon and then click into the (left)
image displayed to define the object. For a rectangle two opposite angles are
be given. For circle / ellipse the center position and the radius are defined. For
a polygon any number of points can be added. Pressing "c" closes the polygon
and ends the point adding. "d" deletes the last entry and "q" quits the entry
and discards the polygon.
Pressing the buttons Clear last item (of X) deletes the last defined objects
in the list of X itmes (may be pressed several times to undo all changes) and
Clear all items clear the whole list to start all over again with an empty list.
The text next to it informs on the number of objects defined so far.
To create a mask in algorithmic mode a number of different operations can
be selected in the list on the right. Press button Recalculate now to use the
image on the left side as source for the calculation and display the new mask
on the right side.
3 Imaging Tools
3.2
Overlay Editor
Overlays are user defined painting structures (lines, polygons, ellipses, texts),
which are connected to buffers or cameras and automatically painted above the
2D-image display of a buffer. The overlay display can be enabled or disabled
in the Data and Display Attributes dialog (see page ??). For information about programming overlays with CL macros please read the Command
Language manual.
Overlays are connected to a buffer as buffer attributes, and they are stored
together with the buffers raw data in file types IM7, IMG, IMX, VEC and VC7.
93
3 Imaging Tools
The Overlay Editor dialog of figure 3.4 can be opened from the batch processing function add overlay in group attributes and from the Buffer menu
in DaVis Classic.
Each object parameter can be changed manually after definition: the name,
pencolor and fillcolor, the penwidth and the positions. With the Set button
each position can be redefined by a mouse click in the buffer view. For a text
object the text itself and some style settings are available.
By default each object is visible and painted on screen. If the mode is disabled,
the object is not painted but available for a later enabling without deleting and
recreating the parameters.
With the file items in the lower left part of the dialog, open file and save
file, the active overlay can be stored or reloaded. This is an easy way to save
an overlay and later use it again in the same or another buffer.
The overlay can be exported to the mask buffer, either the active overlay
or the complete buffer overlay. During the export the intensity values of the
pixels inside the objects and outside of all objects can be defined. Also the
export can be done to another buffer or even to a camera: Each camera can
use an individual overlay definiton, which is copied into the buffer at the end
of image acquisition automatically.
Press the Back button in the toolbar to return to the last dialog or to the
DaVis screen in Classic mode.
3.3
This wizard allows to adapt existing color lookup palettes by adding extra
color entries at specific positions to produce the effect of equipotential lines in
a scalar field.
The dialog is opend via the Window menu entry set palette adapt
existing palette, which can be reached from any dialog at any time.
When you select this entry a dialog will open that looks like this:
3 Imaging Tools
palettes. Furthermore you can undo all changes before leaving the dialog.
Anyway all palettes are restored to their original state when restarting Davis.
In the dialog you select the following parameters:
Source palette is the palette used as basis for the adaptation. You can
either change the palette number in the text box directly or press the
button ... to select the palette from the palette selection window (see
following screenshot).
Destination palette is the palette that will be overwritten by the source
palette colors plus some extra color entries. Again you can either change
the palette number in the text box manually or press the button ...
to select the palette from the palette selection window (see following
screenshot).
min: / max: is the minimum and maximum (arbitrary) range of the
intensity to color mapping you set in your scalar field. Relative to this
mapping the extra color entries are placed inside the adapted palette to
reflect the specified intensities.
Additional color entries: adds up to 10 extra color entries with the
specified colors at the position of the specified intensity values. Only the
intensity levels of the the selected check boxes are added to the palette.
On the right you see an online preview of the palette.
... : pressing this button opens the color selection dialog (see following
screenshot) to choose a new color for this intensity level.
Restore all original palettes (but current) undo all changes to the
state before you entered the dialog, but let you continue to work on the
current palette.
Restore all original palettes and close dialog undo all changes to
the state before you entered the dialog (including the current destination
palette) and closes the dialog.
Take over changes in current palette Takes over the current destination palette (only) to the list of color lookup palettes in Davis. You
can now continue to work on further palettes adapting iteratively several
palettes in a row e.g. for different min/max values.
Take over all changes and close dialog Takes over the current destination palette (and all others you changed) to the list of color lookup
palettes in Davis and leaves the dialog.
96
In the following screenshot you see the dialog to select a new source or destination palette number with a preview of what they look like (before you make
the selection). Just press the button with number of the palette you want to
select above the palette or the close button X in the upper right corner of the
window to leave the dialog without changing the palette number:
3.4
The dialog is used to check the image dewarping function on images as well as
the effect of the vector preshift used in the vector multi pass calculations.
The Image Reconstruction dialog can be reached clicking on an image window with the right mouse button and selecting send to->image correction
and distortion.
97
3 Imaging Tools
The dialog that now opens should look similar to this: (in this example a
calibration plate image is shown to illustrate the dewarping):
The left image holds the source image you started the dialog with the right
image window will hold the result of the correction. If you select the parameters
as shown in the screenshot above and you press Apply correction you should
see something like the following result (which might differ in your experiment
due to the currently active calibration):
You can clearly see that all distortions due to the perspective distortion as
wellas camera lens errors are taken out, placing the crosses on a regular grid.
98
You can do this for the standard case of z = 0 mm height or for any other fixed
height above the calibration plate position of view 1 used in the calibration
process. Alternatively you can provide a height map holding the z-position for
each pixel (as used in the StrainMaster 3D or SurfaceFlow package).
Of course you can do it the other way round providing a corrected image and
distorting it by pressing the button Apply distortion:
Both source and result images can be saved and loaded pressing the corresponding load and save button.
In the dewarping process a bilinear interpolation is used to access image information at subpixel positions. You can select Whittaker reconstruction with
the specified filter length (e.g. 7 pixels) which is significantly slower but might
provide sharper images.
3 Imaging Tools
With this you can check if the vector results of your vector calculation really
describe well the shifts of the image: If two frames are present for a camera
you might select further if you want to apply the whole shift to the second
frame only (as recommended in time series images) or distribute the half of
the vector shift evenly to both frames (with opposite sign as recommended for
double frame images).
When you switch between frames the patterns of both frames should match
exactly now. If there are still shifts present in the corrected image it indicates
that hte vector field still does not describe the shifts in those regions well
enough. Yu should try using more (multi pass) iterations and/or a finer grid.
For vector calculations where image correction has been used you can combine
both use image correction and use vector buffer of course.
Last but nor least yo can choose to correct / distort only frames for a specific
camera or all frames for which CameraNameX buffer attributes exist (auto
mode = recommended).
100
3.5
X/Y Plot
The X/Y Plot dialog can be reached using the X/Y Plot button in the
Project Manager. The dialog can be used to create a user defined x/y plot of
a vector dataset.
The dialog is subdivided into a right part with the views of the source and
result and a left part with the window manager and the x/y plot parameter.
3.5.1
Window Manager
In the top left corner you find the Window Manager that may be used for
image display configuration of the right part of the dialog. A suitable array
of images (vertical horizontal) may be selected using the Layout textbox
within the range 1 1 up to 2 2. The following types can be displayed:
Source: The selected vector dataset which is used to create the x/y plot.
X/Y Plot: The resulting x/y plot.
3.5.2
Plot mode
Before selecting the data for the x- and y-axis the user has to choose a Plot
mode.
101
3 Imaging Tools
x value / y value (1 profile): This mode gets from each source vector
field 1 data point (the selected x and y value) to create one profile with
n (number of vector fields) data points.
x line / y line (n profiles): This mode gets from each source vector
field 1 profile (the selected x data line over the y data line) to create one
plot with n (number of vector fields) profiles.
Note: Depending on the selected Plot mode the dialog supports different
groups/functions for the y- and x-axis.
102
3.5.3
Y - axis
Here you can select the data source for the y-axis. You can choose between a
scalar field operation (all available scalar field operations which are described
in the Batch Processing chapter) and device data which are used to store
additional data like analog values from a A/D converter.
extract scalar field: ...: Choose the group and function of the data
you want to use for the y axis. Depending on the Plot mode you have
different possibilities for the Data range: In the x value / y value
mode you can choose between the average value of the whole vector field
or the average of a user defined rectangle which can be set with the Rect
button. The x line / y line mode expects a data line with n (>1) values.
For this you can choose between:
device data: Choose one of the available device data you want to use
for the y-axis. If the Device data box shows - no device data - there
are no data in the current source dataset. In the x value / y value
mode the operation extracts the average of the selected device data for
each vector field. In the x line / y line mode the operation gets the
complete device data line.
103
3 Imaging Tools
3.5.4
X - axis
Here you can select the data for the x-axis. Depending on the selected Plot
mode and the data for the y-axis you can choose between one or several of
the following groups:
extract scalar field: ...: Choose the group and function of the data
you want to use for the x-axis. If you choose extract scalar field... for
the y- and x-axis both axis are using the data range of the y-axis.
device data: Choose one of the available device data you want to use
for the x-axis. If the Device data box shows - no device data - there
are no data in the current source dataset. In the x value / y value
mode the operation extracts the average of the selected device data for
each vector field. In the x line / y line mode the operation gets the
complete device data line.
file number: Uses the file number of each source file for the x-axis (only
available for x value / y value mode).
time: Extracts from each source file the stored acquisition time (only
available for x value / y value mode).
values along line: This option is only for the x line / y line mode
available.
3.5.5
Store mode
The Store mode determines if and how the resulting X/Y Plot is stored:
off: The result is not stored in the current project (but temporary on
your harddisk).
default: The result is stored in the current project with a default name
in the subfolder of the source dataset.
specify: The result is stored in the current project with the specified
name in the subfolder of the source dataset.
104
3.5.6
Processing
The Start Processing button creates the X/Y Plot using the selected file
range (Source groupbox), the Plot mode, Y-axis and X-axis parameter.
The result is automatically shown in the right part of the dialog.
3.6
Strain Gauge
The Strain Gauge dialog can be reached clicking in the project manager on a
vector field set with right mouse button and selecting the Strain Gauge entry
in the context menu that appears or by pressing the Strain Gauge button in
the toolbar of the project manager (see image shown aside):
The dialog that now opens should look similar to this:
The dialog is used to simulate a virtual strain gauge device attached to any
two points you select on the sample and record the strain development over
time. Alternatively you can extract the local strain (Exx or Eyy ) at a point or
averaged over a rectangular region. Simultaneously the analog signal can be
plotted (usually the force applied by the pulling machine) to compare cause
and effect of the applied force on the sample.
On the top of the dialog next to the displayed images the group Window
Manager allows you to change the number of visible windows as well as to
change the contents of the currently active window (examples are shown further
down).
Below that group another group labeled Settings allows you to define which
values should be extracted and to let you choose how they are calculated.
105
3 Imaging Tools
At the dialog bottom in the Actions group the calculation of the profile results
can be started or any previously calculated profiles deleted from the images.
Furthermore you have an easy access to the export of all profiles as ASCII text
files or a summary table of all magnitudes as ASCII text file.
In the group Analog data choice the analog channel can be selected from
which the data should be extracted. Depending in on the acquisition rate of
the stored analog signal and the camera images there might be a more than
one analog value per image. This raw value trace is plotted as (raw) force
profile. To suppress thermal noise of the analog signal you can filter it first
using a gaussian filter function before extracting the analog value at the time
of image acquisition. The only parameter is the filter length describing the
width of the gaussian curve. This value influences the weight of the neighbor
values Ai (at a temporal distance dt that are included to calculate the filtered
value A(t) at time t.
An (t) = 1/n
+n
X
Ai (t + dt i)
i=n
If the analog signal is noisy, the filtered signal represents a more accurate value
for the force at time t. You can select if you want to use either the (linearly
interpolated) raw force at time t for the strain/force plot or these filtered values
as displayed in green in the (raw) force plot at the bottom of the dialog. Please
refer to the following screenshot:
106
Settings
Here the basic settings how to extract strain values and which units should be
used are selected. The first choice you make is the Extraction mode which
is one of the following:
strain gauge line
Eyy point
Exx point
Eyy area
Exx area
Choosing the first option allows to follow two points on the probe (virtual
extensometer) and calculate the global strain, The next two options calculate
the local strain Exx or Eyy at one ore more specific points only, Choosing the
last two options extract the average local strain Exx or Eyy inside a rectangular
area to improve the signal to noise ratio.
Directly below you find the button labeled Select line, Select point or Select
area depending on the chosen extraction mode. Clicking it the first image of
the recording is shown to select
either two point of a line on the sample that should be followed
or up to ten points on the sample that should be followed. Please stop
the clicking by pressing the SPACE key
or the corner points of a rectangular region on the sample where the
corresponding strain value should be calculated.
Clicking e.g. on the button Select line: you can set two arbitrary points of
your virtual strain gauge on the sample that are followed over time to extract
the profiles. After you have clicked the button the first image of your series
(in most experiments this is the sample at rest) is automatically shown in the
upper left window. Then you select two points by clicking with the left mouse
button on two locations of your sample.
Then you can select the formula that is used to calculate strain. This is:
ELL (t) =
dL(t)
Lo
dL(t)Lo
Lo
( engineering strain )
3 Imaging Tools
If you are happy with the results and want to save the results permanently to
the project press Save results to project. You are asked to provide a name
for the result set. Just press OK if you want to use the default name which
contains the date and time stamp to provide a unique name.
To delete all previously calculated results in the windows press the corresponding button Delete profiles. If you do not delete them the shown overlay will
stay with the images even if you leave the dialog to allow the export with the
Davis Export dialog together with other samples (or the same sample but
other display settings). For further details how to do this please refer to the
chapter about the Export dialog.
109
3 Imaging Tools
Pressing the button in the group Export profiles let you save the profile
or the table selected in the selection box underneath to a text file (*.PRM)
for further evaluation with other programs (for example with a spread sheet
program like Excel). The PRM files contain a header describing the magnitude
and unit for each column then a list of all values is given seperated by blank
space and new lines.
When you are finished press the Close button in the toolbar. Then you will
come back to the project manager.
110
Filter Operations
Filter operations play an important role in image processing. They are used for
smoothing, edge detection, texture or contrast enhancement, and many other
special tasks. There are numbers of filters, especially the NxN-filters, which
only operate on the close neighborhood of a pixel. On the other hand, the filter
operations done using the fourier transform are nonlocalized and operate on
frequencies, i.e. structures like sharp edges are analysed in the realm of their
frequency representation.
The FFT-filter are described in an extra chapter. In this chapter the linear
and non-linear neighborhood filters are described.
Among them the most often used ones are the ones, which calculate the new
value of a pixel from a linear combination of the surrounding 8 pixel values and
the value of the center pixel itself. Mathematically this can be represented as
a 3x3-matrix, which is sort of moved over the image to calculate a new center
pixel each time it is applied to a 3x3 area:
0 =
fi,j
b2 fi,j
b3 fi+1,j /divisor
b1 fi1,j
c1 fi1,j+1 c2 fi,j+1 c3 fi+1,j+1
where
a1 a2 a3
b1 b2 b3 /divisor
c1 c2 c3
is the filter matrix. divisor is the final division factor of the sum. Only if
divisor is the sum over the filter matrix elements, the average image intensity
stays the same. For example, if all of the filter elements are 1 (=smoothing)
then divisor is set to 9 in order not to change the average image intensity.
4.2
Smoothing Filter
Smoothing filters are used to eliminate high frequency noise by taking an average over the neighborhood of a pixel.
111
4.2.1
Smoothing 3x3
1 1 1
1 1 1 /9
1 1 1
This is the simplest smoothing filter and it works well. Function smoothing k
x k is the same matrix, but using up to 99 pixels. Of course, any smoothing
filter will also smooth-out any sharp edges, which are not noise, but physically
real.
4.2.2
Gaussian LowPass
This is another good smoothing filter. It takes the center pixel more into
account than the simple smoothing-3x3-filter. Mathematically it is more like
a gaussian curve. Viewed in the frequency realm, the gaussian low-pass filter
is smoother than the simple 1-1-1-filter.
1 2 1
2 4 2 /16
1 2 1
4.2.3
Median Filter
The median filter is a non-linear filter not working with the simple matrix
equation above. The median filter takes a k x k-area (k = 3, 5 or 7) and
sorts all elements according to their intensity. Then the middle element is
stored back as the new center pixel. Just like the other smoothing filter, it will
eliminate high frequency noise. As an advantage it does not eliminate sharp
edges as much as the other filters. On the other hand this filter is non-linear,
112
Original Image
Smoothing 3 x 3
Smoothing 9 x 9
i.e. the average intensity of the image may change. The median filter works
mathematically very similar to the erosion and dilation filter discussed below,
which have a very different behaviour.
4.3
Sobel Filter
The sobel filter will enhance edges. There are four different ones, each one
preferring a different direction. The effect is one of introducing a pseudo-3D
representation of the data.
All of the sobel filters do not use any divisor (=1). The pixels are simply
multiplied with the filter matrix and summed up.
113
1 0 1
Sobel 1 vertical: 2 0 2
1 0 1
1
2
1
Sobel 2 horizontal: 0
0
0
1 2 1
0 1 2
Sobel 3 diagonal: 1 0 1
2 1
0
2 1 0
Sobel 4 diagonal 1 0 1
0
1 2
4.4
Compass Filter
The compass filters are also edge detection filters. They are named according
to their preferred direction N, NE, E, ... .
1
1
1
Compass-N: 1 2 1
1 1 1
1
1 1
Compass-NE: 1 2 1
1 1 1
114
1 1 1
Compass-E: 1 2 1
1 1 1
and so on...
4.5
Laplace Filter
Laplace filter will detect edges in any direction. Simply try out the three
different laplacian filter. Laplace-3 is a laplacian of a gaussian filter, i.e. it
incorporates a second derivative to provide a noise-independent edge detection
filter.
Just like the sobel filter the divisor is 1.
0 1 0
Laplace-1: 1 4 1
0 1 0
1 1 1
Laplace-2: 1 8 1
1 1 1
1 2 1
Laplace-3: 2 4 2
1 2 1
115
4.6
Sharpening Filter
These filters enhance the contrast of the image, i.e. the image is sharpened.
Mathematically this is done by adding the original image to the laplacian. The
factor a determines the addition of the edge-enhancing second derivative to the
image. For a = 1 this is a 50% addition.
0
1
0
Sharpness-1: 1 4 + a 1 /a
0
1 1 1
Sharpness-2: 1 8 + a 1 /a
1 1 1
116
4.7
Just like the median filter this filter will also sorts the pixels of a 3x3-area
according to their intensity. But instead of taking the middle element, the erosion will take the element before. The effect is a kind of erosion, valley become
deeper and finally the image will be eroded away toward the background level.
The dilation filter does exactly the opposite. It will take the next element after
the middle one in the sorting list. The effect is that edges become sharper and
plateaus flatten and become more even.
4.8
Fourier Transformation
For N-data points there are about NN numerical calculations necessary using
the DFT. Using the FFT this is reduced to Nlog2 (N) which for typical data
sizes like 512 reduces the calculation time by a factor of 57!
The main application of FFTs are in performing filtering techniques, since in
the frequency space many filters can be done by simple multiplication. Most
of the times a low-pass filter is used to eliminate high-frequency noise, or a
high-pass filter may suppress unwanted slow changes in the background.
FFTs are also used as a fast method for computing correlation between two
data ranges, or to compute convolution and deconvolution of signals.
4.8.1
The LaVision DaVis software uses the basic butterfly algorithm enhanced
by the possibility of using arbitrary long arrays of data. Instead of using the
standard 128, 256, 512,... data length, any length of data points can be used (it
must be even, though) while still leading to a very fast algorithm (Singleton).
The time of computation is dependent on how N (the number of data points)
can be separated into factors. If N is close to a prime number (e.g. 2137)
the time of computation is not much faster than in the slow DFT-way of
calculation. If N can be separated into low prime numbers (e.g. 2233)
the algorithm is very fast. Fortunately, the number of pixels used in CCDcameras is most of the times ideal for applying the FFT.
If you take a part of an image for the FFT, simply be aware that some lengths
of data points might require longer times.
The formula for calculating the FFT on some data array xj is:
Fk =
=
1
N
1
N
NP
1
j=0
NP
1
xj ei 2 j k/N
(4.1)
xj (cos(i 2 j k/N ) + i sin(i 2 j k/N ))
j=0
where i is the imaginary number (i2 = 1). The inverse FFT is defined as:
Fk =
NP
1
xj ei 2 j k/N
(4.2)
j=0
Fnm =
1
NM
M
1 NP
1
P
(4.3)
k=0 j=0
Since the FFT works in principle on complex numbers and gives as a result
almost always also complex numbers, even if the original data is real, we need
to be concerned about the storage of the FFT-data in the buffers of the DaVisprogram.
First of all, the FFT-operation only works on FLOAT-buffers and it always
stores the result as a FLOAT-buffer. But since the result of the FFT is complex,
we would need to store the result in two buffers, one for the real part and one
for the imaginary part of the data. This would be true in general, but the
software makes use of a feature which is true when the input data is just real
instead of the general complex case.
When the input data is real, then the output data is symmetric in the real
part and anti-symmetric in the imaginary part of the output-data. So only
half the data needs to be stored, the other half is simply the same or negative.
Exactly how the software stores the result of the FFT in a buffer is explained
in an extra section, because it is not so simple to explain and, in general, it is
of no high interest.
What is important, though, is the way where the software stores the low frequencies and where it stores the high frequencies:
Rule:
This is different than what is expected from equation 4.1, where the lowest
frequencies are (k=0,1,...) at the beginning of the output data array, and
the higher frequencies are to the right. The reason why the storage is done
according to the above rule becomes apparent, when standard filters are applied
to the FFT-images, since then the filters are always symmetric around the
center, which makes them very easy to generate.
119
The lowest frequency (k=0 in equation 4.1), stored at the center, is the average
over all pixels (cos(..) = 1, sin(...) = 0). This average value is stored at the
location N/2-1. For example, if N is 384, then the average is at pixel 384/2-1
= 191 (the first pixel is pixel 0). Or, if the 2D-FFT is used on an image of size
384286 pixel, then the center with the average value is at position (191/142).
The inverse-FFT, of course, takes the storage details into account before using
equation 4.2. The result of the inverse-FFT is only real, since we started with
a real image. Even after applying symmetric filters to FFT-data, the result of
the inverse-FFT will always be real again.
4.8.2
The Fast Fourier Transform dialog (see figure 4.8) can be found in DaVis
Classic in the Compute menu. Here it can be easily checked how the Fast
Fourier Transform works on single images.
Calculate the Amplitude and Phase part of the FFT buffer and show
them on screen.
Button Combine will use the amplitude and phase buffers to recalculate the
FFT buffer.
The FFT computation mode can be horizontal, vertical or 2-dimensional.
Press button Compute Power-FFT, then enter the buffer number of the
result, which will be shown on screen immediately.
Multiply FFTFFT calculates the product of to FFT buffers. You have
to enter the numbers of both source buffers and of the resulting buffer in the
following question boxes.
Multiply FFT(FFT*) works like before, but calculates the conjugatecomplex of the second FFT buffer.
FFT Filter: Apply the active filter (first profile in the profile buffer) to the
image buffer or to the FFT buffer.
Press button Correlation to open the following dialog:
Select the computation mode and press a button for Correlation or Convolution calculation. Button Close closes the dialog without calculation.
121
Exercise
Lets use the basic FFT and IFFT functions in the DaVis software. Note that
the FFT functions are only available if you login as Classic user.
2. Change buffer 1 into a FLOAT-buffer by making using the Batch Processing in the Compute menu. Use the Group: basic image arithmetic and Operation: word to float. Remember that the FFT only
works on FLOAT buffers.
3. Open the Fast Fourier Transform dialog from the Compute menu.
4. Set the FFT computation mode to 2D. You may also try horizontal
or vertical to see the differences in the output.
5. Run the FFT using the Do FFT button, use all pixels of the image
(enter 0 for rectangle) and store the result in buffer 2.
7. Run the IFFT using the Do IFFT to convert the image back to normal.
Store the result in buffer 3. If you have multiplied buffer 2 by 100 before,
then the image is 100 times higher in intensity.
Notice that the original image and buffer 3 are for all practical purposes
exactly the same. Differences only appear in some minor digit due to
rounding errors.
8. Run the amplitude calculation using the Calc.Amplitude button and
run the phase calculation using the using the Calc.Phase button.
4.8.3
FFT-Filter
(4.4)
A filter needs to be defined only over half the image length, since it is symmetric
around the center. For example, if the image size is 200 pixels (in either
dimension) then it is sufficient to define the filter up to pixel 100.
In case the filter function length does not correspond with the image size, or
in case a 2D-filter-function is applied to an image, where the width is not the
same as the height (the standard case), the filter function is extended properly
or cut to length if necessary.
For example, if the FFT has been computed in the 2D-mode, and the image
size is 384286 pixels, and the filter length is two times 100 as in the above
example, then all pixels beyond the end of the filter (100) are set the last value
of the filter function at point N/2, which is 0 in the above example. This
simply means that the low-pass filter is set to 0 for the very high frequencies.
To be more precise, the center of the image is at 191/142, and in horizontal
direction all pixels before pixel 191-100=91 and beyond pixel 191+100=291
are set to 0 and in vertical direction all pixels before 142-100=42 and beyond
pixel 142+100=242 are set to 0.
In the 2D-case the image is multiplied with the filter function vertically and
also horizontally. In the 1D-case, the image is only multiplied once either
horizontally or vertically.
If the filter function is longer than the image data array it is simply cut to
length. Of course, the program always centers the filter function correctly.
Applying a high pass filter it is very important to use the correct filter length,
since cutting the filter to length or extending the filter in length may produce
unwanted results. In the 2D-case it becomes necessary to use two different
filters, vertically and horizontally, of different lengths to account for the fact
that the image height is different from the image width.
Function FFT Filter in the Fast Fourier Transform dialog (see figure 4.8)
will use the first profile of the profile buffer. In the 1D-case the filter is only
applied horizontally or vertically, in the 2D-case it is done in both directions.
Finally you can open the Buffer Operations dialog and use functions
SetInsideRectConstant = C and SetOutsideRectConstant = C for a fast
low-pass or high-pass filter. We advise not to use these functions, though,
since very crude filters will introduce extra noise into the source image as we
show later on.
4.8.4
You are not limited to the filter design menu to manipulate the FFT-data.
Since the FFT-data is a standard FLOAT-buffer, it can be processed in any
other way the program allows. Specifically you may design your own filter
124
function (stored in a profile) and then multiply the FFT-image with the filter
function. Or you may create a complete 2D-buffer to multiply the FFT-data
with.
All functions in the filter design menu are actually CL-macros. The filters are
generated using subroutine MakeFFTFilter() (profile 19), copied to profiles
17 (horizontal) and 18(vertical) and also processed further to account for the
actual image size. Finally, the FFT-data is multiplied with profiles 17 and 18,
either or both vertically and horizontally.
Below is a short CL-programming sequence to show how to use CL to apply a
simple low-pass filter:
// simple horizontal low-pass filter
// let us assume the source image is in buffer 1
GetBufferSize( 1, nx, ny, type )
// check image size
FFT( 1, 0, 0, nx-1, ny-1, 2, 0 )
// horizontal FFT on whole image
// FFT is now in buffer 2
// here comes the definition of the filter function:
SetProfileBoundary( 19, 0, nx-1 )
// set length of profile 19
for ( i = nx/2-1; i<nx-1; i++ )
// right side of filter function
F[ 19, i ] = 1.0 - ( i - nx/2 + 1 ) / ( nx /2 );
// simple straight line to 0.0
for ( i = 0; i<nx/2-2; i++ )
// fill left side of profile symmetrically
F[ 19, i ] = F[ 19, nx - i - 2 ] // center = nx/2 - 1
// pixel 0 = pixel nx-2, 1 = nx-3, ...
B[2] = B[2] * P[19] // apply filter horizontally
IFFT( 2, 3, 0 ) // horizontal IFFT
The next example shows how to multiply a buffer vertically with a profile.
This is not so straight forward, since multiplication of a buffer with a profile
is always done vertically. The trick is to generate a column, which is then
multiplied with the FFT-data.
// Vertical multiplication of buffer 1 with profile 19.
// The result is stored in buffer 2.
B[2] = B[1] // copy buffer 1 to buffer 2
// the important side effect is that buffer 2
// has the same size as buffer 1.
125
4.8.5
The important rule in defining FFT-filter is that the filter function should be
as smooth as possible. There are only very few exceptions to this rule, for
example, in case it is necessary to filter out a well known frequency, and only
this one.
The transition functions in the filter design menu are chosen so that there is a
smooth transition from one segment to the next.
To illustrate what the effect is of using a crude filter with sharp edges, a sample
image is taken and filtered both with a crude filter and a smooth filter. The
sample image has inside itself a rectangle of intensity 100 while the background
is at 20 counts.
Figure 4.11: Original image wth a small rectangle (top), the FFT
(left) and PowerFFT (right).
126
First of all we transform the image into Fourier space. Note that the Fourier
transform of a square has the highest value in the center while decreasing
progressively toward the outside. A sharp edge is the superposition of a series
of progressively higher frequencies with progressively decreasing amplitude.
Smoothing is the elimination of the higher frequencies so that the transition
at the edge will be smoother.
Then a crude low-pass filter is applied with function SetOutsideRectConstant
= C in menu Buffer Operation, setting all pixels to zero, which are roughly
more than 10 pixels away from the center. After transforming back with IFFT
we note an interesting effect in the final image. While the edges have been
smoothed as we expected there is also a reverberation of the square in the
rest of the image. The background does not stay constantly at intensity 200,
but is now swinging around 200. The reason for this is that the low frequencies
are now no longer compensated by higher frequencies to produce a stable background. This means that our crude FFT-filter actually introduced additional
noise into the image!
Let us compare it with a smooth filter designed with the filter design menu.
Higher frequencies are not simply set to zero, but fade out toward zero. The
result is that the background is now much smoother than before. Note that
also the top region of the square is also now much more constant at intensity
100.
Figure 4.12: Crude low-pass filter (left) versus smooth filter (right).
127
4.8.6
There are some useful functions in menu FFT math operations to work with
FFT data in more detail.
First of all since the complex FFT data is stored in a kind of scrambled way
to fit into a FLOAT buffer, it is useful to be able to separate the complex FFT
buffer into two buffers where one is the amplitude part of the complex numbers
and the other one is the phase. Mathematically every complex number can be
expressed not only as a real part and an imaginary part, but also in terms of
amplitude and phase, which in case of the FFT data is a much more useful
representation of the real and imaginary values.
Any complex number Fk can be expressed as
Fk = Rk + iIk = Ak ei Pk
= Ak (cos Pk + i sin Pk )
(4.5)
with
Ak =
Rk Rk + Ik Ik
(4.6)
and
Pk = tan RIkk
(4.7)
where Rk and Ik are the real and imaginary part of Fk and Ak and Pk are the
amplitude and the phase of Fk .
The Cal.Amplitude button computes the amplitude image of the FFT image,
the Calc.Phase button computes the phase. Again the low frequencies are
toward the center of the image and the high frequencies are toward the outside.
In the section on data storage there is more detail about where exactly every
Fk of our fundamental Fourier equation (4.1) is stored. The Combine button
will recombine an amplitude and phase image to an FFT-image, which can
then be transformed back using IFFT. Note that these three function must
know the type of FFT-data, whether it is a horizontal, vertical or 2D-FFT,
because in each case the storage of the FFT-data is differently. For example,
when the original image has been transformed using the 2D-FFT mode, then
all subsequent operations must also been done in the 2D-mode, i.e. the FFT
computation mode must stay the same.
The separation of an FFT-image into amplitude and phase can be used to do
some special filtering on the phase. In the standard case, when we apply a
filter to the complete FFT-image, this is the same as if we apply the filter
to the amplitude image only. But there are some special filtering techniques,
which require, for example, to enhance or change the phase separately. There
128
a number of good books on this topic. See the literature list for references
(page 135).
The most often used application for the computation of the amplitude image
is the computation of the power spectra, which is simply the square of the
amplitude. Function Power-FFT simply computes the amplitude of the FFTimage and then squares the buffer.
Mathematically squaring the amplitude is the same as multiplying a complex
number with its complex-conjugate counterpart. Complex conjugate means
that the imaginary part is changed in sign.
Fk Fk = (Rk + iIk )(Rk iIk )
(Rk Rk iRk Ik + iRk Ik i2 Ik Ik )
(Rk Rk + Ik Ik )
(4.8)
In general the complex multiplication to two different numbers, function multiply A B will compute the complex multiplication between two FFT-images
A and the complex conjugate of B. If B is the same as A, then this function
will compute the power spectrum according the above equation.
Similarly function multiply A B does a complex multiplication without taking the complex conjugate of B. Those two function are mainly used for the
computation of a correlation function or a convolution function.
There is no extra function for complex division, since it is rarely used and
can be generated using the above functions. Defining complex division as
the inverse of the complex multiplication, it can be best visualised in the
realm of amplitude and phase. Here the complex multiplication is simply the
multiplication of the amplitudes while adding the phases:
Fk Gk = (Ak ei Pk ) (Bk ei Qk )
(Ak Bk ) ei (Pk +Qk )
(4.9)
(4.10)
In the same way the division by the complex conjugate G is done by adding
the phases.
4.8.7
The FFT data is stored in one FLOAT-buffer using the fact that the Fourier
transform of a real data array is symmetric in its real part and anti-symmetric
129
in its imaginary part. This means, using the connotation of our basic equation
4.1 and 4.5:
Fk = Rk + iIk with 0 k N 1
(4.11)
(4.12)
pix 0
I4
=
-I6
1
I3
=
-I7
2
I2
=
-I8
3
I1
=
-I9
4
R0
5
R1
=
R9
6
R2
=
R8
7
R3
=
R7
8
R4
=
R6
9
R5
Horizontal and vertical FFTs are computed independently. This means that
the 2D-FFT is done by first computing the horizontal FFT and storing the
result in the above form in one buffer, then computing the vertical FFT on
that buffer and again doing the rearrangement. Therefore in the 2D-case the
final storage arrangement is quite complicated. There is actually no need to
compute it, since it is much easier to use function Amplitude and Phase, in
case direct access to each individual FFT-data point is required.
Using equation 4.5 to 4.7 as the definition as the amplitude and phase, functions
Amplitude and Phase will store the result in the following way, again using
our example of N=10:
pix 0
A6
=
A4
and
130
1
A7
=
A3
2
A8
=
A2
3
A9
=
A1
4
A0
5
A1
=
A9
6
A2
=
A8
7
A3
=
A7
8
A4
=
A6
9
A5
pix 0
P6
=
-P4
1
P7
=
-P3
2
P8
=
-P2
3
P9
=
-P1
4
P0
=
0
5
P1
=
-P9
6
P2
=
-P8
7
P3
=
-P7
8
P4
=
-P6
9
P5
=
0
A64
A65
A60
A61
A62
A63
A74
A75
A70
A71
A72
A73
A04
A05
A00
A01
A02
A03
A14
A15
A10
A11
A12
A13
A24
A25
A20
A21
A22
A23
A34
A35
A30
A31
A32
A33
A44
A45
A40
A41
A42
A43
Since the power spectrum is the square of the amplitude it is stored in the
same way as the amplitude or phase image.
2D-FFT-filter must be designed in such a way that they are symmetric around
R00 or A00 .
4.8.8
1
N
NP
1
f (i) g(k + i)
(4.13)
i=0
The factor 1/N is sometimes omitted, but simply out of practical considerations
it should be included, since otherwise the numbers will get much too big to be
displayed in any way.
Corrk is a measure for how closely the two data arrays agree with each other
when they are shifted by k-data points. Therefore the correlation tells if a
certain structure in one data array appears in the second data array again
up to some displacement vector defined by k. Correlation are, for example,
used for computing flow or particle velocity fields, where two images are taken
shortly one after the other, and the correlation between the two images are
computed. The correlation can be computed on the whole image, giving a
measure of the average flow speed and direction, or it can be done on local
sub-images to compute a 2D-velocity field. The sub-images, of course, must
still be large enough so that in each one there is still enough information to
compute a correlation.
The correlation can be easily extended into 2D:
Corrkl =
1
NM
N 1,M
P 1
f (i, j) g(k + i, l + j)
(4.14)
i=0,j=0
131
(4.15)
The time saving is more than a factor of 1000 for a 512512 image. In the
dialog the Multiply FFT(FFT ) button simply computes the correlation
according to the above recipe. First the FFT is computed of the two source
images, the complex multiplication is done and finally the result is transformed
back.
4.8.9
Autocorrelation
4.8.10
Convolution
1
N
NP
1
f (i) g(k i)
(4.16)
i=0
The convolution is nearly the same as the correlation, except that the second
data array has been flipped over. So, for example, it can be used to detect
similar structures in two different images, where the structure has been reversed
in the second image.
Similarly the convolution can be computed via FFT by using
Conv = IF F T (F F T (f ) F F T (g))
(4.17)
4.8.11
In the definition of the correlation and the convolution, equations 4.13 and 4.16,
you will notice that the index of, for example, g(k + i) will run out-of-bound
for high ks and is. There are two solutions for this problem:
Cyclic computation:
In this case it is assumed that the source data will repeat itself indefinitely to
the right and left. I.e. the cyclic extension of the data is
g(N ) = g(0), g(N + 1) = g(1), g(N + 2) = g(2), ...
Fk = Rk + iIk = Ak ei Pk
= Ak (cos Pk + i sin Pk )
(4.18)
and similarly to the left in case of negative indices for computing the convolution. The advantage of using the cyclic extension of the data is that the
computation of the correlation or convolution by using the Fourier transform
can be done without further modifications, since the FFT is, by definition, also
cyclic, i.e. it also assumes that the data will repeat itself in every dimension.
Note that in the cyclic case the result is symmetric because a displacement
vector of k is the same as a displacement vector of N-k. Therefore it is sufficient
to look at e.g. the two top quadrants of the image (in the 2D-case), because
the other two quadrants do not contain any additional information.
Non-Cyclic computation:
In this case it is assumed that the source data will be 0 outside the specified
data range 0-N-1. I.e. the extension of the data is
g(N ) = 0, g(N + 1) = 0, g(N + 2) = 0, ...
and similarly to the left in case of negative indices for computing the convolution. Another way of understanding this case is that in the equations 4.13
133
and 4.16 we are only computing the sum for those data values which actually
exist. If any index is outside the bounds, it will not be added to the sum.
This case is most often physically much more meaningful, because there is
usually no reason to assume that the data will repeat itself with just exactly
that period N we choose to sample the data with.
It is fairly simple to do those steps inside the program. Picking out an area
of interest is done with menu data compression (compression factor = 1).
Changing buffer sizes is done by clicking on the active buffer to go to the
buffer parameter menu. When enlarging a buffer, the newly created areas are
automatically set to 0.
Here it is shown how to do this using CL:
// optimal non-cyclic AUTOCORRELATION of part of an image
// it is assumed that the relevant image is in buffer 1
SetRect( 1, 100, 100, 139, 119 );
// rectangle 1: 40 x 20 pixels in size = sub-image
// (if you let the user specify a rectangle, you
// must make sure that there is enough space around
// the selected rectangle)
SetRect( 2, 80, 90, 159, 129 );
// rectangle 2: 80 x 40 pixels in size
SetBufferSize( 2, 80, 40, 1 );
// make space for sub-image
B(2) = 0; // fill with zeros
SetBufferSize( 3, 80, 40, 1 )
// make space for counter-image
B(3) = 0; // fill with zeros
MoveRect( Pix( 2, 20, 10, 0 ), 1, 1 );
// copy sub-image to center of buffer 2 !!
MoveRect( Pix( 3, 0, 0 ), 1, 2 )
// copy surrounding area
FFT( 2, 4, 2 );
// 2D-FFT of sub-image
FFT( 3, 5, 2 );
// 2D-FFT of surrounding area
MultiplyFFT( 4, 5, 6, 3+2); // 2D-complex mult. A * (B*)
IFFT( 6, 7, 2 );
// inverse FFT = correlation
SetBufferSize( 7, 40, 20, 1 ); // throw away symmetric parts
B(7) = B(7) / 4;
4.8.12
// renormalize
Literature
4.9
Nonlinear Filter
The non-linear filters do not work with the simple matrix equation as the
linear filters do. Each non-linear filter has its specific advantages, but on the
other hand they are non-linear operations, i.e. the average intensity of the
image may change.
For the three filters Median, Erosion and Dilatation a kk area (k= 3,5,7,9
or 11) is taken and all elements are sorted according to their intensities. Then
the elements are stored back following a special rule for each filter.
Median Filter
The middle element of the sorted k k area is stored back as the new center
pixel. It eliminates high frequency noise. As an advantage compared to many
linear filters it does not eliminate sharp edges.
Erosion Filter
The element before the middle element of the sorted k k area is stored
back as the new center pixel. The effect is a kind of erosion. Valleys become
deeper and finally, after having applied the filter several times, the image will
be eroded away towards the background level.
Dilatation Filter
It does exactly the opposite of the Erosion filter. The next element after
the middle element in the sorted k k area is stored back as the new center
pixel. The effect is that edges become sharper and plateaus flatten.
Concentration Filter
Concentrates intensities on the "local maximum" pixel. First of all the filter
searches for pixels whose intensity is a local maximum. The intensity In addition has to be above a background level (set with the parameter noise-level).
If found, it will move the intensities of the surrounding pixels toward the center
to concentrate all power in the middle.
4.9.1
left to right, from right to left, from top to bottom and from bottom to top
through the image:
Savg (0) = I (0)
and
Savg (i) = (n-1)/n * Savg (i-1) + 1/n * I (i) for i 1
where I(i) is the pixel intensity at a certain pixel i and Savg (i) is the computed
average at that pixel and and Savg (i-1) is the computed average at the previous
pixel. N is the scale length (must be n 2), which corresponds about to the
distance over which the average is computed.
The effect is a sliding average, where each new pixel is added with a small
weighting factor. This type of filter is much faster than any fourier type of
average filter or a linear n n matrix filter, since very few multiplications are
necessary for each pixel, independant on the scale length. There is a small
edge effect at the image borders, but by far not as severe as when using a
FFT-Filter. The only drawback is that the image intensities are shifted a bit
in the direction of processing (an intensity peak becomes smoothed and the
peak center is shifted by n/2). But this is compensated by going not only from
left to right, but also from right to left.
The exact equations for the 4 passes are decribed below:
Going from left to right: For all rows y do:
Savg (x,y) = (n-1)/n * Savg (x-1,y) + 1/n * I (x,y)
Going from right to left: For all rows y do:
Savg (x,y) = (n-1)/n * Savg (x+1,y) + 1/n * Savg (x,y)
Going from top to bottom: For all columns x do:
Savg (x,y) = (n-1)/n * Savg (x,y-1) + 1/n * Savg (x,y)
Going from bottom to top: For all columns x do:
Savg (x,y) = (n-1)/n * Savg (x,y+1) + 1/n * Savg (x,y)
For example, if the scale length is 10 pixel, then
Savg (i) = 0.9 * Savg (i-1) + 0.1 * I (i)
Sliding Minimum Filter:
This filter computes a local minimum over a specified scale length. The filter has the same principle as the sliding average, but with slightly different
equations:
With m = n / 2 half of scale length, do
Step 1: going from left to right: For all rows y do:
137
where fmin is an intermediate variable for storing a sliding minimum over half
the scale length, which again is smoothed over the full scale length.
Step 2-4: same as for sliding average
Note that this filter can still produce sometimes pixel intensities that are
slightly above the original values. The strict sliding minimum filter explained
below is strictly below the original intensities, but is not as smooth as this
filter.
Sliding Maximum Filter:
Same as sliding minimum, only < instead of > in the above equation in step
1.
Strict Sliding Minimum Filter:
Same as sliding minimum, except that none of the resulting pixel intensities
will be below the intensity of the original pixel at a certain position. The
equations are slightly different:
Going from left to right: For all rows y do:
Savg (0,y) = I (0,y)
and
if ( I (x,y) > Savg (x-1,y) )
Savg (x,y) = (m-1)/m * Savg (x-1,y) + 1/m * I (x,y)
else
Savg (x,y) = I (x,y)
Going from right to left: For all rows y do:
Savg (x,y) = min( Savg (x+1,y) (n-1)/n * Savg (x+1,y) +
1/n * Savg (x,y) )
Going from top to bottom: For all columns x do:
Savg (x,y) = min( Savg (x,y-1) (n-1)/n * Savg (x,y-1)
+ 1/n * Savg (x,y) )
138
4.10
The dialog for linear filters (see figure 4.15) can be found in DaVis Classic
in menu Compute. Here the user can choose between predefined filters and
user filters that can be changed by the user.
a1 a2 a3
b1 b2 b3 /divisor
c1 c2 c3
leads to the new value Pi,j :
Pi,j = ( a1 Pi1,j1 + a2 Pi,j1 + a3 Pi+1,j1 +
b1 Pi1,j + b2 Pi,j + b3 Pi+1,j +
c1 Pi1,j+1 + c2 Pi,j+1 + c3 Pi+1,j+1 ) / divisor .
How to Perform Filter Operation
1. Select a filter from the list.
2. Click on "Execute".
3. Enter the source and destination buffer.
4. The result is displayed on the screen.
1D-Vector Filter
There are two predefined vector filters for smoothing over 9 pixel in one dimension (horizontally or vertically). Other 1-dimensional filters can be freely
defined as user filters.
Vector filters are very useful for analyzing, e.g., 1-dimensional spectra, which
have another information on the vertical axis of the image (e.g. space coordinate or time). Maybe, just the spatial axis should be smoothed, but the
spectral resolution on the horizontal axis is kept as it is. In this case use the
vertical smoothing filter.
140
4.10.1
User Filter
The user can freely define 10 different linear filters. The dialog box in which
all settings have to be made is shown below.
In order to define a new user filter, select it in the list of linear filters (shown
on the page before) and click on Edit to open the dialog box.
Choose the type of linear user filter.
Define the filter by entering the matrix or vector coefficients inside the corresponding field directly.
Further actions (divide by, set outer rim) are defined at the bottom of the
dialog box. They are performed before the result of the filter is stored.
The description entered here will apear below the list of linear filters, when
the filter has been selected (see the page before).
Basically, there are three types of user filters.
NxN matrices: Usual NxN-matrices (N= 3, 5, 7 or 9) that are applied
in the same way as the predefined linear filters. They are defined by
entering the matrix elements in the center field.
NxN separable matrices: They work much faster than the usual matrices. If a matrix is separable (is the product of a vertical times a
horizontal 1D-vector), several steps of the full matrices operations are
redundant. Therefore it can be applied in two steps of vector filter operations: first a horizontal vector, second a vertical vector. These filters
are also defined by entering the elements directly into the vectors.
141
142
Index
Index
Dialog
AdaptPalette, 95
CreateMask, 91, 97
Fast Fourier Transform, 120
FFT, 120
Convolution, 121
Correlation, 121
LinearFilter, 139
Edit, 141
MaskDefinition, 90
OverlayEditor, 94
143
Index
144
LaVision
We count on Photons
LaVisionUK Ltd
Downsview House/ Grove Technology Park
Grove, Oxon, Ox 12 9FF/ UK
www.lavisionuk.com
Email: sales@lavision.com
Tel.: +44-(0)-870-997-6532
Fax: +44-(0)-870-762-6252
LaVision GmbH
Anna-Vandenhoeck-Ring 19
D-37081 Goettingen, Germany
www.lavision.com
Email: sales@lavision.com
Tel.: +49(0)551-9004-0
Fax: +49(0)551-9004-100
LaVision, Inc.
211 W. Michigan Ave., Suite 100
Ypsilanti, MI 48197, USA
www.lavisioninc.com
Email: sales@lavisioninc.com
Phone: +1(0)734-485-0913
Fax: +1(0)240-465-4306