Invobot : Artificially intelligent

Lets make machines intelligent

Image capture using Webcam in Matlab

Posted by Ib / Vce(sat) on March 23, 2007

Have you ever wanted to process your image and then do some processing and then move your robot?

well this can be easily done through MATLAB. Get Matlab 7.You must check if you have the data acquisition toolbox in your version. that you have installed.

TO FIND IF YOU HAVE DATA ACQUISITION

Just get to the Matlab Start menu

That shows that the toolbox exixts.

Want more?
Type “imaqhinfo” in command window to see this

Notice that the adaptor is ‘Winvideo’

Any webcam you connect is accessed through this adaptor. Now the main part
1)Connect your webcam to the computer through the USB.
vid = videoinput(‘winvideo’, 1, ‘RGB24_320×240′);

Specify the adaptor name and resolution

2) Open Preview window to view video at runtime
preview(vid);

This will open a window similar to yahoo messenger Webcam interface. And you will be able to view the video demo the webcam at runtime

3) Capture
data = getsnapshot(vid);

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

That’s it , now that you have the image of what your robot is looking at or probably the desired object, you may carry on processing and provide proper control signals to your Parallel Ports . If You are new to parallel ports read here.

comment your thoughts, don’t keep them to yourself!!!

Madan – Your host :)

