My question is related to this stack overflow discussion here.
https://math.stackexchange.com/questions/161780/about-sum-of-squared-differences
The discussion gives us the formula for the sum of squared differences and an answer gives the following example.
For example, if you are comparing two pixels (i.e. one pixel in each image), you have a region of 1 pixel. Let's say it is the fifth pixel in the first row: x = 0, y = 4. The pixel values are 10,3 for f,g respectively. For the region of one 2n1=1=>n1=0, and the same goes for n2.
SSD=(f(x+i,y+j)−g(x+i,y+j))2
SSD=(f(0+0,4+0)−g(0+0,4+0))2
SSD=(f(0,4)−g(0,4))2
SSD=(10−3)2=49
My question is how is he getting the pixel values of 10 for f(x,y) and 3 for g(x,y) from the RGB values for each pixel? RGB are not a single value. That is when I have a single pixel of an image I have a triplet of information: I have the red, green, and blue color values. How does one go from this RGB value to a single value as the example provides?
Processing, then there are a wealth of built-in functions for manipulating colors. If you are not asking about that particular programming language, please delete that tag since it is not an alias forimage-processing(which seems to be your concern here). - John Coleman