What should I insert for 'MAP' in immovie(X,MAP)?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Maya West
le 24 Avr 2017
Réponse apportée : Prashant Arora
le 26 Avr 2017
I'm not sure what to put for the input argument 'MAP' in immovie(X,MAP). I have the X (a 900x1200x1x60 matrix) but any input I have for MAP resullts in error. I've tried variations of gray(256) and colormap. Each matrix is in color (but are still 2D matrices) so I expect my movie to also be in color. This is the error I am getting.
Error using im2uint8 (line 83) Invalid indexed image: an index was less than 1.
Error in immovie>parse_inputs (line 88) X = im2uint8(X,'indexed');
Error in immovie (line 38) [X,map] = parse_inputs(varargin{:});
Error in TweetAnalysis (line 993) mov=immovie(statemat,double(colormap));
0 commentaires
Réponse acceptée
Prashant Arora
le 26 Avr 2017
Hi Maya,
The reason you are getting this error is because the function call immovie(X,map) requires X to be an indexed image. This means that the values of X must greater than 1. To read more about indexed images, you can check out the following link
If your image has intensity values from 0 to 1 and you would like to use a colormap of gray(256), you need to scale the image intensity to [1 256]. You can do by using something like this:
X = X.*255 + 1 % Add 1 to start index from 1
I hope this helps!
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Basic Display dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!