How can I calculate euclidian distance in RGB spaces for a skin lesion ?
12 次查看(过去 30 天)
显示 更早的评论
To be clear I want to find The Euclidean distance D which is calculated between each pixel color and the six colors ( white , red, light brown , dark brown , blue gray and black ). I converted the RGB color space to the CIE Labcolor space but I don't know how to continue . I attach my code so far and an image.
1 个评论
William Rose
2022-9-19
WhenI try to runthe script I get the error
Error using imread (line 349)
File "color.png" does not exist.
Error in xromadik (line 32)
rgbImage= imread('color.png');
采纳的回答
Image Analyst
2022-9-22
"I want to find the percentage of colour appearance for each one of the six colours (white , red, light brown , dark brown , blue gray and black ).What i have to do?" <== See attached Discriminant Analysis demo. It does exactly that.
更多回答(2 个)
Image Analyst
2022-9-19
编辑:Image Analyst
2022-9-19
Use this function: deltaE
You will need to calibrate your images with known color standards, otherwise the delta E you get is totally dependent on the lighting you use and your exposure time. See attached tutorial.
0 个评论
William Rose
2022-9-19
Since there is a file missing which I need to run your code, I will just give a few suggesitons.
- Post the simplest possible example that demonstrates the problem or what you are trying to do.
- If you want to compute distance between two specific colors in CIE space, use dist=imcolordiff(c1,c2), where c1, c2 are RGB colors.
- To get a monochrome image whose gray scale values represent color distance (in CIE space) between corresponding pixels of 2 images, use im3=imcolordiff(im1,im2), where im1, im2 are RGB images.
See imcolordiff help for additional options and examples. Good luck.
6 个评论
Image Analyst
2022-9-23
You can train it and classify it with a discriminant classifier. See attached demo and adapt as needed.
Or you could use k-nearest neighbors.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Color 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!