matlab image processing
古いコメントを表示
How to merge the r,g and b components to get a single rgb image in matlab???
採用された回答
その他の回答 (2 件)
Sivakumaran Chandrasekaran
2012 年 3 月 24 日
hi jan, r = rand(20, 30); g = rand(20, 30); b = rand(20, 30); rgb = [r, g, b]; imshow(rgb)
thats my code.. could you explain me whats the different between your code and mine. I am getting gray image as output. But,you are getting colored one. could you explain this technically. why i am not getting color image even though i concatenated those three basic colors.
Regards, Siva
2 件のコメント
Bjorn Gustavsson
2012 年 3 月 24 日
If you get pure gray it might be because your R G and B images are identical or close to identical?
Jan
2012 年 3 月 24 日
[r,g,b] is equivalent to cat(2, r, g, b): It concatenates along the 2nd dimension. Try it with smaller values to keep the overview:
r=[1,2;3,4]; g=r+5; b=g+5;
disp([r,g,b])
disp(cat(3, r, g, b))
The concatenation along the 2nd dimension creates a 2D matrix of type double, which is displayed as grey scale image.
Sivakumaran Chandrasekaran
2012 年 3 月 27 日
0 投票
Thanks Jan and Bjorn
カテゴリ
ヘルプ センター および File Exchange で Image Arithmetic についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!