Injective function of RGB

asked 2018-12-17 04:32:30 -0600

Filippo9669 gravatar image

Is it possible to find a function that transforms a three-dimensional vector of values (each from 0 to 255) into a one-dimensional injective set of values? In other words, a function that assings an unequivocal value for each of RGB possible colors. Thanks in advance.

edit retag flag offensive close merge delete

Comments

please explain: "one-dimensional injective set of values"

and: " an unequivocal value for each of RGB possible colors"

berak gravatar imageberak ( 2018-12-17 05:01:20 -0600 )edit

f(R,G,B): [R, G, B ] = [(0-255), (0-255), (0-255)] -> [(a,b)] where, for instance f([1, 2, 2]) != f([2, 1, 1]) and so on.

Filippo9669 gravatar imageFilippo9669 ( 2018-12-17 05:03:45 -0600 )edit

are you simply trying to find unique B,G,R combinations in your image ?

have a look here

berak gravatar imageberak ( 2018-12-17 05:05:08 -0600 )edit

you can use hash function

LBerger gravatar imageLBerger ( 2018-12-18 02:27:05 -0600 )edit

What is the bigger goal here? There might be a better way to solve it.

noel gravatar imagenoel ( 2018-12-27 20:28:16 -0600 )edit