MATLAB: Blockproc error…

blockprocImage Processing Toolboxlbp

hi all,
i have cropped an image to be 162×125 …i want to pass it to blockproc function which divide image to 3×3 and do some processing…since, the cropped image doesnt satisfy 3×3 mask it gives error during blockproc function.
So,is there anyway to rectify this problem?
i cannot alter cropped image size since it is automatically done using another function (face image). And i cannot change the block size since Local Binary Pattern operate in 3×3 neighbourhood only..

Best Answer

padding = zeros(162,1,class(YourImage));
padding = padding + realmax; %saturate it in a class-dependent way
paddedImage = [YourImage, padding];
Now run blockproc() over paddedImage, and have fun making sense of the LPB at the right-hand edge.
Related Question