Reputation: 685
I have an image that I want to make the width and length both twice of the original size (means 4 times the original area). I was using imresize(X,2)
but I was told I should use interp2
instead.
I know imresize
uses bicubic interpolation by default and there are other options. So what is the difference between imresize
and interp2
?
Upvotes: 3
Views: 1474
Reputation: 45752
imresize
takes different inputs from interp2
. With interp2
you cannot specify a simple multiplication factor that you want to scale your image by the way you can with imresize
. interp2
does 2D interpolation and instead of a scale input you need to provide it with the x-y coordinates of the points between the pixels that you want to interpolate. imresize
uses interpolation internally, but it it does a fair amount of other processing and calculations beforehand. imresize
also allows you to shrink your image which is not quite as straightforward using just interp2
. Internally they will use the same maths, imresize
just makes the task of resizing an image easier for you.
Upvotes: 4