LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ - particle recognition

I've been working on this problem for a while, and am having trouble finding an answer.  I'm working with Vision Assistant 8.0 and Labview 8.0.
 
I have an image (I16 Greyscale, exported to file as a jpeg2000 file).  I'm trying to apply a threshold filter to isolate a single particle (highest intensity), then find the centroid of that particle.  In order to do this, I adjust the threshold until there is only one particle left.  For some reason, Labview doesn't like the combination or the sequence of filters that I choose to use.  One of two things are happening...
 
- The palette setting for the output image (binary) is conflicted with the image input.
 
- Or my particle filter is measuring 4 particles, when there is only one visible particle.
 
I put some notes on the vi, to describe what/how I want my program to operate.  Also as a side note, you need to specify the location of the attached image (grey.jpeg) before you run the program.
Download All
0 Kudos
Message 1 of 3
(2,935 Views)
Hello System_Eng,

Thank you for using National Instruments discussion forums.  After looking at your Vision code I believe I understand what was happening.  When ever you iterated your while loop you probably thought that both the image src and image dst for the inputs in to the threshold VI were being reinitialized each time.  When you use IMAQ create you are actually allocating memory to hold your image information.  So when ever you change that image information it changes it in memory.  When you use the Threshold VI both the image src and the image dst must be of the same type.  So when you casted your image into an 8 bit format later in the while loop it stayed an 8 bit image when the loop iterated.  What you need to do is at the beginning of the loop cast it into a 16 bit image each time.  I have attached a screen shot of how I modified your code.  I hope this helps.  Let me know if it does not make sense or you are still unclear.  Thanks and have a great day.

Regards,
Mark T
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(2,914 Views)
Thanks for the post.  So far, so good.  Looks like the correction you made is working.
0 Kudos
Message 3 of 3
(2,905 Views)