現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
Color differentation in the image
1 回表示 (過去 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 件)
参考
カテゴリ
Help Center および File Exchange で Computer Vision with Simulink についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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 (한국어)