Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Center and resize images according to a found parameter

Hello,
thats just a beginners question.
I have to analyze different pictures of eyes for there pupilsize and
position. Once I determined the pupil in one picture I would like to
center the next pictures according to the center of the found pupil. That
would give me the benefit of having a comperable section in each
picture. How can I do this in imaq?
One more question, is it better to use grayscale or coloured images
for these measurements?

Thanks in advance for the answers.
Fabian
0 Kudos
Message 1 of 5
(3,701 Views)
Hi Fabian,

from what I can tell, it sounds like you are trying to setup your program such that the pupil appears in the same place for every image.

In order to do this, I would begin by finding the pupil within the image. You might be able to do this by finding the concentric circles that make up the pupil and iris. Identify the pupil, and use the center point of the pupil as a reference point to establish a co-ordinate system.

Once a co-ordinate system is established, the program will use this as the basis for your future measurements. The co-ordinate system will ensure that any measurements you make will be in reference to the location of the pupil.

If you want to find more information on co-ordinate systems, I would recommend a particular example VI. The "Battery Clamp Inspection Example" ships with Labview and can be found at:

C:\Program files\National Instruments\Labview 7.1\examples\Vision\3. Applications\Battery Clamp Inspection Example.vi

To answer your second question, I would think that you could perform this using both color and grayscale images. If you use a color image, you might consider averaging the center point of the pupil for all three color planes. This might give you a more accurate center point.

Good luck, and let us know how things go!

Robert
0 Kudos
Message 2 of 5
(3,687 Views)
Thank you for your answer.

I've got some more questions, sorry.

Finding the concentric circles, what do you mean with that, circular edges?

I am testing it with pattern matching what works fairly well. I define the pattern on the first image where the pupil is always in the middle of the image. Then all other images will (hopefully) be centred according to the found center of the pattern (pupil).
Do you think that’s a good idea? Or any other suggestions?

One more (silly) question, when I add a contour to a ROI with imaqAddRectContour the ROI is not displayed in my loaded image. But its there, when I use imaqConstructROI afterwards there is a ROI sized as my defined rectangle.
How can I display it? I am using CVI 6.0 by the way.

Thanks for the help
0 Kudos
Message 3 of 5
(3,674 Views)
Hi again,

By concentric circles, I was suggesting that you find the iris and pupil in your image with possibly a find circular edge. I believe that the method you are attempting to use will work well also.

Regarding the IMAQAddRectCounter function, I do not have an immediate answer. Let me see if I can find out, and I will let you know!

Regards,

Robert Manion
Applications Engineering
National Instruments
0 Kudos
Message 4 of 5
(3,650 Views)
Hi again,

I believe that in order to display your ROI, you would just need to call img_plot again, in order to refresh/redraw the image. Then the ROI should appear as expected.

Hope this helps,

Robert
0 Kudos
Message 5 of 5
(3,635 Views)