protected boolean internalSetDescriptionBorder(KltFeature feature) {

		computeSubImageBounds(feature, feature.x, feature.y);

		ImageMiscOps.fill(feature.desc, Float.NaN);
		feature.desc.subimage(dstX0, dstY0, dstX1, dstY1, subimage);
		interpInput.setImage(image);
		interpInput.region(srcX0, srcY0, subimage);

		feature.derivX.subimage(dstX0, dstY0, dstX1, dstY1, subimage);
		interpDeriv.setImage(derivX);
		interpDeriv.region(srcX0, srcY0, subimage);

		feature.derivY.subimage(dstX0, dstY0, dstX1, dstY1, subimage);
		interpDeriv.setImage(derivY);
		interpDeriv.region(srcX0, srcY0, subimage);

		int total= 0;

		Gxx = Gyy = Gxy = 0;
		for( int i = 0; i < lengthFeature; i++ ) {
			if( Float.isNaN(feature.desc.data[i]))
				continue;

			total++;

			float dX = feature.derivX.data[i];
			float dY = feature.derivY.data[i];

			Gxx += dX * dX;
			Gyy += dY * dY;
			Gxy += dX * dY;
		}

		// technically don't need to save this...
		feature.Gxx = Gxx;
		feature.Gyy = Gyy;
		feature.Gxy = Gxy;

		float det = Gxx * Gyy - Gxy * Gxy;

		return (det >= config.minDeterminant*total);
	}
protected boolean internalSetDescriptionBorder ( KltFeature feature ) { computeSubImageBounds ( feature , feature . x , feature . y ) ; ImageMiscOps . fill ( feature . desc , Float . NaN ) ; feature . desc . subimage ( dstX0 , dstY0 , dstX1 , dstY1 , subimage ) ; interpInput . setImage ( image ) ; interpInput . region ( srcX0 , srcY0 , subimage ) ; feature . derivX . subimage ( dstX0 , dstY0 , dstX1 , dstY1 , subimage ) ; interpDeriv . setImage ( derivX ) ; interpDeriv . region ( srcX0 , srcY0 , subimage ) ; feature . derivY . subimage ( dstX0 , dstY0 , dstX1 , dstY1 , subimage ) ; interpDeriv . setImage ( derivY ) ; interpDeriv . region ( srcX0 , srcY0 , subimage ) ; int total = 0 ; Gxx = Gyy = Gxy = 0 ; for ( int i = 0 ; i < lengthFeature ; i ++ ) { if ( Float . isNaN ( feature . desc . data [ i ] ) ) continue ; total ++ ; float dX = feature . derivX . data [ i ] ; float dY = feature . derivY . data [ i ] ; Gxx += dX * dX ; Gyy += dY * dY ; Gxy += dX * dY ; } feature . Gxx = Gxx ; feature . Gyy = Gyy ; feature . Gxy = Gxy ; float det = Gxx * Gyy - Gxy * Gxy ; return ( det >= config . minDeterminant * total ) ; }
Computes the descriptor for border features.  All it needs to do
is save the pixel value, but derivative information is also computed
so that it can reject bad features immediately.