LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

line intersection in lawbview 7.1

hi
i m using labview 7.1 for sme image processing
i have detected 4 circles in an image which are in the following fashion
 
                                       1
                                    2     3
                                       4
 
From the IMAQ find circles option, i get the following data:
pos x     pos x     pos x     pos x    - this is the x pos of the center
pos y     pos y     pos y     pos y   -  this is the y pos of the center
radius    radius    radius   radius   -  radius in pixel
core       core      core      core     -  area in pixel
 
now i have to find the intersection of the lines passing through the centers of the (1st,4th) & (2nd,3rd) circle centres.
 
the line intersection option is asking for the co ordinates of the points of the 1st & 2nd line . How can i give the point co ordinates from the circle data?
i.e for the 1st line i must enter the x & y coordinates of the center of 1st & 4th circle and for the 2nd line, x & y of the centers of the 2nd & 3rd cirlces
 
how can i do it?
 
 
0 Kudos
Message 1 of 5
(3,307 Views)
james bond,
 
    The format of the circles needs to be taken apart so that you can get the parts you need to then build the lines.  In the attached image is an example of how you can do this.  Notice that I go from a Find Circles VI to a Lines Intersection VI.
 
1. Send the Circles data through an index array because, like you said, it is an array of clusters for each circle.  Now we can access the data from each circle individually.
2. Send each circle into an Unbundle by Name.  Then decrease the unbundle to two elements and click and select X and Y position values.  Now we have the coordinates for the circles' centers.
3. Now we use four (one for each circle) bundles to get the coordinate data into "point" form (a point is just a cluster of an X value and a Y value).
4. Finally we take the "points" (X value and Y value clusters) and put them into a cluster to create a "line" type.  The data type in the context help window is that of a line, which is what we just created.
 
That setup should work for you, let me know if you have anymore questions.  Thank you!
 
-Allison S.
Applications Engineering
-Allison S.
Calibration Services
Product Support Engineer
0 Kudos
Message 2 of 5
(3,285 Views)
...and the image 🙂
-Allison S.
Calibration Services
Product Support Engineer
0 Kudos
Message 3 of 5
(3,281 Views)
thanks Allison
i did smething similar to what u have said, and i had ended up with the result. thanks for ur time
could u tell me how to calibrate the image in labview.
or if i have calibrate the image in vision assistant, can i use that calibrated image in labview?
thanks
 
0 Kudos
Message 4 of 5
(3,275 Views)
james bond,
 
    I'm glad to hear that the snapshot helped.  As far as calibration, I believe that you are wanting to set up a calibration in LabVIEW, right?  It sounds like you know how to set up calibrations in Vision Assistant.  One of the more common ways to calibrate an image using a sheet of paper with a grid of dots on it with a known distance between the dots.  This is talked about in more detail in this document which also has some helpful links at the bottom:
 
 
    There are several sample programs for image calibration in LabVIEW, specifically in the Simple Calibration Example.vi.  If you open that one you can see that they use a VI called IMAQ Set Simple Calibration.vi.  This VI will handle calibrations when you input your image and the various calibration settings as in the example VI.  What I would recommend, though, is to do your calibration in Vision Assistant like you were mentioning, then you can create LabVIEW code (Tools >> Create LabVIEW VI...) from it and it will create all of the VI's and settings you need to calibrate your image and use your calibrated image in LabVIEW.  If I am misunderstanding please let me know.  Thank you!
 
-Allison S.
Applications Engineering
-Allison S.
Calibration Services
Product Support Engineer
0 Kudos
Message 5 of 5
(3,248 Views)