Sub-pixel Resolved 2D Convolution
This function takes an input matrix mat1 and creates an image of the
matrix mat2 at the position (x,y) in mat1. If (x,y) are floats, then the
image is a sub-pixel bilinear representatoin of mat2 at position (x,y) in
mat1. The output matrix will have the same size at mat1, with no edge effects.
Essentially this is performing a sparse, fully valid convolution of mat2
and mat1 at the point (x,y) with the output size of mat1. The point (x,y)
uses the imaging convention for the coordinate axes.
The values of (x,y) can be floats, as long as they lie within the bounds
of mat1. Combining this function with a for-loop and weights creates a
fully valid 2D subpixel resolution convolution -- see Example -- in
contrast to conv2 which is limited to pixel resolution.
see also: conv2
title('Sparse Convolution of mat1 and mat2')
Tristan Ursell (2021). Matrix Convolution with Sub-Pixel Resolution (https://www.mathworks.com/matlabcentral/fileexchange/35487-matrix-convolution-with-sub-pixel-resolution), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!