colour detection matlab code error

2 views (last 30 days)
dure tabish
dure tabish on 1 Dec 2013
Answered: Image Analyst on 1 Dec 2013
can anyone help me on what is wrong with this colour detection code % colour detection rgb = imread('red.jpg'); image(rgb); title('RGB image') redBand = rgb(:, :, 1); greenBand = rgb(:, :, 2); blueBand = rgb(:, :, 3); % Display them. subplot(3, 4, 2); imshow(redBand); title('Red Band') subplot(3, 4, 3); imshow(greenBand); title('Green Band') subplot(3, 4, 4); imshow(blueBand); title('Blue Band')

Answers (1)

Image Analyst
Image Analyst on 1 Dec 2013
Other than not being formatter properly, which can be fixed by you viewing this link: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup, there are no errors in the code that I can see. However I don't know what you mean by color detection. What that code does is to break the RGB image up into separate color channels and display them. If that's not what you want, then perhaps you need to look at my color segmentation/detection tutorials in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!