How to separate RGB values of an image.
13 views (last 30 days)
Jim Dowd on 1 Feb 2011
Sean de has told you how to get each plane, but it sounds like you want some kind of vector. I am not sure what you mean by a 3 vector, but here are a couple of guesses.
If you want 3 vectors:
R = reshape(I(:,:,1),,1);
G = reshape(I(:,:,2),,1);
B = reshape(I(:,:,3),,1);
Now if you want them all together in a 3 column vector:
V3 = reshape(A(:),,3) % R is first col, G is second col, B is third.
More Answers (3)
Sailesh Sidhwani on 25 Oct 2018
Edited: Sailesh Sidhwani on 3 Sep 2020