matlab - How to calculate variance of an image patch with vectorization -
i have 560*560*3 image file, want divide image many small 8*8 patches, calculate variance of each patch. vectorized way calculate variance of each image patch matlab or octave?
you can use nfilter function:
fun = @var; b = nlfilter(a, [8 8], fun); by way, if wanted 3x3 image patches, use stdfilt function . left apply square on image:
s = stdfilt(im); s = s.*s;
Comments
Post a Comment