What should I insert for 'MAP' in immovie(X,MAP)?

2 次查看(过去 30 天)
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));

采纳的回答

Prashant Arora
Prashant Arora 2017-4-26
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 个)

类别

Help CenterFile Exchange 中查找有关 3-D Volumetric Image Processing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by