MATLAB Answers

How to construct a feature matrix X where rows correspond to pixels and columns correspond to features?

1 view (last 30 days)
Alp Uygur
Alp Uygur on 15 Jan 2020
Edited: Image Analyst on 15 Jan 2020
I have converted the image from RGB color space to Lab color space using rgb2lab function.
Now I need to represent each pixel via its Lab color values. Construct a feature matrix X where rows correspond to pixels and columns correspond to features.
Which function I need to use? How can I do that?

  0 Comments

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 15 Jan 2020
Edited: Image Analyst on 15 Jan 2020
What are the features? The lab values? Have you tried just using brackets and parentheses?
labImage = rgb2lab(rgbImage);
lImage = labImage(:,:,1);
aImage = labImage(:,:,2);
bImage = labImage(:,:,3);
featureMatrix = [lImage(:), aImage(:), bImage(:)]

  0 Comments

Sign in to comment.

Sign in to answer this question.