이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
Color differentation in the image
조회 수: 2 (최근 30일)
이전 댓글 표시
채택된 답변
Image Analyst
2014년 2월 15일
What do you mean by differentiation? I have several color segmentation demos in my File Exchange if that's what you mean: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
댓글 수: 26
hamed abdulaziz
2014년 2월 15일
Thanks for your response,I have many coloured images some of them contains some color (red,blue,brown,and black)what I need to know how can I detect the color variation in the segmented image(ROI),could you help me by demo please?
Image Analyst
2014년 2월 15일
편집: Image Analyst
2014년 2월 15일
If you have objects with a variety of vivid colors, then it's probably best to threshold the saturation image. See my Color segmentation using HSV demo in my File Exchange, or see this answer: http://www.mathworks.com/matlabcentral/answers/116126#answer_124379 Or perhaps you'd like this: http://www.mathworks.com/matlabcentral/fileexchange/37197-dem-diffused-expectation-maximisation-for-image-segmentation
hamed abdulaziz
2014년 2월 15일
이동: DGM
2023년 12월 30일
Where these image are melanoma and the color variation is one of the features to detect this disease
Image Analyst
2014년 2월 15일
Yes, calculating delta E and then getting the histogram, mean, and std dev of that should be good.
Image Analyst
2014년 2월 15일
편집: Image Analyst
2014년 2월 15일
This demo shows you how to calculate the delta E image and get its histogram. http://www.mathworks.com/matlabcentral/fileexchange/31118-color-segmentation-by-delta-e-color-difference.
hamed abdulaziz
2014년 2월 15일
편집: hamed abdulaziz
2014년 2월 15일
OK, I will accept please could adapt your excellent demo for calculating delta E and then getting the histogram, mean, and std dev for use it with my images ,thanks
hamed abdulaziz
2014년 2월 15일
Image Analyst : please could you help me for calculating delta E and then getting the histogram, mean, and std dev for use it with my images ,thanks
Image Analyst
2014년 2월 15일
편집: Image Analyst
2014년 2월 15일
Make sure you take the mask into account.
pixelsInsideMask = deltaE(mask); % 1D vector of pixels only within mask.
counts = hist(pixelsInsideMask, numberOfBins);
meanDeltaE = mean(pixelsInsideMask(:));
SDDeltaE = std(pixelsInsideMask(:));
hamed abdulaziz
2014년 2월 15일
Ok , I tried your demo but I need to all operation automatically (not clicking by mouse) what I need is to get the color variation as a indication for disease feature
Image Analyst
2014년 2월 15일
You just change/adapt it so that it takes the mean color from your whole image (or the masked part). Do you know how to do that?
hamed abdulaziz
2014년 2월 16일
편집: hamed abdulaziz
2014년 2월 16일
I don't know how to do that?please could you change the demo to work with my images,thanks.
Image Analyst
2014년 2월 16일
Find the mask something like this:
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Find where all of them are zero.
mask = redChannel == 0 & greenChannel == 0 & blueChannel == 0;
Then convert rgb to lab and get mean lab like this:
meanL = mean(lChannel(mask));
meanA = mean(aChannel(mask));
meanB = mean(bChannel(mask));
hamed abdulaziz
2014년 2월 16일
Then how can I get the DELTA E after getting the meanL ,meanA,and meanB ?
Image Analyst
2014년 2월 16일
Like it shows in the demo:
% Make uniform images of only that one single LAB color.
LStandard = LMean * ones(rows, columns);
aStandard = aMean * ones(rows, columns);
bStandard = bMean * ones(rows, columns);
% Create the delta images: delta L, delta A, and delta B.
deltaL = LChannel - LStandard;
deltaa = aChannel - aStandard;
deltab = bChannel - bStandard;
% Create the Delta E image.
% This is an image that represents the color difference.
% Delta E is the square root of the sum of the squares of the delta images.
deltaE = sqrt(deltaL .^ 2 + deltaa .^ 2 + deltab .^ 2);
% Mask it to get the Delta E in the mask region only.
maskedDeltaE = deltaE .* mask;
% Get the mean delta E in the mask region
% Note: deltaE(mask) is a 1D vector of ONLY the pixel values within the masked area.
meanMaskedDeltaE = mean(deltaE(mask));
where meanL is just Lmean by a different name.
hamed abdulaziz
2014년 2월 17일
편집: hamed abdulaziz
2014년 2월 17일
how can determine the the number of(rows and columns) in the
LStandard = LMean *
ones(rows, columns);
and can I use the value of deltaE in the
deltaE = sqrt(deltaL
.^ 2 + deltaa .^ 2 +
deltab .^ 2);
as a feature for color variation?
I tried this code
clear all;
clc;
close all;
% rgbImage= imread('D:\final_segmentation\segmentation_abnormal\200AC.BMP');
rgbImage= imread('D:\3.BMP');
% Find the mask something like this:
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Find where all of them are zero.
mask = redChannel ==
0 & greenChannel ==
0 & blueChannel ==
0; % Then convert rgb to lab and get mean lab like this:
% Convert image from RGB colorspace to lab color space.
cform =
makecform('srgb2lab'
);
lab_Image =
applycform(im2double
(rgbImage),cform); % Extract out the color bands from the original image % into 3 separate 2D arrays, one for each color component.
LChannel = lab_Image(:, :, 1);
aChannel = lab_Image(:, :, 2);
bChannel = lab_Image(:, :, 3);
LMean =
mean(LChannel(mask));
aMean =
mean(aChannel(mask));
bMean =
mean(bChannel(mask));
[rows,
columns]=size(LChann
el);
% Make uniform images of only that one single LAB color.
LStandard = LMean *
ones(rows, columns);
aStandard = aMean *
ones(rows, columns);
bStandard = bMean *
ones(rows, columns); % Create the delta images: delta L, delta A, and delta B.
deltaL = LChannel - LStandard;
deltaa = aChannel - aStandard;
deltab = bChannel - bStandard; % Create the Delta E image. % This is an image that represents the color difference. % Delta E is the square root of the sum of the squares of the delta images.
deltaE = sqrt(deltaL .^ 2 + deltaa .^ 2 + deltab .^ 2);
but I always get deltaE = zero
thank you
Image Analyst
2014년 2월 17일
That's from a line earlier in the demo:
[rows, columns, numberOfColorBands] = size(rgbImage);
hamed abdulaziz
2014년 2월 17일
THANK YOU I ATTACHED WAHT I TRIED (MY_DELTA_E) CODE HOW CAN USE FOR COLOR VARIATION INDICATOR PLEASE COULD CHECK IT FOR CORRECTNESS THANK YOU
hamed abdulaziz
2014년 2월 17일
이동: DGM
2023년 12월 30일
I ATTACHED WAHT I TRIED (MY_DELTA_E) CODE HOW CAN USE DELTA_E FOR COLOR VARIATION INDICATOR PLEASE COULD CHECK IT FOR CORRECTNESS
Image Analyst
2014년 2월 17일
이동: DGM
2023년 12월 30일
Looks about right for as far as you got. You just need to complete it to find the variation using code I gave you in my answer:
pixelsInsideMask = deltaE(mask); % 1D vector of pixels only within mask.
counts = hist(pixelsInsideMask, numberOfBins);
meanDeltaE = mean(pixelsInsideMask(:));
SDDeltaE = std(pixelsInsideMask(:));
hamed abdulaziz
2014년 2월 17일
이동: DGM
2023년 12월 30일
Please did you check (MY_DELTA_E) CODE wher do I add your code?could you complet it and check it on the above images,thanks
pixelsInsideMask = deltaE(mask); % 1D vector of pixels only within mask.
counts = hist(pixelsInsideMask, numberOfBins);
meanDeltaE = mean(pixelsInsideMask(:));
SDDeltaE = std(pixelsInsideMask(:));
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)



