Source code of imresize's bicubic interpolation
Show older comments
Is there any website that I can look at the source code of bicubic?
I want to implement in Verilog but i have no idea how matlab done with bicubic
the following is my code
scale = 2;
gt = imread('./Set5/woman_GT.bmp');
lr = imresize(gt,1/scale,'bicubic');
sr = imresize(lr,scale,'bicubic');
2 Comments
Rik
on 21 Jan 2022
I would start on Wikipedia. Anything that you can learn there is very unlikely to be copyrighted by anyone. If you look at the source code of the Matlab implementation there is a chance you will learn a copyrighted method, which would preclude you from implementing it elsewhere.
You can use Matlab to verify your method (by checking if your method returns the same output as the one in Matlab. That is what I did when I attempted to re-implement some functions from the image processing toolbox and the statistics toolbox.
The comments in the file used for creating the kernel give the reference paper:
% See Keys, "Cubic Convolution Interpolation for Digital Image
% Processing," IEEE Transactions on Acoustics, Speech, and Signal
% Processing, Vol. ASSP-29, No. 6, December 1981, p. 1155.
While the core operations are done in mex, most everything else is in .m files. The file locations vary between versions, so if you choose to do so, you'll just have to open imresize() and find the things it calls. Considering that imresize() likely does many things that are totally unnecessary for your simplified implementation, dealing with the volume of irrelevant code is probably more work than just starting from scratch.
Answers (0)
Categories
Find more on Computer Vision with Simulink 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!