I want to create a function: shrinkbyaveraging(imagematrix) that returns an image that is half as large in both height and width. Each pixel in the returned image should be the average of 4 pixels from the input image. Shrinkbyaveraging only needs to work for images having an even number of rows/columns. However, I do not want to use imresize.
function shrink = shrinkbyaveraging(imagematrix) [row,colm] = size(imagematrix); x = row/2; y = colm/2;
but im not sure what the question is asking since i cannot use imresize. :/
4 Comments
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/424576-shrinking-image-by-averaging#comment_623987
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/424576-shrinking-image-by-averaging#comment_623987
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/424576-shrinking-image-by-averaging#comment_624002
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/424576-shrinking-image-by-averaging#comment_624002
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/424576-shrinking-image-by-averaging#comment_1148783
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/424576-shrinking-image-by-averaging#comment_1148783
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/424576-shrinking-image-by-averaging#comment_1148808
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/424576-shrinking-image-by-averaging#comment_1148808
Sign in to comment.