40 namespace SourceXtractor {
43 const SeFloat CROWD_THRESHOLD_AUTO = 0.1;
44 const SeFloat BADAREA_THRESHOLD_AUTO = 0.1;
56 const auto& detection_image = detection_frame->getSubtractedImage();
57 const auto& detection_variance = detection_frame->getVarianceMap();
58 const auto& variance_threshold = detection_frame->getVarianceThreshold();
59 const auto& threshold_image = detection_frame->getThresholdedImage();
79 auto ell_aper = std::make_shared<EllipticalAperture>(cxx, cyy, cxy, kron_radius_auto);
82 const auto& min_pixel = ell_aper->getMinPixel(centroid_x, centroid_y);
83 const auto& max_pixel = ell_aper->getMaxPixel(centroid_x, centroid_y);
86 NeighbourInfo neighbour_info(min_pixel, max_pixel, pix_list, threshold_image);
88 long int area_sum = 0;
89 long int area_bad = 0;
90 long int area_full = 0;
94 for (
int pixel_y = min_pixel.m_y; pixel_y <= max_pixel.m_y; pixel_y++) {
95 for (
int pixel_x = min_pixel.m_x; pixel_x <= max_pixel.m_x; pixel_x++) {
99 if (ell_aper->getArea(centroid_x, centroid_y, pixel_x, pixel_y) > 0) {
102 if (pixel_x >= 0 && pixel_y >= 0 && pixel_x < detection_image->getWidth() &&
103 pixel_y < detection_image->getHeight()) {
109 variance_tmp = detection_variance ? detection_variance->getValue(pixel_x, pixel_y) : 1;
114 if (variance_tmp > variance_threshold)
127 if ((
SeFloat) area_bad / (
SeFloat) area_sum > BADAREA_THRESHOLD_AUTO)
131 if ((
SeFloat) area_full / (
SeFloat) area_sum > CROWD_THRESHOLD_AUTO)
140 if (aperture_check_img) {
143 for (
int y = min_pixel.m_y;
y <= max_pixel.m_y; ++
y) {
144 for (
int x = min_pixel.m_x;
x <= max_pixel.m_x; ++
x) {
145 if (ell_aper->getArea(centroid_x, centroid_y,
x,
y) > 0) {
146 if (
x >= 0 &&
y >= 0 && x < aperture_check_img->getWidth() &&
y < aperture_check_img->getHeight()) {
147 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