LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[Help] Webcam Image distance measurement?

Hi M3rcY,

 

There are a couple example VIs for acquire images from USB webcam on the DeveloperZone Community.  Take a look at this one.  I assume you have already downloaded the IMAQ for USB driver.  If not, it's available here.  I hope this helps!

 

Kristen H.

0 Kudos
Message 11 of 23
(3,772 Views)

Hmm.. thanks for your help , i was able to snap pictures from my cam using NI IMAQ , now i m stuck again , i want to measure the distance of the image , how can i do it now ? now that i have the image taken on Labview , wats next ?

plz help

0 Kudos
Message 12 of 23
(3,748 Views)
I'm still a little fuzzy myself on the best way to measure distance using one camera.  Probably the easiest way to measure the distance of an object would be with a Time of Flight Laser.  There's plenty of off the shelf solutions there.  But if this is a school project, I suppose the difficulty might be the point.

Have a look at the NI Vision Concepts Manual  Great document there. 

There's a section on calibration.  I'm not sure which tools exactly you have installed.  But there are also a couple of example VIs. 

Nonlinear Calibration Example

How exactly you're going to go about figuring out how to put this together is something you'll need to experiment with. 

Good luck.

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 13 of 23
(3,735 Views)

Do you know the size of the objects in the image?  If so, then a calibration of distance units/pixels and some geometry should allow you to calculate an estimate of the distance.  Can you place a linear scale somewhere in the image, at least temporarily, for calibration purposes?

 

Lynn 

0 Kudos
Message 14 of 23
(3,712 Views)

Hi M3rcY,

 

There are currently no built-in VIs for stereoscopy, but it can be done using two cameras.  Check out this KnowledgeBase article that breifly describes one way of implementing it.  Also, I would highly recommend submitting your code to the DeveloperZone Community, so that others wanting to do the same thing won't have to start from scratch. 

 

Kristen H.

0 Kudos
Message 15 of 23
(3,699 Views)

Hello,

i was able to find what I was looking for and its exactly the same thing i wanted , i found this Nonlinear calibiration example.

This is the exact thing that i want , now i m only having this simple problem , i dunno how to acquire images from my usb camera in this project , i tried doing it and after looking on it i was able to find that this example uses a image file for the base work and i want to switch it with my usb camera acquired image , how to do it ? and how to set distance in this example ? 

0 Kudos
Message 16 of 23
(3,638 Views)

Hi M3rcY,

 

I took a look at the example, but I thought you wanted to calculate the distance from camera to the object.  This example corrects distortion to accurately measure objects in the frame.  

 

To read images from your USB camera instead of a file, right-click on the IMAQ ReadFile.vi and select  Replace >> All Palette >> Vision and Motion>> IMAQ USB >> IMAQ USB Snap.vi

 

I hope this helps!

 

Kristen H.

0 Kudos
Message 17 of 23
(3,603 Views)

Hello,

well after consulting my teacher, he told me to measure the size of objects recorded from webcam , so i started looking for some resources and i found the nonlinear calibiration , as u already know i suck at labview , can u plz help me make it ? tell me which part to edit from the nonlinear calibiration example to switch the input to my camera and then setting up the calibiration distance and measuring the size of objects :$ ? please i would really appreciate it , coz i dont understand labview , i have already ordered a tutorial dvd but i wont be receiving it this week and i want to complete it by friday 😞 plz help me

0 Kudos
Message 18 of 23
(3,580 Views)

Hi M3rcY,

 

The VI you need is going to be dependent on the image you acquire because different processing steps may work better for you.  Although, I will explain what is going on within Nonlinear Calibration Example. 

 

Sequence 0: creating buffers to store the images used throughout the remainder of the program

Sequence 1: once the Load Calibration Template button is pressed on the front panel, the image is loaded from a file- you would want to replace the IMAQ Read File with IMAQ USB Snap, as I mentioned in my previous post- take picture of calibration template.The template can be an image of a grid of circles, or a set of pixel coordinates and corresponding real-world coordinates. 

Sequence 2: pause

Sequence 3: learning the template

Sequence 4:returns learn button to false case

Sequence 5: pause

Sequence 6:loads coin image from file- you would want to replace the IMAQ Read File with IMAQ USB Snap

Sequence 7: pause

Sequence 8: set the calibration information, correct calibration, finds the coins using thresholding and processing, extract data from processed image, puts data ontop of image in display

Sequence 9:repeat  processing in sequence 8 for coins only and display in other display

Sequence10: pause

Sequence 11: dispose of images

 

I hope this helps!

 

Kristen H.

0 Kudos
Message 19 of 23
(3,564 Views)

Hi Kristen ,

thanks to your help , i was able to get most of the things ready, now i m only having some troubles , and i know u can help me out,hmm.. i m successfully able to capture the images from webcam , now i only want to set the calibration distance,

and to measure the stuff and configure , and if possible i also want to measure square and rectangle stuff , if its possible , if not just tell me how to complete this first , actually right now, i m able to capture images but its not measuring stuff , so tell me how to do it , but i didnt captured any round objects , i have also attached all the block diagram for ur reference so plz help me out .. thank you .

 

 

0 Kudos
Message 20 of 23
(3,511 Views)