Jump to content
lovemachinez

Color detection in IMAQ Vision

Recommended Posts

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.)

15262888.jpg

-------------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 by lovemachinez

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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)?

Share this post


Link to post
Share on other sites

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.

post-584-127030594272_thumb.png

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

Share this post


Link to post
Share on other sites

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.

post-584-127030594272_thumb.png

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 by lovemachinez

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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