docs: public double computeAverageDerivative(Point2D_F64 a, Point2D_F64 b, double tanX, double tanY) {
  		samplesInside = 0;
  		averageUp = averageDown = 0;
  
  		for (int i = 0; i < numSamples; i++) {
  			double x = (b.x-a.x)*i/(numSamples-1) + a.x;
  			double y = (b.y-a.y)*i/(numSamples-1) + a.y;
  
  			double x0 = x+tanX;
  			double y0 = y+tanY;
  			if(!BoofMiscOps.checkInside(integralImage.getWidth(),integralImage.getHeight(),x0,y0))
  				continue;
  
  			double x1 = x-tanX;
  			double y1 = y-tanY;
  			if(!BoofMiscOps.checkInside(integralImage.getWidth(),integralImage.getHeight(),x1,y1))
  				continue;
  
  			samplesInside++;
  
  			double up = integral.compute(x,y,x0,y0);
  			double down = integral.compute(x,y,x1,y1);
  
  			// don't take the abs here and require that a high score involves it being entirely black or white around
  			// the edge.  Otherwise a random image would score high
  			averageUp += up;
  			averageDown += down;
  		}
  
  		if( samplesInside == 0 )
  			return 0;
  		averageUp /= samplesInside;
  		averageDown /= samplesInside;
  
  		return averageUp-averageDown;
  	}