|
| 1 | +/** |
| 2 | + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | + * SPDX-License-Identifier: Apache-2.0. |
| 4 | + */ |
| 5 | + |
| 6 | +#pragma once |
| 7 | +#include <aws/rekognition/Rekognition_EXPORTS.h> |
| 8 | + |
| 9 | +namespace Aws |
| 10 | +{ |
| 11 | +namespace Utils |
| 12 | +{ |
| 13 | +namespace Json |
| 14 | +{ |
| 15 | + class JsonValue; |
| 16 | + class JsonView; |
| 17 | +} // namespace Json |
| 18 | +} // namespace Utils |
| 19 | +namespace Rekognition |
| 20 | +{ |
| 21 | +namespace Model |
| 22 | +{ |
| 23 | + |
| 24 | + /** |
| 25 | + * <p> A filter that allows you to control the black frame detection by specifying |
| 26 | + * the black levels and pixel coverage of black pixels in a frame. As videos can |
| 27 | + * come from multiple sources, formats, and time periods, they may contain |
| 28 | + * different standards and varying noise levels for black frames that need to be |
| 29 | + * accounted for. For more information, see <a>StartSegmentDetection</a>. |
| 30 | + * </p><p><h3>See Also:</h3> <a |
| 31 | + * href="http://docs.aws.amazon.com/goto/WebAPI/rekognition-2016-06-27/BlackFrame">AWS |
| 32 | + * API Reference</a></p> |
| 33 | + */ |
| 34 | + class AWS_REKOGNITION_API BlackFrame |
| 35 | + { |
| 36 | + public: |
| 37 | + BlackFrame(); |
| 38 | + BlackFrame(Aws::Utils::Json::JsonView jsonValue); |
| 39 | + BlackFrame& operator=(Aws::Utils::Json::JsonView jsonValue); |
| 40 | + Aws::Utils::Json::JsonValue Jsonize() const; |
| 41 | + |
| 42 | + |
| 43 | + /** |
| 44 | + * <p> A threshold used to determine the maximum luminance value for a pixel to be |
| 45 | + * considered black. In a full color range video, luminance values range from |
| 46 | + * 0-255. A pixel value of 0 is pure black, and the most strict filter. The maximum |
| 47 | + * black pixel value is computed as follows: max_black_pixel_value = |
| 48 | + * minimum_luminance + MaxPixelThreshold *luminance_range. </p> <p>For example, for |
| 49 | + * a full range video with BlackPixelThreshold = 0.1, max_black_pixel_value is 0 + |
| 50 | + * 0.1 * (255-0) = 25.5.</p> <p>The default value of MaxPixelThreshold is 0.2, |
| 51 | + * which maps to a max_black_pixel_value of 51 for a full range video. You can |
| 52 | + * lower this threshold to be more strict on black levels.</p> |
| 53 | + */ |
| 54 | + inline double GetMaxPixelThreshold() const{ return m_maxPixelThreshold; } |
| 55 | + |
| 56 | + /** |
| 57 | + * <p> A threshold used to determine the maximum luminance value for a pixel to be |
| 58 | + * considered black. In a full color range video, luminance values range from |
| 59 | + * 0-255. A pixel value of 0 is pure black, and the most strict filter. The maximum |
| 60 | + * black pixel value is computed as follows: max_black_pixel_value = |
| 61 | + * minimum_luminance + MaxPixelThreshold *luminance_range. </p> <p>For example, for |
| 62 | + * a full range video with BlackPixelThreshold = 0.1, max_black_pixel_value is 0 + |
| 63 | + * 0.1 * (255-0) = 25.5.</p> <p>The default value of MaxPixelThreshold is 0.2, |
| 64 | + * which maps to a max_black_pixel_value of 51 for a full range video. You can |
| 65 | + * lower this threshold to be more strict on black levels.</p> |
| 66 | + */ |
| 67 | + inline bool MaxPixelThresholdHasBeenSet() const { return m_maxPixelThresholdHasBeenSet; } |
| 68 | + |
| 69 | + /** |
| 70 | + * <p> A threshold used to determine the maximum luminance value for a pixel to be |
| 71 | + * considered black. In a full color range video, luminance values range from |
| 72 | + * 0-255. A pixel value of 0 is pure black, and the most strict filter. The maximum |
| 73 | + * black pixel value is computed as follows: max_black_pixel_value = |
| 74 | + * minimum_luminance + MaxPixelThreshold *luminance_range. </p> <p>For example, for |
| 75 | + * a full range video with BlackPixelThreshold = 0.1, max_black_pixel_value is 0 + |
| 76 | + * 0.1 * (255-0) = 25.5.</p> <p>The default value of MaxPixelThreshold is 0.2, |
| 77 | + * which maps to a max_black_pixel_value of 51 for a full range video. You can |
| 78 | + * lower this threshold to be more strict on black levels.</p> |
| 79 | + */ |
| 80 | + inline void SetMaxPixelThreshold(double value) { m_maxPixelThresholdHasBeenSet = true; m_maxPixelThreshold = value; } |
| 81 | + |
| 82 | + /** |
| 83 | + * <p> A threshold used to determine the maximum luminance value for a pixel to be |
| 84 | + * considered black. In a full color range video, luminance values range from |
| 85 | + * 0-255. A pixel value of 0 is pure black, and the most strict filter. The maximum |
| 86 | + * black pixel value is computed as follows: max_black_pixel_value = |
| 87 | + * minimum_luminance + MaxPixelThreshold *luminance_range. </p> <p>For example, for |
| 88 | + * a full range video with BlackPixelThreshold = 0.1, max_black_pixel_value is 0 + |
| 89 | + * 0.1 * (255-0) = 25.5.</p> <p>The default value of MaxPixelThreshold is 0.2, |
| 90 | + * which maps to a max_black_pixel_value of 51 for a full range video. You can |
| 91 | + * lower this threshold to be more strict on black levels.</p> |
| 92 | + */ |
| 93 | + inline BlackFrame& WithMaxPixelThreshold(double value) { SetMaxPixelThreshold(value); return *this;} |
| 94 | + |
| 95 | + |
| 96 | + /** |
| 97 | + * <p> The minimum percentage of pixels in a frame that need to have a luminance |
| 98 | + * below the max_black_pixel_value for a frame to be considered a black frame. |
| 99 | + * Luminance is calculated using the BT.709 matrix. </p> <p>The default value is |
| 100 | + * 99, which means at least 99% of all pixels in the frame are black pixels as per |
| 101 | + * the <code>MaxPixelThreshold</code> set. You can reduce this value to allow more |
| 102 | + * noise on the black frame.</p> |
| 103 | + */ |
| 104 | + inline double GetMinCoveragePercentage() const{ return m_minCoveragePercentage; } |
| 105 | + |
| 106 | + /** |
| 107 | + * <p> The minimum percentage of pixels in a frame that need to have a luminance |
| 108 | + * below the max_black_pixel_value for a frame to be considered a black frame. |
| 109 | + * Luminance is calculated using the BT.709 matrix. </p> <p>The default value is |
| 110 | + * 99, which means at least 99% of all pixels in the frame are black pixels as per |
| 111 | + * the <code>MaxPixelThreshold</code> set. You can reduce this value to allow more |
| 112 | + * noise on the black frame.</p> |
| 113 | + */ |
| 114 | + inline bool MinCoveragePercentageHasBeenSet() const { return m_minCoveragePercentageHasBeenSet; } |
| 115 | + |
| 116 | + /** |
| 117 | + * <p> The minimum percentage of pixels in a frame that need to have a luminance |
| 118 | + * below the max_black_pixel_value for a frame to be considered a black frame. |
| 119 | + * Luminance is calculated using the BT.709 matrix. </p> <p>The default value is |
| 120 | + * 99, which means at least 99% of all pixels in the frame are black pixels as per |
| 121 | + * the <code>MaxPixelThreshold</code> set. You can reduce this value to allow more |
| 122 | + * noise on the black frame.</p> |
| 123 | + */ |
| 124 | + inline void SetMinCoveragePercentage(double value) { m_minCoveragePercentageHasBeenSet = true; m_minCoveragePercentage = value; } |
| 125 | + |
| 126 | + /** |
| 127 | + * <p> The minimum percentage of pixels in a frame that need to have a luminance |
| 128 | + * below the max_black_pixel_value for a frame to be considered a black frame. |
| 129 | + * Luminance is calculated using the BT.709 matrix. </p> <p>The default value is |
| 130 | + * 99, which means at least 99% of all pixels in the frame are black pixels as per |
| 131 | + * the <code>MaxPixelThreshold</code> set. You can reduce this value to allow more |
| 132 | + * noise on the black frame.</p> |
| 133 | + */ |
| 134 | + inline BlackFrame& WithMinCoveragePercentage(double value) { SetMinCoveragePercentage(value); return *this;} |
| 135 | + |
| 136 | + private: |
| 137 | + |
| 138 | + double m_maxPixelThreshold; |
| 139 | + bool m_maxPixelThresholdHasBeenSet; |
| 140 | + |
| 141 | + double m_minCoveragePercentage; |
| 142 | + bool m_minCoveragePercentageHasBeenSet; |
| 143 | + }; |
| 144 | + |
| 145 | +} // namespace Model |
| 146 | +} // namespace Rekognition |
| 147 | +} // namespace Aws |
0 commit comments