MATLAB: How to highlight a specific color or range of colors in an image for separating objects from their surroundings? This concept is called color slicing but no idea how to implement it in MATLAB.

color segmentationcolor slicinghighlighting a range of colorsImage Processing Toolbox

the formula is si = some value , if rj -aj = W/2 ; = ri , otherwise where, rj = pixel value aj = specific color value w = width of the cube

Best Answer

I've never heard of color slicing. I've heard of color segmentation. It sounds like you first need to do a segmentation as to what's foreground and what's background. This could be tough if you have objects of vastly different sizes on backgrounds of varying colors. For example, what is the foreground on the image "The autumn color swamp" on this page http://www.ritsumei.ac.jp/~akitaoka/index-e.html
I have many color segmentation methods on my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862