Holograms2 Posted February 13, 2008 Report Share Posted February 13, 2008 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 Quote Link to comment
crelf Posted February 13, 2008 Report Share Posted February 13, 2008 QUOTE(Holograms2 @ Feb 12 2008, 07:54 AM) I am focussing on camera capture of an image... 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. Quote Link to comment
Holograms2 Posted February 13, 2008 Author Report Share Posted February 13, 2008 QUOTE(crelf @ Feb 12 2008, 01:17 PM) 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. Quote Link to comment
crelf Posted February 13, 2008 Report Share Posted February 13, 2008 QUOTE(Holograms2 @ Feb 12 2008, 09:43 AM) Should have done a spell check there!!! I was actually referring to the pun 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? Quote Link to comment
eaolson Posted February 13, 2008 Report Share Posted February 13, 2008 QUOTE(crelf @ Feb 12 2008, 09:49 AM) 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. 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. I hope this will not be seen as sedition, but if you're not using Vision, you might want to check out http://rsb.info.nih.gov/ij/' target="_blank">ImageJ. It's an open-source image processing program specifically intended for this sort of thing. Not being written in LabVIEW, it is of course, inferior, but it has its uses. Quote Link to comment
crelf Posted February 13, 2008 Report Share Posted February 13, 2008 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! Quote Link to comment
Holograms2 Posted February 14, 2008 Author Report Share Posted February 14, 2008 QUOTE(crelf @ Feb 12 2008, 07:19 PM) :thumbup: Good point! Tnaks for the advice guys, I've made the image binary and it looks great. Clearly defined edges. I can't seem to find the IMAQ fit ellipse function, I'm guessing I'm using an older Imaq version, someone mentioned there was a problem with this until 6.0.5. Quote Link to comment
crelf Posted February 14, 2008 Report Share Posted February 14, 2008 QUOTE(Holograms2 @ Feb 13 2008, 08:50 AM) I can't seem to find the IMAQ fit ellipse function, I'm guessing I'm using an older Imaq version, someone mentioned there was a problem with this until 6.0.5. What version are you using? what was the problem that you heard? Quote Link to comment
Holograms2 Posted February 15, 2008 Author Report Share Posted February 15, 2008 QUOTE(crelf @ Feb 13 2008, 02:59 PM) What version are you using? what was the problem that you heard? 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. Quote Link to comment
eaolson Posted February 15, 2008 Report Share Posted February 15, 2008 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? Quote Link to comment
TobyD Posted February 15, 2008 Report Share Posted February 15, 2008 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. Quote Link to comment
Holograms2 Posted February 19, 2008 Author Report Share Posted February 19, 2008 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. Quote Link to comment
TobyD Posted February 23, 2008 Report Share Posted February 23, 2008 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 Quote Link to comment
Holograms2 Posted March 7, 2008 Author Report Share Posted March 7, 2008 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.