29 namespace SourceXtractor {
36 m_variance(variance), m_threshold(threshold), m_convolution(kernel) {
40 return "BgDFTConvolutionImageSource(" +
getImageRepr() +
")";
45 int start_x,
int start_y,
int width,
int height)
const {
48 int clip_x =
std::max(start_x - hx, 0);
49 int clip_y =
std::max(start_y - hy, 0);
50 int clip_w =
std::min(width + hx * 2, image->getWidth() - clip_x);
51 int clip_h =
std::min(height + hy * 2, image->getHeight() - clip_y);
55 clip_w, clip_h, [image, clip_x, clip_y](
int x,
int y) {
56 return image->getValue(clip_x + x, clip_y + y);
60 clip_w, clip_h, [
this, clip_x, clip_y](
int x,
int y) {
61 return m_variance->getValue(clip_x + x, clip_y + y);
93 int off_x = start_x - clip_x;
94 int off_y = start_y - clip_y;
95 for (
int y = 0; y <
height; ++
y) {
96 for (
int x = 0; x <
width; ++
x) {
97 if (mask->
getValue(x + off_x, y + off_y)) {
99 x + start_x, y + start_y,
100 conv_masked->getValue(x + off_x, y + off_y) / conv_mask->getValue(x + off_x, y + off_y)
103 tile.
setValue(x + start_x, y + start_y, 0);
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y