フィルターのクリア

How to change 257x251x1 uint8 into 257x251x3 uint8?

1 回表示 (過去 30 日間)
Dayangku Nur Faizah Pengiran Mohamad
Dayangku Nur Faizah Pengiran Mohamad 2023 年 6 月 13 日
コメント済み: mohd akmal masud 2023 年 7 月 13 日
Can anyone help me out? How to change my input image data in grayscale 257x251x1 uint8 change into 'truecolor' rgb type? (mxnx3)
Here my codes:
I=imread('1222.png');
I2=I(:,:,1:3);
The error occured; Index in position 3 exceeds array bounds (must not exceed 1).

採用された回答

Walter Roberson
Walter Roberson 2023 年 6 月 13 日
I=imread('1222.png');
if ndims(I) == 2; I = I(:,:,[1 1 1]); end %convert to rgb
  5 件のコメント
Walter Roberson
Walter Roberson 2023 年 6 月 13 日
Based on the sizes it looks like you concatenated along the first dimension when you needed to concatenate along the 4th dimension.
mohd akmal masud
mohd akmal masud 2023 年 7 月 13 日
Dear @Dayangku Nur Faizah Pengiran Mohamad, maybe you can attached the image data, and groundtruth labeling here.
quite imposiible to find the error just read the code given.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeJust for fun についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by