01-10-2013 05:01 AM
for a project i'm working on i have interests in using the particle filter 2 vi to select a range of valid particle area sizes.
the particle filter seems to work only partially, it filters out all the particles i want it to, but if i later attempt to display the image the shown image is completely black. the image viewer also reports the value of the pixels at the particles to be 0.
if i send the same image to the particle analisis report vi it works like expected and gives details about every remaining particle.
i am working with labview 7.1.1
best regards
Jasper
Solved! Go to Solution.
01-10-2013 10:27 AM
This discussion may be helpful:
http://forums.ni.com/t5/Machine-Vision/IMAQ-Particle-Filter-2-unexpected-behavior/td-p/566000
Kevin C.
01-11-2013 02:23 AM
i have looked at that specific topic before, but i am afraid my case seems different.
the problem is not that it isn't detecting the particles i want it to. but that even though the particle analysis vi that i send the image to reports the exact particles i need, when i look at the image, it appears completely black.
Jasper
01-28-2013 03:33 AM
Hello,
Could you use IMAQ Particle Remove.vi instead of? I couldn't find enough info about that issue. Maybe if you can test it in another machine, or another version, you can check if it will happend again or not.
If ther is any update, I hope to hear it from you.
Best regards,
Hossein
01-28-2013 04:34 AM
since i need to precisely select my particles by area i don't think the Particle Remove.vi would be sufficient. i am looking for a way to seperate my particles into several size categories like, for example, one category with area's between 10 and 50, another one between 50 and 100, and so on.
furthermore, i believe i am the only one around here who has the vision module installed. and as a student my options for getting another version are very limited.
best regards,
Jasper
01-31-2013 04:21 AM
Hello Jasper,
I still cannot find enough info but I have some links for you which could be helpful for you.
Besides, I found some info about the size of the particles which you can choose. When you use the Particle filter you cannot separate a bigger than 256 bytes of your image in every part.
I hope this will help you.
http://zone.ni.com/devzone/cda/epd/p/id/1517
http://www.ni.com/white-paper/3169/en
Kind regards,
Hossein
01-31-2013 08:13 AM
i seem to have solved the problem by using an U8 image source and a I16 image destination. i have no idea why this works, but it does.
luckily i chanced upon it when i wanted to add a rejectborder filter which only accepts U8 and i tested it before i set the destination to U8.
my earlier attempts to switch to U8 didn't work since having the destination as U8 doesn't seem to work (i tested it again).
Hossein,
thank you for your suggestions, i will look into them for more info and perhaps an explanation for my solution.
best regards,
Jasper
01-31-2013 08:31 AM
Hi Jasper,
That is great. I will close this forum post. I just have to mentioned again that when you use U8 or I16 you keep the value between 265 bytes which is possible to use in Patricle Filtering. That is why you are able to do that.
Have a great time.
Regards,
Hossein
09-09-2013 04:56 PM
I have had the same problem as you and this works for me as well.... unfortunately I need the image to be U8 becasue I16 doesn't seem to work for some other processing that I am doing. Have you found a different solution to this problem yet?
Also, I can't even cast the image back to U8 after the particle filter, so the filter must require an I16 to work? Either NI need to fix this, or remove the U8 symbol at the top of the documentation.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
09-09-2013 05:50 PM - edited 09-09-2013 05:50 PM
Success! After some playing around a bit and experimenting with differenting casting methods, IMAQ operators, etc I figured out a workaround.
Since I only need the image to be black and white, nothing in between, my method below worked:
1. Cast original image to I16
2. Run Particle Filter on IMAGE
3. Convert image to an array of I16 using IMAQImagetoArray.vi
4. Cast image back to an U8
4. Use two nested For-loops to cycle through each pixel.
a. If a pixel is greater than zero, output 255 as an U8
b. Else, output 0 as an U8
5. Convert the new array to an U8 IMAQ image using IMAQArraytoImage.vi
Now I have an U8 IMAQ image with the particles filtered out that I need.
Thanks for the initial help. If I didn't know about the I16 solution I never would have figured this out.
Best,
James
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'