ColorThresholdParams

Description

This structure contains parameters for color-based thresholding of an image.

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

  • Pixel RgbColor - Color to compare the image to
  • float ChromaAmount = 0.7f - Proportion of chromatic information in distance computation
  • float MaxDifference = 5 - Maximum difference between image pixel and model color
  • float Hysteresis - Defines how much the threshold criterion is lowered for pixels neighboring with other foreground pixels
struct ColorThresholdParams
{
	Pixel	RgbColor;
	float	ChromaAmount;
	float	MaxDifference;
	float	Hysteresis;

	explicit ColorThresholdParams
	(
		 float ChromaAmount_ = 0.7f,
		 float MaxDifference_ = 5 
	) :
		 ChromaAmount(ChromaAmount_),
		 MaxDifference(MaxDifference_) 
	{}

	Pixel RgbColor( void ) const		{ return RgbColor;		};
	float ChromaAmount( void ) const	{ return ChromaAmount;	};
	float MaxDifference( void ) const	{ return MaxDifference;	};
	float Hysteresis( void ) const		{ return Hysteresis;	};

	bool operator == ( const avl::ColorThresholdParams& rhs ) const
	{
		return RgbColor == rhs.RgbColor && 
			ChromaAmount == rhs.ChromaAmount && 
			MaxDifference == rhs.MaxDifference && 
			Hysteresis == rhs.Hysteresis;
	}

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

};