# Color detect with Kinect v2

**URL:** <https://discourse.processing.org/t/color-detect-with-kinect-v2/37971>\
**Category:** Project Guidance\
**Created:** [July 15, 2022, 3:34pm UTC](https://discourse.processing.org/t/color-detect-with-kinect-v2/37971 "2022-07-15T15:34:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![potter3366](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@potter3366](https://discourse.processing.org/u/potter3366)\
**Post date:** [July 15, 2022, 3:34pm UTC](https://discourse.processing.org/t/color-detect-with-kinect-v2/37971/1 "2022-07-15T15:34:09Z")

</div>

I detect the color of the glove and check if it is one of the three colors (RGB). Every frame I get integer values:

NColor = 0 for RED  
NColor = 1 for GREEN  
NColor = 2 for BLUE  
NColor = -1 for unknown color

As the lighting conditions are not always ideal, the integer values change frequently. What would be the best procedure to find the frequency of occurrence of a number in a given interval that would more accurately represent the color of the glove?

Any help will be appreciated…
