×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Memory problem while doing video / image analysis in Matlab

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

RE: Memory problem while doing video / image analysis in Matlab

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources