Open meRybaczek opened 10 months ago
Well, I did try it with RGB, however I did encounter some problems with it (dont remember exactly), MAXIMUM_THRESHOLD is set to 0.05 owing to the fact that it is tolerance (we were discussing about it during our previous talks). Ofc I will try again tomorrow or in next week to solve it with more clean solution, as it is only PoC
IMHO:
My idea is to calculate the distance between two colors (also called delta E) basing on RGB parameters. This idea comes from the fact that we will be comparing colorimetric values rather than perceptual ones. For colorimetric values, RGB parameters are sufficient. We don't need perceptual values because we don't need to measure differences perceived by the naked eye. The entire comparison process is needed for our digital calculations case.
We can calculate MAXIMUM_THRESHOLD after our hardware Arduino construction will be finalized. Then we can make few sensor readings in static final environment for the same color. That would be the best way to calculate this tolerance factor.
After all I will prepare some different color cards, take few RGB readings of each card, aproximate results and then you can store it as an Enum parameter in java app.
ps. I had to re-dust my old books from colorimetric lessons. I didn't think I would ever have to do this :)
https://github.com/meRybaczek/Automatic-list/blob/69b6a76b9820bee58fcfaaa7b2089c81844a0063/src/main/java/project/PoC/AuthorizingServicePoC.java#L44
nice method, but I think we can calculate the Euclidean distance using the formula directly with RGB parameters. I believe the conversion to HSB may not be necessary.
why MAXIMUM_THRESHOLD is set to 0,05? Do you have any source info? If not I think that the best way to calculate this parameter would be make some measurement experiments with RGB sensor.