Forums > Jitter

Average value of a matrix?

April 10, 2007 | 4:06 pm

I’m looking to take the average RGB value of a matrix, presumably by taking the sum of all cells divided by the number of cells. The problem is that, as you know, each cell is (presumably) a list of four (ARGB) chars. I presume therefore I need to sum the four plane values together, then peform the aforementioned operation.

Any clues as to how to go about this? Realising algorithms in dataflow languages does my head in. I’m just looking for a scalar, color average of an entire matrix.


April 10, 2007 | 4:25 pm

On 10 avr. 07, at 18:06, Serge wrote:

> I’m looking to take the average RGB value of a matrix, presumably
> by taking the sum of all cells divided by the number of cells. The
> problem is that, as you know, each cell is (presumably) a list of
> four (ARGB) chars. I presume therefore I need to sum the four plane
> values together, then peform the aforementioned operation.
>
> Any clues as to how to go about this? Realising algorithms in
> dataflow languages does my head in. I’m just looking for a scalar,
> color average of an entire matrix.

Did you look at jit.3m?

ej


April 10, 2007 | 4:39 pm

Try jit.3m on for size.

Andreas

Serge skrev:
> I’m looking to take the average RGB value of a matrix, presumably by taking the sum of all cells divided by the number of cells. The problem is that, as you know, each cell is (presumably) a list of four (ARGB) chars. I presume therefore I need to sum the four plane values together, then peform the aforementioned operation.
>
> Any clues as to how to go about this? Realising algorithms in dataflow languages does my head in. I’m just looking for a scalar, color average of an entire matrix.
>
> .
>
>


Viewing 3 posts - 1 through 3 (of 3 total)