To improve the significance of the data
2 次查看(过去 30 天)
显示 更早的评论
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](https://www.mathworks.com/matlabcentral/answers/uploaded_files/251670/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](https://www.mathworks.com/matlabcentral/answers/uploaded_files/251671/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 个评论
回答(1 个)
Image Analyst
2019-12-1
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.
See for FAQ for code https://matlab.fandom.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F.
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 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!