Applying Threshold mask
i am making image compression in matlab.
After i applied DCT on image and i had img matrix, i want to apply a threshold mask on that matrix.
mask = [1 1 1 1 0 0 0 0
1 1 1 0 0 0 0 0
1 1开发者_高级运维 0 0 0 0 0 0
1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0];
maskedImg = blkproc(img,[8 8],mask );
I used that function but it didnt work and i get error message:
Error in ==> blkproc at 67 [a, block, border, fun, params, padval] = parse_inputs(varargin{:});
According to latest Matlab
documentation; closest blockproc syntax (for your case) is B = blockproc(A,[M N],fun)
. So apparently your mask
really should be a function!
However, I recall that blkproc
has been a valid Matlab
function for a while ago, thus double check the proper way to call it by typing (in the command line) > help blkproc
. (Al tough I'm quite confident that it will share the calling signature with blockproc
[in this case]).
精彩评论