LAVA: Color detection in IMAQ Vision - LAVA

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Color detection in IMAQ Vision Rate Topic: -----

#1 User is offline   lovemachinez 

  • More Active
  • PipPip
  • Group: Members
  • Posts: 30
  • Joined: 26-March 09

Posted 02 April 2010 - 06:58 PM

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

This post has been edited by lovemachinez: 02 April 2010 - 06:59 PM

0

#2 User is offline   crelf 

  • I'm a LAVA, not a fighter.
  • View gallery
  • Group: V I Engineering, Inc.
  • Posts: 4,921
  • Joined: 13-October 03
  • Version:LabVIEW 2009
  • Since:1993

Posted 02 April 2010 - 07:48 PM

View Postlovemachinez, on 02 April 2010 - 06:58 PM, said:

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.
Posted Image
0

#3 User is offline   lovemachinez 

  • More Active
  • PipPip
  • Group: Members
  • Posts: 30
  • Joined: 26-March 09

Posted 03 April 2010 - 09:58 AM

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

#4 User is offline   Mark Balla 

  • Extremely Active
  • View gallery
  • Group: Premium Member
  • Posts: 400
  • Joined: 06-August 04
  • Location:Gurnee Illinois
  • Version:LabVIEW 2009
  • Since:1997

Posted 03 April 2010 - 02:50 PM

View Postlovemachinez, on 02 April 2010 - 06:58 PM, said:

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.

Attached Image: Vision assistant.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
Attached File  blob filter.zip (76.62K)
Number of downloads: 50

Good luck
0

#5 User is offline   lovemachinez 

  • More Active
  • PipPip
  • Group: Members
  • Posts: 30
  • Joined: 26-March 09

Posted 06 April 2010 - 08:01 AM

View PostMark Balla, on 03 April 2010 - 02:50 PM, said:

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.

Attachment Vision assistant.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
Attachment 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.

This post has been edited by lovemachinez: 06 April 2010 - 08:04 AM

0

#6 User is offline   François Normandin 

  • The 500 club
  • Group: Moderators
  • Posts: 865
  • Joined: 18-January 08
  • Location:Montréal, QC
  • Version:LabVIEW 2009
  • Since:1999

Posted 06 April 2010 - 12:33 PM

View Postlovemachinez, on 06 April 2010 - 08:01 AM, said:

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.
François [frɑ̃swa], CLD
0

#7 User is offline   Dragoon235 

  • Active
  • Pip
  • Group: Members
  • Posts: 13
  • Joined: 16-June 10
  • Version:LabVIEW 2009
  • Since:2008

Posted 17 June 2010 - 07:44 PM

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic