How to Describe the Color of an Image Patch? I want to describe the color of an image patch (say, of size 5x5) centered around a pixel of an RGB image. The most straightforward way to do that is to calculate the average color over that patch and have a 3D vector, where each component represents the average color of the corresponding channel. 

Another way, more informative in my opinion, is to calculate an weighted average where the weights decrease the further we go from the center of the patch. In the literature, is there an efficient and proven way to describe the color of a small patch of an image?



I'm asking this question because I'm trying to implement a particle filter that tracks an object that has a certain color. Now, the object I want to track is very narrow, so my patch should be very small to fit inside it. 

Most of the color-based particle filtering algorithms represent the color information with a histogram and calculate the battacharyya distance - for example, between the histogram of the particle and the reference histogram. For a patch of 5x5, a histogram is not efficient because there are only 25 pixels.

On the other hand, patch descriptors like SIFT and SURF are not suited for color in my opinion (but if you have a different opinion it's more than welcome), this is why I'm looking for another way to robustly represent the color on a small patch of pixels.
Another approach which might be appropriate in your Bayesian approach (Filter Particle) would be Mean Vector + Covariance Matrix.

Even for that you could employ your idea of weighing (Which is reasonable).

I would pay attention to the color space you're working in.
Euclidean Distance isn't working (At least not well) in RGB.

Example in CIE LAB

The mean is given by:

$$ {x}_{c} = \frac{1}{n} \sum_{i = 1}^{n} {p}_{i} $$

Where $ {p}_{i} \in \mathbb{R}^{3} $ is the vector of LAB valus of each pixel from a patch of $ n $ pixels.

The Covariance is given by:

$$ {C} = \frac{1}{n} \sum_{i = 1}^{n} {\left( {p}_{i} - {x}_{c} \right)} {\left( {p}_{i} - {x}_{c} \right)}^{T} $$