How do I analyze color uniformity of my image in Matlab?

조회 수: 17 (최근 30일)
Utkarsh Desarda
Utkarsh Desarda 2022년 1월 26일
편집: Image Analyst 2022년 7월 30일
I have a image of a paper sensor made by dipping in a bunch of solutions. After drying, it produces almost uniform color all over the paper. But is there any way I can analyze this image to arrive at a perticular value of uniformity? My ultimate goal is to be able to produce uniform color and be able to reproduce same results that I can put in matlab and confirm the value. I have attached the image that I want to analyze.

답변 (3개)

Mahesh Taparia
Mahesh Taparia 2022년 3월 8일
Hi
With respect to your image, there are possibly 2 different colors. You can analyze the pixel values using histogram of image, refer this documentation for more detail. You can convert the RGB image to gray scale or you can consider the channel which you want to analyze. The histogram will give peaks, those peaks can be the desired value.

Mathew Metzger
Mathew Metzger 2022년 7월 30일
I am also interested in color uniformity calculations. Have you found any solutions to your question?
  댓글 수: 1
Walter Roberson
Walter Roberson 2022년 7월 30일
You could find the standard deviation of some measure of the color. For example you could convert to HSV and examine the H channel -- remembering, though, that any difference from the mean needs to be calculated as min(difference, 1-difference) because H is an angle in the range 0 to 1

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2022년 7월 30일
편집: Image Analyst 2022년 7월 30일
This is not hard at all. First of all you have to get just the green paper disc, which you can do easily by thresholding on the Saturation or CIE A color channel.
Then you need to convert the image to CIELAB with rgb2lab(). Then get the mean L, a, and b with mean(). Then you need to get a delta E image using Pythagorean theorem. Finally look at the histogram of the delta E values. You can use std or iqr to get a metric related to uniformity.
In short (untested)
labImage = rgb2lab(rgbImage);
[lImage, aImage, bImage] = imsplit(labImage);
% Compute the circular mask.
mask = aImage < -8; % Or whatever works. Or use the Color Thresholder app.
mask = imclearborder(mask);
mask = bwareafilt(mask, 1); % Take largest blob.
% Get mean LAB values.
meanL = mean(lImage(mask))
meanA = mean(aImage(mask))
meanB = mean(bImage(mask))
% Compute the color difference image.
deltaEImage = sqrt((lImage - meanL).^2 + (aImage - meanA).^2 + (bImage - meanB).^2);
deltaEImage(mask) = 0; % Mask away stuff outside the mask.
imshow(deltaEImage, []);
% Compute uniformity metrics:
stdDev = std(deltaEImage(mask))
If you can't get it to work, let me know and I'll work up a full demo.

카테고리

Help CenterFile Exchange에서 Modify Image Colors에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by