/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace Rekognition { namespace Model { /** *

A filter that allows you to control the black frame detection by specifying * the black levels and pixel coverage of black pixels in a frame. As videos can * come from multiple sources, formats, and time periods, they may contain * different standards and varying noise levels for black frames that need to be * accounted for. For more information, see StartSegmentDetection. *

See Also:

AWS * API Reference

*/ class BlackFrame { public: AWS_REKOGNITION_API BlackFrame(); AWS_REKOGNITION_API BlackFrame(Aws::Utils::Json::JsonView jsonValue); AWS_REKOGNITION_API BlackFrame& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_REKOGNITION_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

A threshold used to determine the maximum luminance value for a pixel to be * considered black. In a full color range video, luminance values range from * 0-255. A pixel value of 0 is pure black, and the most strict filter. The maximum * black pixel value is computed as follows: max_black_pixel_value = * minimum_luminance + MaxPixelThreshold *luminance_range.

For example, for * a full range video with BlackPixelThreshold = 0.1, max_black_pixel_value is 0 + * 0.1 * (255-0) = 25.5.

The default value of MaxPixelThreshold is 0.2, * which maps to a max_black_pixel_value of 51 for a full range video. You can * lower this threshold to be more strict on black levels.

*/ inline double GetMaxPixelThreshold() const{ return m_maxPixelThreshold; } /** *

A threshold used to determine the maximum luminance value for a pixel to be * considered black. In a full color range video, luminance values range from * 0-255. A pixel value of 0 is pure black, and the most strict filter. The maximum * black pixel value is computed as follows: max_black_pixel_value = * minimum_luminance + MaxPixelThreshold *luminance_range.

For example, for * a full range video with BlackPixelThreshold = 0.1, max_black_pixel_value is 0 + * 0.1 * (255-0) = 25.5.

The default value of MaxPixelThreshold is 0.2, * which maps to a max_black_pixel_value of 51 for a full range video. You can * lower this threshold to be more strict on black levels.

*/ inline bool MaxPixelThresholdHasBeenSet() const { return m_maxPixelThresholdHasBeenSet; } /** *

A threshold used to determine the maximum luminance value for a pixel to be * considered black. In a full color range video, luminance values range from * 0-255. A pixel value of 0 is pure black, and the most strict filter. The maximum * black pixel value is computed as follows: max_black_pixel_value = * minimum_luminance + MaxPixelThreshold *luminance_range.

For example, for * a full range video with BlackPixelThreshold = 0.1, max_black_pixel_value is 0 + * 0.1 * (255-0) = 25.5.

The default value of MaxPixelThreshold is 0.2, * which maps to a max_black_pixel_value of 51 for a full range video. You can * lower this threshold to be more strict on black levels.

*/ inline void SetMaxPixelThreshold(double value) { m_maxPixelThresholdHasBeenSet = true; m_maxPixelThreshold = value; } /** *

A threshold used to determine the maximum luminance value for a pixel to be * considered black. In a full color range video, luminance values range from * 0-255. A pixel value of 0 is pure black, and the most strict filter. The maximum * black pixel value is computed as follows: max_black_pixel_value = * minimum_luminance + MaxPixelThreshold *luminance_range.

For example, for * a full range video with BlackPixelThreshold = 0.1, max_black_pixel_value is 0 + * 0.1 * (255-0) = 25.5.

The default value of MaxPixelThreshold is 0.2, * which maps to a max_black_pixel_value of 51 for a full range video. You can * lower this threshold to be more strict on black levels.

*/ inline BlackFrame& WithMaxPixelThreshold(double value) { SetMaxPixelThreshold(value); return *this;} /** *

The minimum percentage of pixels in a frame that need to have a luminance * below the max_black_pixel_value for a frame to be considered a black frame. * Luminance is calculated using the BT.709 matrix.

The default value is * 99, which means at least 99% of all pixels in the frame are black pixels as per * the MaxPixelThreshold set. You can reduce this value to allow more * noise on the black frame.

*/ inline double GetMinCoveragePercentage() const{ return m_minCoveragePercentage; } /** *

The minimum percentage of pixels in a frame that need to have a luminance * below the max_black_pixel_value for a frame to be considered a black frame. * Luminance is calculated using the BT.709 matrix.

The default value is * 99, which means at least 99% of all pixels in the frame are black pixels as per * the MaxPixelThreshold set. You can reduce this value to allow more * noise on the black frame.

*/ inline bool MinCoveragePercentageHasBeenSet() const { return m_minCoveragePercentageHasBeenSet; } /** *

The minimum percentage of pixels in a frame that need to have a luminance * below the max_black_pixel_value for a frame to be considered a black frame. * Luminance is calculated using the BT.709 matrix.

The default value is * 99, which means at least 99% of all pixels in the frame are black pixels as per * the MaxPixelThreshold set. You can reduce this value to allow more * noise on the black frame.

*/ inline void SetMinCoveragePercentage(double value) { m_minCoveragePercentageHasBeenSet = true; m_minCoveragePercentage = value; } /** *

The minimum percentage of pixels in a frame that need to have a luminance * below the max_black_pixel_value for a frame to be considered a black frame. * Luminance is calculated using the BT.709 matrix.

The default value is * 99, which means at least 99% of all pixels in the frame are black pixels as per * the MaxPixelThreshold set. You can reduce this value to allow more * noise on the black frame.

*/ inline BlackFrame& WithMinCoveragePercentage(double value) { SetMinCoveragePercentage(value); return *this;} private: double m_maxPixelThreshold; bool m_maxPixelThresholdHasBeenSet = false; double m_minCoveragePercentage; bool m_minCoveragePercentageHasBeenSet = false; }; } // namespace Model } // namespace Rekognition } // namespace Aws