function projection = myProjection (image, points, m, n, method )

% allocate new image of correct size
projection = zeros(n, m);

% calculate projection matrix
matrix = createProjectionMatrix([1,1; m,1; m,n; 1,n]', points);

for xIndex = 1:m
    for yIndex = 1:n
        xy = matrix * [xIndex; yIndex; 1];
        xy = xy / xy(3);
        projection(yIndex, xIndex) = pixelValue(image, xy(1), xy(2), method);
    end
end

%{
%make a list of all coordinates
points = [repmat([1:m], 1, n); floor([m:m*n+m-1]/m); ones(1,m*n)];

%transform them
points = matrix * points;

%take away labda ..

%interpolate them

for xa = 1:m
    for ya = 1:n
        % using the specified interpolation method
        projection(ya, xa) = pixelValue(image, points(1, (ya-1)*m+xa), points(2, (ya-1)*m+xa), method);
    end
end
projection = reshape(projection, n, m);
%}