Scan_Calculator_linear
Author: Peter Stierlen (peter.stierlen@t-online.de)
History: 2009/04/27 (v1.00 beta): first
public version
2009/05/07 (v1.01): “spacetime”
calculation removed
2009/05/11
(v1.02): improved “standard”
calculation with better
skeletonization
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 the
undistort function.
Description: This plugin allows you to calculate 3D data
out of 2D scanline data captured with a linear laserscanner. This plugin can be
used for linear scanners with camera and line laser fixed to each other moving
together linear to the object. Different scanner configurations can be used
very easily.
Limitations: Different to the plugin Scan_Calculator the
spacetime analysis is no longer enabled in this one. Spacetime analysis as
described in the listed paper is working for scanner setups with fixed camera/object
positions.
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 |
Calculation of
3D data from 2D image stacks captured by a laser scanner
Open your original distort stack
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