lovemachinez Posted April 2, 2010 Report Share Posted April 2, 2010 (edited) Hi, Now I'm using NI LabVIEW 8.5 with IMAQ Vision and a USB Camera. I look for some method to detect a group of black color.(I don't know how to say it in English >.< Please see the picture below.) -------------100 pixels----------------------30 pixels Let say, I have two pictures like this. and I want to detect the group of black color, which have more pixel than 50 pixels. (in this picture is the first one.) I can do a bit with the color detection, but in this case how can I know which one have the black color, which are grouping more than 50 pixels. So, please help me to do something. and also now I'm trying to improve my English if anything is wrong please correct it for me. (I will appreciate it a lot.) Thank a lot. Edited April 2, 2010 by lovemachinez Quote Link to comment
crelf Posted April 2, 2010 Report Share Posted April 2, 2010 I look for some method to detect a group of black color. That should be pretty straight-forward - please upload the code you've written so we can help. Quote Link to comment
lovemachinez Posted April 3, 2010 Author Report Share Posted April 3, 2010 well, I can do color matching already. by using color matching vi. but it can only detect which one is black and which one is not. How can I know which one have more black pixels (mean that it is bigger)? Quote Link to comment
Mark Balla Posted April 3, 2010 Report Share Posted April 3, 2010 Now I'm using NI LabVIEW 8.5 with IMAQ Vision and a USB Camera. I look for some method to detect a group of black color. I can do a bit with the color detection, but in this case how can I know which one have the black color, which are grouping more than 50 pixels. The function you are looking for is called "Particle Filter" but before you can use it you need to convert your image to binary. The image below shows how it can be done in vision assistant. If the image is color you will have to extract a color plane then do a threshold. Here is the script and the vi that vision assistant created for me blob filter.zip Good luck Quote Link to comment
lovemachinez Posted April 6, 2010 Author Report Share Posted April 6, 2010 (edited) The function you are looking for is called "Particle Filter" but before you can use it you need to convert your image to binary. The image below shows how it can be done in vision assistant. If the image is color you will have to extract a color plane then do a threshold. Here is the script and the vi that vision assistant created for me blob filter.zip Good luck yeah, Thank a lot. by the way, if I got a binary image how can I convert it back to the normal image. Edited April 6, 2010 by lovemachinez Quote Link to comment
Francois Normandin Posted April 6, 2010 Report Share Posted April 6, 2010 by the way, if I got a binary image how can I convert it back to the normal image. If you've got the original image, don't try to convert it back. Instead, make a copy and use that copy to extract a plane and convert it to binary. You can discard the copy to regain memory space when done. Quote Link to comment
Dragoon235 Posted June 17, 2010 Report Share Posted June 17, 2010 There are several VI's that can give you lots of information about particles after you have filtered them: The Particle Analysis VI can tell you exactly how many pixels are in each blob. It can also do lots of other binary image statistics: elongation, circularity, etc... Other Analysis VI's part of IMAQ can do other operations. I'd recommend using the filter command as suggested above to limit the amount of data. 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.