how to divide an image into 3*3 block?for each block i have to calculate mean and standard deviation for each block
Show older comments
pls help me to write a code
Answers (2)
Azzi Abdelmalek
on 3 May 2014
You can use blockproc
im=imread('your_image')
[n,m]=size(im)
n1=ceil(n/3)
m1=ceil(m/3)
im_mean=blockproc(im,[n1,m1],@(x) mean(x.data(:)))
im_std=blockproc(im,[n1,m1],@(x) std(double(x.data(:))))
Image Analyst
on 3 May 2014
0 votes
You can use blockproc(), in the Image Processing Toolbox. I have two demos where it's used in several ways to produce a variety of effects. Run them and see how you can perform different functions (like mean and std) and get different output sizes. It should be quite instructive.
Categories
Find more on Neighborhood and Block Processing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!