Sunteți pe pagina 1din 20

Thickening

CH 9.5.6
By Douglas Metz
What is Thickening?
Thickening is a morphological operation that is used to
grow selected regions of foreground pixels in binary
images
The Thickening process is a sub process
of Thinning. Essentially the Thickening
process is four major steps, one of which
includes the Thinning process. The
Thinning process consists of a sequence
set that passes over the image until the
image stops changing. These sequences
are rotated versions of each other as
shown in figure 9.21. This process is
some-what a complication in it self. The
Thickening Process uses it in the second
step of the algorithm.
Thickening – The Basic
Algorithm
The Algorithm Consists of four major
steps…

1. Take the negative of the original image – just


reversing the gray levels of the image to be the
opposite of the original.

2. Use Thinning on the negative image – This will


expand the white regions.

3. Apply the negative process over the image again –


to return the image to its proper gray level.

4. Finally remove the points in the image that are not


connected – These points are the undesired
results of the Thinning process.

Once you have the Thinning process down the rest


is pretty simple to follow.
Thickening – The Algorithm
What For?...
• It has several applications, including
determining the approximate convex hull
of a shape, and determining the skeleton
by zone of influence.
• Thickening is normally only applied to
binary images, and produces another
binary image as output.
For Convex Hull
• An approximate convex hull can be computed using thickening with the
structuring elements shown in the Figure. The convex hull computed
using this method is actually a `45° convex hull' approximation, in which
the boundaries of the convex hull must have orientations that are
multiples of 45°. Note that this computation can be very slow
Convex Hull it some more…
• Structuring elements for determining the convex hull using
thickening. During each iteration of the thickening, each element
should be used in turn, and then in each of their 90° rotations, giving
8 effective structuring elements in total. The thickening is continued
until no further changes occur, at which point the convex hull is
complete.
Thickening – What is
Achieved…
Essentially what you get as an end result is an image
whose darker regions have expanded. What good
could come of this you may ask? Well, this process
can bring out more detain in an image that you may
not be able to see. For instance using this process
on a finger print image such as this:
We get this….
Major parts of
the finger print
come forth.
This image can
show in more
detail the form
and major parts of
the print. This
would prove
useful in an
application that
needed to identify
criminals based
off of finger prints
alone that are not
very good prints
to begin with.
Comparison
The Code
My code follows the basic outline I discussed before. Before
doing anything to the image I had to make the image a binary
image.

% Set up the image----------------


im1=uint8(im); % casting
LEVEL=Thresh/255.0;
BW = IM2BW(im1,LEVEL); %converts the intensity image I to black
%and white.
% --------------------------------
The Code
Also I would like to mention is that I used the function
“bwmorph()” to morph the image. This made it easier to program
this project and was able to help generate the finger print image
you saw previously.

The operation in my code is set up as:


op=bwmorph(negative,'thin');
The Whole Code
function do_thickening(filename) % Take the negative --------------
s=size(BW);
Thresh=120; % thresholding level negative = zeros(s(1),s(2));
max_gray = max(max(BW));
im=imread(filename); max_gray = im2double(max_gray);
% display the original image------
subplot(3,1,1); for i = 1:s(1)
imagesc(im); for j = 1:s(2)
axis('square'); negative(i,j)= max_gray - BW(i,j);
colormap('gray'); end
% -------------------------------- end
% --------------------------------
% Set up the image----------------
im1=uint8(im); % casting % do the morphing process
LEVEL=Thresh/255.0; op=bwmorph(negative,'thin');
BW = IM2BW(im1,LEVEL); %converts the intensity image I to black % --------------------------------
%and white.
% -------------------------------- % Take the negative --------------
s=size(op);
% display the image as black and white final = op;
subplot(3,1,2); max_gray = max(max(op));
imagesc(BW); max_gray = im2double(max_gray);
axis('square');
colormap('gray');
% --------------------------------
The Rest of it….
for i = 1:s(1)
YA! IM
for j = 1:s(2) THICK!
final(i,j)= max_gray - op(i,j);
end
AHHHHH!!!!!
end
% --------------------------------

% display the end result


subplot(3,1,3);
imagesc(final);
axis('square');
colormap('gray');
% --------------------------------

figure;
imagesc(im);
axis('square');
colormap('gray');
Thickening – Examples
Thickening – Examples
Thickening – Examples
Thickening – Examples
References
Some References other than the book:

•http://www.freepatentsonline.com/6154575.html

•http://homepages.inf.ed.ac.uk/rbf/HIPR2/thick.htm

•http://www.cee.hw.ac.uk/hipr/html/thick.html
Comments or Questions??

S-ar putea să vă placă și