R,G,Bに分かれた​行列からカラー画像を​つくりたいです。

I_result_R
I_result_G
I_result_B
I_color = uint8(cat(3, I_result_R, I_result_G, I_result_B));
I_result_RとI_result_GとI_result_Bの3つを合わせてカラー画像を作りたいのですが
I_color = uint8(cat(3, I_result_R, I_result_G, I_result_B));ではグレースケールの画像が出力されました。

3 件のコメント

Dyuman Joshi
Dyuman Joshi 2023 年 12 月 22 日
On a cursory glance, try using im2uint8 -
I_color = im2uint8(cat(3, I_result_R, I_result_G, I_result_B))
What are the data type of the R, G and B matrices?
Atsushi Ueno
Atsushi Ueno 2023 年 12 月 22 日
By some mistake, the contents of I_result_R, I_result_G, and I_result_B would be exactly the same.
何かの手違いで、I_result_R, I_result_G, I_result_B の内容が全く同じ内容になっているのでしょう。
RGB = imread("peppers.png");
I_result_R = RGB(:,:,1);
% I_result_G = RGB(:,:,2);
% I_result_B = RGB(:,:,3);
I_color = uint8(cat(3, I_result_R, I_result_R, I_result_R));
imshow(I_color)
Dyuman Joshi
Dyuman Joshi 2023 年 12 月 22 日
That could be possible, nice find @Atsushi Ueno.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File Exchangeイメージ についてさらに検索

タグ

質問済み:

2023 年 12 月 22 日

コメント済み:

2023 年 12 月 22 日

Community Treasure Hunt

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

Start Hunting!