Class: Google::Cloud::Vision::Annotation::Face::Angles
- Inherits:
-
Object
- Object
- Google::Cloud::Vision::Annotation::Face::Angles
- Defined in:
- lib/google/cloud/vision/annotation/face.rb
Overview
# Angles
The orientation of the face relative to the image.
Instance Attribute Summary collapse
Class Method Summary collapse
-
.from_grpc(grpc) ⇒ Object
object.
Instance Method Summary collapse
-
#initialize ⇒ Angles
constructor
A new instance of Angles.
- #inspect ⇒ Object
-
#pitch ⇒ Float
(also: #tilt)
Pitch (tilt) angle.
-
#roll ⇒ Float
Roll angle.
-
#to_a ⇒ Array
Returns the object’s property values as an array.
-
#to_h ⇒ Hash
Converts object to a hash.
- #to_s ⇒ Object
-
#yaw ⇒ Float
(also: #pan)
Yaw (pan) angle.
Constructor Details
#initialize ⇒ Angles
Returns a new instance of Angles.
151 152 153 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 151 def initialize @grpc = nil end |
Instance Attribute Details
#grpc ⇒ Object
147 148 149 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 147 def grpc @grpc end |
Class Method Details
.from_grpc(grpc) ⇒ Object
object.
221 222 223 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 221 def self.from_grpc grpc new.tap { |f| f.instance_variable_set :@grpc, grpc } end |
Instance Method Details
#inspect ⇒ Object
214 215 216 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 214 def inspect "#<Angles #{self}>" end |
#pitch ⇒ Float Also known as: tilt
Pitch (tilt) angle. Indicates the upwards/downwards angle that the face is pointing relative to the image’s horizontal plane.
184 185 186 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 184 def pitch @grpc.tilt_angle end |
#roll ⇒ Float
Roll angle. Indicates the amount of clockwise/anti-clockwise rotation of the face relative to the image vertical, about the axis perpendicular to the face.
162 163 164 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 162 def roll @grpc.roll_angle end |
#to_a ⇒ Array
Returns the object’s property values as an array.
194 195 196 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 194 def to_a [roll, yaw, pitch] end |
#to_h ⇒ Hash
Converts object to a hash. All keys will be symbolized.
203 204 205 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 203 def to_h { roll: roll, yaw: yaw, pitch: pitch } end |
#to_s ⇒ Object
208 209 210 211 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 208 def to_s format "(roll: %s, yaw: %s, pitch: %s)", roll.inspect, yaw.inspect, pitch.inspect end |
#yaw ⇒ Float Also known as: pan
Yaw (pan) angle. Indicates the leftward/rightward angle that the face is pointing, relative to the vertical plane perpendicular to the image.
173 174 175 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 173 def yaw @grpc.pan_angle end |