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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to automatically take photos from Webcam?

Solved!
Go to solution

Hi everyone,

 

the idea is to program a camera which will be used as a bar code reader.

Using the Vision Bar Code Read Function I have managed to take a picture from the webcam, display the image and read the barcode, however I have to take the picture manually.

I would like my camera to be able to automatically take the photo of the barcode when I put a barcode in front of it.

How could I programmatically do this?

 

Thank you for your support,

 

KevinCoder

0 Kudos
Message 1 of 5
(3,987 Views)
Solution
Accepted by topic author KevinCoder11

Hi Kevin,

 

by manually, I assume you mean, push a button in LabVIEW, to take an image.

To trigger it with the barcode you could snap and analyze in a loop, until the output makes sense and then continue to process your data. This could be handled beautifully in a state machine.



Remember Cunningham's Law
0 Kudos
Message 2 of 5
(3,982 Views)

 Hi Peter,

 

indeed, the solution was to continuously scan with a while loop until the barcode was detected, in fact a state machine was a great idea for doing this, thanks for the tipp, now I have a perfectly functional bar code camera,

 

best regards,

 

Kevin

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

In this example, we will create a program in Labview to capture images from a USB camera to your application for further processing using the NI Vision module.

 

https://decibel.ni.com/content/docs/DOC-30531

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

Hi, could you send me the source code please, thank you

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