Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Memory problem while doing video / image analysis in Matlab

Status
Not open for further replies.

crchaudhari

Electrical
Jan 29, 2007
1
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
 
Replies continue below

Recommended for you

I'm not that familiar with video grabbing but I can give you some tips...

You will surely benefit from preallocating memory for your image matrices, especially if you collect images inside a loop.
Code:
img = zeros(h,w,3,n);
h = height, w = width and n = number of images.

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor