Class: AWSCDK::Rekognition::CfnStreamProcessor::BoundingBoxProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Rekognition::CfnStreamProcessor::BoundingBoxProperty
- Defined in:
- rekognition/cfn_stream_processor.rb
Overview
Identifies the bounding box around the label, face, text, or personal protective equipment.
The left (x-coordinate) and top (y-coordinate) are coordinates representing the top and left sides of the bounding box. Note that the upper-left corner of the image is the origin (0,0).
The top and left values returned are ratios of the overall image size. For example, if the input image is 700x200 pixels, and the top-left coordinate of the bounding box is 350x50 pixels, the API returns a left value of 0.5 (350/700) and a top value of 0.25 (50/200).
The width and height values represent the dimensions of the bounding box as a ratio of the overall image dimension. For example, if the input image is 700x200 pixels, and the bounding box width is 70 pixels, the width returned is 0.1. For more information, see BoundingBox .
The bounding box coordinates can have negative values. For example, if Amazon Rekognition is able to detect a face that is at the image edge and is only partially visible, the service can return coordinates that are outside the image bounds and, depending on the image edge, you might get negative values or values greater than 1 for the
leftortopvalues.
Instance Attribute Summary collapse
-
#height ⇒ Numeric
readonly
Height of the bounding box as a ratio of the overall image height.
-
#left ⇒ Numeric
readonly
Left coordinate of the bounding box as a ratio of overall image width.
-
#top ⇒ Numeric
readonly
Top coordinate of the bounding box as a ratio of overall image height.
-
#width ⇒ Numeric
readonly
Width of the bounding box as a ratio of the overall image width.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(height:, left:, top:, width:) ⇒ BoundingBoxProperty
constructor
A new instance of BoundingBoxProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(height:, left:, top:, width:) ⇒ BoundingBoxProperty
Returns a new instance of BoundingBoxProperty.
717 718 719 720 721 722 723 724 725 726 |
# File 'rekognition/cfn_stream_processor.rb', line 717 def initialize(height:, left:, top:, width:) @height = height Jsii::Type.check_type(@height, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "height") @left = left Jsii::Type.check_type(@left, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "left") @top = top Jsii::Type.check_type(@top, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "top") @width = width Jsii::Type.check_type(@width, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "width") end |
Instance Attribute Details
#height ⇒ Numeric (readonly)
Height of the bounding box as a ratio of the overall image height.
732 733 734 |
# File 'rekognition/cfn_stream_processor.rb', line 732 def height @height end |
#left ⇒ Numeric (readonly)
Left coordinate of the bounding box as a ratio of overall image width.
737 738 739 |
# File 'rekognition/cfn_stream_processor.rb', line 737 def left @left end |
#top ⇒ Numeric (readonly)
Top coordinate of the bounding box as a ratio of overall image height.
742 743 744 |
# File 'rekognition/cfn_stream_processor.rb', line 742 def top @top end |
#width ⇒ Numeric (readonly)
Width of the bounding box as a ratio of the overall image width.
747 748 749 |
# File 'rekognition/cfn_stream_processor.rb', line 747 def width @width end |
Class Method Details
.jsii_properties ⇒ Object
749 750 751 752 753 754 755 756 |
# File 'rekognition/cfn_stream_processor.rb', line 749 def self.jsii_properties { :height => "height", :left => "left", :top => "top", :width => "width", } end |
Instance Method Details
#to_jsii ⇒ Object
758 759 760 761 762 763 764 765 766 767 |
# File 'rekognition/cfn_stream_processor.rb', line 758 def to_jsii result = {} result.merge!({ "height" => @height, "left" => @left, "top" => @top, "width" => @width, }) result.compact end |