I need to find standard deviation from labeled matrix
Show older comments
My project need to find homogeneity from each cell from image so I decided to use SD for each cell
but I already try std(A) but it doesn't work I try meanintensity in regionprops but I don't know what to do next
do I have anyway to get SD from each labelmatrix
clear
clc
close all
IMG = imread('Cal-IR-MP-3.jpg');
blue = IMG(:,:,3);
th = graythresh(blue);
bw = imbinarize(blue,th);
bw = imclearborder(bw,8);
seD = strel('disk',3);
bw = imopen(bw,seD);
CC = bwconncomp(bw, 8);
L = labelmatrix(CC);
xx = [];
a = 1;
LL1 = L;
for i = 1:CC.NumObjects
LL = L;
if length(CC.PixelIdxList{i})<1000
LL(LL==i) = 0;
LL1(LL1==i) = 0;
else
LL(LL ~= i) = 0;
LL(LL == i)= 1;
xx(a,1) = i;
stats = regionprops(LL,blue,'MeanIntensity');
xx(a,2) = stats.MeanIntensity;
s = std2(i);
a = a+1;
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!