function [mbgi, stdbgi] = comp_stat ( ima )


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% function In = comp_stat ( I )
% 
% It computes mean and variance of the bg looking at the border of the
% image.
%
% USE:  ima input image 
%       mbgi mean of bg
%       stdbgi standard deviation of bg
%
% EXAMPLE:  >> 
%           
%
% DATE: 16 Dec 2003
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


B = [ima(1:10,:)'];
B = [B; ima(end-9:end,:)'];
B = [B; ima(11:end-10,1:10)];
B = [B; ima(11:end-10,end-9:end)];

mbgi = mean(B(:));

stdbgi = std(B(:));

