Jump to content

Measuring 'size' of an image


Recommended Posts

Hi, first post guys. Hope somebody can help with this!

Im currently working on a project that involves computer generated holograms. I am focussing on camera capture of an image, and then calculating how 'round' the image is. The image capture part of the program is running succesfully and displaying an image on my monitor (using an CCD as input). I know want to add a bit on to the program that will allow me to calculate size and roundness of the image. Was thinking of using a histogram to start, is this a good starting point or is there a better way to tackle this?

Any help will be much appreciated.

Thanks

Link to comment

QUOTE(Holograms2 @ Feb 12 2008, 07:54 AM)

:D

QUOTE(Holograms2 @ Feb 12 2008, 07:54 AM)

...calculating how 'round' the image is.

That depends on what you mean by 'round' - the image, I assume, isn't round, but some feature in the image is? This will be a whole lot easier to discuss if you upload an example image or two.

Link to comment

QUOTE(crelf @ Feb 12 2008, 01:17 PM)

:D

That depends on what you mean by 'round' - the image, I assume, isn't round, but some feature in the image is? This will be a whole lot easier to discuss if you upload an example image or two.

Should have done a spell check there!!!

Image is attached.

It is a Laguerre Gauss ring. I want labview to be able to use the number of white image pixels to be able to determine firstly the size of the image and pixels, and then be more specific in measuring how close it is to a circle.

Hope this helps a bit.

Link to comment

QUOTE(Holograms2 @ Feb 12 2008, 09:43 AM)

I was actually referring to the pun :D

QUOTE(Holograms2 @ Feb 12 2008, 09:43 AM)

Image is attached. It is a Laguerre Gauss ring. I want labview to be able to use the number of white image pixels to be able to determine firstly the size of the image and pixels, and then be more specific in measuring how close it is to a circle.

Wow - that's a really low contrast varying image (sometimes referred to as "blurred" or "not sharp") so determining where the shape is will have to be based on rules you set up. Also, it doesn't look like it's symmetrical, so finding a circle to match might takes some doing. That said, start with making the image binary - so do a binary threshold, then use an IMAQ Rake to find the edges of the circle, and then feed those into IMAQ Fit Circle - that'll return you the centre, radius, area and perimeter of the detected circle. Note: I've assumed that you're using the LabVIEW Vision toolkit, right?

Link to comment

QUOTE(eaolson @ Feb 12 2008, 02:00 PM)

That would work, but it doesn't tell you how good of a fit you've got. You could also use IMAQ Fit Ellipse, then compare the lengths of the Minor Axis and Major Axis. The closer those are to equal, the more circular your shape.

:thumbup: Good point!

Link to comment
QUOTE(crelf @ Feb 13 2008, 02:59 PM)
Problem is that I can't seem to find the Imaq fit ellipse function or Imaq fit circle functions. I'm guessing if I have an older version it'll be a tad more complicated to do this.QUOTE(Holograms2 @ Feb 14 2008, 11:40 AM)

Problem is that I can't seem to find the Imaq fit ellipse function or Imaq fit circle functions. I'm guessing if I have an older version it'll be a tad more complicated to do this.

Just been told that best way would be to plot a Gaussian graph of x components, and then y components and work that way rather than using an ellipse fitting function.

Link to comment

QUOTE(Holograms2 @ Feb 14 2008, 06:35 AM)

Problem is that I can't seem to find the Imaq fit ellipse function or Imaq fit circle functions. I'm guessing if I have an older version it'll be a tad more complicated to do this.

You still haven't said which version of LabVIEW or Vision you're using. For me (8.2) it's under Vision and Motion : Machine Vision : Analytic Geometry. For some reason both functions are called IMAQ Fit Ellipse 2 and IMAQ Fit Circle 2.

QUOTE

Just been told that best way would be to plot a Gaussian graph of x components, and then y components and work that way rather than using an ellipse fitting function.

I'm not quite sure what you mean by this. "Components" of what?

Link to comment

QUOTE(crelf @ Feb 13 2008, 06:59 AM)

What version are you using? what was the problem that you heard?QUOTE(Holograms2 @ Feb 14 2008, 04:35 AM)

Problem is that I can't seem to find the Imaq fit ellipse function or Imaq fit circle functions. I'm guessing if I have an older version it'll be a tad more complicated to do this.

Just been told that best way would be to plot a Gaussian graph of x components, and then y components and work that way rather than using an ellipse fitting function.

Wow, you managed to not answer either one of these questions. I assume by components you mean coordinates. Although this approach may work, I think the IMAQ Fit Elipse function would be much easier to configure.

Link to comment

QUOTE(TobyD @ Feb 14 2008, 05:28 PM)

Wow, you managed to not answer either one of these questions. I assume by components you mean coordinates. Although this approach may work, I think the IMAQ Fit Elipse function would be much easier to configure.

I've worked out what I want to do now. I want to find the 'centre of mass' of the image. using the same prinicple as mechanics, I'll be looking at intensities instead of masses, and sum up the intensities of all pixels to locate a centre point. From that take an x and y sweep to produce an intensity distribution, and from this calculate how round it is by measuring standard deviation.

I can't seem to find a function on labview just now to count the number of pixels in the image. I need to be able to know the how many pixels there are and the value of each individual pixels intensity.

Hints always welcome. Thanks for the help so far.

Link to comment

QUOTE(Holograms2 @ Feb 18 2008, 06:46 AM)

I've worked out what I want to do now. I want to find the 'centre of mass' of the image. using the same prinicple as mechanics, I'll be looking at intensities instead of masses, and sum up the intensities of all pixels to locate a centre point. From that take an x and y sweep to produce an intensity distribution, and from this calculate how round it is by measuring standard deviation.

I can't seem to find a function on labview just now to count the number of pixels in the image. I need to be able to know the how many pixels there are and the value of each individual pixels intensity.

Hints always welcome. Thanks for the help so far.

It sounds like you want the IMAQ Quantify.vi

Link to comment
  • 2 weeks later...

QUOTE(TobyD @ Feb 22 2008, 06:54 PM)

It sounds like you want the IMAQ Quantify.vi

The IMAQ Quantify seems a bit of a loose cannon to me. Its not clear what its comparing the image to.

I know have a test image for expected hologram, and my hologram (of laguerre gauss beams). I have scaled them so they are both 512*512 pixels.

My program currently takes an image and gives an intensity distribution through the x centroid, and one through the y centroid. Can I plot 2 images on the one graph, ie the x centroid distribution of both the predicted, and actual hologram image, and the same for the y.

I need to do this so I can make a direct comparison between the predicted image, and the actual image.

Cheers

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.