MATLAB: Averaging in a uint 8 image pixel array

averageimage processingImage Processing Toolboxpixeluint8

Hello,
I am trying to extract the pixel values (of an intensity image-so all R,G,B are the same) over a series of frames (video). I can extract information from a single pixel image(x,y) and plot it over time, but I want do this but with an area of pixels with their average value. I cannot figure out how to get the image pixel matrix, a 480×640 uint 8, into a form where I can do so. I have tried converting with num2cell and cell2mat and cat, but with no avail. Any tips?
I promise to also start helping people once I get better at some of these things.

Best Answer

Using MAT2TILES, available here you can do things like this:
Img=uint8(rand(16)); %Fake image
C=mat2tiles(Img,[8,8]), %Split into 8x8 tiles
AreaMeans=cellfun(@(c)mean(c(:)),C) %Means of each tile
Related Question