protected double computeVariance ( int x0 , int y0 , int x1 , int y1 ) { // can use unsafe operations here since x0 > 0 and y0 > 0 double square = GIntegralImageOps . block_unsafe ( integralSq , x0 - 1 , y0 - 1 , x1 - 1 , y1 - 1 ) ; double area = ( x1 - x0 ) * ( y1 - y0 ) ; double mean = GIntegralImageOps . block_unsafe ( integral , x0 - 1 , y0 - 1 , x1 - 1 , y1 - 1 ) / area ; return square / area - mean * mean ; }
Computes the variance inside the specified rectangle . x0 and y0 must be &gt ; 0 .