Scan_Calculator
Author: Peter Stierlen (peter.stierlen@t-online.de)
History: 2009/02/16 (v1.00 beta): first public version
2009/05/12 (1.02) : improved calculation with better skeletonization
Download: Scan_Calculator.jar
Installation: Download Scan_Calculator.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 laserscanner. This plugin can be used
for scanners with a fixed camera and a turning laser line. Different scanner
configurations can be used very easily.
Limitations: This version is only working correctly for
laser installation on the left side. The changes for the right side
installation will be done in the next weeks.
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_Calculation
Clicking the plugin
Scan_Calculator
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.
Scan_Calculator
– 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.
Standard
(Fourier) - Calculation
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”
Spacetime
(Gauss):
The complete
calculation method is described in
http://www-graphics.stanford.edu/papers/spacetime/
The center
position in the turned spacetime image is calculated for a Gaussian
distribution in “sub-pixel” accuracy and will be used as is in the following
calculations of the 3D data.
Spacetime
(Fourier):
See above.
The center
position in the turned spacetime image is calculated in “sub-pixel” accuracy
using the Fourier method and will be used as is in the following calculations
of the 3D data.
Spacetime
(Fourier) - Calculation
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