43 const SeFloat CROWD_THRESHOLD_APER = 0.1;
54 const auto& detection_image = detection_frame->getSubtractedImage();
55 const auto& detection_variance = detection_frame->getVarianceMap();
56 const auto& variance_threshold = detection_frame->getVarianceThreshold();
57 const auto& threshold_image = detection_frame->getThresholdedImage();
72 auto min_pixel = aperture.getMinPixel(centroid_x, centroid_y);
73 auto max_pixel = aperture.getMaxPixel(centroid_x, centroid_y);
76 NeighbourInfo neighbour_info(min_pixel, max_pixel, pix_list, threshold_image);
84 for (
int pixel_y = min_pixel.m_y; pixel_y <= max_pixel.m_y; pixel_y++) {
85 for (
int pixel_x = min_pixel.m_x; pixel_x <= max_pixel.m_x; pixel_x++) {
88 auto area = aperture.getArea(centroid_x, centroid_y, pixel_x, pixel_y);
92 if (pixel_x >= 0 && pixel_y >= 0 && pixel_x < detection_image->getWidth() &&
93 pixel_y < detection_image->getHeight()) {
98 auto variance_tmp = detection_variance ? detection_variance->getValue(pixel_x, pixel_y) : 1;
103 if (variance_tmp > variance_threshold)
113 if (total_area > 0) {
119 if (full_area / total_area > CROWD_THRESHOLD_APER)
131 if (aperture_check_img) {
135 auto min_pixel = aperture.getMinPixel(centroid_x, centroid_y);
136 auto max_pixel = aperture.getMaxPixel(centroid_x, centroid_y);
138 for (
int y = min_pixel.m_y;
y <= max_pixel.m_y; ++
y) {
139 for (
int x = min_pixel.m_x;
x <= max_pixel.m_x; ++
x) {
140 if (aperture.getArea(centroid_x, centroid_y,
x,
y) > 0) {
141 if (
x >= 0 &&
y >= 0 && x < aperture_check_img->getWidth() &&
y < aperture_check_img->getHeight()) {
142 aperture_check_img->setValue(
x,
y, src_id);
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y