Flora TCS34725 LUT algorithm

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
omg93
 
Posts: 1
Joined: Sat Jun 16, 2018 3:57 pm

Flora TCS34725 LUT algorithm

Post by omg93 »

I'm trying to get better results using TCS34725 sensor for my color-view project. The sensor's non-linearity got me into a lot of troubles. The best solution I figured out was creating a look-up table for matching the colors. The number of colors stored it's not relevant. It can be 64, 256, 1024. I managed to store the values of colors (generated by me) that sensor is returning and their real values. I can make an algoritm for this lut that works only if I scan a stored value from it. Now what I'm trying to manage it's a "middle" situation when I scan a color that it's not stored in table, but it can be found between 2 stored colors. What I want this algorithm to do is to find the closest matching color from table for that color.
I have 6 vectors with values: 3 vectors with real values and 3 vectors with returned values of sensor for those real values.
realR = { x , a ... }
realG = { y , b ... }
realB = { z , c ... }
returnedR = { x' , a'... }
returnedG = { y' , b'... }
returnedB = { z' , c'... }
First real color values are (R G B) : x - y - z
First returned color values are (R G B) : x' - y' - z'
Second real color values are (R G B) : a - b - c
Second returned color values are (R G B) : a' - b' - c'
For example Blue (0-0-255) it's returned as (40-90-180) (R-G-B)
I used this progress bar for generating the color (not this literally but i generated samples from it on desktop screen)
https://s22.postimg.cc/lj8knyrw1/Clipboard01t5.jpg
Or maybe is there anyone who has a better idea than a lut?
Sorry for bad english btw

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”