PCL
|
Automatic star detection. More...
#include <StarDetector.h>
Classes | |
struct | Star |
Structure to hold the data of a detected star. More... | |
Public Types | |
using | psf_function = PSFFit::psf_function |
using | star_list = Array< Star > |
Definition at line 73 of file StarDetector.h.
using pcl::StarDetector::psf_function = PSFFit::psf_function |
Represents a point spread function type.
Definition at line 80 of file StarDetector.h.
using pcl::StarDetector::star_list = Array<Star> |
A dynamic array of pcl::StarDetector::Star structures.
Definition at line 182 of file StarDetector.h.
|
default |
Default constructor.
|
default |
Copy constructor.
|
inlineoverride |
Destroys a StarDetector object.
Definition at line 202 of file StarDetector.h.
|
inline |
Bright stars threshold.
Stars with measured SNR above this parameter in units of the minimum detection level (as defined by the sensitivity parameter) will always be detected, even if their profiles are too flat for the current peak response. This allows us to force inclusion of bright stars. The default value is 3.0.
Definition at line 475 of file StarDetector.h.
|
inline |
Returns a pointer to the current star detection mask image, or nullptr if no detection mask is being used.
If a detection mask is used, star detection will only consider source pixels for which the corresponding mask pixels are nonzero. This allows for the implementation of partial star detection tasks limited to arbitrary regions of interest.
Definition at line 812 of file StarDetector.h.
star_list pcl::StarDetector::DetectStars | ( | const ImageVariant & | image | ) | const |
Performs star detection with the current parameters. Returns a dynamic array of Star structures sorted by brightness (flux) in descending order.
|
inline |
Disables detection of clustered sources. See IsClusteredSourcesEnabled() for a description of this parameter.
Definition at line 552 of file StarDetector.h.
|
inline |
Disables elliptical PSF fits. See IsEllipticPSF().
Definition at line 770 of file StarDetector.h.
|
inline |
Disables image inversion. See IsImageInversionEnabled() for a description of this parameter.
Definition at line 684 of file StarDetector.h.
|
inline |
Disables local maxima detection. See IsLocalMaximaDetectionEnabled() for a description of this parameter.
Definition at line 633 of file StarDetector.h.
|
inline |
Disables PSF fitting for this star detector. See IsPSFFittingEnabled() for a description of this parameter.
Definition at line 725 of file StarDetector.h.
|
inline |
Enables detection of clustered sources. See IsClusteredSourcesEnabled() for a description of this parameter.
Definition at line 543 of file StarDetector.h.
|
inline |
Enables elliptical PSF fits. See IsEllipticPSF().
Definition at line 762 of file StarDetector.h.
|
inline |
Enables image inversion. See IsImageInversionEnabled() for a description of this parameter.
Definition at line 675 of file StarDetector.h.
|
inline |
Enables local maxima detection. See IsLocalMaximaDetectionEnabled() for a description of this parameter.
Definition at line 624 of file StarDetector.h.
|
inline |
Enables PSF fitting for this star detector. See IsPSFFittingEnabled() for a description of this parameter.
Definition at line 716 of file StarDetector.h.
|
inline |
Size of the hot pixel removal filter.
This is the radius in pixels of a median filter applied by the star detector before the structure detection phase. A median filter is very efficient to remove hot pixels. To disable hot pixel removal, set this parameter to zero. The default value is 1 pixel.
Definition at line 272 of file StarDetector.h.
|
inline |
Returns true iff detection of clustered sources is allowed.
If this parameter is false, a local maxima map will be generated to identify and prevent detection of multiple sources that are too close to be separated as individual structures, such as double and multiple stars. In general, barycenter positions cannot be accurately determined for sources with several local maxima. If this parameter is true, non-separable multiple sources will be detectable as single objects. The default value is false.
Definition at line 534 of file StarDetector.h.
|
inline |
Returns true if elliptical point spread functions (PSFs) will be fitted when PSF fitting is enabled. Returns false if circular functions will be fitted. Elliptical PSFs are disabled by default.
Definition at line 754 of file StarDetector.h.
|
inline |
Returns true iff image inversion is enabled for this star detector.
When inversion is enabled, the star detector algorithm will look for dark stars over a bright background. This feature is disabled by default.
Definition at line 666 of file StarDetector.h.
|
inline |
Returns true iff detection of local maxima is enabled.
When this parameter is enabled, each reported Star object will include the number of local maxima detected in the corresponding image structure, irrespective of the current state of the detection of clustered sources parameter (see IsClusteredSourcesEnabled()).
When disabled, the number of local maxima will be zero for all reported Star objects, and the detection of clustered sources parameter will be implicitly disabled.
The default value is true.
Definition at line 615 of file StarDetector.h.
|
inline |
Returns true iff PSF fitting is enabled for this star detector.
When PSF fitting is enabled, a point spread function of the type specified by PSFType() will be fitted numerically for each detected star. The Levenberg-Marquardt non-linear least squares algorithm will be used to minimize the difference between the fitted function and the pixel sample values in the detection region. See the PSFFit class for complete information on our PSF fitting implementation.
When PSF fitting is enabled, the pos
data member of the pcl::StarDetector::Star corresponds to the centroid of the fitted PSF instead of the barycenter position calculated by the star detection algorithm, and the signal
member is a robust estimate of the mean signal evaluated over the local background, also from the fitted PSF.
PSF fitting is disabled by default.
Definition at line 707 of file StarDetector.h.
|
inline |
Size of the local maxima detection filter.
This is the radius in pixels of a structuring element used to generate a local maxima map, when detection of clustered sources is disabled. The default value is 2, which applies a 5x5 filter.
Definition at line 564 of file StarDetector.h.
|
inline |
Returns the local maxima detection limit.
This parameter is a normalized pixel value in the [0,1] range. Structures with pixels above this value will be excluded for local maxima detection. The default value is 0.75.
Definition at line 586 of file StarDetector.h.
|
inline |
Maximum star distortion.
Internally, star distortion is evaluated in units of coverage of a square region circumscribed to each detected structure. The coverage of a perfectly circular star is π/4 (about 0.8). Lower values denote elongated or irregular sources.
To isolate the public interface of this class from its internal implementation, this parameter is normalized to the [0,1] range, where 0 and 1 represent minimum and maximum distortion, respectively. This abstraction allows us to change the star detection engine without breaking dependent tools and processes.
Use this parameter, if necessary, to control inclusion of elongated stars, complex clusters of stars, and nonstellar image features. The default value is 0.6.
Definition at line 508 of file StarDetector.h.
|
inline |
Minimum signal-to-noise ratio of a detectable star.
Given a source with estimated brightness s, local background b and local background dispersion n, SNR is evaluated as (s - b)/n. Stars with measured SNR below this parameter won't be detected.
The value of this parameter can be increased to limit star detection to a subset of the brightest sources in the image adaptively, instead of imposing an arbitrary limit on the number of detected stars. The default value is zero.
Definition at line 451 of file StarDetector.h.
|
inline |
Returns the automatically calculated minimum star size in square pixels.
The value returned by this function is only valid after a successful execution of the DetectStars() function (or, equivalently, operator()()) with a zero minimum structure size parameter value. See the MinStructureSize() member function for more information.
Definition at line 363 of file StarDetector.h.
|
inline |
Minimum size of a detectable star structure in square pixels.
This parameter can be used to prevent the detection of small and bright image artifacts wrongly as stars. This can be useful to work with uncalibrated or poorly calibrated data, especially demosaiced CFA frames where uncorrected hot pixels have generated large bright artifacts that cannot be removed with a median filter, or for rejection of cosmic rays.
This parameter can be used in three ways:
Definition at line 339 of file StarDetector.h.
|
inline |
Number of (dyadic) wavelet layers used for noise reduction.
Noise reduction prevents detection of bright noise structures as false stars, including hot pixels and cosmic rays. This parameter can also be used to control the sizes of the smallest detected stars (increase it to exclude more stars), although the minimum structure size parameter can be more efficient for this purpose. The default value is 0, which effectively disables this noise reduction feature.
Definition at line 249 of file StarDetector.h.
|
inline |
Size of the noise reduction filter.
This is the radius in pixels of a Gaussian convolution filter applied to the working image used for calculation of star positions during the star detection phase. Use it only for very low SNR images, where the star detector cannot find reliable stars with default parameters.
Be aware that noise reduction will modify star profiles and hence the way star positions are calculated, resulting in a less accurate centroid determination. Under extreme low-SNR conditions, however, this is probably better than working with the actual data anyway.
The default value is zero, which effectively disables this feature.
Definition at line 302 of file StarDetector.h.
|
inline |
Performs star detection with the current parameters. Returns a dynamic array of Star structures sorted by brightness (flux) in descending order.
This operator is equivalent to the DetectStars( const ImageVariant& ) member function.
Definition at line 852 of file StarDetector.h.
|
default |
Copy assignment operator. Returns a reference to this object.
|
inline |
Peak sensitivity of the star detection device.
Internally, the peak response property of the star detection algorithm is expressed in kurtosis units. For each detected structure, kurtosis is evaluated from all significant pixels with values greater than the estimated mean local background. Peak response is the minimum value of kurtosis necessary to trigger star detection.
To isolate the public interface of this class from its internal implementation, this parameter is normalized to the [0,1] range, where 0 and 1 represent minimum and maximum peak response, respectively. This abstraction allows us to change the star detection engine without breaking dependent tools and processes.
If you decrease this parameter, stars will need to have stronger (or more prominent) peaks to be detected. This is useful to prevent detection of saturated stars, as well as small nonstellar features. By increasing this parameter, the star detection algorithm will be more sensitive to peakedness, and hence more tolerant with relatively flat image features. The default value is 0.5.
Definition at line 424 of file StarDetector.h.
|
inline |
Returns the centroid tolerance in pixels.
The centroid tolerance is the maximum allowed distance in pixels between a detected star position (or barycenter) and the centroid position of the corresponding fitted PSF. Stars where that distance is greater than the value returned by this function will be rejected and excluded for signal estimation. This allows preventing PSF fits departing too much from detected star coordinates, which enforces robustness and stability of the PSF fitting process.
The default centroid tolerance is 1.5 pixels.
Definition at line 788 of file StarDetector.h.
|
inline |
Returns the type of point spread function (PSF) fitted numerically when PSF fitting is enabled. See IsPSFFittingEnabled() and the pcl::PSFunction namespace.
Definition at line 735 of file StarDetector.h.
|
inline |
Sensitivity of the star detection device.
Internally, the sensitivity of the star detection algorithm is expressed in signal-to-noise ratio units with respect to the evaluated dispersion of local background pixels for each detected structure. Given a source with estimated brightness s, local background b and local background dispersion n, sensitivity is the minimum value of (s - b)/n necessary to trigger star detection.
To isolate the public interface of this class from its internal implementation, this parameter is normalized to the [0,1] range, where 0 and 1 represent minimum and maximum sensitivity, respectively. This abstraction allows us to change the star detection engine without breaking dependent tools and processes.
Increase this value to favor detection of fainter stars. Decrease it to restrict detection to brighter stars. The default value is 0.5.
Definition at line 387 of file StarDetector.h.
|
inline |
Sets the bright stars threshold. See BrightThreshold() for a description of this parameter.
Definition at line 484 of file StarDetector.h.
References pcl::Range().
|
inline |
Sets the detection mask image. See DetectionMask() for a description of this parameter.
If the specified mask pointer is nullptr, no mask will be used in subsequent star detection tasks performed by this object. Otherwise, the specified mask image must have the same dimensions as the image(s) that will be specified for star detection, and must remain valid while this object performs star detection tasks.
Definition at line 827 of file StarDetector.h.
References pcl::ImageGeometry::IsEmpty().
|
inline |
Sets the size of the hot pixel removal filter. See HotPixelFilterRadius() for a description of this parameter.
Definition at line 281 of file StarDetector.h.
References pcl::Range().
|
inline |
Sets the radius in pixels of the local maxima detection filter. See LocalDetectionFilterRadius() for a description of this parameter.
Definition at line 573 of file StarDetector.h.
References pcl::Range().
|
inline |
Sets the local maxima detection limit. See LocalMaximaDetectionLimit() for a description of this parameter.
Definition at line 595 of file StarDetector.h.
References pcl::Range().
|
inline |
Sets the maximum star distortion. See MaxDistortion() for a description of this parameter.
Definition at line 517 of file StarDetector.h.
References pcl::Range().
|
inline |
Sets the minimum signal-to-noise detection level. See MinSNR() for a description of this parameter.
Definition at line 460 of file StarDetector.h.
References pcl::Max().
|
inline |
Sets the minimum size n ≥ 0 of a detectable star structure in square pixels. See MinStructureSize() for a detailed description of this parameter and its possible values.
Definition at line 349 of file StarDetector.h.
References pcl::Max().
|
inline |
Sets the number of wavelet layers used for noise reduction. See NoiseLayers() for a description of this parameter.
Definition at line 258 of file StarDetector.h.
References pcl::Range().
|
inline |
Sets the size in pixels of the noise reduction filter. See NoiseReductionFilterRadius() for a description of this parameter.
Definition at line 311 of file StarDetector.h.
References pcl::Range().
|
inline |
Sets the peak sensitivity. See PeakResponse() for a description of this parameter.
Definition at line 433 of file StarDetector.h.
References pcl::Range().
|
inline |
Sets the centroid tolerance in pixels. See PSFCentroidTolerance() for a description of this parameter.
Definition at line 797 of file StarDetector.h.
References pcl::Max().
|
inline |
Sets the type of point spread function (PSF) fitted numerically when PSF fitting is enabled. See PSFType().
Definition at line 744 of file StarDetector.h.
|
inline |
Sets the star detection sensitivity. See Sensitivity() for a description of this parameter.
Definition at line 396 of file StarDetector.h.
References pcl::Range().
|
inline |
Sets the number of wavelet layers used for structure detection. See StructureLayers() for a description of this parameter.
Definition at line 228 of file StarDetector.h.
References pcl::Range().
|
inline |
Sets the upper star detection limit. See UpperLimit() for a description of this parameter.
Definition at line 654 of file StarDetector.h.
References pcl::Range().
|
inline |
Number of (dyadic) wavelet layers used for structure detection.
This parameter determines the size in pixels of the largest image structures that can be detected. With more layers, larger stars (and perhaps also some nonstellar objects) will be detected. The default value is 5, which corresponds to structures in the scale of 32 pixels.
Definition at line 219 of file StarDetector.h.
Image pcl::StarDetector::StructureMap | ( | const ImageVariant & | image | ) | const |
Computes a binary map of star detection structures for the specified image and the current set of star detection parameters.
Returns the star detection map as a new image.
Image pcl::StarDetector::Structures | ( | const ImageVariant & | image | ) | const |
Isolates star detection structures for the specified image.
Returns a new image which is the result of multiplying the specified image by the binarized structure map generated with the current star detection parameters.
|
inline |
Upper star detection limit in the normalized [0,1] range.
Stars with peak values larger than this value won't be detected. This can be useful to reject all stars brighter than a fixed level systematically. The default value is 1.0, which effectively disables this feature.
Definition at line 645 of file StarDetector.h.