LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate distance between two points

Hi all,

Need few suggestions:

 

1. I am trying to find the distence( in cm) between two points using image processing(one is fixed intentionally other point is not fixed and keeps varying).

2. If I use ball of different diameters as a point here,can I find the diameter of the ball also simultaniously .

3. Both are in realtime.

 

Please help.

0 Kudos
Message 1 of 10
(6,427 Views)

The feedback forum is the wrong place for this but we need more information to decide where it should go. (machine vision maybe?)

 

What is your software?

What is your hardware?

0 Kudos
Message 2 of 10
(6,423 Views)

Sorry for that altenbach.

 

Im using labview ver 2011. I use a logitech webcam for image acquisition.

 

In brief:

 

In my experimental setup,camera will be faced towards a plain white background (say wall).There will be a permanent marker on the center and also rays of light(one at a time) will be seen on the wall( but it keeps varying).so my objective is to;

a) find the distence between the permanent marker and the center of mass of the incident light.

b) find the diameter of the incident ray on the wall.

 

Please find the attachment.

 

In below attached image,my objective is to find distence 'a' and 'b'.

 

Thanks for the reply 🙂

 

 

0 Kudos
Message 3 of 10
(6,420 Views)

You need to attach your VI (or a .zip file of your Project).  Did you see Altenbach's question, "What is your Hardware and Software?"  We can tell a lot from your code, including "Where is the Problem?" and "How can we help you learn to do this yourself?".

 

Bob Schor

0 Kudos
Message 4 of 10
(6,365 Views)

Assuming that your 'marker' is a known size, on the same surface as the incident light and the wall is perpendicular to the camera this should be pretty straight forward:

 

Use background comparison or blob detection to find the objects on the wall, given the size of the mark you can tell the relative size of the light and its position from the mark.

 

I'm assuming that you have the labview IMAQ to use in order to facilitate all of this? Otherwise it might get difficult but you should be able to perform using still JPEGs from the camera.

Message 5 of 10
(6,329 Views)

Hi ogk.nz,

 

Can u please explain or leave a link below where i can study about blob detection? As i am new to labview Im using tamplet matching.

 

Below attached file is a screenshot of my another project similar(no fixed point though) to this.

 

 

 

 

Download All
0 Kudos
Message 6 of 10
(6,218 Views)

Vigvi,

 

     You have now been asked several times to post your code.  All you have shown us is Front Panels.  Do you actually have code for which you need help, or are you trying to get us to develop the code for you (for free)?  If the latter, then you are posting to the wrong Forum -- you want the "LabVIEW Developers Seeking Employment" Forum.

 

     However, if you do have code, and want help, post your code.  If you want help with a single VI, post the VI itself.  If there are multiple VIs or a Project we need to see, compress the surrounding Folder and post the resulting .ZIP file.

 

     It would also help if you could post an example image and describe (relative to that image) the Question you are posing.

 

Bob Schor

Message 7 of 10
(6,199 Views)

Hi Bob_Schor,

 

Please find the attachment below for the VI and output image.

 

Please note:

 

a. Im using mathod of tamplet matching.Please suggest me if any other easy method.

b. As im still doing this project its not complete. Its only till my tamplet is matching and i get accurate X and Y coordinates.

c. According to this VI,I need two points to consider( one is Fixed mark and second is moving light)Can u suggest me hw can i do this.Can i use two temples matching simultaneously?

d. Ones i select the tamplet,its not matching contineously as tamplets keeps changing.So i need to change the threshold ( normally it will b above 800) to very low (say 300) due to which tamplet matching is getting affected.

 

Thanks

0 Kudos
Message 8 of 10
(6,140 Views)

Thank you for (finally!) attaching your VI.  At least part of your problem is that you are using Express VIs, which may be OK tools to explore some of the features of LabVIEW (and IMAQ), but provide limted (and limiting) capabilities if you want to do anything complex or iterative (I'm over-generalizing, but at some level, you really do have to master the underlying technology).

 

Could you attach an example Image, and indicate what part of the Image is the "Fixed" reference point, and which is the "Movable" Target whose distance you want to compute?  Can you also define what you mean by "Distance", i.e. describe the units?  Do you want this in Pixels (which is the "natural unit" for images)?  Degrees?  Millimeters?  {For the latter two, additional data are needed ...).

 

Bob Schor

0 Kudos
Message 9 of 10
(6,095 Views)

Hi Bob,

 

Sorry for delayed response,

 

I dont have the real image of the expt mention below bt attached the image how it will look like i.e reference image of that in the above conversation.

Distance is prefered to be in Millimeters( both 'a' as well as 'b').

 

Thanks in advance 🙂

0 Kudos
Message 10 of 10
(6,011 Views)