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

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

Overview

Nose

The landmarks of the nose 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/vision"

vision = Google::Cloud::Vision.new

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

nose = face.features.nose

nose.tip
#<Landmark (x: 225.23511, y: 122.47372, z: -25.817825)>

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bottomLandmark (readonly)

The nose, bottom center.

Returns:

  • (Landmark)

    the current value of bottom



1256
1257
1258
# File 'lib/google/cloud/vision/annotation/face.rb', line 1256

def bottom
  @bottom
end

#leftLandmark (readonly)

The nose, bottom left.

Returns:

  • (Landmark)

    the current value of left



1256
1257
1258
# File 'lib/google/cloud/vision/annotation/face.rb', line 1256

def left
  @left
end

#rightLandmark (readonly)

The nose, bottom right.

Returns:

  • (Landmark)

    the current value of right



1256
1257
1258
# File 'lib/google/cloud/vision/annotation/face.rb', line 1256

def right
  @right
end

#tipLandmark (readonly)

The nose tip.

Returns:

  • (Landmark)

    the current value of tip



1256
1257
1258
# File 'lib/google/cloud/vision/annotation/face.rb', line 1256

def tip
  @tip
end

#topLandmark (readonly)

The midpoint between the eyes.

Returns:

  • (Landmark)

    the current value of top



1256
1257
1258
# File 'lib/google/cloud/vision/annotation/face.rb', line 1256

def top
  @top
end

Instance Method Details

#to_aArray

Returns the object's property values as an array.

Returns:

  • (Array)


1274
1275
1276
# File 'lib/google/cloud/vision/annotation/face.rb', line 1274

def to_a
  [left, bottom, tip, top, right]
end

#to_hHash

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

Returns:

  • (Hash)


1283
1284
1285
1286
# File 'lib/google/cloud/vision/annotation/face.rb', line 1283

def to_h
  { left: left.to_h, bottom: bottom.to_h, tip: tip.to_h,
    top: top.to_h, right: right.to_h }
end