use of boofcv.struct.ImageRectangle in project BoofCV by lessthanoptimal.
the class ImplIntegralImageOps method convolveSparse.
public static int convolveSparse(GrayS32 integral, IntegralKernel kernel, int x, int y) {
int ret = 0;
int N = kernel.getNumBlocks();
for (int i = 0; i < N; i++) {
ImageRectangle r = kernel.blocks[i];
ret += block_zero(integral, x + r.x0, y + r.y0, x + r.x1, y + r.y1) * kernel.scales[i];
}
return ret;
}
use of boofcv.struct.ImageRectangle in project BoofCV by lessthanoptimal.
the class ImplIntegralImageOps method convolveBorder.
public static void convolveBorder(GrayF64 integral, IntegralKernel kernel, GrayF64 output, int borderX, int borderY) {
for (int x = 0; x < integral.width; x++) {
for (int y = 0; y < borderY; y++) {
double total = 0;
for (int i = 0; i < kernel.blocks.length; i++) {
ImageRectangle b = kernel.blocks[i];
total += block_zero(integral, x + b.x0, y + b.y0, x + b.x1, y + b.y1) * kernel.scales[i];
}
output.set(x, y, total);
}
for (int y = integral.height - borderY; y < integral.height; y++) {
double total = 0;
for (int i = 0; i < kernel.blocks.length; i++) {
ImageRectangle b = kernel.blocks[i];
total += block_zero(integral, x + b.x0, y + b.y0, x + b.x1, y + b.y1) * kernel.scales[i];
}
output.set(x, y, total);
}
}
int endY = integral.height - borderY;
for (int y = borderY; y < endY; y++) {
for (int x = 0; x < borderX; x++) {
double total = 0;
for (int i = 0; i < kernel.blocks.length; i++) {
ImageRectangle b = kernel.blocks[i];
total += block_zero(integral, x + b.x0, y + b.y0, x + b.x1, y + b.y1) * kernel.scales[i];
}
output.set(x, y, total);
}
for (int x = integral.width - borderX; x < integral.width; x++) {
double total = 0;
for (int i = 0; i < kernel.blocks.length; i++) {
ImageRectangle b = kernel.blocks[i];
total += block_zero(integral, x + b.x0, y + b.y0, x + b.x1, y + b.y1) * kernel.scales[i];
}
output.set(x, y, total);
}
}
}
use of boofcv.struct.ImageRectangle in project BoofCV by lessthanoptimal.
the class ImplIntegralImageOps method convolveBorder.
public static void convolveBorder(GrayS32 integral, IntegralKernel kernel, GrayS32 output, int borderX, int borderY) {
for (int x = 0; x < integral.width; x++) {
for (int y = 0; y < borderY; y++) {
int total = 0;
for (int i = 0; i < kernel.blocks.length; i++) {
ImageRectangle b = kernel.blocks[i];
total += block_zero(integral, x + b.x0, y + b.y0, x + b.x1, y + b.y1) * kernel.scales[i];
}
output.set(x, y, total);
}
for (int y = integral.height - borderY; y < integral.height; y++) {
int total = 0;
for (int i = 0; i < kernel.blocks.length; i++) {
ImageRectangle b = kernel.blocks[i];
total += block_zero(integral, x + b.x0, y + b.y0, x + b.x1, y + b.y1) * kernel.scales[i];
}
output.set(x, y, total);
}
}
int endY = integral.height - borderY;
for (int y = borderY; y < endY; y++) {
for (int x = 0; x < borderX; x++) {
int total = 0;
for (int i = 0; i < kernel.blocks.length; i++) {
ImageRectangle b = kernel.blocks[i];
total += block_zero(integral, x + b.x0, y + b.y0, x + b.x1, y + b.y1) * kernel.scales[i];
}
output.set(x, y, total);
}
for (int x = integral.width - borderX; x < integral.width; x++) {
int total = 0;
for (int i = 0; i < kernel.blocks.length; i++) {
ImageRectangle b = kernel.blocks[i];
total += block_zero(integral, x + b.x0, y + b.y0, x + b.x1, y + b.y1) * kernel.scales[i];
}
output.set(x, y, total);
}
}
}
use of boofcv.struct.ImageRectangle in project BoofCV by lessthanoptimal.
the class ImplIntegralImageOps method convolve.
public static void convolve(GrayF64 integral, IntegralKernel kernel, GrayF64 output) {
for (int y = 0; y < integral.height; y++) {
for (int x = 0; x < integral.width; x++) {
double total = 0;
for (int i = 0; i < kernel.blocks.length; i++) {
ImageRectangle b = kernel.blocks[i];
total += block_zero(integral, x + b.x0, y + b.y0, x + b.x1, y + b.y1) * kernel.scales[i];
}
output.set(x, y, total);
}
}
}
use of boofcv.struct.ImageRectangle in project BoofCV by lessthanoptimal.
the class ImplIntegralImageOps method convolveSparse.
public static long convolveSparse(GrayS64 integral, IntegralKernel kernel, int x, int y) {
long ret = 0;
int N = kernel.getNumBlocks();
for (int i = 0; i < N; i++) {
ImageRectangle r = kernel.blocks[i];
ret += block_zero(integral, x + r.x0, y + r.y0, x + r.x1, y + r.y1) * kernel.scales[i];
}
return ret;
}
Aggregations