Satellite detection
Siril is capable of detecting streaks for the purpose of satellite position measurement in images taken with sidereal tracking. Stars look like stars, satellites look like streaks. For long enough exposures this could also be the case for asteroids and it may also work for that, but the typical use case is having short exposures that contain streaks long enough for a reliable detection (at least 80 pixels, a few hundreds is better).
Example streak detection in sidereal image
Satellite detection requires both accurate positional detection and accurate timing. For this purpose, cameras with a GPS timestamp have also been integrated in Siril, the QHY models in particular for now. These two features have been kindly contributed to the public domain by the OurSky company, hoping that the amateur satellite trackers will benefit from it.
Ideal conditions for detection
Detecting streaks in an image full of stars is a rather complicated problem. It will of course work better if streaks are long and bright. But there is an ideal length: too short and they look too much like stars, leading to many false positive detections; too long and there is a big risk of catching only one end of the satellite movement in the image, in which case the data is not very useful.
From experience, ideal length for streaks is about a tenth of the image size. This means that exposure should be calculated to provide streaks of this length. For high orbits like GEO, this would require rather long exposures, so having streaks of at least 80 pixels, or even better 120 pixels should be the target (this also depends on sampling and image quality, which gives the size of stars in pixels).
Streaks must be bright enough to be seen by humans. his will set a rather high limit on object size depending on their orbit, for fainter targets, images tracking the satellite instead of the stars will be required, and processing those images is not supported by Siril.
If a streak is clearly visible but undetected, it may be because you are seeing
the image at a zoom level that is not native, like zoomed out. Objects will
appear brighter like that. In that case, you may need to resample the image,
using the binxy 3 command to apply a binning x3 on it.
An ideal image does not contain gradient. The detection in Siril does not use a sliding window or area detection, but uses a global threshold. If there is a gradient or a cloud, the bright area itself will be detected as a streak. For better performances, images should be calibrated with darks (this also removes hot pixels that may interfere with detection) and flats or at least some gradient removal should be done on it.
Streaks should be line segments, not arcs or wiggly lines. Mount tracking is expected to be good, wind interference must be minimal too. The algorithm looks for lines, not weird shapes.
Data output
At the end of a detection, Siril will output a CSV file named like the open
image with a .streaks extension. Feel free to change the code to output to
your preferred format. In this CSV, pixel coordinates are given, but also
equatorial J2000 coordinates if the images are plate solved (they should be if
you want to do something useful with the data), and accurate GPS timestamp of
the center of the streak if images come from a QHY GPS camera. Otherwise,
and for other dates in the CSV, DATE-OBS and EXPTIME are used from the FITS
headers.
Usage
Streak detection can be done on a single image using the detect_streak
command. For best detection, the expected streak length should be given, or
something like 70% of it.
For bright targets, like the space stations, that are often saturated, a
different threshold finding algorithm can be used by passing the -bright
option. This works very well. Otherwise, the halo around the streak is
detected.
Siril command line
Algorithm details
The streak detection in Siril uses the Probabilistic Hough Lines Transform method from OpenCV. This works quite well but a lot of post processing of the data is required, which is the bulk of the Siril code.
Another thing that is not given is finding the detection threshold for an image, the threshold in ADU at which the streak is visible but not too much noise from the image's background. Siril finds it using an iterative method, from long and bright streaks for dimmer and shorter until it finds one with the minimum requested length. Because of these iterations, short faint streaks will take longer to be detected. Make sure you don't provide an expected length that is way larger than what is expected in the image to make it run faster.
As stars can be a big problem for the detection if there are a lot, Siril
removes them from the image before running the streak detection. This is not
seen during the detection and does not require a third party tool, it uses a
simple replacement of stars by a dark disk. The ssr commmand can show what
happens with that to help with detection problems.
Limitations
This streak detection algorithm will only find the bright and long streaks of an image if there are several of different brightness and length.
Streaks for disco ball type satellites, with lots of specular reflections, will not be detected because the star removal step will make it appear as a dotted line.
The detection runs at a single scale. If your image is oversampled, or if the detection failed while a streak is clearly visible, run a software binning on it first.
Vertical and horizontal streaks may have some orthogonal offset in the detected streak ends, but that does not change the fact that the center of the streak is correct and this is what matters.
Bright stars diffraction spikes will be detected as streaks. Dead (bright) columns too, be sure to calibrate your images with darks or use cosmetic correction in that case.