Image capture using Webcam in Matlab

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_320x240’);

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 🙂

Author: Madan Thangavelu

Software Engineer

358 thoughts on “Image capture using Webcam in Matlab”

  1. 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. 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?

  3. 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!!!

    1. Anh Nguyen Minh Triết ơi, có phải anh học trường đại học sư phạm kỹ thuật và đã làm đồ án robot bám vật không anh? em cũng đang làm đề tài đó nhưng không biết liên lạc với anh bằng cách nào, nếu đọc được tin nhắn này anh liên lạc với em qua nick yahoo: doanminhquan123, hoặc mail: doanminhquan123@yahoo.com.vn nhé! cảm ơn anh

    2. anh ơi, e là sinh viên BKHN, e đang nghiên cứu về Object tracking, a giúp e với, học thầy ko tày học bạn.

  4. 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...

    1. plzz help us….we did same procedure but we failed…..tell me the right way of implementation steps…..
      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...

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

    1. Hi.. im working on real time image processing, i m facing problem in using command
      vid = videoinput(‘winvideo’, 1, ‘RGB24_320x240′);
      Error using ==> videoinput.videoinput
      The FORMAT specified is not supported by this device. See IMAQHWINFO(ADAPTORNAME).
      help plz

      1. just replace the statement by
        vid = videoinput(‘winvideo’, 1, ‘YUY2_320x240’);
        n it should work

  6. 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

  7. 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?

  8. 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

  9. 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,

  10. 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

    1. Hello, Chongwan
      Did anyone help you ? Actually i am having the same problem. I want to connect two same web cameras to the laptop by using this code. But don’t know how ….. can u help me out ????

  11. 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

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

    1. please tell me where will be those captured images are stored and also how do I save in a specified place??

  13. 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

  14. 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: [1×0 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

    1. use this instead it will work
      vid = videoinput(‘winvideo’, 1, ‘YUY2_320x240’);

      i have use this me self……

  15. 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…………………….?

  16. 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_352x288’ 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

  17. 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..

    1. hi how are you first i would like to say iam new here and iam so happy to be here
      you want to calculate the distance of object iam Msc student i have some project in image processing and my paper talk about how to calculate the object distance the main point to know or calculate the camera filed of view and after that know the ratio of number of pixels & camera field of view
      hassan

  18. 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: [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!!!

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

  20. 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!!!

    1. yeah you can but now really i dont have the steps but i promise u when i get it i will write this steps ok

  21. 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

  22. 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

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

    thanks
    pls send respond to mail

  24. hey guys i think

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

    hope this helps.

  25. 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?

  26. 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..

  27. 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.

  28. 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

  29. 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

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

  31. 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

  32. 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

  33. 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

  34. 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.

  35. 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

  36. 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 🙂

    1. thanks a lot david it works thanks a lot.
      can you explain this command. i mean to say why are we getting the following error
      ??? Error using ==> videoinput.videoinput
      before this command
      vid = videoinput(cell2mat(info.InstalledAdaptors))
      waiting for your reply 🙂

    2. hi dave, i use usb webcam a4tech and i have installed the a4tech.exe but it still not recognized, then what driver do you mean? thx alot

    3. helo sir, i am doing project on “motion detection form video” can you please help me , firstly how to recoed video from webcame in matlab” plz reply
      thanku,
      best regards.

  37. 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_160x120-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!!!!!!

  38. 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

  39. 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

  40. 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

  41. 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

  42. 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

  43. 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?

  44. 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.

  45. 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?

  46. 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

  47. 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!!!!

  48. 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

  49. 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

  50. 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

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

  52. 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

  53. 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: [1×81 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.

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

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

  56. 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.

  57. 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 ….

  58. 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

  59. 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.

  60. 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..

  61. 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: [1×81 char]
    AdaptorDllVersion: ‘1.10 (R2006a)’
    AdaptorName: ‘winvideo’
    DeviceIDs: {1×0 cell}
    DeviceInfo: [1×0 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!!!

  62. 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

  63. info =

    AdaptorDllName: [1×81 char]
    AdaptorDllVersion: ‘1.10 (R2006a)’
    AdaptorName: ‘winvideo’
    DeviceIDs: {1×0 cell}
    DeviceInfo: [1×0 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

  64. 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.

  65. 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.

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

  67. 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………

  68. 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………

  69. 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

  70. 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

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

  72. 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

  73. 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

  74. 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

  75. 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..

  76. 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?

  77. 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.

  78. 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

  79. 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.

  80. 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_768x576′)

    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_768x576’ 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?

    1. Try,

      >> vid = videoinput(‘winvideo’,1, ‘YUY2_640x480’);
      >> 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.

  81. 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……………

  82. 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..

  83. 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.

  84. 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.

  85. 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.

  86. Hello,
    I have two identic cams and i want to take some pics simultaneously with a specific exposure. I allready have access to them but only one after an other.

    Please help

  87. hey anyone there…. i humbly requesting for your help… i’m working with my project and im goin to use matlab.. my project is about automatic scoring using only 2 webcams.. i’m a noob in using matlab.. but im interested to listen to all of you.. can u teach me?? pls pls pls….
    my first problem is how to get image using 2 webcam… 2nd is how will the matlab know if where is the location of the object(ex.. in darts, how can the matlab knw if where is the tips of the darts). and 3rd.. the scoring.. how will i map the scores in only 1 image(database). your help is much appreciated… thanks… i’l w8.. pls…..

  88. Hello,
    I have two identic cams and i want to take some pics simultaneously with a specific exposure. I allready have access to them but only one after an other.

    plz help me

  89. vk said
    November 11, 2007 at 4:31 pm
    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…………………….?

    i have the same idea , please any one can help you ?
    thanks

  90. motion capturing and calculate its center point (x and y coordinates)

    my problem is that how can i run this code by interfacing camera and play it in real time instead of running sample videos which is in AVI format.

    plz any one help me and rpl me as fast as u can :-s. . .
    thnx
    siddiqui.moiz@hotmail.com

    %=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=%
    clear data
    clc
    disp(‘Display Input Video Screen’);

    avi = aviread(‘samplevideo.avi’);
    video = {avi.cdata};
    for a = 1:length(video)
    imagesc(video{a});
    axis image off
    drawnow;
    % end;
    %=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=%

    %=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=%
    disp(‘Display Output Video Screen’);

    if ischar(video)
    avi = aviread(video);
    pixels = double(cat(4,avi(1:2:end).cdata))/255;
    clear avi

    else
    pixels = double(cat(4,video{1:2:end}))/255;
    clear video
    end
    %=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=%
    framess = size(pixels,4);
    for f = 1:framess
    pixel(:,:,f) = (rgb2gray(pixels(:,:,:,f)));
    end
    %=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=%
    rows=240;
    columns=255;
    rames=f;
    %=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=%
    for l = 2:rames
    d(:,:,l)=(abs(pixel(:,:,l)-pixel(:,:,l-1)));

    k=d(:,:,l);
    bw(:,:,l) = im2bw(k, .2);
    bw1=bwlabel(bw(:,:,l));
    imshow(bw(:,:,l))
    hold on
    %=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=%
    count=1;
    for h=1:rows
    for w=1:columns

    if(bw(h,w,l)>0.5)
    toplength = h;

    if (count == 1)
    tppoint=toplength;
    end
    count=count+1;
    break
    end
    end
    end
    %=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=%
    coun=1;
    for w=1:columns
    for h=1:rows
    if(bw(h,w,l)>0.5)
    leftside = w;

    if (coun == 1)
    lftpoint=leftside;
    coun=coun+1;
    end
    break
    end
    end
    end
    %=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=%
    widthrect=leftside-lftpoint;
    heightrect=toplength-tppoint;
    widthcenter=widthrect/2;
    heightcenter=heightrect/2;
    xcenter=lftpoint+widthcenter;
    ycenter=tppoint+heightcenter;
    wth(l)=xcenter;
    hth(l)=ycenter;

    rectangle(‘Position’,[lftpoint tppoint widthrect heightrect],’EdgeColor’,’g’);

    x = uint8(xcenter);
    y = uint8(ycenter);

    plot(x,y, ‘r*’);
    drawnow;
    hold off
    %=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=%

    disp(x);
    disp(y);
    end;
    %=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=%

    1. hello, i find the website by google. And i am also searching to find the center of a moving object by using webcam in real-time. Do you solve the problem yet? may i ask for the code. plz mail me! plz. thx a lot.

  91. Hi all!
    I wanna use image proccessing in matlab…
    -but the MatLab does not find my webcam driver.
    -My webcam’s name is ‘Generous’.
    -I can use my webcam in its software.
    -Before installation of my camera, the following information in matlab was availabled:

    >> imaqhwinfo

    ans =

    InstalledAdaptors: {‘coreco’ ‘winvideo’}
    MATLABVersion: ‘7.2 (R2006a)’
    ToolboxName: ‘Image Acquisition Toolbox’
    ToolboxVersion: ‘1.10 (R2006a)’

    ——————–
    -After installation of my camera, the same information was showen. mean:

    >> imaqhwinfo

    ans =

    InstalledAdaptors: {‘coreco’ ‘winvideo’}
    MATLABVersion: ‘7.2 (R2006a)’
    ToolboxName: ‘Image Acquisition Toolbox’
    ToolboxVersion: ‘1.10 (R2006a)’

    ——————

    * I use the ‘coreco’ and ‘winvideo’ in following but the MatLab could not communicate with my camera…

    Plese help me that how can I solve this problem?

    THANKS…

  92. hi

    i want a matlab code for counting object in image or background elimination for my garduation project i really need help coz i can’t figure it out can any one help me out please please

  93. Hi,
    I am working on a project based on eye tracking ie tracking the pupil of the person. so i need to capture video using a `falcon` camera which is connected to the PCI card.i am not able to initialize the camera using matlab.
    Please help me with this.

  94. when we use obj=getsnap(vid) exactly which frame is stored in obj..????because there are so many frames in vid(video)…please illustrate

  95. hi,
    i’m trying to get images from my webcam with matlab.
    i use the image acquisition toolbox, but i have some troubles with the resolution of the acquired images. i’d like to set it at 640×480, how can i do this?
    thank you very much

  96. HI i am in trouble due to my final year project ,which is target tracking in matlab.
    it is not a real time application .
    i have a code for input the video but in further code i got trouble.
    help me
    pls contact me through my mail

  97. Dear all,

    I made GUI for showing a video stream using webcam on one axis {axes(handles.input_fig);} and I want to get snapshot from this axis to dispaly it at another axis.
    fortunately, I have previewed the video in the first axis but I could not capturing an image from it.

    my question is how can get snapshot from GUI figure axis?

    Thank you in advanced…

  98. Dear all,

    I made GUI for showing a video stream using webcam on one axis {axes(handles.input_fig);} and I want to get snapshot from this axis to dispaly it at another axis.
    fortunately, I have previewed the video in the first axis but I could not capturing an image from it.

    my question is how can get snapshot from GUI figure axis?

    Thank you in advanced…

    1. hi i saw your post, m facing the same thing regarding my final year project. can you mail me the code or give the answer to the question if u already have solved it.
      regards

  99. hi all

    i have a problem regarding video input in matlab..
    actually i have a builtin camera in my laptop. but for my project i need to use an external camera with better resolution.

    but the problem here is whenever i run my code for video input, it uses the builtin camera by default..
    how can i use the external cameraa.. plz help me

  100. helllo everybody ,,, really I have a big problem
    I have a video which I want to recognize using a matlab code
    what is the alogorith to make a video recognition
    Simply , there is a ball which I want to mark it using a cursor ,, I want to use a simple algorithm ,, how can I implement it
    Thanks in advance;

  101. hello….

    i am doing a real time project that is face recognition using webcam and i am in need of code that recognises the face through webcam….plzzzz i am very much in need …do reply me as soon as possible..

  102. Hi all!
    i need some1 to convert the followings codes to extract image frames from a already recorded video stream?

    vid=videoinput(‘winvideo’,1);
    triggerconfig(vid,’manual’);
    set(vid,’FramesPerTrigger’,1);
    set(vid,’TriggerRepeat’,Inf);
    start(vid);

    while(1)
    for j=1:3
    trigger(vid);
    im=getdata(vid,1);
    if j==1
    i_bef=im;
    end
    if j==3
    i_aft=im;
    end
    end
    [x,y,u]=isub(i_aft,i_bef);
    end

    Thank you..

  103. hi all

    i am doing one project related to image processing , its like pan tilt tracking system , in which i do tracking of the moving object . if you have same project or similar to it do mail me so we can help each other my id is gleam.uahmed@gmail.com

  104. Hello,
    I need help.
    I want to know how can we acquired images continuously using I.A.Toolbox.I am using WebCam.

    vid = videoinput(‘winvideo’);

    % Configuring Parameter
    set(vid,’FramesPerTrigger’,200)
    set(vid,’FrameGrabInterval’,3)
    vid.TriggerRepeat = inf;
    set(vid,’LoggingMode’,’Memory’)
    triggerconfig(vid,’manual’)
    % set Memory
    imaqmem(700000000)
    cnt = imaqmem;
    mem_low = 100000000;
    mem_low1 = 200000000;
    mem_left = cnt.FrameMemoryLimit – cnt.FrameMemoryUsed;
    start(vid)
    trigger(vid)

    while(mem_left > mem_low)

    frame = getsnapshot(vid);
    I = rgb2gray(frame);
    imshow(I);

    if (mem_left < mem_low1)

    flushdata(vid);
    mem_left = cnt.FrameMemoryLimit – cnt.FrameMemoryUsed;
    end
    end
    stop(vid)

    But this is not working,cause as memory gets full it stops. I wanted to acquire images continuously.

    Thank you.

  105. hi, i have to work with a robot with a webcam. i adquire the image i need and then i have to convert the pixel to centimetres. this is not easy because the webcam gives me distroied image. how can i correct it? thanks

  106. It took 12 seconds to take and save 10 snapshots at that resolutions. I’d like to analyze video input in real-time. Is there anyway to speed the processes of capturing and turning the data into an image?

  107. Hi…
    I want the code to interface Webcam in MATLAB and then to convert the image in Binary data so that i can run DC motor.
    plz send if anyone has

  108. Hi..
    i am working in project where i have to send the image after the acquisation step to an FPGA to performe some signale processing in this image

    so if any one can help me to tell me how can i send this image to the FPGA in real time.

    Thank’s

  109. hi madan
    i am capturing an image from the webcam and then i want to find the coordinates of the edges of the items in the image so can u tell me how can i do this.
    thanks

  110. 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: [1×81 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 asap me on my email.
    thnks

  111. hi i am doing in iris image processing and i have the camera for the eye and when i use videoinput function it get the normal sence … i need the image in under red violation cause this camera take this postion… i need help ………

  112. i have to make GUI for my webcam. GUI that recalls my image from C drive. can any one please help me out. reply please

  113. i have to make GUI for my webcam. GUI that recalls my image from C drive. or a GUI that play my video and capture image through webcam button. i want a permanent program for this. if anyone have a program please send me on xtreme2610@hotmail.com can any one please help me out. reply please

  114. hi friends… i am doing a bot for image processing… i need to differentiate between 2 colours red and green coloured doors.. i need to check in the green coloured door.. how do i process the image and control my bot.. as i am a beginner.. it might be useful if u provide data from basics..
    thank u..

  115. plzzzz need ur help…. can u help me from the begining of video prcessing in matlab.. i dont know a single thing.plz

  116. hey
    i am able to get the snapshot i want to get the real time coordinates of my hands so that i can use those coordinates fyrther can any1 help me i will be highly thankful to you

  117. hi
    help me!!
    My problem is:
    >> vid=videoinput(‘winvideo’,1);
    ??? vid=videoinput(‘winvideo’,1);
    |
    Error: The input character is not valid in MATLAB statements or expressions.

    help me plz!!1

  118. hi
    I am working on a project called License plate recognition system.I need to know how to interface webcam of laptop witj matlab.i want to open a picture of car license plate at main program im matlab which is captured by webcam of laptop.so how to open that captured vimage into matlab. pls guide me on this..
    Regards

  119. hi i am using matlab with webcam ..when i am run the program i got the error like this….Multiple VIDEOINPUT objects cannot access the same device simultaneously….how to solve this problem..please help any one quickly…thanks in advance

  120. hi please i want to ask how to get a data from serial port from pic 16f877a
    in matlab it is analog to digital value
    can i and how please send the answer to my e-mail

  121. Dear madan,
    my final year project is to make an eye mouse it capture eye movement and move the mouse accordingly.
    i want to know how to acquire and PROCESS IT in REAL TIME.
    i have developed the code once i get the frames.
    the problem is capturing frames in real time.

    also can the m file made into an executable then? i mean with the live video capture etc?

    please help at the earliest either here or on radhikamody119@gmail.com

    thanks!

  122. Hi,i am using webcam to detect my object. However, the image that be show up in screen from webcam is YUY and not RGB.
    This is my resolution for my webcam:
    Resolution webcam:

    Columns 1 through 2

    ‘YUY2_160x120’ ‘YUY2_176x144’

    Columns 3 through 4

    ‘YUY2_320x240’ ‘YUY2_352x288’

    Column 5

    ‘YUY2_640x480’

    I using this code to change to YUY to RGB :
    vid=videoinput(‘winvideo’1,’YUY2_640x480′);
    set(vid,’ReturnedColorSpace’,’rgb’);
    preview(vid);

    But its still same image come out in YUY type. It only change to RGB if :
    getsnapshot(vid);

    But i want in the screen image come out in RGB . Any 1 can help me? i try change webcam wtill the same problem.

  123. Hi I have Matlab v7.5.0 (R2007b)

    I tried using the following code to connect my webcam to matlab:

    clear all;
    video = videoinput(‘winvideo’,1,’YUY2_352x288′);
    preview(video);
    origimage=getsnapshot(video);

    BUT I get the following error message? (Im not sure if its beacuse I dont have the imaq toolbox)

    ??? Undefined function or method ‘videoinput’ for input arguments of type ‘char’.

    Error in ==> Code_for_WEB_CAM at 4
    video = videoinput(‘winvideo’,1,’YUY2_352x288′);

    anyone know what I can do?
    Thanks!!!

  124. whenever i type

    imaqhwinfo

    the answer i got is
    ans =

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

    and then when i type
    vid = videoinput(‘winvideo’, 1, ‘RGB24_320x240′);

    i got an error

    ??? vid = videoinput(‘coreco’, 1, ‘RGB24_320x240);
    |
    Error: The input character is not valid in MATLAB statements or
    expressions.

    plz helpme out in getting rid of this error…

    i m using compaq cq62 176tx model…

  125. hello
    please help me i want to build block daigram of fire alarm system with video image using fuzzy logic how i can insert video image in block daigram?
    thank you

  126. hi all,
    if anyone knew how to capture image from video and after 1 second capture another one and then………..
    thanks

  127. Hi all,
    i’m using webcam to capture the vedio.I want this vedio preview to be shown when i press the button in the gui. Could any one suggest me how can i do this.

  128. Hello, I’m using a laptop with a PCMCIA framegrabber card (Imperx VCE-PRO) along with a Zeltom Hilink development board that communicates over RS232. My application is the “Ball On Plate” experiment. The Hilink board controls a pair of servos which enables plate motion and my camera takes images and computes the centroid of the ball location and sends the result to the ball on plate control regulator.

    This application runs in simulink and requires the Image Acquisition and Image Processing Toolboxes along with real time workshop and real time windows target. To compile the simulink block diagram I use: Tools – Real Time Workshop – Build Model and the block diagram fails to compile. Belo is an excerpt of the command line output which shows the following:

    ### Starting Real-Time Workshop build procedure for model: Plant_Gpx_fix
    Warning: Output port 2 of ‘Plant_Gpx_fix/Demux’ is not connected.

    ### Created Real-Time Windows Target module Plant_Gpx_fix.rwd
    C:/PROGRA~1/MATLAB/R2009a/toolbox/rtw/targets/rtwin/openwat/binnt/wlink \
    @C:/PROGRA~1/MATLAB/R2009a/toolbox/rtw/targets/rtwin\rtwin\rtwin.rsp \
    LIBPATH C:/PROGRA~1/MATLAB/R2009a/toolbox/rtw/targets/rtwin\lib;C:/PROGRA~1/MATLAB/R2009a/toolbox/rtw/targets/rtwin\openwat\lib386 \
    NAME ../Plant_Gpx_fix.rwd \
    FILE Plant_Gpx_fix.obj,Plant_Gpx_fix_data.obj,rtGetInf.obj,rtGetNaN.obj,rt_nonfinite.obj,rtwin_main.obj,rt_sim.obj,ext_svr.obj,updown_rtwin.obj,ode3.obj
    Error! E2028: exIMAQAcquireData_ is an undefined reference
    Error! E2028: exIMAQGetLastError_ is an undefined reference
    Error! E2028: exIMAQTerminateSystem_ is an undefined reference
    Error! E2028: exIMAQCreateFVDSystem_ is an undefined reference
    Error! E2028: exIMAQStartSystem_ is an undefined reference
    file Plant_Gpx_fix.obj(C:\Program Files\Hilink\Plant_Gpx_fix_rtwin\Plant_Gpx_fix.c): undefined symbol exIMAQAcquireData_
    file Plant_Gpx_fix.obj(C:\Program Files\Hilink\Plant_Gpx_fix_rtwin\Plant_Gpx_fix.c): undefined symbol exIMAQGetLastError_
    file Plant_Gpx_fix.obj(C:\Program Files\Hilink\Plant_Gpx_fix_rtwin\Plant_Gpx_fix.c): undefined symbol exIMAQTerminateSystem_
    file Plant_Gpx_fix.obj(C:\Program Files\Hilink\Plant_Gpx_fix_rtwin\Plant_Gpx_fix.c): undefined symbol exIMAQCreateFVDSystem_
    file Plant_Gpx_fix.obj(C:\Program Files\Hilink\Plant_Gpx_fix_rtwin\Plant_Gpx_fix.c): undefined symbol exIMAQStartSystem_
    gmake: *** [../Plant_Gpx_fix.rwd] Error 1

    Has anybody had a similar problem when using real time workshop and real time windows target? If so, how can I eliminate this error? I did use imaqreset before initializing the video object. I’m using Matlab R2009a with WinXP Pro 2002 SP3. Any ideas? Thank you in advance.

  129. getsnapshot function does not give the proper image so is there any other command to get actual clear image??

  130. hi,iam using a programme of web cam ho save and view an image and do the aquisition with matlab and i need the interface graphique ho do this programme.thank u

  131. My problem is to track object in motion with single camera, can you help me to do that with source matlab please

  132. Dear Sir
    I’m using Matlab 7.6.0 (R2008a). I already installed Data Acquisition in matlab tools box.
    When I type
    >>imaqhinfo
    This error was showed:
    ??? Undefined function or variable ‘imaqhinfo’.
    I don’t know why. Could you help me?

  133. Robocon :
    Dear Sir
    I’m using Matlab 7.6.0 (R2008a). I already installed Data Acquisition in matlab tools box.
    When I type
    >>imaqhinfo
    This error was showed:
    ??? Undefined function or variable ‘imaqhinfo’.
    I don’t know why. Could you help me?

    More information:
    My laptop had integrated webcam. My OS is win7. Thanks before.

  134. hi guys i have data and i want to save it using matlab could some one inform me
    and also i how to inter such as name in edite in matlab gui and save it

  135. how to capture,
    when I put my id or thumb front of camera
    then capture and fixed it with data
    then if not same with data or picture wich we have then PC will give wrong sound
    then if same with data or picture wich we have then pc will give good sound
    (sorry I’m from Indonesia, my english is bad, and I’m newbie)
    thanks a lot
    u can send to my email
    masnyarosa2@yahoo.com

  136. hey…………i need ur help in writting coding for matlab to detect any friction or movement taking place in a room and to send signals to the piezoelectric sensor………………pls help me i have only 2 weeks of time to complete my project………
    send to my e-mail rini.mat.9@gmail.com

  137. hi,
    i am making project on car parking system using matlab 7.6. for that i have to connect my camera with my pc which take an image after 10 min n then analyze it…so can anybody tell me how it happens in matlab that it take an image automatically after 10 min…and plz someone send me a code of that.

  138. hey thx for those stuff. it was really useful. there is a problem that i am not getting a good rgb image through getsnapshot command as i can through though frame command in running mode. can anyone give me an idea that why is this happening.

  139. hi..
    i m using integratet webcam of laptop for matlab.
    There is some problem.pls help me for that problem.
    when i am given this command ,there is no problem
    i.e

    >> imaqhwinfo

    ans =

    InstalledAdaptors: {‘winvideo’}
    MATLABVersion: ‘7.0.1 (R14SP1)’
    ToolboxName: ‘Image Acquisition Toolbox’
    ToolboxVersion: ‘1.7 (R14SP1)’

    >> info=imaqhwinfo(‘winvideo’)

    info =

    AdaptorDllName: [1×63 char]
    AdaptorDllVersion: ‘1.7 (R14SP1)’
    AdaptorName: ‘winvideo’
    DeviceIDs: {[1] [2]}
    DeviceInfo: [1×2 struct]

    but….problem is arise in this command…

    >> vid = videoinput(’winvideo’)
    ??? vid = videoinput(’winvideo’)
    |
    Error: Missing variable or function.

    >> vid = videoinput(‘winvideo’, 1, ‘RGB24_320×240’);
    ??? Error using ==> videoinput.videoinput
    The FORMAT specified is not supported by this device. See IMAQHWINFO(ADAPTORNAME).

    what should i do for this problem?
    pls help me sir.
    thank u.

    1. get the info of its format and resolution
      imaqhwinfo (‘winvideo’);
      dev_info=imaqhwinfo (‘winvideo’, 1) ;
      dev_info.SupportedFormats

  140. Image quality and preview quality are quite different. Please help me out. What can I do to improve my image quality ……..

  141. hi am currently working on my project “motion detection” i am using matlab but i don’t know how to import the webcam to my gui. i want to click on a button and then the camera should load into a window,
    pls if you have any idea help
    thank you.

  142. Thanks a Bunch !!! Really helped! I would’ve corrected my issue yesterday if i had read these comments about the imaqreset command but thanks!

  143. Hello sir/madam

    i want to compare the captured image with image in database,,,can anybody send matlab codings for that..thanku

  144. Here you have explained how to use it with a USB camera. What are the changes I need to make in the code, if I have to use the integrated webcam of my laptop.

  145. hi, may I ask which toolbox is suitable for human posture recognition (stand, sit, fall)?
    I am using neuralnetwork toolbox and the results is not very accurate. Thanks!!

  146. Hi,
    I have to work on a project in matlab which is to write a programe in matlab that compare two images of a person having different resolution and display the out put that the images are of a single person.. please if anyone has the idea do help me..

  147. please help me……….
    where can i get this software with crack file for free……..
    plz send me the link to my mail id (akhilsb422@gmail.com)

  148. 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

    Regard
    Maha Devan.v.s(9940928923)

  149. i have a project about hand tracking please help me with the project i use matlab nd i dont know how to start.. please help me this is my email address.. keventongco@hotmail,com please anybody help me this depends on our project thanks hope you guys will help me

  150. hello fnd…..myself sneh…student of M Tech..i m extracting vehicle license plate but yet i m unble to extract plate..plz help me..give me matlab code for extract car license plate…

    thanks in advance

  151. >> info = imaqhwinfo(‘winvideo’);
    ??? Undefined command/function ‘imaqhwinfo’.

    what does it mean???

  152. Hi
    I m using MATLAB 2010a ,It is detecting only laptop camera adaptor ,it is not detecting usb camera adaptor although i can acccess camera in Image acquisition tool box
    kindly guide me

  153. an ultra-conservative told me 3 years ago that America made a terrible mistake by electing Obama. He swore that, America should have listened to Limbaugh, FNN and Palin. It was nice to hear that ditto heads like him didn’t recognize why they lost.

  154. I am Using Wireless camera, The problem is that each time I get image of the same object, it give the different composition of R,G,B…..
    Please help me out.

  155. Great weblog right here! Also your site quite a bit up fast!
    What host are you the use of? Can I am getting your associate link for your host?

    I want my web site loaded up as fast as yours lol

  156. great work bro … i wanna ask u something plz .. when i want to save an image using matlab i use the command (imwrite) but if i want to save a sequence of certain images according to some processing and try to use (imwrite) in a loop , every new saved image will overwrite the last one coz i can’t change the name of the saved image .. for ex,
    >>imwrite(A,’name.tif’);
    what shall i do in this prob.

  157. Greetings from California! I’m bored at work so I decided to check out your website on my iphone during lunch break. I love the knowledge you present here and can’t wait
    to take a look when I get home. I’m shocked at how quick your blog loaded on my phone .. I’m not even using WIFI,
    just 3G .. Anyways, great site!

  158. Hmm is anyone else having problems with the pictures on
    this blog loading? I’m trying to determine if its a problem on my end or if it’s
    the blog. Any feedback would be greatly appreciated.

  159. Please let me know if you’re looking for a writer for your blog. You have some really great posts and I feel I would be a good asset. If you ever want to take some of the load off, I’d
    absolutely love to write some articles for your blog
    in exchange for a link back to mine. Please send me an email if interested.
    Thanks!

  160. You’re so cool! I do not think I’ve read a single thing
    like that before. So wonderful to find another person with a few original thoughts on this topic.
    Really.. thank you for starting this up. This website is something that’s needed on the internet, someone with some originality!

  161. you are actually a just right webmaster. The website loading velocity is amazing.
    It seems that you are doing any unique trick.
    Furthermore, The contents are masterwork.
    you’ve performed a great process on this topic!

  162. you’re really a just right webmaster. The website loading pace is incredible. It kind of feels that you’re doing any
    unique trick. Furthermore, The contents are masterpiece.
    you have performed a wonderful job in this topic!

  163. Greate pieces. Keep posting such kind of information on your
    page. Im really impressed by your blog.
    Hey there, You have performed a fantastic job. I’ll definitely digg it and for my part suggest to my friends. I am confident they will be benefited from this web site.

  164. I am using linux. My adaptor name is linuxvideo. When I run vid =videoinput(‘linuxvideo, I get an error message “There are no devices installed for the specified ADAPTORNAME.”

    My webcam is installed in my laptop. I have windows vista but i log remotely to a unix server to access matlab. My device is recognized: InstalledAdaptors: {‘linuxvideo’}
    MATLABVersion: ‘7.13 (R2011b)’
    ToolboxName: ‘Image Acquisition Toolbox’
    ToolboxVersion: ‘4.2 (R2011b)’

    Thanks.

  165. The pectorals are great muscles to build and can add to
    your level of masculinity. * Standing one arm dumbbell presses: This workout mainly focuses your middle deltoid.

    The Wikipedia defines dumbbell as, a type of free weight, a
    piece of equipment used in weight training.

  166. This is certainly among the most interesting blogs I have
    seen. It’s so easy to get jaded, but there’s truly some first-rate material online, and I believe
    your site is seriously one of them!

  167. 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

  168. To all those who are getting the following error :
    Error: The input character is not valid in MATLAB statements or expressions.

    You are getting this error because you have directly copied the code from the website into your command window. Type it out instead of copy-pasting. The error is because of the unrecognised font format of the single quotes i guess.

  169. I think this is one of the most significant info for me.
    And i am glad reading your article. But wanna remark
    on some general things, The website style is wonderful, the articles is really excellent :
    D. Good job, cheers

  170. When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each
    time a comment is added I get four emails with the same comment.
    Is there any way you can remove me from that service?
    Thanks a lot!

  171. This topic is much too complicated for simply 1 article, honestly, I need a great
    deal more if I am going to figure this out. The article was good, but I
    believe there was a good deal that was skipped. Anybody else agree?

    I’m not whining, I just want more, lol!

  172. i want help to find a obstacle from a photograph and that should be compare with another one pls anybody help me soon………….

  173. Hello, how can i capture image continuously by using webcam in MATLAB, because now i just can capture one image even a loop is inserted. Can you help me?

  174. Following six months, you need to see major improvement as effectively as your genital warts must be marginal or entirely gone.
    This can be this kind of substantial good to the item, mainly because it relies on organic course of action of recovery how the physique of a human
    has been working with from the time we’ve evolved!Having mentioned that the manual release technique are prefect for owners that operate the collar to perform additional coaching combined with bark manage.Having an oral medication, this is a pretty hassle-free technique of clearing 1’s genital warts.

  175. Someone essentially lend a hand to make severely
    articles I would state. That is the first time I frequented your web page and
    to this point? I surprised with the analysis you made to
    make this particular publish incredible.

    Wonderful job!

  176. Vintage lace is more special as the designs are more intricate and unique and is soft to the touch.
    From couture one-of-a-kind dresses to breezy ready-to-wear styles, these five up-and-coming designers
    represent the next class of high-style designer names to remember.
    Some brides have even been known to walk down their wedding isle
    bare as the day they were born, so any choice of color in wedding gowns for any new bride should be just fine with
    anyone.

  177. Use this mixture over the face as an astringent anytime required.

    Let’s see what they had to say and explore some other homemade beauty care ideas also.

  178. Good day! This post could not be written any better!
    Reading this post reminds me of my previous room
    mate! He always kept chatting about this. I will forward this page to
    him. Pretty sure he will have a good read. Thanks for sharing!

  179. I blog quite often and I really thank you for your
    content. This great article has truly peaked my interest.
    I am going to bookmark your blog and keep checking for new information about once a week.
    I subscribed to your Feed as well.

  180. Samuels (Eminem) “Nothin’ On You” — Philip Lawrence, Ari Levine, Bruno Mars
    & Bobby Simmons Jr. Not only does a digger realize
    that it’s very possible he might locate a good deal of gold with hardly any trouble, but, worse still, he knows he could work quite difficult without getting any gold at all. After debating the problem and being from the opinion the Government had no chance to reimburse, they submitted the truth on the Crown Law Office for their decision.

  181. hellow guys following 1 and 2 steps are going well but when i write 3rd step then following error occurs. plz plz plz help me out.

    (1) >> imaqhwinfo

    ans =

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

    (2) >> info=imaqhwinfo(‘winvideo’)

    info =

    AdaptorDllName: ‘C:\Program Files\MATLAB\R2009a\toolbox\imaq\imaqadaptors\win32\mwwinvideoimaq.dll’
    AdaptorDllVersion: ‘3.3 (R2009a)’
    AdaptorName: ‘winvideo’
    DeviceIDs: {1×0 cell}
    DeviceInfo: [1×0 struct]

    (3) >> info=imaqhwinfo(‘winvideo’,1)
    ??? Error using ==> imaqhwinfo at 136
    There is no device with the specified DEVICEID.

  182. Apart from stress, there is also the matter of
    diet and lifestyles. It is often referred to as impotence, which actually includes all of the above mentioned sexual problems along with erectile problems.
    The majority of available penis pills are made from
    a blend of natural ingredients, herbs, vitamins and herbal supplements that stimulate the growth of safe and effective.

  183. Maybe someones knows:
    When making any operation from command window (for exaple cycle for) preview stops till it’s finish.
    How can I run and preview at the same time?

  184. i want to interface external webcam to my laptop, but problem is that i does not find the name n id of the wxternal web cam . plz give suggestion

  185. constantly i used to read smaller content that as well clear their motive,
    and that is also happening with this piece of writing which I am reading now.

  186. Hi, This above’ Image capture using Webcam in Matlab’ step is very used for me.When I follwed this step, now I can easily captured my image from webcam. This is very usefu for me…Thank You

  187. Sumathi :
    Hi, This above’ Image capture using Webcam in Matlab’ step is very used for me.When I follwed this step, now I can easily captured my image from webcam using matlab command. This is very useful for me…Thank You

    1. Hi, This above’ Image capture using Webcam in Matlab’ step is used for me.When I followed this step, now I can easily captured my image from webcam using matlab command. This is very useful for me…Thank You

  188. Hi my fyp z regarding real time motion detection camera and auto panning system ..and i m working it in matlab.. Plz if some one have code and data which can help me and sure can save my time regarding this project…plz mail me at khani17@yahoo.com
    wating for ur reply

  189. We will be setting up a bridged VPN since we want complete access for our roadwarriors.
    The actual number of private dealers and coin shops
    has been steadily decreasing and the remaining shops have focused their sales on
    gold and silver. # This config item must be copied to # the client config file
    as well.

  190. hi, i type imaqhwinfo(‘winvideo’)

    but an error which is “invalid mex file and not valid win32 application

    plz hlp me

  191. It is perfect time to make some plans for the future and it is time to be happy.
    I’ve read this post and if I could I desire to suggest you
    some interesting things or advice. Perhaps you could
    write next articles referring to this article.
    I wish to read even more things about it!

  192. Hello,

    I am a final year student, EEE. I am doing my project which involves automatically acquiring images of cars from a camera and detecting their plate numbers, then displaying them automatically. Please help with this. It’s urgent.

    Thanks, Bright.

  193. hi ,
    i am done code for image subtraction.first image without any object is subtracted from the image with object, then we can find out the center point (centroid ) of that object ,
    plz help me as early as posible

  194. Hi,
    Thanks for sharing!
    Do you have any idea about connecting a android device as webcam in matlab?
    I’ve tried connecting the android device to my computer via “wo webcam app” through USB.
    Skype can recognize the android device’s camera, but matlab can’t.
    Still only one camera matlab can recognize that is my integrated webcam( I use laptop) and my command as below:
    imaqhwinfo(‘winvideo’)
    AdaptorDllName: ‘D:\MATLAB\R2013a\toolbox\imaq\imaqadaptors\win64\mwwinvideoimaq.dll’
    AdaptorDllVersion: ‘4.5 (R2013a)’
    AdaptorName: ‘winvideo’
    DeviceIDs: {[1]}
    DeviceInfo: [1×1 struct]

  195. hey it is working .but it is showing me only single frame as output.but i m working with real time video encryption so i want all frames of that video.plz can u help me with that.

  196. Hello sir, I’m currently studying in final year of BE. My project is drowsiness detection. i have interfaced webcam to matlab. Now i dont do how to capture the live image and detect face and then eyes.
    so Please help me to find
    Thank you

  197. my webcam isn’t shutting down even after typing closepreview command ,the video input window closes but the webcam light isnt shutting down,am i doing something wrong please help me

  198. I am using a leica MC120 HD cam, my program is working in Matlab, but when i have created an EXE file from the same code, its showing error that “PREVIEW()” doesn’t compatible with deploytool? please suggest me an alternative either to preview() or deploytool.

    name = ”;
    name = get(handles.statrStopCamera,’String’);
    vid = handles.vid;
    if(name == ‘Start Camera’)
    set(handles.statrStopCamera,’String’,’Stop Camera’);
    start(vid);
    preview(vid);
    elseif(name == ‘Stop Camera’)
    set(handles.statrStopCamera,’String’,’Start Camera’);
    closepreview(vid);
    stop(vid);

Leave a reply to krishan Cancel reply