how compute color std fast

3 ビュー (過去 30 日間)
michael scheinfeild
michael scheinfeild 2014 年 9 月 9 日
コメント済み: Image Analyst 2014 年 9 月 10 日
hi i want to detect areas in image where there is large diffrence in color for example [r,g,b] = [130 120 137]--> new binary image 0 [r,g,b] = [60 190 87]--> new binary image 1 (large difrence of colors) so i do loop but it seems not efficient
for(mi=1:m)
for(ni=1:n)
newimg(mi,ni) = squeeze(std(imd(m,n,:)));
end
end
then i do threshold on newimg

回答 (3 件)

Image Analyst
Image Analyst 2014 年 9 月 9 日
You don't want to do it the way you propose. Trust me - I teach courses on color science. Color difference is called "Delta E" and is pretty much the distance between the colors plotted in CIE LAB color space (see my avatar to the left). I have an application that computes the local Delta E and returns that as an image. You first compute that image and then threshold that. For example see in the image below that areas with high color variation are the edges and those are segmented out (by thresholding the delta E image in the middle row, left column), along with areas where the color doesn't change much.
  1 件のコメント
Image Analyst
Image Analyst 2014 年 9 月 10 日
So, Michael, what do you think?

サインインしてコメントする。


Ahmed
Ahmed 2014 年 9 月 9 日
編集済み: Ahmed 2014 年 9 月 9 日
The std function can operate on any dimension. For details see the help of 'std'.
newimg = std(imd,0,3);
It might be faster, if you re-order your data matrix 'imd' such that the third dimension becomes the first.
imd = permute(imd,[3 1 2]);
newimg = squeeze(std(imd,0));

Michael scheinfeild
Michael scheinfeild 2014 年 9 月 10 日
i realy didnt get what you mean but my idea works great even it can overcome ilumination that homomorphic transform didnt succes , this is the histogram and it make great segmentation for my case , i cant put the segmented image due to security reasons
  1 件のコメント
Image Analyst
Image Analyst 2014 年 9 月 10 日
OK, if your ad hoc method works for your images, then fine. Though, it doesn't measure color difference the same in different parts of color space because RGB color space is not linear with respect to human vision. For example the same stdDev around black or white does not produce the same apparent visual color difference to humans as when the colors are vivid red or blue. That's why CIE LAB color space was invented - see my avatar to the left. Hopefully some day you will have time to learn about color theory and the human visual system.

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by