function [conv]=get_conversion_matrix(input)				#this forms the conversion matrix
	m=rows(input);
	n=columns(input);
	conv=zeros(m*n);
	for i=1:m
		for j=1:n
			conv((n*(i-1)+j),(n*(i-1)+j))=1;				#(i,i) is set to 1
			if i==1
			else
				conv((n*(i-1)+j),(n*(i-2)+j))=1;			#the element on the top of it is set to 1 in the conversion matrix if it isnt in the first row
			endif
			if i==m
			else
				conv((n*(i-1)+j),(n*(i)+j))=1;				#the element on the bottom of it is set to 1 in the conversion matrix if it isnt in the last row
			endif
			if j==1
			else
				conv((n*(i-1)+j),(n*(i-1)+j-1))=1;			#the element on the left of it is set to 1 in the conversion matrix if it isnt in the leftmost column
			endif
			if j==n
			else
				conv((n*(i-1)+j),(n*(i-1)+j+1))=1;			#the element on the right of it is set to 1 in the conversion matrix if it isnt in the rightmost column
			endif
		endfor
	endfor
endfunction