Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting partial circles in images

I am trying to detect partial circles in images. We are taking pictures of the moon over the full range of phases so that we end up with the partial circle of the bright side of the moon. The goal is to detect where the center of the moon is within the image. From that we want to get outputs and use it to center the camera over the true center of moon so that the image is centered.

 

This algorithm to detect the center is readily available in Matlab, but for reasons that aren't worth discussing we can't use it on the machine. Using an exe from Matlab and called from Labview doesn't seem to allow inputs or outputs. I've read through numerous threads on here about that and I am confused. If a Matlab script is called and doesn't have an output, what is it good for? Obviously, I don't understand the basics here.

 

Anyway, is it possible to do center detection using some Labview vision processing? I've read the vision package help files on the processing vi's but nothing seems to fit as far as I can understand it.

 

Thanks

David A. Taylor
0 Kudos
Message 1 of 17
(7,557 Views)

This is a straightforward operation using IMAQ Vision : The find circular edge function, applied directly to a grey level image, returns the position of the center.

 

23180iE32E9F5579BC699D

Chilly Charly    (aka CC)
Message 2 of 17
(7,529 Views)

CC,

Thank you. This looks great. I will give it a try.

 

David A. Taylor
0 Kudos
Message 3 of 17
(7,504 Views)

Hi

I am doing pretty much very similar to what you are doing.

I need to detect partial circles in the image. I didnot understand

what ahve you done here.

 

Yeshwanth KAdire

0 Kudos
Message 4 of 17
(7,488 Views)

If there is a single partial circle, this is a one step operation, using the find circular edge function. Try it.

If there are several circles, you'll need some processing to isolate the different circle portions and apply the FCE successively to each portion. 

Chilly Charly    (aka CC)
0 Kudos
Message 5 of 17
(7,476 Views)

Correction : when there are several circles, you should use the shape detection function, using the "occulted" option. Again, a one step operation, that returns a table with radius, X,Y position, angle (when working with ellipses...

Chilly Charly    (aka CC)
0 Kudos
Message 6 of 17
(7,473 Views)

The code shown above is not clear. What processign steps you have used to detect the half circle.

What I did in my code for something similar to this was

 

Acquire

extract red plane with minimum threshold.(I donot know but that decreased noise)

Dilate and erode the circle until there are no holes in the circle.

then extract the circlular image using IMAQ mask.

 

I don't know what to do if its a semi circle as shown above. COULD

ANYONE PLEASE EXPLAIN WHAT you guys did in the above code.

 

 

Yeshwanth

0 Kudos
Message 7 of 17
(7,457 Views)

It uses the IMAQ Find Circular Edge Vi. Give it an inner and outer circle (the red ones) and it will search between then for an edge along a number of spokes (the blue lines). It then does a best fit (I think) of the edge points (faint white dots on the edge of the circle you're looking for) to work out the circle. Interesting that I've just been doing the same thing with an incomplete circle so I know it works.

0 Kudos
Message 8 of 17
(7,454 Views)

I played with the edge detector and the spokes confused me. The documentation is pretty weak on this function.

 

Anyway, is it possible to programatically control the location of those spoked wheels? I am brand new at this, but I am assuming that once you have defined a script in the assistant you can convert this to regular LV code like any other Express vi. Is that the case?

David A. Taylor
0 Kudos
Message 9 of 17
(7,450 Views)

That's what I've done this week. I used Vision Assistent to play around with things, then export as a vi so I can use it in large vi.

Yes, you can define a start and finish angle of the spokes, so they don't need cover 360 deg from the centre if you don't need to.

0 Kudos
Message 10 of 17
(7,447 Views)