function [ x1, y1, x2, y2 ] = EnvConv( IMG )
[x, y, dim]=size(IMG);

x1=1;
while (IMG(x1,:)==0 & x1<x)
x1=x1+1;
end

y1=1;
while (IMG(:,y1)==0 & y1<y)
y1=y1+1;
end

x2=x;
while (IMG(x2,:)==0 & x2>x1)
x2=x2-1;
end

y2=y;
while (IMG(:,y2)==0 & y2>y1)
y2=y2-1;
end
end