68 int start_y,
int width,
int height)
const {
69 const int hx =
m_kernel->getWidth() / 2;
70 const int hy =
m_kernel->getHeight() / 2;
71 const int clip_x =
std::max(start_x - hx, 0);
72 const int clip_y =
std::max(start_y - hy, 0);
73 const int clip_w =
std::min(width + hx * 2, image->getWidth() - clip_x);
74 const int clip_h =
std::min(height + hy * 2, image->getHeight() - clip_y);
77 auto image_chunk = image->getChunk(clip_x, clip_y, clip_w, clip_h);
78 auto variance_chunk =
m_variance->getChunk(clip_x, clip_y, clip_w, clip_h);
81 const int off_x = start_x - clip_x;
82 const int off_y = start_y - clip_y;
84 for (
int iy = 0; iy < height; ++iy) {
85 for (
int ix = 0; ix < width; ++ix) {
86 if (variance_chunk->getValue(ix + off_x, iy + off_y) <
m_threshold) {
91 ix - hx + off_x, iy - hy + off_y, clip_w, clip_h,
96 tile_image.setValue(ix, iy, total / conv_weight);
99 tile_image.setValue(ix, iy, 0.);