Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

# Matrix Convolution with Sub-Pixel Resolution 1.0

Date Added: June 18, 2013  |  Visits: 277

Tristan UrsellSub-pixel Resolved 2D ConvolutionMarch 2012 matout=matoverlay(mat1,mat2,x,y); This function takes an input matrix mat1 and creates an image of thematrix mat2 at the position (x,y) in mat1. If (x,y) are floats, then theimage is a sub-pixel bilinear representatoin of mat2 at position (x,y) inmat1. The output matrix will have the same size at mat1, with no edge effects. Essentially this is performing a sparse, fully valid convolution of mat2and 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 boundsof mat1. Combining this function with a for-loop and weights creates afully valid 2D subpixel resolution convolution -- see Example -- incontrast to conv2 which is limited to pixel resolution. see also: conv2 Example: N=50;x=1+99*rand(1,N);y=1+99*rand(1,N); mat1=zeros(100,100); mat2=mat2gray(fspecial('gaussian',[11,11],3)); I0=zeros(size(mat1));ints=rand(1,N);for i=1:N I0=I0+ints(i)*matoverlay(mat1,mat2,x(i),y(i));end figure;colormap(hot)subplot(1,2,1)imagesc(mat2)axis equalaxis tighttitle('mat2') subplot(1,2,2)hold onimagesc(I0)plot(x,y,'bo')axis equalaxis tighttitle('Sparse Convolution of mat1 and mat2')

 Requirements: No special requirements Platforms: Matlab Keyword: Bounds,  Combining,  Contrast,  Conv,  Limited,  N3d50,  Pixel,  Rand Users rating: 0/10