MATLAB Answers

Is it possible to acquire and display real-time video from the VGA port of a notebook?

12 views (last 30 days)
Qun HAN
Qun HAN on 23 May 2011
The video is acquired by a CCD-camera with a BNC port. By a BNC to VGA converter I can display video on a seperate monitor. I now want to display it directly in an axis on the MATLAB GUI which I have set-up to control the manufacturing system. Is there anyway to realize this? Thanks.

  0 Comments

Sign in to comment.

Answers (1)

Ben Mitch
Ben Mitch on 25 May 2011
There are mechanisms for doing real-time video capture, yes. AFAIK VGA streams are rarely used in this way.
If you have an analog signal (such as BNC or VGA) you would be looking for a "video capture card", which digitizes the analog stream. How you import this into Matlab will depend on the manufacturer of the card - usually, the card will ship with an SDK and include an API offered in C, so you can build a simple mex file which collects a frame from their driver on a fixed interval.
However, unless your application is tied in to a particular camera model, or requires particular camera characteristics (low light, high frame rate, for example) that are only available from a particular class of analog camera, I think it's much easier these days to start with a camera with a digital interface. Frames from many webcams can be captured using the Image Acquisition toolbox. Standard video streams (over firewire, USB) are accessible through generic OS-specific interfaces, which allows you to use much higher grade cameras (e.g. consumer DV or HD camcorders). Tools to access these interfaces from Matlab most likely already exist (see URL, below, for instance). Special purpose cameras (e.g. high speed or high resolution) typically provide their own API, and allow very simple frame import via a mex file that calls their API.
Note that for real-time capture, the HDMI interface (becoming standard on consumer HD cameras) is not currently suitable owing to high lag and poor real-time OS support. I speak from bitter experience. If you need not-so-great image quality and extremely low latency (or fairly high frame rate) I can't recommend enough the pairing of the PS3 Eye camera and the CLEye interface (google this). I am using this myself and it's top dog.

  3 Comments

Qun HAN
Qun HAN on 25 May 2011
The CCD camera is "GS-2800 CC" from Golden State Instrument Co. It seems I have to purchase a "Video capture card". Is there any model you can recomend for me? Thank you. You have been realy helpful.
Ben Mitch
Ben Mitch on 25 May 2011
No, I am afraid I am not familiar with the capture card market. Here is an example http://bit.ly/jsCRYu but it is just that, an example - I know nothing about this card, it may be awful, and there are hundreds on the market. Most products will do adequate video capture; the key will be finding one with a suitable API for access from Matlab. This is a black art, and I strongly recommend searching out someone with prior experience. If they used a card with Matlab, and it worked, throw caution to the wind and buy that card ;).
If you are going to use the camera for real-time "control [of a] manufacturing system", your most important parameter may be latency - that is, how long between the shutter open time and the time a frame becomes available from the capture card driver. If the thing you are controlling is a slow process, this becomes less important, but for rapid processes it is critical. Unfortunately, manufacturers seldom quote this parameter since it is irrelevant for video logging and transcoding, the most common uses of video capture.
If latency is important to you, have a poke around the enthusiast forums for video capture. Someone there is most likely to be able to help you further.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!