LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 hours finished the webcam program

I tried now with another Win7 laptop.

 

There the program is working fine, but only for the integrated Camera. The program does not open a window asking to choose the desired camera...

Then I used my Win XP computer and it is working fine.

 

The Vision SW has defenitely no influence on the function of the program because the access to the camera works with direct calls of the windows dlls.

 

If anyone has a probably solution for the Win7 problem, I'd appreciate your help.

 

Greets,

Walter

0 Kudos
Message 71 of 84
(8,405 Views)

 

Hello guys.

 

I creating a Test Systems with Three (3) USB cameras, but I need to know how to choose any without operator.

 

This will be an automation systems and I'm using the cameras just to Take a picture and get the serial number form the picture. 

there is three positions/sockets on the fixture and each has the own camera.

 

any Ideas?

 

PD. I need to use it without IMAQdx or other licensed products..

0 Kudos
Message 72 of 84
(8,346 Views)

thannks alottt

your vi is perfectly working but on my built in web cam can i use it for an IP camera instead that is wirelessly connected to the PC?

how can i change the camera device used?

 

appreciate your helpp

 

0 Kudos
Message 73 of 84
(7,889 Views)

Hi Man,

 

Thanks For your VI. Here i was wondering if you could explained me how your VI work, coze i'm trying to put together an image recognition program using labview and a usb camera. obviously without the NI-IMAQ kit since as a student dont have enough money to buy it. So any useful documentation on how to get started on this project will be fantastic. Cheers

0 Kudos
Message 74 of 84
(7,776 Views)

Smiley Surprised  They can't manage to pay $0.00???  IMAQ utilities are free.  You must be thinking of the NI-Vision and Vision Builder toolkits.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
Message 75 of 84
(7,750 Views)

Ok, this is one of the strangest LabView programs if've ever seen - but this dot.net stuff works, somehow.

 

On all 3 Laptops tested, the original .vi was running smoothly displaying a nice color-image when started for the first time, but if I had stopped it, and tried to run it again, I only got a black screen displayed. 

I could only re-run succesfully after re-starting windows. each time.

-_-

 

That is why I have re-written McArthur's vi:

 

 

2015-08-06_webcam-mcarthur_dotnetpicturebox.png

 

 

 

The .vi attached does capture images - or rather a video-stream - from the built-in cameras of an Asus Laptop running Windows 8.1 and a HP Laptop running Windows 7 and even an Acer Laptop running Windows Vista Home Premium - each time I used the Laptops built-in webcam to capture images.

 

I'm a bit puzzeled for the folowing reasons:

0# the picturebox is outside the while-loop, instead of being inside the while loop hurting our beloved data-flow paradigm - but, ok, I guess I can cope with this exception

 

 the picture box is displaying and refreshing images, if the first itaration takes some time e.g 1000 ms - okay that's cool, we all need our time, but...

1# the picture box is displaying and refreshing images, EVEN IF the while loop stands still in iteration 2

 

2# the picture box won't refresh if you leave out the "this part reshreshes the picture box"-part hi-lighted in the snippet/vi with the black rectangle.

 

3# even stranger: if I don't put all the .dlls in the while loop, I get a behavior as mentioned above: first run ok, re-run = restarting windows

 

 

If attached a version converted to LabView 2010

 

 

Regards,
Alex

 

 

 

Message 76 of 84
(7,667 Views)

 

The picture box does refresh itself (displays new images) even if the while loop is not executing.

But during the first Iteration, four HEX values (U32) have to be written in a certain order to user32.dll

 

I have been asked about the meaning of those HEX values.

x040A, x0435, x0434,  x0432

 

Well, according to msdn those HEX values must be Application-Defined Messages

"Values in the range 0x0400 (the value of WM_USER) through 0x7FFF are available for message identifiers for private window classes."

 

And empirically:

x040A, x0435 ... start the image stream and display first image

x0434, x0432 ... refresh displayed image

 

 

webcam_2018.png

 

Message 77 of 84
(6,872 Views)

Those "magic" numbers are Video for Windows message identifiers. The VfW capture interface is  really a background window that handles all the interaction with the VfW capture drivers (nowadays there really only is one, the Direct Draw to VfW Bridge that translates all Direct Draw sources into VfW capture sources.

And the way to control that VfW manager window is through these messages. As it is a dedicated window it can use whatever message indicators that are reserved for the private user range. Only this window knows about these message identifiers and reacts in the documented way, any other window in Windows will either not understand the message at all or do something entirely different when receiving one of these message numbers.

MSDN describes the Video for Windows interface here. But it is not available anymore by browsing the selection tree, as Microsoft doesn't really want anyone to use this interface anymore as it is really a Windows 3.x technology that got obsoleted by Direct Draw in Windows 2000 or so and only exists for backwards compatibility and might get axed at the first real problem, rather than trying to spend a single man hour on fixing a problem in it.

Rolf Kalbermatter
My Blog
Message 78 of 84
(6,854 Views)

https://forums.ni.com/t5/Example-Code/Video-for-Windows-avicap32-dll/ta-p/3491285

 

init_webcam.PNG

 

I think I found the msg meanings. The original source code could be found via this Link 

 

It follows 

WM_CAP_START = 0x400;

WM_CAP_DRIVER_CONNECT = WM_CAP_START+10 = 0x040A;

WM_CAP_SET_PREVIEW = WM_CAP_START+50 = 0x0432;

WM_CAP_SET_PREVIEWRATE = WM_CAP_START+52 = 0x0434;

WM_CAP_SET_SCALE = WM_CAP_START+53 = 0x0435;

 

Thank you for your kindly reply. 

 

Best Regards, 

 

Yours Dylan Zhong

0 Kudos
Message 79 of 84
(6,831 Views)

Hi friends

 

I would like to use this vi, or change it to use in my project.

I have a vi that measure distance from my car from an encoder in the wheel.

I need to add a webcam in this project to save pictures at preseted distance interval for example each 10m takes a picture. The other problem is that, how can save the jpg image with the name "10.jpg" that corresponds to the 10m picture and next "20.jpg"...

Is that possible or is some cruise idea?

 

best regards

cpalka

0 Kudos
Message 80 of 84
(6,653 Views)