Class: Google::Cloud::Vision::Annotation::Face::Features::Landmark
- Inherits:
-
Object
- Object
- Google::Cloud::Vision::Annotation::Face::Features::Landmark
- Defined in:
- lib/google/cloud/vision/annotation/face.rb
Overview
Landmark
A face-specific landmark (for example, a face feature). Landmark
positions may fall outside the bounds of the image when the face
is near one or more edges of the image. Therefore it is NOT
guaranteed that 0 <= x < width
or 0 <= y < height
.
See Google::Cloud::Vision::Annotation::Face::Features and Google::Cloud::Vision::Annotation::Face.
Instance Method Summary collapse
-
#to_a ⇒ Array
Returns the object's property values as an array.
-
#to_h ⇒ Hash
Converts object to a hash.
-
#type ⇒ String
The landmark type code.
-
#x ⇒ Float
The X (horizontal) coordinate.
-
#y ⇒ Float
The Y (vertical) coordinate.
-
#z ⇒ Float
The Z (depth) coordinate.
Instance Method Details
#to_a ⇒ Array
Returns the object's property values as an array.
626 627 628 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 626 def to_a [x, y, z] end |
#to_h ⇒ Hash
Converts object to a hash. All keys will be symbolized.
635 636 637 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 635 def to_h { x: x, y: y, z: z } end |
#type ⇒ String
The landmark type code.
587 588 589 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 587 def type @gapi.type end |
#x ⇒ Float
The X (horizontal) coordinate.
596 597 598 599 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 596 def x return nil unless @gapi.position @gapi.position.x end |
#y ⇒ Float
The Y (vertical) coordinate.
606 607 608 609 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 606 def y return nil unless @gapi.position @gapi.position.y end |
#z ⇒ Float
The Z (depth) coordinate.
616 617 618 619 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 616 def z return nil unless @gapi.position @gapi.position.z end |