transientskp / pyse

Python Source Extractor
BSD 2-Clause "Simplified" License
11 stars 5 forks source link

Connected component labeling using sep #32

Closed HannoSpreeuw closed 2 years ago

HannoSpreeuw commented 2 years ago

sep.extract turns out to be able to do connected component labelling (ccl) quite fast. We can, however, not use 4-connectivity or an arbitrary structuring element. 8-connectivity is set in stone in SExtractor hence in sep. sep.extract does more than ccl, it also does source measurements, albeit without the accuracy of (Gaussian) fits - it uses the moments or barycenter method, that is also implemented in PySE, but in PySE as an initial 'guess' to start Gauss fitting. We don't use these source measurements from sep.extract yet, just the segmented islands, the rest of PySE still uses its own routines for source measurements. The next step could be to speed up those source measurements using e.g. Numba ot to use the source measurements from sep.extract. The latter option would obviously be the fastest.