MATLAB Answers

To improve the significance of the data

1 view (last 30 days)
Alvin Alvin
Alvin Alvin on 1 Dec 2019
Answered: Image Analyst on 1 Dec 2019
Average gradient (AG). The AG reflects 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:
1.jpeg
This is the code AG
[dfdx,dfdy] = gradient(f) ;
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:
1.png
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?

  0 Comments

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 1 Dec 2019
Run through all your images calling mean2
Then run through them all again dividing by the mean and getting your gradient with imgradient() or imgradientxy(), which ever you want.
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.
% Now call imgradient()
end

  0 Comments

Sign in to comment.

Sign in to answer this question.