top of page
  • Writer's pictureDr. Daniel Dimanov

Unraveling the Spectrum: The Science of Colour Recognition in CCTV Computer Vision

At CountingLab, our quest to extend the frontiers of artificial intelligence and data science frequently leads us to confront complex puzzles. Among these, colour recognition in apparel and objects in CCTV footage represents a notably intricate challenge. Although it appears deceptively straightforward to the human eye, enabling computers to accurately identify colours is an endeavour filled with complexity.


 

The Intricacy Behind Colour Perception


Humans can effortlessly differentiate hundreds of shades and colours, yet for a computer, this task is laden with obstacles. Variations in lighting, camera angles, and the presence of shadows or patterns can drastically alter the perceived colour of an item. Moreover, the individual colours of pixels in an image rarely convey the true colour of the object in question.


A white shirt which looks blue on pixel-level
White shirt in CCTV with zoomed regions


This discrepancy is vividly illustrated by the picture of a white shirt above. To the human observer, the shirt may clearly appear white, but under different lighting conditions or when viewed through a camera lens, the same shirt might not be identified as white by a computer that usually focuss on the raw pixel values. The small zoomed regions show how while we see the shirt is white the zoomed in regions look blue or brown. This challenge underscores the complexity of colour recognition and the need for sophisticated solutions.


 

Innovating Solutions at CountingLab for Colour Recognition


To navigate these hurdles, we've explored a variety of state-of-the-art methods, each tailored to decode the complex language of colours:

  1. Predefined Colour Dictionaries: By utilising an extensive dictionary of colours, we assign each pixel to its nearest match using Delta-E distance in the CIELAB colour space or Euclidean distance in RGB/HSV, cumulating these to pinpoint the dominant colour.

  2. Colour Histograms in HSV Space: Converting images to the HSV colour space allows us to utilise colour histograms to identify dominant hues. Despite its straightforward nature, this approach has encountered challenges due to the non-uniform distribution of colours, prompting ongoing refinement.

  3. K-means Clustering for Colour Quantisation: This technique clusters similar colours in an image, using the centroids of these clusters to determine predominant colours. It adapts well to items with multiple colours, showcasing a balance between accuracy and adaptability.

  4. Convolutional Neural Networks (CNNs): Training on a large dataset of labelled images, CNNs learn to recognise complex patterns and combinations of colours, representing the pinnacle of colour recognition technology.

  5. Exploratory Methods with SAM and FastSAM: Our trials with sophisticated models like SAM and FastSAM have thus far demonstrated promising performance with queries for arbitrary colours outside our selection, but have failed to improve on the CNN approach above for the colours of interest. However, we continue to pursue such avenues.

 

Delving into Our Laboratory


Our foray into the science of colour has yielded some interesting results. While the first pixel counting approach with predefinied dictionaries was one of the fastest, it also proved to be the approach affected the most by the deceptive nature of CCTV colours. While we pushed all different appraoches to a state of decent results, there was one clear winner when it came down to identifying tricky colours in small CCTV objects, which was the custom designed CNNs. SAM and FastSAM did achieve good enough results as a starting point given the zero-shot nature of this approach, but with a carefully designed dataset of handpicked colour images from hundreds of CCTV images, the custom-trained neural networks had the edge over all other approaches.


One caveat with the CCN approach, however, is that adding new colours is much more involved than with any of the other methods, so once again the "no free lunch theorem" still holds and despite the challenges presented by image quality and the inherent complexity of colour perception, our team stands at the forefront of developing robust and accurate colour recognition systems.



 

A Colourful Future Awaits


As we refine our methods and explore new datasets with a wider spectrum of colours, the potential applications of our research expand dramatically. From enhancing security through CCTV analysis to transforming fashion retail, the implications of precise colour recognition are extensive and varied.


At CountingLab, we're not merely analysing colours; we're shaping the future of technology. Embark with us on this vibrant exploration as we continue to delve into the myriad possibilities in the realm of artificial intelligence and computer vision.

CounitngLab logo


15 views0 comments
bottom of page