How does the imresize function work?

25 views (last 30 days)
Happy PhD
Happy PhD on 14 Aug 2018
Edited: Happy PhD on 14 Aug 2018
Hi, I was wondering if the resize function changes the size of the pixel? Is the resize function same as CCD binning? I like to change the size of my image but not change the ratio. My original image has a pixelsize of 5,5 um.
J = imresize(I, 0.5);
I tried to see if resizing changed the result (the size of my object and the integrated intensity) and it does comes out differently than if I would calculate with my orginial image which takes a long time (with convolution of my image and my mask aperture which is considerably smaller image than my orginial image). Try to figure out why it coems out differently.

Accepted Answer

Jan
Jan on 14 Aug 2018
imresize does not have or use any information about the size of the pixels. It combines the values of the pixels only to create a smaller or greater output array.
If the resizing changes your "result", this must be an effect on how the "result" is calculated. So please post the code you are using and explain the differences between the output and your expectations ins detail.
  2 Comments
Happy PhD
Happy PhD on 14 Aug 2018
Edited: Happy PhD on 14 Aug 2018
What I want to calculate is worst alpha (angle in mrad) and Q (energy within said angle) that gives the highest SF-value.
I execpt to get the same alpha, Q and SF, since the image is unchanged other than redued in size. Instead Q is completely different and alpha isnt exactly the same.
original image gives;
SF =
ans =
5.6508
alpha =
ans =
3.6000
Qm =
ans =
24.1148
alpha_x alpha_y
ans =
2.2000 5.0000
resized image by 0.5 and bilinear gives:
SF =
ans =
2.4068
alpha =
ans =
3.8333
Qm =
ans =
60.2866
alpha_x alpha_y
ans =
2.6667 5.0000
Edit: Removed code.
Jan
Jan on 14 Aug 2018
Of course reducing the number of pixels to a quarter of the original number changes the contents of the image. imresize does not change the size of the pixels, but their number. I do not know, what the shown parameters are, but it seems to be obvious that their value if affected by the reduction of the pixels. Why do you assume, that the values do not change? I think, that this assumption is the only problem.

Sign in to comment.

More Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Products


Release

R2015b

Community Treasure Hunt

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

Start Hunting!