How can I apply the "lillietest" function to data from a grayscale image to see how the data fits a normal distribution?
1 view (last 30 days)
Show older comments
MathWorks Support Team
on 1 Sep 2016
Answered: MathWorks Support Team
on 14 Oct 2016
How can I apply the "lillietest" function to data from a grayscale image to see how the data fits a normal distribution?
Accepted Answer
MathWorks Support Team
on 1 Sep 2016
In order to apply the "lillietest" function to your image data, please use the following workflow replacing 'download.jpg' with your image name:
img = imread('download.jpg'); % Read the image (either grayscale or not).
grayScaleImg = rgb2gray(img); % Convert to grayscale.
grayScaleImg = reshape(grayScaleImg,1,[]); % Reshape into a column vector.
grayScaleImg = double(grayScaleImg); % Convert to double since lillietest requires double or single.
[h,p,k,c] = lillietest(grayScaleImg); % Apply Lillefors test to get parameters.
It is important to know that the "lillietest" function requires a single vector of raw data instead of separate vectors for the frequency of data points and the data points themselves.
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!