Class: Google::Cloud::Vision::Annotation::Face::Features::Ears

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/vision/annotation/face.rb

Overview

Ears

The landmarks for the ear tragions.

Left and right are defined from the vantage of the viewer of the image, without considering mirror projections typical of photos. So face.features.eyes.left typically is the person's right eye.

See Google::Cloud::Vision::Annotation::Face::Features and Google::Cloud::Vision::Annotation::Face.

Examples:

require "google/cloud/vision"

vision = Google::Cloud::Vision.new

image = vision.image "path/to/face.jpg"
face = image.face

ears = face.features.ears
ears.right
#<Landmark (x: 303.81198, y: 88.5782, z: 77.719193)>

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#leftLandmark (readonly)

The left ear tragion.

Returns:

  • (Landmark)

    the current value of left



750
751
752
# File 'lib/google/cloud/vision/annotation/face.rb', line 750

def left
  @left
end

#rightLandmark (readonly)

The right ear tragion.

Returns:

  • (Landmark)

    the current value of right



750
751
752
# File 'lib/google/cloud/vision/annotation/face.rb', line 750

def right
  @right
end

Instance Method Details

#to_aArray

Returns the object's property values as an array.

Returns:

  • (Array)


765
766
767
# File 'lib/google/cloud/vision/annotation/face.rb', line 765

def to_a
  [left, right]
end

#to_hHash

Deeply converts object to a hash. All keys will be symbolized.

Returns:

  • (Hash)


774
775
776
# File 'lib/google/cloud/vision/annotation/face.rb', line 774

def to_h
  { left: left.to_h, right: right.to_h }
end