How to reduce an image given a factor?

3 ビュー (過去 30 日間)
Carlos Antonio
Carlos Antonio 2018 年 4 月 24 日
コメント済み: Ameer Hamza 2018 年 4 月 25 日
Hello, can someone help me how to make an image be reduced given a factor. For example I have to do the following To reduce we will form blocks of (factor x factor) pixels, we will add their gray values and we will divide by the number of summed values. In this way, we will apply super-sampling with a medium low pass filter. How do I make the blocks and the average? I do not get it. One help please Thanks

回答 (1 件)

Ameer Hamza
Ameer Hamza 2018 年 4 月 24 日
You can use imresize(), to resize your image by a given factor. You can specify the interpolation method, using 'method' property as follow
resizedImage = imresize(image, factor, 'method', 'bicubic');
the available methods are listed here.
  14 件のコメント
Carlos Antonio
Carlos Antonio 2018 年 4 月 25 日
Now everything works correctly but one last question in the exercise I do this warning although the result I get is not bad but there says to apply a low pass filter but when I apply the filter the image is blurred a bit but without filter goes well. The warning reads as follows:
At the time of the formation of the blocks, it must be taken into account that within the limits of image it is possible that blocks of pixels can not be formed (factor x factor). In In that case, you must consider how many pixels really add up so that applying the low pass filter does not obscure the image in the limit.
Ameer Hamza
Ameer Hamza 2018 年 4 月 25 日
It is normal for a filter to get blur on applying a low pass filter.
It appears warning is talking about the fact that the blocks will not always fit inside the complete image e.g. if the number of columns is odd and you are using 2*2 block then at least one column will be left out. More problem will happen if you will use a large n*n block. In that case you will need to decide how to handle those pixels.

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by