26 namespace SourceXtractor {
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 (offset_x >= 0 && offset_y >= 0 && offset_x < threshold_image->getWidth() &&
52 offset_y < threshold_image->getHeight()) {
53 if (threshold_image->getValue(offset_x, offset_y) > 0) {
54 if (m_neighbour_image->getValue(act_x, act_y) != -1) {
55 m_neighbour_image->setValue(act_x, act_y, 1);
58 m_neighbour_image->setValue(act_x, act_y, 0);
62 m_neighbour_image->setValue(act_x, act_y, 0);
72 assert(act_x >= 0 && act_y >= 0 && act_x < m_neighbour_image->getWidth() && act_y < m_neighbour_image->getHeight());
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y