LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[Help] Webcam Image distance measurement?

Hello, 

I got a project which i have to finish by friday , but i m stuck and i dunno how to do it ?

i have a A4tech webcam and i want to capture images from that camera to labview and then measure the distance of things shown in the image from the webcam. any help would be appreciated .. if u dunno how to measure distance can u tell me something other than that which is closer , like how much each colour is there in the picture , actually i want to demonstrate a webcam and some measuring stuff.

Any help will be appreciated.

Thanks in advance

0 Kudos
Message 1 of 23
(10,006 Views)
Hi there,

 

In order to get some meaningful help, you should provide a little more background about what you have tried so far, and what your results have been.  

Are you able to capture images?  

What tools are you using?  (Vision Builder, Vision Assistant, etc.)  

Measuring distances in the captured image is possible once the image has been calibrated.  There are several examples on image calibration.  

However measuring an object's distance from the camera is quite a bit more difficult.  I'm sure there is a way to do it.  But I would try starting with just measuring your object first.  
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 2 of 23
(9,986 Views)
Hmm, well to tell u the truth , i m a total beginner at Labview , and thats y i dunno how to get started , can u plz guide me how to do it ? i have  a A4Tech 1.3 Megapixel USB Web cam , and i have Labview v8.6 , can u plz guide me , from where to begin, and how to measure image distance , the image size or something , any thing would be helpful.
0 Kudos
Message 3 of 23
(9,984 Views)

Its hard to determine a distance only using 1 camera.

It would be easier to use two cameras, then use a little geometery to determine the distance.

That is why you have two eyes Smiley Tongue

Cory K
0 Kudos
Message 4 of 23
(9,982 Views)
ok, no problem i will get another camera , but tell me how to do it 😄 , i m totally stuck :$
0 Kudos
Message 5 of 23
(9,981 Views)

Can the camera move?

Set the two cameras X distance apart.


Then, the first camera will turn A degrees, and the second will turn B degrees, until they are both focused on the object.

You then have two angles, and a length of a triangle.

You can use the Law of Sines to find the distance from either camera.

In terms of coding, I agree with Patrick Allen that you will need to use the 'Calibration' VI's under the 'Vision Utilities' menu
Message Edited by Cory K on 04-02-2009 11:14 AM
Cory K
0 Kudos
Message 6 of 23
(9,978 Views)

sounds good,

 

i will try that , but first can u plz tell me how can i acquire image from my web cam ? and what processing will be needed to calculate distance from those cameras

0 Kudos
Message 7 of 23
(9,969 Views)

To aquire an image, under NI-IMAQ:
a) use 'IMAQ snap' to take a single image, like a photo

b) use 'IMAQ grab' to take continuous images, like a video.

 

b should be used in combination with 'IMAQ grab aquire'

 

To measure distances:

You would use the function under 'Vision Utilities', 'Calibration'.

I personally have never used these functions, so I cant really give you much help from there, sorry

Cory K
0 Kudos
Message 8 of 23
(9,965 Views)

Thanks man u r the best,

well after reading ur msg i thinks its pretty easy to measure image distance from the cam , but then a thing rings in my head

 why the hell then my teacher gave me the hardest project and he even challenged me that u wont be able to do it and if u r able to do it i will give u full marks . do u really think its that easy ? Thanks again , i will try IMAQ to take images from a single cam.

Wish me luck and any other advice for me on measuring the image ? and if i want to measure the amount of colours in the snap how to do it ? for example, i took of photo of mine , i have black hairs , so how to measure how much black colour is in the snap in total ? 

0 Kudos
Message 9 of 23
(9,962 Views)

Hehe, good luck with your project

 


M3rcY wrote:

... if i want to measure the amount of colours in the snap how to do it ? for example, i took of photo of mine , i have black hairs , so how to measure how much black colour is in the snap in total ? 


For this, I would recommend 'IMAQ ColorMatch'

You can find it here:

Vision & Motion >> Image Processing >> Color Processing >> IMAQ ColorMatch

 

It takes an input of an image, and a color (along with other things)

and outputs a "score", where a score is 0, no match, to 1000, perfect match

Message Edited by Cory K on 04-02-2009 11:46 AM
Cory K
0 Kudos
Message 10 of 23
(9,958 Views)