how compute color std fast
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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
0 comentarios
Respuestas (3)
Image Analyst
el 9 de Sept. de 2014
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 comentario
Ahmed
el 9 de Sept. de 2014
Editada: Ahmed
el 9 de Sept. de 2014
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));
0 comentarios
Michael scheinfeild
el 10 de Sept. de 2014
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 comentario
Image Analyst
el 10 de Sept. de 2014
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.
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!