What does the following message mean?"Unable to perform assignment because the size of the left side is 50-by-150 and the size of the right side is 50-by-150-by-3."
1 回表示 (過去 30 日間)
古いコメントを表示
Yanitsa Stancheva
2019 年 5 月 19 日
回答済み: Yanitsa Stancheva
2019 年 5 月 20 日
Hi everyone, I am new to matlab and currently working on image processing and I have the following issue: I am trying to insert an image 50x150 onto another image, but it shows that error "Unable to perform assignment because the size of the left side is 50-by-150 and the size of the right side is 50-by-150-by-3." I am really puzzled what this means? The image I am trying to insert is called "july" in the work space and it appears 50x150x3 which I have no clue what the "3" is???Any help will be greatly appreciated.
0 件のコメント
採用された回答
Walter Roberson
2019 年 5 月 20 日
50x150x3 means 50 rows, 150 columns, and 3 color planes. Your image july is an RGB image, even if it looks grayscale. You probably read it from a JPEG image, and JPEG images are almost always RGB.
You are trying to store an RGB image into a space that is only set up to receive a grayscale or pseudocolor image.
If you expect to be working with grayscale then use rgb2gray(july)
0 件のコメント
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!