Linear_base_calibration
Author:
Peter Stierlen (peter.stierlen@t-online.de)
History:
2011/12/23 (v1.00 beta):
first public version
Download:
Scan_Calculator_linear.jar
Installation:
Download Scan_Calculator_linear.jar to
the plugins folder and restart Imagej. You need the intrinsic
camera parameters of your cam system if you want to use this
plugin.
Description: This
plugin allows you to calculate the distance between your laser
and the camera nodal point. This plugin can be used for linear
scanners with camera and line laser fixed to each other moving
together linear to the object. A more detailed description of
the trigonometry behind this plugin can be found here.
Limitations: Up
to now this plugin uses only two images. With higher numbers
the result may be more accurate. The test sprcimen must be
placed in a propper orientation.
Calculation of the base length L of a 3D Linear
Laser Scanner setup
3D calibration specimen
The theoretical base for this plugin is
described in linear_base_calibration-theory.htm
The first step is the production of the calibration specimen.
This can be realized out of polyurethane block material or any
other material with a non reflecting surface and a constant
thickness of the plates. The best dimensions depend on the
laser/camera setup and must found for other setups by your own.
For the given setup the front part of the specimen has a
dimension of 200 x 60 x 50mm.
Start the plugin Scan_Calculator_linear
Clicking the plugin Scan_Calculator_linear
you will start up in the main menu which is split in two
different sections.
In the upper section you can check and edit the
basic scanner setup data. In the lower section you can find
all the functions needed to control the data calculation
process. If you do not want to undistort your 2D image data
you can directly start the calculation from the main menu. But
I will now describe the procedure for the complete plugin
configuration.
!!! You must input the linear Step Pitch
value. This value describes the movement of the setup between
two captured images!!!
Scan_Calculator_linear – Maim menu
Change to the Camera Prefs
Menu
Camera Prefs – parameters for undistortion of
images (zhang calibration parameters)
In the Camera Prefs
Menu you can check and edit all the camera parameters needed
for the undistortion of the 2D images. Since Version 1.00 beta
Focal length, Chip width and
Chip height
are no longer needed for the undistort process.
You can also load the calibrations data directly
from the zhang output file Params.txt
by File>Load
Camera Prefs>…\Params.txt
The data will directly be written into the
input-fields.
Load Camera Prefs – import the zhang
calibration parameters for the used camera
Please keep in mind that the camera parameters
are only valid for the calibrated camera and camera
configuration (zoom).
Definition of 3D bounding box
Change to the menu 3D Bounding Box. Only the
points included in the bounding box will be processed. It will
be a helpful option to minimize the number of “nirvana”
points.
Definition of the size of the 3D bounding box
The height of the bounding box is defined similar
in the z-direction. Half of the box is z=height above
the xy-plane and
the other half below. In most cases it will be adequate to
define the frontside and
the backside of
the 3D bounding box to reduce the excessive points.
3D Calculation
Undistort
Please keep in mind that grabbed pictures have a
optical deformation which can decrease the accuracy of the 3D
data significantly. You can undistort the image stack directly
by clicking the Undistort
button.
The undistortion process is not very quick …
wait.
Save the resulting stack as a Tiff-Stack.
Keep in mind that the metadata from the source stack will not
be stored in the new stack file. If you want to read the
metadata including the scanner configuration data you must
also open the source file and read the meta data from this
one.
Read metadata
If you captured and saved the 2D image stack with
my Scan_Capturing plugin you can read
in the scanner configuration data by clicking the Read Meta
button directly from the stack. You can check and change the
data in the upper section of the main menu if necessary.
Make 3D
You can choose 5 different types of calculation.
Naturally the trigonometry is still the same. You can find the
differences in how the scanline in the 2D images will be
skeletonized.
Standard (Gauss):
Each slice in the stack is processed separately.
In each slice the program looks line by line for the position
representing the center of a Gaussian intensity distribution.
The center position is calculated in “sub-pixel” accuracy and
will be used as is in the following calculations of the 3D
data.
Standard (Fourier):
Each slice in the stack is processed separately.
In each slice the program looks line by line for the position
representing the center of the intensity distribution by using
a Fourier method. The method is described in http://www.numatec.de/Fachaufsatz.pdf (German language) but you can also download a
excel sheet demonstrating the simple method http://www.numatec.de/FourierPos.zip
The center position is also calculated in
“sub-pixel” accuracy and will be used as is in the following
calculations of the 3D data.
Quick:
If you have a stack with skeletons you can
directly process the 3D data with this option. Please keep in mind
that in opposite to the other methods the accuracy is not
“sub-pixel”
MAX:
This type looks for the most “black”-pixel in
each line. If you have more pixels with the same value it will
take the most right one.
Saving 3D Data
The calculated 3D data can be saved in different
point or mesh formats. All formats are ASCII –based.
Data-Type |
Format |
Extension |
Polylines |
Rhino3D - polylines |
*.txt |
Points |
Rhino3D - points |
*.txt |
|
x,y,z |
*.txt |
|
x_y_z |
*.txt |
Meshes |
STL- meshes |
*.stl |
|
PLY-meshes |
*.ply |
|
OBJ- wavefront meshes |
*.obj |
Post-Processing of 3D data
In most cases the 3D data require a little bit of
post-processing before you can use them in other CAD, CAM or
3D-visualization programs.
I advise you the free software Meshlab
http://meshlab.sourceforge.net/
Fantastic tool!
Happy meshing!
You are visitor