Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Using CVI to write code for image processing

Hey, all,

I am using vision in real time control. The image processing task is to identify a arc in an image and try to find the circle center coordinates. I can use vision assistant to implement it. But it results in 100ms delay, which is too big for our application. One sample image is attached, is there a better way to find the circle center in 5ms? The way I am thinking is to write my own image processing code using Labwindows/CVI. The problem is that how do I combine my own code with the main VI. Is it possible to use Labwindows/CVI to write an image processing VI? If yes, where can I find the related documents and examples? Thank you very much!

Regards,
Haifei
0 Kudos
Message 1 of 5
(4,439 Views)
Hi Haifei,

I took a look at your image, and set up an inspection on my machine.  I was able to do the analysis in under 2ms.  I started with a threshold to make the image binary.  Then I eroded the image to remove many of the speckles.  Last, I found circular edges.  It found the center at -358, 1569 (where the origin is at the top left of the image).

What are you running on?  Is it a real-time PC?  What speed is the processor?

You can also test this in CVI to see if it is faster by going to Tools » Generate C Code... I don't expect it to be significantly faster in CVI, but it is worth looking into.  If you decide that you do want to use CVI, this is a possible option, but you will have to create a .DLL in CVI to be called by LabVIEW.

Let me know if you need any further assistance.
Regards,
Brandon M.
Applications Engineer
National Instruments
Message 2 of 5
(4,420 Views)
Hey Brandon,
 
Thank you for your respond. For searching the circle center, did you use >>Machine Vision>>Circular Edge(Spoke) ? If it is, we have to draw a search lines profile. This profile depends on the arc position in the image. But the arc might present on the image in any position. The only thing fixed is that the image center is on the arc or very close to the arc. Do you know any other way?
 
Thank you again!
 
Regards,
Haifei
0 Kudos
Message 3 of 5
(4,411 Views)
Hi Haifei,

That is how I found the center.

Another way is to find edges and then use those edges with a caliper function to find the circle that runs through those points.  That is a more arbitrary method because you can draw the lines anywhere and use those points to find the circle.  I attached a screenshot that also indicates how long this took.
Regards,
Brandon M.
Applications Engineer
National Instruments
Message 4 of 5
(4,399 Views)

Hey Brandon,

This method is quite good. Thank you for your time, I really appreciate it.

Regards,

Haifei

0 Kudos
Message 5 of 5
(4,391 Views)