04-02-2009 09:03 AM
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
04-02-2009 11:01 AM
04-02-2009 11:04 AM
04-02-2009 11:06 AM
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
04-02-2009 11:08 AM
04-02-2009 11:11 AM - edited 04-02-2009 11:14 AM
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.
04-02-2009 11:15 AM
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
04-02-2009 11:22 AM
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
04-02-2009 11:26 AM
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 ?
04-02-2009 11:45 AM - edited 04-02-2009 11:46 AM
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