LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i count 1 when some color pass the camera?

Color separation machine i receive color spectrum and instructs the servo motor to rotate but the problems is how can i count one and i try to use elapse time but don't work. help me please ( sorry for my English)image.pngimage.png

0 Kudos
Message 1 of 5
(2,002 Views)

@TinyfromThailand wrote:

 ( sorry for my English)


Our Language is LabVIEW. We understand diagrams, but it is much more difficult to help of you attach incomplete picture fragments. Please attach the VI and explain what you want to count. I assume you want to count to more than just 1.

0 Kudos
Message 2 of 5
(1,979 Views)

@

0 Kudos
Message 3 of 5
(1,918 Views)

Hi Tiny,

 

cleanup your VI and remove Rube-Goldberg constructs:

check.png

(I left just the core functions, don't have LINX/IMAQ installed.)

You can even place those boolean indicators into a cluster and use ArrayToCluster after BuildArray to further reduce block diagram clutter…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(1,910 Views)

@GerdW wrote:

You can even place those boolean indicators into a cluster and use ArrayToCluster after BuildArray to further reduce block diagram clutter…


Exactly! And if you make the cluster container transparent, the front panel would look exactly the same, but with 5x less clutter on the diagram. Instead if indexing out the elements and re-building the array, You can even do all in one step. I16 is awfully limiting for a computer count. I would recommend at least I32. I am not sure if only exactly one LED can be true at the same time, so I question the code part with "search array". I am not familiar with the missing IMAQ function, but if you really only want the most dominant color, an "array max" might do the trick and the max-index would point to the count to be incremented.

 

 

CountColors.png

 

 

It might be more accurate to count only the FALSE>>>TRUE transitions to ensure not to count a slow object twice. (not shown, but this would only require small changes to the code)

0 Kudos
Message 5 of 5
(1,885 Views)