Borrar filtros
Borrar filtros

Segmenting or Thresholding Blue

4 visualizaciones (últimos 30 días)
Haimon
Haimon el 8 de Mayo de 2014
Comentada: Image Analyst el 11 de Jun. de 2019
I need to segment the color blue on this image.
It seems easy, but the software doesn't recognize the blue from some other structures in the image - which are clearly not blue.
Can anyone help?

Respuesta aceptada

Juderb
Juderb el 8 de Mayo de 2014
Most color images are stored in RGB format. In other words, they are 3D matrices where the first, second, and third matrix represents the intensity of red, green, and blue respectively.
In your case, the simplest solution may be to isolate the blue-channel and perform segmenting on that image:
imageRaw = imread("source");
imageBlue = imageRaw(:,:,3);
imageBlueThresh = graythresh(imageBlue);
imageBlueBw = im2bw(imageBlue,imageBlueThresh);
What would you like to do with the segmented regions though? Remove everything else from the image? Outline them? Quantify something within those regions?
  8 comentarios
tashu Dabariya
tashu Dabariya el 9 de Jun. de 2019
show this error Indexing cannot yield multiple results.
error in (line 6) [imageMax,imageMaxIndex] = max(imageRaw,[],3);
Image Analyst
Image Analyst el 11 de Jun. de 2019
You're right - this code doesn't work. Not sure why it was accepted when it's wrong.
There may be other problems, but at least these two lines need to be fixed, and here they are:
imageRaw = imread('IMG_0860.JPG');
imageRaw = double(imageRaw); % NOT double(image) !!!!!!!!!!!!
If you continue to have problem, see my answer below or post your code and image in a new question.

Iniciar sesión para comentar.

Más respuestas (1)

Image Analyst
Image Analyst el 8 de Mayo de 2014
There are several ways to do it, and I show some of them in my File Exchange http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
Or, if you have the stats toolbox, you can use kmeans: http://www.mathworks.com/products/demos/image/color_seg_k/ipexhistology.html
  2 comentarios
Juderb
Juderb el 8 de Mayo de 2014
It looks like your DeltaE file would be perfect for this.
Image Analyst
Image Analyst el 8 de Mayo de 2014
It could be. I'd have to look at the color gamut in 3D. Depending on the shape of the gamut, there are different methods that would be best. Delta E basically carves out a ball in LAB color space. Sometimes you need to carve out a sector using thresholding on the hue channel, and sometimes you need to also consider the saturation and value channels.

Iniciar sesión para comentar.

Categorías

Más información sobre Convert Image Type en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by