astrorama / SourceXtractorPlusPlus

SourceXtractor++, the next generation SExtractor
https://astrorama.github.io/SourceXtractorPlusPlus/
GNU Lesser General Public License v3.0
72 stars 9 forks source link

SE++ with weight image does not work #453

Closed mkuemmel closed 2 years ago

mkuemmel commented 2 years ago

I made a SE++ run with a weight image with 1.0 in the central pixels and 0.0 in a 50 pix wide border (bias area). The weight threshold (0.5) should switch off detections on the border, but SE++ does not find any objects. Using an rms image (1.0 in center, 1e15 at border and 1e14 threshold) it works.

I tried to check into the code but failed. It has something to do with the segmentation filtering. In both runs the internal filter was used, and with the weight image the filtered checkimage is 0.0 everywhere and the thresholded image is nan everywhere. When switching off the segmentation filter I get detections in both cases (weight and rms). I have not tried a user defined filter.

The dataset is here: https://deepdip.iap.fr/#folder/6217ca7d123ea5e2f1a213ac (deepdip, then mkuemmel-->Public-->weighting_issue)

mkuemmel commented 2 years ago

I found out why it does not work . in this example it is --weight-absolute=0 meaning the weightmap is scaled by the rms in the image. But the weight threshold is not scaled. In this particular example the scaled variance is everywhere larger than the not scaled threshold --> not objects. Under the assumption that threshold refers to the given image and not the scaled image this behaviour is wrong.

mkuemmel commented 2 years ago

Looks like it works for the detection image, but not for measurement images.

I'll have a look.

mkuemmel commented 2 years ago

Should be fixed as of now.