affect its results. To solve this problem, a low-pass
filter on the image will produce fuzzy results and
also can reduce the noise.
2.2.2 Enhance the Image Contrast
The contrast of a non-obviously image can be
enhanced through the expansion of gray-scale
distributions.
Using histogram equalization, assuming a gray-
scale image has L gray levels, in the histogram of
the i layer has n pixels, and assuming that all the
number of pixels are
110
...
−
+++=
L
nnnN
the gray-
level i can be replaced by Equation 2.4 (Lin, 2001):
()
1
...
10
−
⎟
⎠
⎞
⎜
⎝
⎛
+++
L
N
nnn
i
(4)
A clear contrasted black and white images will be
obtained.
2.2.3 Binarization
After the step of the image contrast enhancement,
the next step is the binary image process. The
required stripes and unnecessary image need to be
split. The change of gray-scale image will be
converted into black and white binary images. A
common method is to set a threshold value of gray-
scale images T to judge the grayscale value of each
pixel, shown as follows.
⎩
⎨
⎧
<
≥
=
Tyxg
Tyxg
yxg
),(,0
),(,255
),(
Sometimes, the brightness of image is not consistent.
A single threshold may not be fully extracted the
images. The images can be cut to different blocks
and each image block can have different setting of
threshold value.
2.2.4 Thinning
The Zhang-Suen iterative algorithm was used to
process the thinning (Zhang & Fu, 1984).
1. Odd-iteration was used to remove the right,
bottom and upper-left corner pixels.
2. Even-iteration was used to remove the left, top
and bottom right corner pixels.
However, there is certain condition should be
considered. There is one neighboring pixel which
may be the endpoint of framework and can’t be
removed. if there are 7 or more neighboring pixels,
then it should remove the image object which
probably can destroy the shape of image.
After the thinning step, it should remove the four-
side line to get a contour line graph. The next section
will be the actual measurement results and establish
the three-dimensional graphic.
3 EXPERIMENTAL RESULTS
The pitch of reference grating is 1mm (p = 1mm),
light source is from θ
1
= 45 ° to project, and the
observation is from θ
2
= 0 ° to observe, shown in
Figure 4 which is the extracting image of the Moiré.
Through Equation 3.1 calculating the d=1N(mm), it
represents that there is a depth change of 1 mm in
each pixel. The image area was cut appropriately
and the color image was converted into grayscale for
each pixel RGB (www.mathworks.com, 2009).
Gray=0.299×R + 0.587×G + 0.114×B (5)
Cutting the region of interest image and filtering
the reference grating stripes, shown in Figure 4.
(a) (b) (c) (d)
Figure 4: Capture images (a) original image (b) 8-bit
grayscale (c) filtering the grating stripes (d) contrast
enhancement.
After binarization of the image, the unneeded
parts were cut or manual removed, shown as Figure
5(a) Marking on the Moiré lines, Figure 5(b) fill in
the different gray values.
(a) (b) (c)
Figure 5: Remove the unwanted unneeded parts and fill in
the gray-scale value.
Figure 6: Three-dimensional graphic rebuit.
3D OBJECT MEASUREMENT BY SHADOW MOIRÉ
163