Digital Signal Processing Reference
In-Depth Information
Similarly for the focused image:
m ¼
(250
þ
250
þ
250
þ
250
þ
0
þ
0
þ
0
þ
0)
8/64
¼
125
125) 2
125) 2
125) 2 þ
F
¼
(1 / 8
8)
(((250
þ
(250
þ
(250
125) 2
125) 2 þ (0
125) 2
125) 2 þ (0
125) 2 )
(150
þ
(0
þ
(0
8)
15,625
Here we see that the focused image has a higher variance than
the unfocused image.
One of the variations on this algorithm divides the final result
by the mean pixel value, thus normalizing the result, and
compensating for variations in image brightness.
F
¼
19.2 Segmentation
Until now we have considered the entire image to be in the
same level of focus. This may not be the case. For example,
images of tiny micro-electro-mechanical-systems (MEMS) may
have regions of the image that are in different levels of focus,
thus we have to choose the region of the image that we want to
be correctly focused. Sometimes this can be as simple as
choosing a region in the middle of the image, but it is not always
this easy, and there are situations where the region of interest
must be located and its focus score calculated. We would need to
extract a segment from the image. There are techniques to find
the edges in an image, and from this information identify the
edges of interest. These techniques are beyond the scope of this
chapter
what we will consider here is the simpler case where
we know the shape of the region that we want to locate.
e
19.2.1 Template Matching
The segmentation algorithm uses expanding, shifting shape
templates to locate regions within the image. For example, if the
target region is a circle, then pixel image data is collected from
circular regions of varying radius and position. Summing pixel
data in these circular regions gives a gray level score for the region
and comparing gray values between circular regions determines
the region boundary.
Let's take a look at the example in Figure 19.3 . We are going to
locate a square region of 4
12
image. Since we are looking for a square region, we will use
shifting, expanding square templates and match these against the
image. Furthermore, since the square region we are trying to
locate has uniform gray values, we will only add the values of the
pixels on the perimeter of the squares, and ignore the pixel values
inside the squares. We will start with a square template of size
4 pixels, located within a 12
Search WWH ::




Custom Search