2015年3月28日 星期六

[MATLAB] im2frame() colormap & Array Preallocation

There has some thing to notice is that im2frame need to assign a colormap

ie.  mov = im2frame(img_variable, colormap);

img_variable is the name of a image file that you are dealing with

colormap decide which kind of image you are using, like RGB color image or gray scale

imge etc.

So, next time don't forget to assign the colormap



Another thing is

when we want to make a video from a sequence of images

be careful this problem (Variable appears to change size on every loop iteration )

If not, you'll find out your RAM will overload when there are hundreds of images you

want to process.

(Related  1. Understanding Array Preallocation ;

                2. More about automatic array growth improvements in MATLAB R2011a

                3. Performance penalties)



沒有留言:

張貼留言

/* 載入prettify的autoloader */ /* 載入JQuery */