How to construct a feature matrix X where rows correspond to pixels and columns correspond to features?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Image Analyst
2020-1-15
编辑:Image Analyst
2020-1-15
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Modify Image Colors 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!