function [ g, stary_obraz ] = nahr_mapa( objekt, stary_obraz )
%NAHR_MAPA Summary of this function goes here
%   Detailed explanation goes here
objekt = objekt - stary_obraz;

vel_y = abs(ceil(min(find(objekt==1))/size(objekt,1)) ...
- ceil(max(find(objekt==1))/size(objekt,1)));

vel_x = abs(ceil(min(find(objekt'==1))/size(objekt',1)) ...
- ceil(max(find(objekt'==1))/size(objekt',1)));

g = objekt(ceil(min(find(objekt'==1))/size(objekt',1)):ceil(min(find(objekt'==1))/size(objekt',1)) + vel_x, ...
ceil(min(find(objekt==1))/size(objekt,1)):ceil(min(find(objekt==1))/size(objekt,1)) + vel_y);

a = zeros(1, size(g,1));
g = [a' g a'];

b = zeros(1, size(g, 2));
g = [b; g; b];


stary_obraz = objekt + stary_obraz;
end

