2
votes

I asked it in the past, someone suggested me to use MACBETH but I don't have enough money for having it :/

enter image description here

So before I photographed, I've added 3 circles to the image to be places in the image: the first circle is red with RGB of [255 0 0], the second is green circle with RGB of [0 255 0] and the third is blue [0 0 255]. Thus I can see the change about the pixels average of each of them and fix the whole image by this change.

I have all the pixels of each circle. I made average of the pixels and I got the next thing:

The red circle's average RGB of its all contained pixels is [243 15 26].

the green circle's average RGB of its all contained pixels is [29 235 56].

and about the blue circle it is [14 33 250].

how can I fix the colors of each pixel in the image by the result of the new red\green\blue circles' RGB?

1
it is not clear what you want to do. What do you mean "the colors of each pixel in the image"? Which pixels do you refer to? Also what is the "new RGB"? The average RGB values from the circles? Is your problem replacing the circle-pixel values with their estimated average?gevang
@gevang, I'm sorry. I tried to explain it again. thank you!Alon Shmiel

1 Answers

1
votes

If you assume a linear color mapping, you can construct a linear system that describes the change from original colors, e.g. (0, 0, 255) to observed colors, eg. (14, 33, 250).

Basically, y = A*x, where x is the original colors, y is the observed colors, A is the transformation matrix.

Once you calculated A, you can invert it to obtain the transform needed to go from y to x. You can then apply A^(-1) on all pixels for linear color correction.