Memory problem while doing video / image analysis in Matlab
Memory problem while doing video / image analysis in Matlab
(OP)
Hello everyone,
I am working on a project where I need to analyse video data in real
time to control the robot. I need to get a frame from video data
received from CCD camera and perform some image processing and
generate a control action based on it and then again repeat the same
process for next frame.
I have created a video object using videoinput function and am
getting a frame from this video data using getsnapshot function but I
am facing some memory problems(like java.lang.memory out and Matlab
crashes)while running the program in a loop. I dont know much about
the settings and memory management. Please guide me so that I can use
these functions in a loop and do analysis frame by frame.
Thanks,
Chandresh
I am working on a project where I need to analyse video data in real
time to control the robot. I need to get a frame from video data
received from CCD camera and perform some image processing and
generate a control action based on it and then again repeat the same
process for next frame.
I have created a video object using videoinput function and am
getting a frame from this video data using getsnapshot function but I
am facing some memory problems(like java.lang.memory out and Matlab
crashes)while running the program in a loop. I dont know much about
the settings and memory management. Please guide me so that I can use
these functions in a loop and do analysis frame by frame.
Thanks,
Chandresh





RE: Memory problem while doing video / image analysis in Matlab
You will surely benefit from preallocating memory for your image matrices, especially if you collect images inside a loop.
CODE
Explore the possibility of using uint8 data type instead of the default double (64bits) for your image matrices. This will reduce the memory requirements for your images to 1/8.
I believe that many (if not all) of Matlab's image processing functions can be used on uint8 images.