Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] MATLAB Simulink image and video acquisition ?

Status
Not open for further replies.

hadimotamedi

Newbie level 5
Joined
Jan 12, 2011
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,352
Dear All
To deal with MATLAB Simulink image and video acquisition toolbox, do I need to obtain a special webcam or any general purpose webcam that can be purchased domestically can do the job and the toolbox will recognize it automatically?
Thank you
 

You must have a Matlab version 7 or above.
Check your toolbox for image acquisition toolbox. For this open matlab->start->toolbox. Check out all the installed toolboxes.

Then type in the matlab command window imaqhwinfo. This will get you the list of adaptors.

>>imaqhwinfo

ans =

InstalledAdaptors: {'coreco' 'winvideo'}
MATLABVersion: '7.8 (R2009a)'
ToolboxName: 'Image Acquisition Toolbox'
ToolboxVersion: '3.3 (R2009a)'


This is what I got for the a same command. See the adaptors installed are ‘{'coreco' 'winvideo'}

Any camera you connect to your PC or Laptop can be accessed through these adaptors.

Connect your webcam to the computer through the USB.

aqVideo = videoinput(‘winvideo’, 1, ‘RGB24_640x480′); \\Specify the adaptor name and resolution of the video.
preview(aqVideo);
aqImage = getsnapshot(aqVideo);Capture

This command will store the image of that instant into the variable data in a matrix of 640X480.

Now you can process the data as you wish. I hope this is helpful to you. :smile:
 
Thank you very much for your help. I have MATLAB R2010a and according to you I just need to have a general purpose webcam attached to my MS Windows machine.
 

sir how to get a snapshot of image and how the image save..
 

i mean sir.. how to capture an image and save it to a folder...
 

If you need to capture and image from a video source like a webcam or so, the code is mentioned above.

Type in the matlab command window imaqhwinfo. This will get you the list of adaptors.

>>imaqhwinfo

ans =

InstalledAdaptors: {'coreco' 'winvideo'}
MATLABVersion: '7.8 (R2009a)'
ToolboxName: 'Image Acquisition Toolbox'
ToolboxVersion: '3.3 (R2009a)'


This is what I got for the a same command. See the adaptors installed are ‘{'coreco' 'winvideo'}

Any camera you connect to your PC or Laptop can be accessed through these adaptors.

Connect your webcam to the computer through the USB.

aqVideo = videoinput(‘winvideo’, 1, ‘RGB24_640x480′); \\Specify the adaptor name and resolution of the video.
preview(aqVideo);
aqImage = getsnapshot(aqVideo);Capture

This command will store the image of that instant into the variable data in a matrix of 640X480.
 

anyone here has an idea how to clear memory in matlab? thanks a lot..
 

Function 'clear' and 'clearvars' clears the workspace.

clear all; - clears the entire workspace
clear var1,var2; - clears only var1 and var2 variable from the workspace
 

sir i tried the function but still the same error occurred...

thank you so much for the reply.. i really appreciate it..

more power...
 

If you are memory overload is creating a problem for you, one way I guess is to increase your virtual memory substantially. This increases the workspace and hereby more number of variables can be worked upon. However you can also look for memory fragmentation under matlab. This might be of help too.
 

Hi,
The information you gave here is useful when someone wants to take snapshots of video from webcam or other input device, but what if i want to take snapshots of videos available in matlab workspace? Command 'mplay' helps to play a video. But i want to take snapshots of the videos available in workspace. What should i do?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top