Need Explanation of Bicubic Interpolation, in imresize inbuilt function of MatLab?

38 views (last 30 days)
I have a Image and I want to resize it by factor of 0.5 in C code . So In matlab I can do by using inbuilt function imresize(Image,0.5 'bicubic') .But I have to convert this imresize inbuilt function in C code. So I need expalnation on how imresize function is working in matlab??
Can anyone please Explain me How Can I processd??

Answers (3)

DGM
DGM on 18 Dec 2022
Edited: DGM on 18 Dec 2022
If you're out to replicate imresize(), see this answer:
and this comment:
Also:
I also recall another conversation that I can't find yet. I'll add it if I do. It might have been deleted.
Ultimately, you'll find that the core issue will be the black box that is imresizemex.mexa64. I don't know what's in that.
If you just want any example of 2D interpolation, there are probably more examples around.
  1 Comment
Annu Sheoran
Annu Sheoran on 20 Dec 2022
@DGM sir Matlab is using bicubic interpolation using Convolution algorthim.
I understand in imresize how weights and indics are calculated but not able to understand after that how we can apply these wights on pixcels .
For example
my matrix is
a = [10,20;30,40]; scaling factor 2,method bicubic
weights genrated by matlab
[-0.0234375000000000 0.226562500000000 0.867187500000000 -0.0703125000000000
-0.0703125000000000 0.867187500000000 0.226562500000000 -0.0234375000000000
-0.0234375000000000 0.226562500000000 0.867187500000000 -0.0703125000000000
-0.0703125000000000 0.867187500000000 0.226562500000000 -0.0234375000000000]
final output using imresize
[7.1875 10.1563 16.0938 19.0625
13.1250 16.0938 22.0313 25.0000
25.0000 27.9688 33.9063 36.8750
30.9375 33.9063 39.8438 42.8125]
how they are gettinh this output im not understanding
Can you please help??

Sign in to comment.


Image Analyst
Image Analyst on 18 Dec 2022
Did you try
>> edit imresize

Steven Lord
Steven Lord on 18 Dec 2022
If you have access to MATLAB Coder, the imresize function supports the C / C++ Code Generation extended capability (with some limitations.) See the Extended Capabilities section on its documentation page for more information about what's supported.

Categories

Find more on Read, Write, and Modify Image in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!