Matrix Convolution with Sub-Pixel Resolution

버전 1.0.0.0 (2.17 KB) 작성자: Tristan Ursell
Convolve two matrices at sub-pixel resolution, using bilinear interpolation.
다운로드 수: 499
업데이트 날짜: 2012/3/6

라이선스 보기

Tristan Ursell
Sub-pixel Resolved 2D Convolution
March 2012

matout=matoverlay(mat1,mat2,x,y);

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

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 equal
axis tight
title('mat2')

subplot(1,2,2)
hold on
imagesc(I0)
plot(x,y,'bo')
axis equal
axis tight
title('Sparse Convolution of mat1 and mat2')

인용 양식

Tristan Ursell (2024). Matrix Convolution with Sub-Pixel Resolution (https://www.mathworks.com/matlabcentral/fileexchange/35487-matrix-convolution-with-sub-pixel-resolution), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2009b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Image Segmentation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0