use of boofcv.alg.transform.ii.IntegralKernel in project BoofCV by lessthanoptimal.
the class ImplIntegralImageFeatureIntensity method hessianNaive.
/**
* Brute force approach which is easy to validate through visual inspection.
*/
public static void hessianNaive(GrayF32 integral, int skip, int size, GrayF32 intensity) {
final int w = intensity.width;
final int h = intensity.height;
// get convolution kernels for the second order derivatives
IntegralKernel kerXX = DerivativeIntegralImage.kernelDerivXX(size, null);
IntegralKernel kerYY = DerivativeIntegralImage.kernelDerivYY(size, null);
IntegralKernel kerXY = DerivativeIntegralImage.kernelDerivXY(size, null);
float norm = 1.0f / (size * size);
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
int xx = x * skip;
int yy = y * skip;
computeHessian(integral, intensity, kerXX, kerYY, kerXY, norm, y, yy, x, xx);
}
}
}
use of boofcv.alg.transform.ii.IntegralKernel in project BoofCV by lessthanoptimal.
the class ImplIntegralImageFeatureIntensity method hessianBorder.
/**
* Only computes the fast hessian along the border using a brute force approach
*/
public static void hessianBorder(GrayS32 integral, int skip, int size, GrayF32 intensity) {
final int w = intensity.width;
final int h = intensity.height;
// get convolution kernels for the second order derivatives
IntegralKernel kerXX = DerivativeIntegralImage.kernelDerivXX(size, null);
IntegralKernel kerYY = DerivativeIntegralImage.kernelDerivYY(size, null);
IntegralKernel kerXY = DerivativeIntegralImage.kernelDerivXY(size, null);
int radiusFeature = size / 2;
final int borderOrig = radiusFeature + 1 + (skip - (radiusFeature + 1) % skip);
final int border = borderOrig / skip;
float norm = 1.0f / (size * size);
for (int y = 0; y < h; y++) {
int yy = y * skip;
for (int x = 0; x < border; x++) {
int xx = x * skip;
computeHessian(integral, intensity, kerXX, kerYY, kerXY, norm, y, yy, x, xx);
}
for (int x = w - border; x < w; x++) {
int xx = x * skip;
computeHessian(integral, intensity, kerXX, kerYY, kerXY, norm, y, yy, x, xx);
}
}
for (int x = border; x < w - border; x++) {
int xx = x * skip;
for (int y = 0; y < border; y++) {
int yy = y * skip;
computeHessian(integral, intensity, kerXX, kerYY, kerXY, norm, y, yy, x, xx);
}
for (int y = h - border; y < h; y++) {
int yy = y * skip;
computeHessian(integral, intensity, kerXX, kerYY, kerXY, norm, y, yy, x, xx);
}
}
}
Aggregations