52 #ifndef __PCL_StarDetector_h
53 #define __PCL_StarDetector_h
117 Star(
const DPoint& p,
const Rect& r,
const Rect& sr = 0,
float a = 0,
float f = 0,
float s = 0,
float m = 0 )
118 : pos( p ), rect( r ), srect( sr ), area( a ), flux( f ), signal( s ), mad( m )
127 : pos( p ), flux( f )
135 Star(
double x,
double y,
float f = 0 )
136 : pos( x, y ), flux( f )
166 return flux > s.
flux;
221 return m_structureLayers;
230 PCL_PRECONDITION( n > 0 && n <= 8 )
231 m_structureLayers =
Range( n, 1, 8 );
251 return m_noiseLayers;
260 PCL_PRECONDITION( n >= 0 && n <= 4 )
261 m_noiseLayers =
Range( n, 0, 4 );
274 return m_hotPixelFilterRadius;
283 PCL_PRECONDITION( n >= 0 && n <= 3 )
284 m_hotPixelFilterRadius =
Range( n, 0, 3 );
304 return m_noiseReductionFilterRadius;
313 PCL_PRECONDITION( n >= 0 && n <= 64 )
314 m_noiseReductionFilterRadius =
Range( n, 0, 64 );
341 return m_minStructureSize;
351 PCL_PRECONDITION( n >= 0 )
352 m_minStructureSize =
Max( 0, n );
365 return m_minStarSize;
389 return m_sensitivity;
398 PCL_PRECONDITION( s >= 0 && s <= 1 )
399 m_sensitivity =
Range( s, 0.0F, 1.0F );
426 return m_peakResponse;
435 PCL_PRECONDITION( r >= 0 && r <= 1 )
436 m_peakResponse =
Range( r, 0.0F, 1.0F );
462 PCL_PRECONDITION( snr >= 0 )
463 m_minSNR =
Max( 0.0F, snr );
477 return m_brightThreshold;
486 PCL_PRECONDITION( r >= 1 && r <= 100 )
487 m_brightThreshold =
Range( r, 1.0F, 100.0F );
510 return m_maxDistortion;
519 PCL_PRECONDITION( d >= 0 && d <= 1 )
520 m_maxDistortion =
Range( d, 0.0F, 1.0F );
536 return m_allowClusteredSources;
545 m_allowClusteredSources = enable;
554 EnableClusteredSources( !disable );
566 return m_localDetectionFilterRadius;
575 PCL_PRECONDITION( n >= 1 && n <= 5 )
576 m_localDetectionFilterRadius =
Range( n, 1, 5 );
588 return m_localMaximaDetectionLimit;
597 PCL_PRECONDITION( v >= 0 && v <= 1 )
598 m_localMaximaDetectionLimit =
Range( v, 0.1F, 1.0F );
617 return !m_noLocalMaximaDetection;
626 m_noLocalMaximaDetection = !enable;
635 EnableLocalMaximaDetection( !disable );
656 PCL_PRECONDITION( u >= 0 && u <= 1 )
657 m_upperLimit =
Range( u, 0.0F, 1.0F );
686 EnableImageInversion( !disable );
727 EnablePSFFitting( !disable );
756 return m_psfElliptic;
764 m_psfElliptic = enable;
772 EnableEllipticPSF( !disable );
790 return m_psfCentroidTolerance;
799 PCL_PRECONDITION( t >= 0 )
800 m_psfCentroidTolerance =
Max( 0.0F, t );
829 if ( mask !=
nullptr )
854 return DetectStars( image );
876 int m_structureLayers = 5;
877 int m_noiseLayers = 0;
878 int m_hotPixelFilterRadius = 1;
879 int m_noiseReductionFilterRadius = 0;
880 int m_minStructureSize = 0;
881 mutable int m_minStarSize = 0;
882 float m_sensitivity = 0.5F;
883 float m_peakResponse = 0.5F;
884 float m_minSNR = 0.0F;
885 float m_brightThreshold = 3.0F;
886 float m_maxDistortion = 0.6F;
887 bool m_allowClusteredSources =
false;
888 int m_localDetectionFilterRadius = 2;
889 float m_localMaximaDetectionLimit = 0.75F;
890 bool m_noLocalMaximaDetection =
false;
891 float m_upperLimit = 1.0F;
892 bool m_invert =
false;
893 bool m_fitPSF =
false;
894 psf_function m_psfType = PSFunction::Gaussian;
895 bool m_psfElliptic =
false;
896 float m_psfCentroidTolerance = 1.5F;
A generic point in the two-dimensional space.
A generic rectangle in the two-dimensional space.
bool IsEmpty() const noexcept
Acts like a union for all types of images in PCL, with optional class-wide ownership of transported i...
PSFData::psf_function psf_function
A process using multiple concurrent execution threads.
Automatic star detection.
void SetNoiseLayers(int n)
void SetPeakResponse(float r)
void SetPSFType(psf_function type)
StarDetector(const StarDetector &)=default
void SetBrightThreshold(float r)
void EnableLocalMaximaDetection(bool enable=true)
Image StructureMap(const ImageVariant &image) const
const UInt8Image * DetectionMask() const
float Sensitivity() const
void SetMinStructureSize(int n)
void SetMaxDistortion(float d)
void EnablePSFFitting(bool enable=true)
void SetUpperLimit(float u)
bool IsPSFFittingEnabled() const
void SetStructureLayers(int n)
void DisableLocalMaximaDetection(bool disable=true)
void SetSensitivity(float s)
int StructureLayers() const
void SetLocalDetectionFilterRadius(int n)
int NoiseReductionFilterRadius() const
void DisablePSFFitting(bool disable=true)
int MinStructureSize() const
bool IsEllipticPSF() const
bool IsImageInversionEnabled() const
Image Structures(const ImageVariant &image) const
bool IsLocalMaximaDetectionEnabled() const
void DisableImageInversion(bool disable=true)
void SetDetectionMask(const UInt8Image *mask)
void SetMinSNR(float snr)
star_list operator()(const ImageVariant &image) const
void EnableImageInversion(bool enabled=true)
float PeakResponse() const
void DisableEllipticPSF(bool disable=true)
void DisableClusteredSources(bool disable=true)
void EnableClusteredSources(bool enable=true)
float MaxDistortion() const
void SetLocalMaximaDetectionLimit(float v)
bool IsClusteredSourcesEnabled() const
int HotPixelFilterRadius() const
void EnableEllipticPSF(bool enable=true)
void SetNoiseReductionFilterRadius(int n)
float PSFCentroidTolerance() const
psf_function PSFType() const
star_list DetectStars(const ImageVariant &image) const
void SetPSFCentroidTolerance(float t)
int LocalDetectionFilterRadius() const
void SetHotPixelFilterRadius(int n)
float BrightThreshold() const
float LocalMaximaDetectionLimit() const
bool operator==(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
bool operator<(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
constexpr const T & Range(const T &x, const T &a, const T &b) noexcept
constexpr const T & Max(const T &a, const T &b) noexcept
Structure to hold the data of a detected star.
Star(const DPoint &p, float f=0)
Star(const Star &)=default
Star(const DPoint &p, const Rect &r, const Rect &sr=0, float a=0, float f=0, float s=0, float m=0)
float flux
Total flux above local background.
Star(double x, double y, float f=0)
DPoint::component component