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 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Yanitsa Stancheva
il 19 Mag 2019
Risposto: Yanitsa Stancheva
il 20 Mag 2019
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 Commenti
Risposta accettata
Walter Roberson
il 20 Mag 2019
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 Commenti
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Image Processing Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!