MATLAB: How to build a simulink model which can generate HDL coder to resize images or videos

Computer Vision ToolboxfpgahdlHDL CoderHDL Verifierimage processingsimulinkvideo processing

I want to resize images or videos by FPGA. I only know the resize block but it cannot generate HDL code. Anybody can teach me or give me some ideas?

Best Answer

If you are scaling down, a simple method to re-sample the signal could be used. You could resize to 1/2, or 1/3, etc by just selecting every 2nd, or every 3rd sample.
In order to achieve ratios like 2/3 or 4/5, you can implement interpolation algorithms that pick the points in the signal and calculate an interpolant. This could be computationally expensive depending on the algorithm chosen.
Another option is to use the Direct Lookup Table (N-d). With some cleverness, you should be able to achieve both downsampling and upsampling behavior from the block.