DynamicThresholdParams

Description

This structure contains parameters for dynamic thresholding of an image.

Structure fields and default values (if defined) are described below:

  • int Radius = 5 - Radius of dynamic threshold internal blur
  • float MinRelativeValue = 5 - Minimal relative value of a pixel that is considered foreground
  • float MaxRelativeValue - Maximal relative value of a pixel that is considered foreground
  • float Hysteresis - Defines how much the threshold criteria are lowered for pixels neighboring with other foreground pixels
struct DynamicThresholdParams
{
	int		Radius;
	float	MinRelativeValue;
	float	MaxRelativeValue;
	float	Hysteresis;

	explicit DynamicThresholdParams
	(
		int Radius_ = 5,
		float MinRelativeValue_ = 5 
	) :
		 Radius(Radius_),
		 MinRelativeValue(MinRelativeValue_) 
	{}

	int Radius() const				{ return Radius;			};
	float MinRelativeValue() const	{ return MinRelativeValue;	};
	float MaxRelativeValue() const	{ return MaxRelativeValue;	};
	float Hysteresis() const		{ return Hysteresis;		};

	bool operator == ( const avl::DynamicThresholdParams& rhs ) const
	{
		return Radius == rhs.Radius && 
			MinRelativeValue == rhs.MinRelativeValue && 
			MaxRelativeValue == rhs.MaxRelativeValue && 
			Hysteresis == rhs.Hysteresis;
	}

	bool operator != ( const avl::DynamicThresholdParams& rhs ) const
	{
		return !(operator==(rhs));
	}

};