What should I do to extract texture features now?

2 Ansichten (letzte 30 Tage)
Shaila parvin
Shaila parvin am 17 Mär. 2014
Kommentiert: Image Analyst am 6 Jul. 2016
This is the code for segmentation of an image. I want to extract the texture features of the image. What should I do now? Please help me.
clc;
he = imread('t1.jpg');
imshow(he), title('Apple image');
text(size(he,2),size(he,1)+15,...
'Image courtesy of Alan Partin, Johns Hopkins University', ...
'FontSize',7,'HorizontalAlignment','right');
cform = makecform('srgb2lab');
lab_he = applycform(he,cform);
ab = double(lab_he(:,:,2:3));
nrows = size(ab,1);
ncols = size(ab,2);
ab = reshape(ab,nrows*ncols,2);
nColors = 3;
% repeat the clustering 3 times to avoid local minima
[cluster_idx cluster_center] = kmeans(ab,nColors,'distance','sqEuclidean', ...
'Replicates',3);
pixel_labels = reshape(cluster_idx,nrows,ncols);
imshow(pixel_labels,[]), title('image labeled by cluster index');
segmented_images = cell(1,3);
rgb_label = repmat(pixel_labels,[1 1 3]);
for k = 1:nColors
color = he;
color(rgb_label ~= k) = 0;
segmented_images{k} = color;
end
imshow(segmented_images{1}), title('objects in cluster 1');
imshow(segmented_images{2}), title('objects in cluster 2');
imshow(segmented_images{3}), title('objects in cluster 3');

Antworten (1)

Image Analyst
Image Analyst am 17 Mär. 2014
Well that code does not do it. It does color segmentation. To do a texture segmentation you want to get a gray level image such as by taking one color channel or using rgb2gray() or by using rgb2hsv and taking one of the channels such as the v channel. Then use stdfilt() or entropyfilt() or a filter of your own.
  2 Kommentare
Preeti
Preeti am 6 Jul. 2016
How to extract texture features after applying the filter? graycoprops provides only 4 features
Image Analyst
Image Analyst am 6 Jul. 2016
Like I said, create "a filter of your own." If you know those are not enough or what you want, then what other properties do you want?

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by