Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

fitting an ellipse to an image blob

Solved!
Go to solution

Hi.

Iam new to labview and am processing eye-images to locate pupil center. I reached upto  a point of isolating the pupil from the rest of the image(binary) but now i like to fit an ellipse to it to get an accurate pupil center. I looked into the ellipse fit vi but i have no idea how to extract radial points from the image to fit an ellipse to it. Could someone please help me with this.

0 Kudos
Message 1 of 21
(6,159 Views)

Hello,

 

if your image is thresholded, you can have a go with a basic PCA. I have attached a sample code, but there is some error I can't quite figure out at the moment regarding the both axes lengths (eigenvalues). But the orientation is correct.

 

If you (or anybody else) happen to have the answer, I will be glad to hear it. I will also take a deeper look into this.

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 2 of 21
(6,145 Views)

Could u please downconvert the vi to 8.6 cause i can't open it in labview .........it's sounding an error

Thanks

0 Kudos
Message 3 of 21
(6,139 Views)

Hello,

 

here you go.

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 4 of 21
(6,128 Views)

hi, i seem to be encountering a problem in the vi because it can't find the path to ramp pattern by samples vi.....is this a user defined subvi????....or is this an upgraded version of ramp pattern vi of 8.6.........?????

 

0 Kudos
Message 5 of 21
(6,115 Views)

Hello,

 

try replacing the vi with yours. This is not a user vi, but has been replaced with polymorphic instance in Labview 2010.

 

Anyway, I have updated the algorithm, which now uses pca to find the orientation and the particle analysis to find the ellipse axes.

 

ellipse_fit_pca_FP.png

 

The time it takes to process this is ~25 msec, which equals around 40 fps (this was tested on only one iteration).

 

Best regards,

K

 


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Message 6 of 21
(6,106 Views)

hello......i tried what u suggested and pointed the path to ramp pattern vi when asked however i still felt that the vi is somehow incomplete.........i have uploaded the picture that i get when i open the ellipse_PCA vi......please do check if it is the same..... or is incomplete in some way

0 Kudos
Message 7 of 21
(6,090 Views)

Hello,

 

does it work for you?

 

this ramp only generates 1000 samples of data between 0 an 2pi. If you are having problems, you can manually generate the data (check the documentation).

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 8 of 21
(6,084 Views)

hello.......i could not use the ellipse_PCA vi directly as it points to an error with the thresholding but i changed the acquisition part and it seems to be working .......i do however have a doubt on why the adder outputs are left open in the picture that i attached....is it because it cannot find that particular vi.......if it is incomplete could u please attach the complete structure so i can connect manually.................thank u

0 Kudos
Message 9 of 21
(6,072 Views)
Solution
Accepted by Prathiksha

Hello,

 

don't worry about that. This is just some code that was used for some testing. Use this (attachment):

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Message 10 of 21
(6,067 Views)