31 : m_offset{min_pixel} {
32 auto width = max_pixel.
m_x - min_pixel.m_x + 1;
33 auto height = max_pixel.m_y - min_pixel.m_y + 1;
36 for (
auto& pixel_coord : pixel_list) {
37 auto act_x = pixel_coord.m_x - m_offset.m_x;
38 auto act_y = pixel_coord.m_y - m_offset.m_y;
40 if (act_x >= 0 && act_y >= 0 && act_x < width && act_y < height) {
41 m_neighbour_image->setValue(act_x, act_y, -1);
45 for (
int act_y = 0; act_y < height; ++act_y) {
46 for (
int act_x = 0; act_x < width; ++act_x) {
47 int offset_x = act_x + m_offset.m_x;
48 int offset_y = act_y + m_offset.m_y;
51 if (threshold_image->isInside(offset_x, offset_y)) {
52 bool is_above_threshold = threshold_image->getValue(offset_x, offset_y) > 0;
53 bool belongs = m_neighbour_image->getValue(act_x, act_y) == -1;
54 m_neighbour_image->setValue(act_x, act_y, is_above_threshold && !belongs);
63 assert(act_x >= 0 && act_y >= 0 && act_x < m_neighbour_image->getWidth() &&
64 act_y < m_neighbour_image->getHeight());
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y