126 Responses to “Image capture using Webcam in Matlab”

  1. Rob Purser said

    Thanks for talking about Image Acquisition Toolbox!

    You talk about checking if Data Acquisition Toolbox is installed, but the functionality that you’re discussing is part of the Image Acquisition Toolbox. You should check to see if “Image Acquisition Toolbox” shows up in the list of installed products on the Start/Toolboxes menu item. You can see it in the snapshot you provide.

    All the best,
    -Rob Purser

  2. madan said

    :) Thanks Rob , Nice of you

  3. yogendra said

    How to get a particular frame for processing…

  4. well here we are not capturing a video and extracting image but we are capturing a single snap at runtime. are u asking about how to extract a single image from a already recorded video stream?

  5. thanks , man .
    useful information .

  6. arun said

    thank u ….

  7. trietnguyen said

    Pls, help !!!
    My problem is: “I have plugged my WC to my PC, installed its driver, and it worked well. But when i typed “imaqhwinfo(‘winvideo’)” in command windows, i got responses as below:

    >> info = imaqhwinfo('winvideo')

    info =

    AdaptorDllName: [1x81 char]
    AdaptorDllVersion: '1.10 (R2006a)'
    AdaptorName: 'winvideo'
    DeviceIDs: {1x0 cell}
    DeviceInfo: [1x0 struct]

    –> What’s my DeviceIDs?
    >> vid = videoinput('winvideo', 1,'RGB24_320×240');
    ??? Error using ==> videoinput.videoinput
    There are no devices installed for the specified ADAPTORNAME. See IMAQHWINFO.

    I can’t specify the adaptor name and resolution. Please help!!!

  8. madan said

    @trietnguyen
    Are you able to ust execute this command?
    vid = videoinput(‘winvideo’)

  9. trietnguyen said

    Thank you for your replying.
    Yes, I am. And the response is :

    >> vid = videoinput(’winvideo’)
    ??? vid = videoinput(’winvideo’)
    |
    Error: The input character is not valid in MATLAB statements or expressions.

    Thank you again...

  10. trietnguyen said

    Hura!!! I did it. After typing “imaqreset” command, everything correct!!!
    Cheer, thank you madan, thank you!!!

  11. madan said

    @trietnguyen
    Thanks for informing the change. Lot of people care least to do so.. Thanks once again.

  12. Christian said

    Hi.. I’m working in image proccessing. I want to work with sequences or videos. Can I record a video with a Web Cam in Matlab.

    Thank you in advance,
    Christian

  13. madan said

    @christian

    Download this file and add it to your library and try it
    check out here

  14. sixaxis said

    I also faced the same problem as trietnguyen.
    The webcam installed is not recognized by the imaqfind command.

    But what does the imaqreset command do actually?

  15. Osama Nasir said

    Can u please tell me that this code will work with camera connecting to computer via bluetooth? and how it can b interfaced via bluetooth

    Thanx

  16. Norain said

    thank you man very much it is realy usefull

  17. Parisa said

    Hi,

    when I enter the ‘imaqhwinfo’ command I get almost the same result as yours. but I can not run ‘preview(vid)’ command. it gives me this error: “??Undefined function or variable ‘vid’”

    Thanks for your help,

  18. chongwan said

    Hi,

    Im a final year students and is doing my fyp project on stereo vision based tracking. The acquisition part will be a little bit headache for me coz im dealing with image acquisition using 2 cameras. I was wondering whether the function u given above can deal with image acqusition from two different web cameras at the same time. I have tried the image acquisition with vcapg but output video image is a little bit lag which is about 1 to 1.5 frame per second. Hope that you will help me with this.. thanks in advance…

    Regards,
    chongwan

  19. ankur jain said

    hi

    i m a final yr student and i need to use this code for my camera installed on a remote controlled car………..can u tell me how many frames per second we can get as speed of car will be adjusted according to it.

    secondly, i need to know whether this functionality is their in matlab 6.1

  20. Tarang said

    Hi,
    Any idea where the snap shot is stored in the matlab once it has been taken so that one can recall if required

  21. madan said

    the variable that u assign it to is where it is stored. u may decide to save that value for suture use too.

  22. arda said

    hi!

    first all I must say that it is very useful..Thank you..

    but i have a question ; i want to take snapshots in every 3seconds automatically by using MATLAB.how can i do that?

    thank you!

    arda

  23. madan said

    use a delay function, call it inside the for loop. You can get delay.m online if yoiu search for it

  24. arda said

    thanks for your help i ‘ll try it..

  25. rax said

    the following happens if i type in the command below.
    >> info = imaqhwinfo(‘winvideo’)

    info =

    AdaptorDllName: ‘D:\toolbox\imaq\imaqadaptors\win32\mwwinvideoimaq.dll’
    AdaptorDllVersion: ‘2.1 (R2007a)’
    AdaptorName: ‘winvideo’
    DeviceIDs: {1×0 cell}
    DeviceInfo: [1x0 struct]

    and again,when i type the following command
    >> vid = videoinput(‘winvideo’, 1, ‘RGB24_320×240′);
    ??? Error using ==> videoinput.videoinput at 233
    There are no devices installed for the specified ADAPTORNAME. See IMAQHWINFO.

    please help me out here

  26. vk said

    in my project i hav to track the movement of my hand and move the cursor according to the hand movement i am able to track the movement of hand using matlab but how to pass this coordinates to the cursor and move it accordingly…………………….?

  27. Manoj said

    Hello Madan

    can u help me out plzzz
    i got stuck in a situation where i need to find where my snap shot is stored in the matlab once it has been taken so that one can recall if required. this is the summary thats in my command window..

    >> preview(vid);
    >> data = getsnapshot(vid);
    >> vid = videoinput(‘winvideo’)

    Summary of Video Input Object Using ‘PC CAMERA DATA SOURCE(6029)1.0(32-32)’.

    Acquisition Source(s): input1 is available.

    Acquisition Parameters: ‘input1′ is the current selected source.
    10 frames per trigger using the selected source.
    ‘RGB24_352×288′ video data to be logged upon START.
    Grabbing first of every 1 frame(s).
    Log data to ‘memory’ on trigger.

    Trigger Parameters: 1 ‘immediate’ trigger(s) on START.

    Status: Waiting for START.
    0 frames acquired since starting.
    0 frames available for GETDATA.

    kindly help me pass through this situation plz

    thnx n regards

  28. madan said

    >> preview(vid);
    >> vid = videoinput(’winvideo’)
    >> data = getsnapshot(vid);
    >> save data

    This will give save the picture for you

  29. suley said

    im a final year student and i’m using stereo to find distance of obstacle..i’ve capture all the image required but having prob in developing the code for my stereos to find the distance..can u help me..plz..

  30. ansh said

    Hii
    I got this msg while trying
    >> info = imaqhwinfo(‘winvideo’)

    info =

    AdaptorDllName: ‘Z:\matlab_7.1\toolbox\imaq\imaqadaptors\win32\mwwinvideoimaq.dll’
    AdaptorDllVersion: ‘1.9 (R14SP3)’
    AdaptorName: ‘winvideo’
    DeviceIDs: {1×0 cell}
    DeviceInfo: [1x0 struct]

    and when i type following command i get :
    vid = videoinput(‘winvideo’,1, ‘RGB24_320×240′);
    ??? Error using ==> videoinput.videoinput
    There are no devices installed for the specified ADAPTORNAME. See IMAQHWINFO.

    I tried : vid = videoinput(‘winvideo’) but got
    ??? Error using ==> videoinput.videoinput
    There are no devices installed for the specified ADAPTORNAME. See IMAQHWINFO.

    I also tried imaqreset and after doing even that i got the same errors.
    please help!!!

  31. Alireza said

    I need one article about line follower robots with image processing
    that wrote with matlab7
    thank you very much
    I wait for u

  32. sadha said

    Hii
    I got this msg while trying
    >> info = imaqhwinfo(’winvideo’)

    info =

    AdaptorDllName: ‘c:\matlab_7.2\toolbox\imaq\imaqadaptors\win32\mwwinvideoimaq.dll’
    AdaptorDllVersion: ‘1.9 (R14SP3)’
    AdaptorName: ‘winvideo’
    DeviceIDs: {1×0 cell}
    DeviceInfo: [1×0 struct]

    and when i type following command i get :
    vid = videoinput(’winvideo’,1, ‘RGB24_320×240′);
    ??? Error using ==> videoinput.videoinput
    There are no devices installed for the specified ADAPTORNAME. See IMAQHWINFO.

    I tried : vid = videoinput(’winvideo’) but got
    ??? Error using ==> videoinput.videoinput
    There are no devices installed for the specified ADAPTORNAME. See IMAQHWINFO.

    I also tried imaqreset and after doing even that i got the same errors.
    please help!!!

  33. Mike said

    Can I capture an image from a webcam using an m file that has been converted to an executeable file?

  34. feddy said

    can i capture images using the camera of W810i sony erricson mobile phone using matlab7??

    i ve already installed PC suite that came with mobile phone and tried myself but got the following responses:

    >> imaqhwinfo

    ans =

    InstalledAdaptors: {’winvideo’}
    MATLABVersion: ‘7.0 (R14)’
    ToolboxName: ‘Image Acquisition Toolbox’
    ToolboxVersion: ‘1.5 (R14)’

    >> vid = videoinput(’winvideo’,1);
    ??? Error using ==> videoinput.videoinput
    There are no devices installed for the specified ADAPTORNAME. See IMAQHWINFO.

    Plz help me out.
    Thanking u in anticipation.
    feddy

  35. Advance said

    Is the robot able to transfer to PHP?

  36. Feddy said

    Kindly do help me in interfacing mobile phone(W810i)with matlab7 for capturing images!!!!

  37. Feddy said

    Hello Madan!
    Can u plz hepl me out?

  38. mohammad said

    I got this msg while trying
    >> info = imaqhwinfo(’winvideo’)

    info =

    AdaptorDllName: ‘c:\matlab_7.2\toolbox\imaq\imaqadaptors\win32\mwwinvideoimaq.dll’
    AdaptorDllVersion: ‘1.9 (R14SP3)’
    AdaptorName: ‘winvideo’
    DeviceIDs: {1×0 cell}
    DeviceInfo: [1×0 struct]

    and when i type following command i get :
    vid = videoinput(’winvideo’,1, ‘RGB24_320×240′);
    ??? Error using ==> videoinput.videoinput
    There are no devices installed for the specified ADAPTORNAME. See IMAQHWINFO
    please help me. what is cuse of “device id is 0 or empty” and who can transverse it to 1?
    tanks
    pls send rasponse for mail

  39. rosma said

    i’ve use logitech webcam RGB24_352×288 resolution for matlab, but the image cannot exist. what the suitable webcam that i have to use?

    thanks
    pls send respond to mail

  40. Sutharshan said

    hey guys i think

    the code [1x0] that you get in device id says that the webcam driver is present but the hardware is not detected.Check it.

    hope this helps.

  41. rakesh said

    1. how will we see images using mat-lab?

    2. which one is more complex in between dct and fft?which is more effective in those both?

    3. will the compression-rate increase or decrease using hadamard transform?If so,how much will it increase or decrease?

  42. Anne said

    After i run the code, there r some errors occur, it says for the function image, the results must be positive integer or logical. Plz reply cos i dunno wat to do..thanks..

  43. anupriya said

    thnx……..

  44. krishan said

    hi,
    i am making project on directing robot/motor using matlab by capturing the images through webcam. i have read ur article regarding it, but i was unable to see its pics. please send all info about it.
    thank u 4 everything u provided, it is a good effort.

  45. Anoop said

    hi,
    I am doing my final year project in object tracking using pan and tilt.I have got the acquisition part and filtered image and converted the image to binary.I have got the image as such.Could u please help in obtaining the centroid of image and the pixel location of that image so that I should transmit it to the servo controller

    Thanking you in advance

  46. rahul said

    friends ur most of the problems of image processing is with u present in ur setup cd
    move to ur cd and find help folder in that find folder containing pdf in its name then go in there in folder naming image u will thav full tutorial of image processing
    note u may not find this in the help folder of ur installed softwares
    u will find in help folder much more things

  47. chaitanya said

    friends i am working on project hand gesticulation recognition. can any body tell me how can i track hand using matlab in video.thankyou…

  48. mk said

    would the command works for usb webcam and file wmv video file

  49. amit said

    imaqhwinfo(‘winvideo’)
    ??? Undefined function or variable ‘imaqhwinfo’.

    >> vid = videoinput(‘winvideo’)
    ??? Undefined function or variable ‘videoinput’.

    please reply soon what to do for this problem
    as i have connected webcam,also installed its driver & it is also showing the video but matlab is detecting it

  50. behnam said

    hello
    i want to know how webcam interface with matlab?
    thx

  51. kyle said

    Hello. I have a question for you.

    I am importing an image in to matlab from a USB webcam via
    the image acq. toolbox. The image is fed into a while loop,
    processed, and information from the image is converted into
    a command for a device that is sent via rs-232. The problem
    I am having is that the device does not respond until after
    the 3-5 frame has been processed even though the device
    receives a command and acknowledges that command after the
    first iteration of the loop. It will run fine as long as it
    is not waiting on matlab to acquire images (meaning if i tell
    it to run while acquiring a vid object, but when I import an
    image in, there is a delay). Any ideas as to
    why this is happening would be greatly appreciated since it is
    holding up my thesis.

    Thanks

  52. Muhammad Irfan said

    Hi
    My name is Irfan Now days i m working our final year project i want to compare this save images to another save image Sir please guide me

  53. silivis said

    i am making project on directing robot
    matlab should receive data from usb pot in online form.i read all of this page but i cant do this project.please help me.

  54. alok said

    thanks……………….

  55. baishali said

    got this msg while trying
    >> info = imaqhwinfo(’winvideo’)

    info =

    AdaptorDllName: ‘c:\matlab_7.2\toolbox\imaq\imaqadaptors\win32\mwwinvideoimaq.dll’
    AdaptorDllVersion: ‘1.9 (R14SP3)’
    AdaptorName: ‘winvideo’
    DeviceIDs: {1×0 cell}
    DeviceInfo: [1×0 struct]

    and when i type following command i get :
    vid = videoinput(’winvideo’,1, ‘RGB24_320×240′);
    ??? Error using ==> videoinput.videoinput
    There are no devices installed for the specified ADAPTORNAME. See IMAQHWINFO
    please help me. what is cuse of “device id is 0 or empty” and who can transverse it to 1?
    tanks
    pls send rasponse for mail

  56. David said

    Hello baishali,
    I had the same problem, but i solved this way:
    1-. Before opening matlab, install the drivers of the webcam.
    2-. Start Matlab, and use:
    info = imaqhwinfo;
    3-. Then start image viewing by:
    vid = videoinput(cell2mat(info.InstalledAdaptors))
    4-. Open window image viewer
    preview(vid)

    … And that should work :)

  57. Else said

    Help!
    Here is the code I ran on the Matlab…

    % reset
    imaqreset
    clear all
    % initial
    [yy,fs]=wavread(‘hw1.wav’);
    %
    vidobj = videoinput(‘winvideo’,1);
    set(vidobj, ‘FramesPerTrigger’,1);
    set(vidobj, ‘TriggerRepeat’,inf);
    triggerconfig(vidobj, ‘manual’);
    start(vidobj);
    i=1;
    n=1
    % get
    while 1,
    trigger(vidobj);
    frame=getdata(vidobj);
    if(i==1),
    b=frame;
    imwrite(b,’base.jpg’);
    end
    y=frame;
    p=mean(mean(abs(b(:,:,3)-y(:,:,3))));
    if(p>30),
    sound(yy(55355:66411),fs)
    pause(1);
    n=n+1;
    if(n==3),
    stop(vidobj);
    break;
    end
    end
    i=i+1;
    end
    %stop(vidobj);

    But the Matlab showed that

    Error event occurred at 22:59:18 for video input object: UYVY_160×120-winvideo-1.

    winvideo: Image acquisition device cannot acquire.

    Make sure no other objects or applications are accessing the same device.

    What the problem is??????
    Please help!!!!!!

  58. amy said

    how to do auto capture image in every 5 seconds ???
    can u send me the code for refer ??

  59. elhaam said

    hi,
    i have a problem for taking snapshot,i’ve instulled my webcam and for preview everything is ok, but when i want to snapshot the colour of the image is been red,could u pls help me,
    thanks.
    elhaam

  60. Muhammad Irfan said

    Hello
    sir when i type this code
    >> vid=videoinput(‘winvideo’,1,’RGB24_320X240′)
    ??? Error using ==> videoinput.videoinput
    The FORMAT specified is not supported by this device. See IMAQHWINFO(ADAPTORNAME).
    that error will occure.
    Also my measure problem is that when i can take image by using
    vid=videoinput(‘winvideo’)
    so that image is not same as my real time image means it colour is very differnt like a flam

  61. pop said

    how can i write the code for Image compression using wavelet transform.couldnt get any idea to do this project. plz any one help me.

    with regards
    pop

  62. humphrey ibifubara said

    sir,how do i write the code for capturing image with a webcam connected to laptop and comparing it with already enrolled image-data in the laptop.thank you

  63. hassan said

    hi
    i wont some commond using for control of servo motor
    and i wont name of card interface using for PTZ camera and control cricute
    thank u

  64. Ryan said

    Here is my code to work with two webcams (two Logitech webcams).

    vidobj = videoinput(‘winvideo’,1);
    vidobj2 = videoinput(‘winvideo’,2);
    preview(vidobj)
    preview(vidobj2)

    Hope this will answer some of the questions above. I plan to write a program to control multiple webcams as those security monitor systems. Any suggestions?

  65. nixan said

    hi all,
    im final year student doin Final year Project with help of Image Processing.basically im not very familier with image processing. however i hope to learn and finish this.

    my expectation is this:
    there is a scenario record by a webcam (saved as video format).
    an image should prepare using that video.

    this is small part of my project.

    i want to know how to take a frame out of streaming video.
    can anyone help me to solve this????

    thanks in advance.

  66. edward said

    Hai everyone..im currently do my project on automatic object identification system..now,im on 5th week of my project but still confuse..i need some advise because im not familiar with image processing..is that by using matlab is more convenience or any other software?

  67. noel said

    is there some think I can capture my wife webcam when we chat on yahoo??

  68. gowthami said

    iam final B.tech ECE iam doing project’digital image processing based automatic object detect’ using MATLAB can you give any matter obout it in this we are using stepper motor ,webcam .please reply very soon it is urgent

  69. gowthami said

    please reply its very urgent
    about earlier i posted

  70. toon said

    Thank you

  71. toon said

    I study in university I have project for complete
    I have Question?
    Imaqhwinfo : I can output alone

    *but I can’t use to processing (I followed in comment 57)

    I want code for capture frame
    and Data output is?

    Thank You Very Much!!!!

  72. machmud said

    hello every one
    how i can record with optical webcam if i use matlab
    I want code record in matlab
    please send to rifadil_2mr@yahoo.com

  73. Dharm Khoker said

    sir i have a project to detect a man in given image(2D or 3D) using matlab.can u suggest me a algorithem to make it?
    i hope u will help me.
    thanks

  74. ben said

    hi, i am planning to do a optical flow mobile robot navigation which using a webcam. where can i get relate example on how to capture image by MATLAB then send out data to control the robot? i am using a laptop and i am beginner for MATLAB. thanks for help

  75. Miquel said

    Hi guys,

    I have to do a project for the university using the data aquisition toolbox. I don’t have any webcam and then I’ll have to buy one. Can anybody tell me a webcam that does work with the toolbox. It would be nice to don’t have to buy a second webcam because of incompatibility between Matlab and the webcam.

    thanks on advance

  76. gita said

    Can u help me about video streaming with matlab, because I difficult for solve my Final project to get bachelor degree

  77. lll said

    Helpful article. Now for the “final year” students. Work hard ok? No one will give you a final solution.

  78. Mike said

    For all the people trying to record from a webcam, I believe there is a way to make little movies using Matlab. Here is a link.

    http://www.math.canterbury.ac.nz/~c.scarrott/MATLAB_Movies/movies.html

  79. Dennis said

    Hello i’m making a card-recognition algorithm via a webcam in a project and encountered a little problem.

    We chose to take som pictures via a program called Logictech QuickCam ( a program which came with the camera ) and made our algorithm from it. And now that i’ve saved a snapshot. And i run a test on the snapshot i observed that the image was a lot more blurry, inaccurate or unsharpend (i’ve also tried the “fspecial” function inside matlab with “unsharp” without a good result ). I’m using a fixed zoom in both programs (inside matlab and the Logitech Quickcam software) and my algorithm is working “almost everytime” even though the distortion.. I wonder if any1 have encountered a similar problem??

    I guess the problem is the settings from Logitec Quick cam, and it’s tuning options… But i got no idea how to get those specific settings into matlab even though i’m using “imagtool” which can save hardware settings to a *.m file.. Any input??

    Best regard
    Dennis

  80. Gan said

    Hi madam,
    I got few question abount the webcam showing,following is my code
    imaqhwinfo

    ans =

    InstalledAdaptors: {‘coreco’ ‘winvideo’}
    MATLABVersion: ‘7.6 (R2008a)’
    ToolboxName: ‘Image Acquisition Toolbox’
    ToolboxVersion: ‘3.1 (R2008a)’

    when i type info
    info =

    AdaptorDllName: [1x81 char]
    AdaptorDllVersion: ‘3.1 (R2008a)’
    AdaptorName: ‘winvideo’
    DeviceIDs: {[2] [3]}
    DeviceInfo: [1×2 struct
    and when i type following command i get :
    vid = videoinput(’winvideo’,1, ‘RGB24_320×240′);
    i get
    Error using ==> videoinput.videoinput at 268
    No device is available at the specified DEVICEID. See IMAQHWINFO(ADAPTORNAME).

    Error in ==> webcam at 1
    vid = videoinput(‘winvideo’,1, ‘RGB24_320×240′);
    please reply me on my email.

  81. abdou said

    How I can capture image from my webcame at my laptop dell

  82. abu said

    hello sir,
    pls send me teh codez for my phd thesis
    thx

  83. kitty said

    Thanks man that snapshot thing was really useful.

  84. Murthy said

    Thanks for usefull article.

  85. Islam Yousry said

    Thanks very much for your help …

  86. soran said

    please how i can save thevidio in to the matlab.
    bocause i need that for ask make image process to that

  87. soran said

    please how i can save thevidio in to the matlab.
    bocause i need that for ask make image process to the pic

  88. phongnv2014 said

    Hi, everyone!
    I have a problem, I hope you can help me.
    this: How save image after acquisition image from webcam to workspace? and what do these images type of?
    How do convert they into .JPG,.bnp,or .tiff.
    Please help me. Thank you.

  89. phongnv2014 said

    Please send your’squestion to mymail: nguyenvanphong.us@gmail.com.
    Thank you very much!

  90. Lee said

    Hi sir/madam,
    Could you please send a matlab code for color detection where one should be able to filter only an image of particular RGB value and not by using ‘roipoly’ function ….

  91. Ayesha Sani said

    Hi.
    I am a final year student and doing my final project in Image processing..I am new in MAtlab ,So its quite hard for me to do the project i need the help.Plz help me out
    In my project i jave to make live vedio through webcam then dtect the moving and static object in that vedio and maeasure the distance between the static and moving objects..
    Actually my project is a CHILD SURVILANCE SYSTEM..
    So I need the help in doing the projcet
    even i dont know how to start my project plz guide me that how to do this project and i also want the open source code for capturing the vedio in matlab….detect the moving and ststic object So plzzzz Help me

    Thanks in Advance.

    Regard
    Ayesha Sani

  92. harin said

    Hi madan,
    I’m doin my final year project which involves image processing to make a TV controller. I want to know whether it’s possible to program a HCS12 microcontroller through matlab.can matlab access the serial port so i can use the RS232?? yuour help on this is very much appreciated.cheers.

  93. doraemon said

    hey, thanks a lot,it really help!!^_^

  94. Bob said

    Hi..
    I got problem with my 2 webcam..I have two same webcam SUNFLOWER and plug them on my PC.
    Then I process on Matlab 6.1 with this syntax:
    >> imaqhwinfo

    ans =

    InstalledAdaptors: {‘winvideo’}
    MATLABVersion: ‘6.5.1 (R13SP1)’
    ToolboxName: ‘Image Acquisition Toolbox’
    ToolboxVersion: ‘1.1 (R13SP1)’

    >> vid=videoinput(‘winvideo’);
    >> get(vid,’Source’)

    Display Summary for Video Source Object:

    Index: SourceName: Selected:
    1 ‘input1′ ‘on’

    Why MATLAB only detect 1 webcam?? How I gonna make realtime two webcam if MATLAb only detect 1 webcam?

    Plzz help me..coz this is for my final project..

    Thank you..

  95. rajesh said

    Pls, help !!!
    My problem is: “I have plugged my WC to my PC, installed its driver, and it worked well. But when i typed “imaqhwinfo(’winvideo’)” in command windows, i got responses as below:

    >> info = imaqhwinfo(‘winvideo’)

    info =

    AdaptorDllName: [1x81 char]
    AdaptorDllVersion: ‘1.10 (R2006a)’
    AdaptorName: ‘winvideo’
    DeviceIDs: {1×0 cell}
    DeviceInfo: [1x0 struct]

    –> What’s my DeviceIDs?
    >> vid = videoinput(‘winvideo’, 1,’RGB24_320×240′);
    ??? Error using ==> videoinput.videoinput
    There are no devices installed for the specified ADAPTORNAME. See IMAQHWINFO.
    I can’t specify the adaptor name and resolution. Please help!!!

  96. rajesh said

    Hello
    sir when i type this code
    >> vid=videoinput(’winvideo’,1,’RGB24_320X240′)
    ??? Error using ==> videoinput.videoinput
    The FORMAT specified is not supported by this device. See IMAQHWINFO(ADAPTORNAME).
    that error will occure.

    with regards
    rajesh

  97. vinayak said

    info =

    AdaptorDllName: [1x81 char]
    AdaptorDllVersion: ‘1.10 (R2006a)’
    AdaptorName: ‘winvideo’
    DeviceIDs: {1×0 cell}
    DeviceInfo: [1x0 struct]

    if you are getting this info with DeviceIDs means that device is not supported by the Matlab. Try out with another webcam(usually all web cams are supported. What is the port used to connect to the PC

  98. Dikshant said

    Hi. Can someone please tell me how to wait for a command for a command from a pic microcontroller (connected via Rs232) to run a function for Data Acquisition (Sound samples) in matlab. I need to to control stepper motors to make them move 100 postions and take samples at each position.

    Thanks.

    Dikshant.

  99. vikram said

    hi .. i have a matlab code for motion detection .. but i am unable to debug it can someone help me debug it…

    i ll mail the code if some one can debug it…

    the errors are as follows…
    Warning: File ‘log.txt’ not found.
    > In motion_detection>togglebutton1_Callback at 96
    In gui_mainfcn at 75
    In motion_detection at 42
    Warning: File ‘film.avi’ not found.
    > In motion_detection>togglebutton1_Callback at 97
    In gui_mainfcn at 75
    In motion_detection at 42
    Warning: File ‘var.mat’ not found.
    > In motion_detection>togglebutton1_Callback at 98
    In gui_mainfcn at 75
    In motion_detection at 42

    radio =

    1

    ??? Error: File: C:\MATLAB7\work\Codes\sad_algorithm.m Line: 17 Column: 17
    Missing variable or function.

    Error in ==> motion_detection>togglebutton1_Callback at 101
    sad_algorithm

    Error in ==> gui_mainfcn at 75
    feval(varargin{:});

    Error in ==> motion_detection at 42
    gui_mainfcn(gui_State, varargin{:});

    ??? Error while evaluating uicontrol Callback.

  100. milad said

    hi
    i need to capture a movie with webcam and then convert i to frames howcani do tis
    (all this seps should be realtime)

  101. abdul rab said

    hello every body
    i need help
    i want to do image processing of bottles.main task is to reject a broken bottle from a conveyour belt.
    i wana do this from matlab with image comparison and template matching.
    i have made a programme but it cant match template correctly.
    if any body can help me in this matter reply me at my email id
    rite2abdul@hotmail.com
    i ll send the code….
    plz plz its very very urjent………

  102. abdul rab said

    hello every body
    i need help
    i want to do image processing of bottles.main task is to reject a broken bottle from a conveyour belt.
    i wana do this from matlab with image comparison and template matching.
    i have made a programme but it cant match template correctly.
    if any body can help me in this matter reply me at my email id
    rite2abdul@hotmail.com
    i ll send the code….
    plz plz its very very urjent………

  103. abdul rab said

    please reply me as soon as possible if any person can do a good template matching.
    its very urjent
    plz plz plz
    help
    reply me on my email id i ll send the code

  104. Asma said

    hello,
    i want help regarding image capture from web cam…and i did it but i want tht it will work in graphical user interface..plz gude me how can i do this

    plz rply me

  105. niloo said

    Hi,
    does anybody know how can i processed a saved video file in matlab? for example take frames out of it.
    thank u

  106. walex said

    pls i really need assistance about my final year project,
    can somebody bail me out,
    am looking for a means of connecting webcam with mathlab and perform the following operation on
    captured image,
    cropping of image,converting to gray scale,segmentation of some part of the image using quadtree,
    pls kindly help ,here is my adress./……checkwale2002@yahoo.com

  107. etudiantarp said

    hello
    please i need a help, i have probleme with webcam, i have 2 PCs connected in the net ,i want to transmit a video via the net from pc 1 to pc 2 with matlab.
    thank you

  108. etudiantarp said

    hello
    please i need a help, i have probleme with webcam, i have 2 PCs connected in the net ,i want to transmit a video via the net from pc 1 to pc 2 with matlab.
    if any one want to help me, he sent me in eroman382@gmail.com
    thank you

  109. Mais said

    hello,
    i need help please,my problem is in my graduation project i need my security system camera to track an intruder automatically and i was told i can do it on matlap.. how can i do it and is it a programing issue or just something can be done on matlab.. thank you in advance for help..

  110. ASIF MEHMOOD said

    I have problem to detect USB camera in matlab
    but failed what is the procedure

  111. sudantha said

    i’m doing image processing project as my final year project. i want to detect yellow color areas from a video…can u help me?

  112. [...] Matlab Image Acquisition Thanks to Madan! [...]

  113. Prionkor said

    Here is the solution for the ERROR :

    vid=videoinput(’winvideo’,1,’RGB24_320X240′)
    ??? Error using ==> videoinput.videoinput
    The FORMAT specified is not supported by this device. See IMAQHWINFO(ADAPTORNAME).

    Try this:

    vid = videoinput(‘winvideo’,1);

    There is a problem with the video format ’RGB24_320X240′ thats why the program is causing error. Thanks.

  114. kerry william said

    How can you get the “Lnks for ModelSim(R)” in the toolbox list?

    I have Matlab with EDA Simulator Link toolbox and ModelSim SE but I do not have “Links for Modelsim(R)” in my toolbox list

  115. Alllfff said

    I have a high speed camera (200fps) connected through Ethernet, I need to get snapshot every 1/200s for lets say 10 seconds…any idea? I know lots of snapshots, but Its for an analysis of things happening in the frame lets say 200×200 pixels.

  116. varun said

    hi
    i have a hp laptop and i want to use it to capture images or videos using matlab for my project.
    i run following commands

    >> vid=videoinput(‘winvideo’, 1,’YUY2_768×576′)

    Summary of Video Input Object Using ‘HP Analog Capture’.

    Acquisition Source(s): tuner is available.

    Acquisition Parameters: ‘tuner’ is the current selected source.
    10 frames per trigger using the selected source.
    ‘YUY2_768×576′ video data to be logged upon START.
    Grabbing first of every 1 frame(s).
    Log data to ‘memory’ on trigger.

    Trigger Parameters: 1 ‘immediate’ trigger(s) on START.

    Status: Waiting for START.
    0 frames acquired since starting.
    0 frames available for GETDATA.

    >> preview(vid)

    then i get a window with black screen

    what do i do?

    • Diogo said

      Try,

      >> vid = videoinput(‘winvideo’,1, ‘YUY2_640×480′);
      >> preview (vid)

      Who knows if your PC cannot grabe image with that resolution… And if you pass this way now you know that your laptop works with MATLAB and the only thing that you have to search it’s abut the resolution.

  117. dahlia said

    i am a final year student in cse. i work in a project face recognation using matlab 7. i need some help or code for face recognation. pls help me……………

  118. dahlia said

    anyone work in face recognation using matlab……..pls mail me with code…………….
    nafiadahlia@yahoo.com………..
    pls..pls..pls….
    …..its urgent………

  119. Gia Ng said

    Thanks madman! :) )

  120. july said

    hello,Madan….
    I got the same problem with bob on March 19, 2009.And i’ve done like Ryan said on July 25, 2008. I used two same webcam Logitech.

    Please help me..this is for my final project..

    Thank you..

  121. tim demon said

    Hello guys,

    Who can tell me how i can adjust the refresh frequeny (frames per second) in “videoinput”. I like to get 25 till 30 frames per second if possible.

    Thanx you all for all the past information on this site.. Really useful.

  122. mert said

    Hello everyone,

    After “The FORMAT specified is not supported by this device. See IMAQHWINFO(ADAPTORNAME).” How can we change the image or video format, i can’t change the resolution 320X240, when i write:
    vid = videoinput(‘winvideo’,1);
    it gives me 160×120.

  123. Dinesh Kumbhar said

    thank you for info. abt image acqisition tool.
    but i want to know abt how to get the adaptor name plz help me out.
    regards.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>