From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggered grab using inbuilt laptop webcam

Hi,

 

I am new to Vision acquistion and hence, am having a lot of difficulties setting up my camera. My application requires that I use a camera to capture a frame @ 7 fps minimum and then process the captured frames. However, the processing of the image must be done alongside, cannot wait for the capturing to finish. Since I am not performing an industrial application, I am not using a professional camera. I am using the inbuilt camera of my laptop; the model of my laptop is tx1220 ca. I tried to use the examples called Triggered Grab.vi under IMAQ.dx but it does not work and neither does Triggered Grab (with ROI).vi. However, Grab Express.vi works with my camera. I cannot understand what the problem is and even after hours of searching have no clue abt. the same. I keep getting an error message : Possible reason(s):

NI-IMAQdx: (Hex 0xBFF6900F) Attribute not supported by the camera.

 

whenever I use the triggered grabs.

I was wondering if anyone has tried doing the same and have faced similar problems. If yes, could you tell me how to solve it. By the way it is very critical in my application that the images are processed alongside their capture.

 

I was thinking if there was a way I could make my camera capture an image every few ms say 200, then perhaps it would work. But I have no clue how to create such a timed system in LabView.

 

Any help would be appreciated.

 

Thanks in advance

-shahniya 

0 Kudos
Message 1 of 5
(3,495 Views)

You are looking in the wrong place.  Triggered Grab and others require an external signal to drive the image capture.  Web cams don't have external signal inputs, so they can't be triggered.

 

What you want to do is change the effective frame rate of your web cam.  I know two ways to do this:

 

In the camera setup in MAX, you can probably select from a variety of frame rates.  Usually 30, 15, 7.5, etc.

 

Otherwise, use a fast frame rate (30) and only capture every Nth frame.  In your acquisition loop, you can request frame 0, 5, 10, 15 and ignore the ones in between.  You will need a large buffer to hold the unused images, but that isn't a big deal.  Some acquisition methods allow skip frames, which will just acquire every Nth frame, but I don't know if those will be available for a web cam.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 5
(3,480 Views)

Bruce is right. If you want to process live images from a USB camera at a fixed frame rate, either configure the camera to acquire at that rate if it has an applicable video mode, or else have it free-run at whatever rate it acquires at and then simply call Get Image with the "newest" mode. This will get whatever the latest image is. You can use a timed loop or a normal loop with a Wait for Multiple call inside of it to throttle your processing to 7 frames a second. 

 

Eric 

0 Kudos
Message 3 of 5
(3,467 Views)

Thank you guys. It really helped to know that I was on the wrong track. My camera can not be configured to capture at 7 frames per second and hence I would have to use the loop method. Can any of you please point out an example file to me. It would give me an idea on how to get started. I have tried several times to come up with such a loop; but it never works out. Moreover, for my application it is necessary that I do not have to manually restart the loop every time an image is stored/fetched.  I would really appreciate if you could show me an example loop that does something along the lines.

 

Thanks in advance

-shahniya 

0 Kudos
Message 4 of 5
(3,459 Views)

Did you ever end up finding a good example of this?

 

-Phil

0 Kudos
Message 5 of 5
(2,835 Views)