code: protected static void borderAverageFlow( ImageFlow flow , ImageFlow averageFlow) {
  
  		for( int y = 0; y < flow.height; y++ ) {
  			computeBorder(flow,averageFlow, 0, y);
  			computeBorder(flow,averageFlow, flow.width-1, y);
  		}
  
  		for( int x = 1; x < flow.width-1; x++ ) {
  			computeBorder(flow,averageFlow, x, 0);
  			computeBorder(flow,averageFlow, x, flow.height-1);
  		}
  	}
docs: Computes average flow using an 8-connect neighborhood for the image border