Jump to content

infinitenothing

Members
  • Posts

    367
  • Joined

  • Last visited

  • Days Won

    15

Posts posted by infinitenothing

  1. That makes sense. Let me throw out an idea:

     

    So you're trying to find the coefficients in this formula: Z=a1x+a2y+C. You might be able to use this: http://zone.ni.com/reference/en-XX/help/371361H-01/gmath/general_ls_linear_fit/

     

    Where Y is an array of all the pixel intensities and H is {x1,y1,c}, ...

     

    You might want to use real world coordinates instead of pixel coordinates.

    post-15670-0-59330000-1433263440.png

  2. You might have to show us some pictures. It sounded like you had some edge detection which should give you points that make a circle on the edge of the cylinder. You can use a circle fit to get the radius which will give you an area. If you need, you can take an average inside the circle to get the height of the cylinder.

  3. Thanks everyone, for the insightful discussion. I agree that it's most sensible to perform cleanups even if an error occurred, and the Network Stream example sounds like a design flaw.

     

    Aside from cleanups though, I can't think of any other good cases which should run regardless of error -- do you guys do this in non-cleanup code?

     

    As for accessors, I agree that read VIs for a simple number shouldn't have error I/O terminals. I still put them in write VIs though -- I avoid modifying my object's state if an error occurred beforehand. Does anyone feel strongly against this?

     

    Any sort of inter-module communication will have certain messages that you want to get across regardless of the error.

  4.     Thanks for the reply!  I have a couple different ROIs set up and I am measuring the amount of space inside the box that the "white stuff" occupies.  (see the image below)  I was a little vague about how I am actually doing the thresholding.  In short, I am not just using the threshold vi and hoping for the best.  I am trying to use an algorithm (using the Gaussian mixture model) that dynamically changes but like you said, with the lighting/contrast/brightness of the image always changing it does not always perform that well, whereas the edge detection seems to always find the correct edges.  

     

    I suppose I was hoping I could use the edge detection as the base for some kind of mask or something...

     

     

     

    What happens when you threshold your "edges" image? Can you just use particle analysis to "fill holes" on that img?

     

    Alt path: It looks like a regular threshold should work on your ROIs if you manually select the threshold right?  Maybe do an erosion to get rid of the small particles? If that's the case maybe you can find some safe areas where you know there won't be any white? The corners maybe? Use that to set your threshold.

  5. Can you tell us a bit more about what your desired measurement is? Are you just trying to get the area of the white stuff? Usually, you want to make this work as easy as possible for the software (crap in crap out principle) so you want to control the lighting and have a fixed ROI. Secondly you might want to use an auto threshold method so that it dynamically changes if the lighting control isn't perfect. Third, you'll notice the top of your image is much darker than the bottom. Your eyes are really good at subtracting shadows. Here's an example illusion based on that effect. You'll need have a different threshold for different parts of the image (preferably a gradient) to compensate for this.

×
×
  • Create New...

Important Information

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