initially my data is like this :
after some steps I have used:
imwrite (mat2gray(Gxx_t2), 'NEW IMAGE.png');
[X_raw,map] = imread ('NEW IMAGE.png');
The values X_avg are saved in excel sheet as ' text (tab delimited)'.
now I can recall X_avg directly by using:
y=dlmread('X_avg.txt', '\t', 0, 0);
I need to use dlmread to read the data and i need to use imagesc instead of imread and imshow.
Like this I have created a database of around 40 text files for metal pipe, steel box, plastic box. I want to extract statistical features from all the files for that I have calculated mean, variance, skew, kurtosis for single file.
[pixelCounts GLs] = imhist(X_avg);
numberOfPixels = sum(pixelCounts);
meanGL = sum(GLs .* pixelCounts) / numberOfPixels
varianceGL = sum((GLs - meanGL) .^ 2 .* pixelCounts) / (numberOfPixels-1)
skew = sum((GLs - meanGL) .^ 3 .* pixelCounts) / ((numberOfPixels - 1) * sd^3)
kurtosis = sum((GLs - meanGL) .^ 4 .* pixelCounts) / ((numberOfPixels - 1) * sd^4)
How to calculate these features for all files using single code and how to store these features?