IS THERE ANY INBUILT TO CALCUALTE MEAN AND VARIANCE IN MATLAB

Step 1 : Read a color image 0 with size NX N. Step 2: Calculate the trichromatic coefficients for each pixel according to equation (1) Step 3: Decompose the image recursively by quadtree partitioning. 1) Partition the image in 4 non-overlapped blocks with size N/2xN/2
2) For each such a block, calculate the average trichromatic coefficient and variances according to equations (2)-(3). THIS IS MY ALGORITHM WHICH I AM IMPLEMENTING...BUT I GOT THE PROBLM IN CALCULATING THE MEAN OF A BLOCK..ABOVE I HAVE MENTION THE STEPS OF MY ALGO.

Answers (1)

If a block means a N-by-M matrix called, e.g., BLOCK, you can get the mean of all N*M elements using
mean(BLOCK(:))

Tags

No tags entered yet.

Asked:

on 9 Oct 2013

Answered:

on 9 Oct 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!