code: public void meanShiftLocation( ChessboardCorner c ) {
  		float meanX = (float)c.x;
  		float meanY = (float)c.y;
  
  		// The peak in intensity will be in -r to r region, but smaller values will be -2*r to 2*r
  		int radius = this.shiRadius*2;
  		for (int iteration = 0; iteration < 5; iteration++) {
  			float adjX = 0;
  			float adjY = 0;
  			float total = 0;
  
  			for (int y = -radius; y < radius; y++) {
  				float yy = y;
  				for (int x = -radius; x < radius; x++) {
  					float xx = x;
  					float v = intensityInterp.get(meanX+xx,meanY+yy);
  					// Again, this adjustment to account for how pixels are counted. See center from contour computation
  					adjX += (xx+0.5)*v;
  					adjY += (yy+0.5)*v;
  					total += v;
  				}
  			}
  
  			meanX += adjX/total;
  			meanY += adjY/total;
  		}
  
  		c.x = meanX;
  		c.y = meanY;
  	}
docs: Use mean shift to improve the accuracy of the corner's location. A kernel is selected which is slightly larger
  than the "flat" intensity of the corner should be when over a chess pattern.