Académique Documents
Professionnel Documents
Culture Documents
- Jin, Tao
Introduction
We have modified the image from the lowest level of pixel
data into higher-level representations, using image
segmentation and transforms.
Image segmentation allows us to look at object features.
Object features include the geometric properties of binary
objects, histogram features, and color features.
Area
The area Ai is measured in pixels and indicates the relative
size of the object.
Ai = Ii(r,c) (0 <= r, c <= N-1)
Where:
Ii(r, c) =
1
0
Center of area
We define the center of area for an object by the pair (ri, ci)
ri = ( rIi(r,c) )/Ai (0 <= r, c <= N-1)
ci = ( cIi(r,c) )/Ai (0 <= r, c <= N-1)
(sum of the r,c value of all the pixels divides the number of pixels)
center
c
Perimeter
The perimeter of the object can help us to locate in in space
and provide information about the shape of the object.
The perimeter can be found in the original binary image by
counting the number of 1 pixels that have 0 pixels as
neighbors.
Or it can be found by applying an edge detector to the
object, followed by counting the 1 pixels. Finding the
area of the border.
Matlab - imfeature
Matlab image processing toolbox
provides the imfeature function
stats=imfeature(L,measurements)
L: labeled binary image
Measurement: name of the features
Output: struct array with fields.
FeatureData =
80x1 struct array with fields:
Area
Centroid
BoundingBox
MajorAxisLength
MinorAxisLength
Eccentricity
Orientation
ConvexHull
ConvexImage
ConvexArea
Image
FilledImage
FilledArea
EulerNumber
Extrema
EquivDiameter
Solidity
Extent
PixelList
Experiment - Area
Array = [FeatureData.Area];
Min = min(Array);
Max = max(Array);
Mean = mean(Array);
Std = std(Array);
figure('Name', 'histogram for area'), hist(Array, 20);
idx = find(Array < (Mean-Std));
L2 = ismember(L, idx);
L2 = I.*L2;
figure('Name', 'Objects below mean-std :area'), imshow(L2);
idx = find(Array > (Mean+Std));
L2 = ismember(L, idx);
L2 = I.*L2;
figure('Name', 'Objects above mean+std :area'), imshow(L2);
idx = find((Array < (Mean+Std)) & (Array > (Mean-Std)));
L2 = ismember(L, idx);
L2 = I.*L2;
figure('Name', 'Objects between mean-std and mean+std :area'),
imshow(L2);
Experiment Area(cont.)
Experiment - centroid
Array = [FeatureData.Centroid];
Array = reshape(Array, 2, numObj);
Min = [min(Array(1,:)); min(Array(2,:))];
Max = [max(Array(1,:)); max(Array(2,:))];
Mean = [mean(Array(1,:)); mean(Array(2,:))];
Std = [std(Array(1,:)); std(Array(2,:))];
figure('Name', 'histogram for Centroid.row'), hist(Array(1,:), 20);
figure('Name', 'histogram for Centroid.col'), hist(Array(2,:), 20);
[row, col] = find( (Array(1,:) < (Mean(1,1)-Std(1,1))) & (Array(2,:) < (Mean(2,1)Std(2,1))));
L2 = ismember(L, col);
L2 = I.*L2;
figure('Name', 'Objects below mean-std :Centroid'), imshow(L2);
[row, col] = find( (Array(1,:) > (Mean(1,1)+Std(1,1))) & (Array(2,:) >
(Mean(2,1)+Std(2,1))));
L2 = ismember(L, col);
L2 = I.*L2;
figure('Name', 'Objects above mean+std :Centroid'), imshow(L2);
[row, col] = find( (Array(1,:) > (Mean(1,1)-Std(1,1))) & (Array(2,:) > (Mean(2,1)-Std(2,1)))
& ...
(Array(1,:) < (Mean(1,1)+Std(1,1))) & (Array(2,:) < (Mean(2,1)+Std(2,1))));
L2 = ismember(L, col);
L2 = I.*L2;
figure('Name', 'Objects between mean-std and mean+std :Centroid'), imshow(L2);
Experiment centeroid(cont.)