Feature extraction of texture, irregularity

Is there any opinion about how can calculate these kind of texture's regularity metric. You see there is difference because of directionality,particle shape, size, placement etc. Is there any code for this. regards

 Réponse acceptée

Image Analyst
Image Analyst le 3 Mai 2016

0 votes

Try functions like stdfilt(), graycomatrix(), graycoprops(), regionprops(), etc. There are a lot of things you could potentially measure so the algorithm depends on exactly what you're interested in characterizing.

3 commentaires

ali
ali le 3 Mai 2016
Actullay i thought these something like that std/mean. First i thought score characterizing the spread of the primitives. For examples peaks points then. There should be distance measure for closing neighbor like min(i-j) for N fixation points. And then all these distance points can combine, after my suggestion should be take into. But how can i first calculate these distances for all image(n point), is there a simple way :)
Image Analyst
Image Analyst le 3 Mai 2016
If you use regionprops() you can get the centroid of all the blobs. Then you can use pdist2() in the stats toolbox to find the distance of every centroid to every other centroid. Sometimes people look at the mean distance of the 5 or 10 closest blobs.
Anjali Acharya
Anjali Acharya le 10 Août 2018
Modifié(e) : Anjali Acharya le 10 Août 2018
How can we use GLCM features to obtain fractal dimension?

Connectez-vous pour commenter.

Plus de réponses (4)

Image Analyst
Image Analyst le 3 Mai 2016

0 votes

4 commentaires

ali
ali le 3 Mai 2016
thanks. I will analyze the link.
ali
ali le 4 Mai 2016
newy5 = y3(1:1460, 1:2080); imshow(newy5); yn=im2bw(newy5,0.5); %threshold level define 0.7 5 icin 0.5 7 ler icin figure;imshow(yn); tst=imcomplement(yn);figure;imshow(tst);
BW2 = bwareaopen(tst,7000); %remove small dipserse objects figure;imshow(BW2);
s = regionprops(BW2,'centroid'); % calculate the remaining objects centers. centroids = cat(1, s.Centroid); % combine all them
D = pdist2(centroids(:,1),centroids(:,2),'euclidean'); %calculate the distance between them
value=std(D)/mean(D) %irregularity
value1=mean2(D)
is this true or not what is your suggestion
You're calling pdist2() incorrectly. You have to pass it two arrays of x,y coordinates. In your case they will be the same array. So you should do
distances = pdist2(centroids, centroids, 'euclidean');

Connectez-vous pour commenter.

ali
ali le 5 Mai 2016
Modifié(e) : ali le 5 Mai 2016

0 votes

s = regionprops(newBW2,'centroid'); % calculate the remaining objects centers. centroids = cat(1, s.Centroid);
D = pdist2(centroids(:,1),centroids(:,2),'euclidean');
the result just Centroid: [949.2040 788.5083], why i cant take all distances if blobs big then calculate but for this figure the particles small then just one centroid. What is wrong? So the value i use for irregularity always zero because std(D)=0 and mean(D)=0 because of the D is just one value. How can i solve this

8 commentaires

Image Analyst
Image Analyst le 5 Mai 2016
"why i cant take " <== You can. No one is stopping you.
D should not be just one value unless you have only one centroid. What does length(s) tell you? That's how many regions you have.
ali
ali le 8 Mai 2016
Modifié(e) : ali le 8 Mai 2016
Actually I dont understand, I remove bigger ones from binary image. But like you see from untitled, When ı use the s = regionprops(newBW2,'centroid','Area'); it calculates all white areas but centroid just one values why I cant take all pairwise distances from second image.
You're calling pdist2() incorrectly. You have to pass it two arrays of x,y coordinates. In your case they will be the same array. So you should do
distances = pdist2(centroids, centroids, 'euclidean');
ali
ali le 9 Mai 2016
Modifié(e) : ali le 9 Mai 2016
like this usage distance found 0. More than 5000 objects found on binary image. Soit has to be found distances but no?
What is the size of centroids?
size(centroids)
ali
ali le 9 Mai 2016
Modifié(e) : ali le 9 Mai 2016
%% ifeatures=zeros(1,5);%/to take features close all; for i=1:30%/for take one by one image close all;
%preprocessing step for images readimage=tum{1,i}; new_image = readimage(1:1460, 1:2080); %//%% imshow(new_image);
%convert to gray image binary level %suggested threshold for 3 and 5 level about 0.7 %7 level ıs 0.5 thresh_image=im2bw(new_image,0.7); %threshold level define 0.7 5 icin, 0.5 7 ler icin % figure;imshow(thresh_image);
%complement stage thresh_image_conv=imcomplement(thresh_image);figure;imshow(thresh_image_conv);
%removing dispersed areas from image %level is determined by expert and found empirically BW2 = bwareaopen(thresh_image_conv,5000); %remove small dipserse objects % figure;imshow(BW2); newBW2=imsubtract(thresh_image_conv,BW2);figure;imshow(newBW2); %substract image to remove non-dispersed areas %
%this part use for extract features from images(binary) if(mean2(newBW2)~=0) % calculate the remaining objects centers. s = regionprops(newBW2,'centroid','Area'); area = extractfield(s,'Area'); centroids = cat(1, s.Centroid); % combine all them [labeledImage, numberOfObject] = bwlabel(newBW2);
%calculate the distance between them
D = pdist2(centroids,centroids,'euclidean');
value=std(D)/mean(D) %irregularity
value1=mean2(D) % average value of all distances
value2=std(D); %std for all areas
elseif(mean2(newBW2)==0)
value=0;
value1=0;
value2=0;
end
temp_new=horzcat(value,value1,numberOfObject,mean2(area),max(value2));
ifeatures=vertcat(ifeatures,temp_new);
end
ali
ali le 9 Mai 2016
Modifié(e) : ali le 9 Mai 2016
size(centroids)
answer 1 2
ali
ali le 10 Mai 2016
waiting for this suggestion you ImageAnalyst

Connectez-vous pour commenter.

ali
ali le 9 Mai 2016
Modifié(e) : ali le 9 Mai 2016

0 votes

Actually I want to look at for this images dispersion level. The white cells dispersion is high(regular) or not on the surface image that is the reason why i want to measure this. Like homogeneus dispersion but GLCM not give significant so i want to design new feature. Like your suggestion i cant take dimension what is wrong my code? Fractal analysis can be use or not?

2 commentaires

Image Analyst
Image Analyst le 9 Mai 2016
This is not an answer to the original question. Was it a comment to me, or a comment on your other "answer"?
ali
ali le 10 Mai 2016
This is an another idea that comes my mind. I m waiting for your suggestion another centroid question

Connectez-vous pour commenter.

ali
ali le 10 Mai 2016

0 votes

And image analyst do you have any suggestion for calculation distance for this D = pdist2(centroids,centroids,'euclidean'); for mathematical formula and other suggestions from you for centroid question

Community Treasure Hunt

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

Start Hunting!

Translated by