# To improve the significance of the data

1 view (last 30 days)
Alvin Alvin on 1 Dec 2019
Answered: Image Analyst on 1 Dec 2019
Average gradient (AG). The AG reﬂects the ability to express the details of an image and can be used to measure the
relative clarity of the image. AG is formulated as:
This is the code AG
M = (dfdx.^2+dfdy.^2)/2 ;
AG = mean(mean(M)) ;
But need help with this equation
To improve the significance of the data, a comprehensive evaluation parameter was set in the experiment so that the average values of different sets of test data could be presented in a consistent manner:
where n is the sample size, Yi is the result of testing on a certain sample, and Y is the average value.
How to code this equation?

Image Analyst on 1 Dec 2019
Run through all your images calling mean2
for k = 1 : numFiles
% Get gray scale image..... using FAQ... then
means(k) = mean2(grayImage);
end
% Get the the mean of all the image means.
meanMean = mean(means)
% Now go through again
for k = 1 : numFiles
% Get gray scale image..... using FAQ... then
grayImage = meanMean * double(grayImage) / means(k); % Cast to uint 8 if you want in in uint8 instead of double.