Geoscience Reference
In-Depth Information
by-1,060 pixels of three colors (red, green and blue). Since the image is
relatively large, we reduce the image size by a factor of two.
clear
I1 = imread('pollen.jpg');
I1 = I1(1:2:end,1:2:end,:);
imshow(I1,'InitialMagnification',100)
We reject the color information of the image and use the red color only.
I2 = I1(:,:,1);
imshow(I2,'InitialMagnification',100)
Next, we use
adapthisteq
to perform a contrast-limited adaptive histogram
equalization (CLAHE) in order to enhance the contrast in the image
(Zuiderveld 1994).
I3 = adapthisteq(I2);
imshow(I3,'InitialMagnification',100)
h e function
imfindcircles
implements the Hough transform and extracts
circles from the original image.
[centers,radii] = imfindcircles(I3,[12 20],...
'Method','TwoStage',...
'ObjectPolarity','Bright',...
'Sensitivity',0.92,...
'EdgeThreshold',0.20);
num = length(centers);
nstr = ['Number of Pollen Grains: ',num2str(num)];
Herein we use the
TwoStage
detection method for a two-stage circular Hough
transform, following the procedure described by Yuen et al. (1990) and
Davies (2005). h e object polarity is set to
bright
as we are looking for bright
rather than dark objects in our image. h e sensitivity of
0.92
and the edge
threshold of
0.20
are found by trial and error. We then use
viscircles
to
display the circles on the grayscale image
I2
imshow(I2,'InitialMagnification',100)
viscircles(centers, radii,'EdgeColor','b')
title(nstr)
using the output
centers
and
radii
from
imfindcircles
. h e edge color of
the circles in the graphics is set to
b
for blue. h e result shows that we have
counted 884 pollen grains with the method. h e algorithm identii es the
majority of the objects, but some are not recognized and some of the larger
objects are mistakenly identii ed as two or more pollen grains. Using a better