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

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

Overview

Mouth

The landmarks of the mouth in the features of a face.

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"

gcloud = Google::Cloud.new
vision = gcloud.vision

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

mouth = face.features.mouth

mouth.center
#=> #<Landmark (x: 228.53499, y: 150.29066, z: 1.1069832)>

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#centerLandmark (readonly)

The mouth, center.

Returns:

  • (Landmark)

    the current value of center



1195
1196
1197
# File 'lib/google/cloud/vision/annotation/face.rb', line 1195

def center
  @center
end

#leftLandmark (readonly)

The mouth, left.

Returns:

  • (Landmark)

    the current value of left



1195
1196
1197
# File 'lib/google/cloud/vision/annotation/face.rb', line 1195

def left
  @left
end

#rightLandmark (readonly)

TThe mouth, right.

Returns:

  • (Landmark)

    the current value of right



1195
1196
1197
# File 'lib/google/cloud/vision/annotation/face.rb', line 1195

def right
  @right
end

Instance Method Details

#to_aArray

Returns the object's property values as an array.

Returns:

  • (Array)


1211
1212
1213
# File 'lib/google/cloud/vision/annotation/face.rb', line 1211

def to_a
  [left, center, right]
end

#to_hHash

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

Returns:

  • (Hash)


1220
1221
1222
# File 'lib/google/cloud/vision/annotation/face.rb', line 1220

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