MATLAB Answers

blockproc - histogram for each window

5 views (last 30 days)
RuiQi
RuiQi on 17 May 2017
Answered: RuiQi on 17 May 2017
I read that blockproc allows me to create custom functions that will process sub-images in a sliding window fashion. I am not sure however, how I can accumulate the histogram of each sub-image. My input is an 8 bit image. The output should thus be a 3 dimensional array of [rows x cols x 256].
B = blockproc(A,[10 10],@histogram_function_here);
I hope someone can give me a link or some tips or the code itself.

  0 Comments

Sign in to comment.

Accepted Answer

RuiQi
RuiQi on 17 May 2017
function [ counts ] = getHist( block )
[counts,]=hist(block.data(:), 1:256);
counts = shiftdim(counts,-1);
end
HistA = blockproc(lbp, [3 3], @(block_struct) getHist(block_struct));

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.