@@ -134,10 +134,10 @@ size
134
134
: The physical size of the marker, as the vision system expects it.
135
135
136
136
pixel_centre
137
- : A [ ` Coordinate ` ] ( #Coordinate ) describing the position of the centre of the marker.
137
+ : A [ ` PixelCoordinates ` ] ( #PixelCoordinates ) describing the position of the centre of the marker.
138
138
139
139
pixel_corners
140
- : A list of 4 [ ` Coordinate ` ] ( #Coordinate ) instances, each representing the position of the corners of the marker.
140
+ : A list of 4 [ ` PixelCoordinates ` ] ( #PixelCoordinates ) instances, each representing the position of the corners of the marker.
141
141
142
142
distance
143
143
: The distance between the camera and the centre of the marker, in millimetres.
@@ -146,20 +146,33 @@ orientation
146
146
: An [ ` Orientation ` ] ( #Orientation ) instance describing the orientation of the marker.
147
147
148
148
spherical
149
- : A [ ` Spherical ` ] ( #Spherical ) instance describing the position relative to the camera.
149
+ : A [ ` SphericalCoordinate ` ] ( #SphericalCoordinate ) instance describing the position relative to the camera.
150
150
151
151
cartesian
152
- : A [ ` ThreeDCoordinate ` ] ( #ThreeDCoordinate ) instance describing the absolute position of the marker relative to the camera.
152
+ : A [ ` CartesianCoordinates ` ] ( #CartesianCoordinates ) instance describing the absolute position of the marker relative to the camera.
153
153
154
- [ ` Coordinate ` ] ( #Coordinate ) {#Coordinate}
154
+ <a id =" Coordinate " />
155
+
156
+ [ ` PixelCoordinates ` ] ( #PixelCoordinates ) {#PixelCoordinates}
155
157
---------
156
158
157
- A ` Coordinate ` object contains an ` x ` and ` y ` attribute. The exact meaning and unit of these attributes depends on its source.
159
+ A named tuple of ` x ` and ` y ` coordinates for the point, in pixels relative to the top left of the image.
160
+
161
+ ~~~~~ python
162
+ print (marker.pixel_centre.x, marker.pixel_centre.y)
163
+ ~~~~~
158
164
159
- [ ` ThreeDCoordinate ` ] ( #ThreeDCoordinate ) {#ThreeDCoordinate}
165
+ <a id =" ThreeDCoordinate " />
166
+
167
+ [ ` CartesianCoordinates ` ] ( #CartesianCoordinates ) {#CartesianCoordinates}
160
168
---------
161
169
162
- A ` ThreeDCoordinate ` object contains an ` x ` , ` y ` and ` z ` attribute. The exact meaning and unit of these attributes depends on its source.
170
+ A named tuple of ` x ` , ` y ` and ` z ` coordinates for the point, in millimeters relative to the camera.
171
+ Increasing values are to the right, below and away from the camera respectively.
172
+
173
+ ~~~~~ python
174
+ print (marker.cartesian.x, marker.cartesian.y, marker.cartesian.z)
175
+ ~~~~~
163
176
164
177
[ ` Orientation ` ] ( #Orientation ) {#Orientation}
165
178
---------------
@@ -171,62 +184,71 @@ One (possibly both) of them may change to resolve this.
171
184
172
185
An ` Orientation ` object describes the orientation of a marker.
173
186
174
- ![ A visual representation of how the orientation axes work. Source: SourceBots] ({{ site.baseurl }}/images/content/vision/yaw-pitch-roll.png)
175
-
176
- pitch
187
+ rot_x
177
188
: Rotation of the marker about the cartesian x-axis, in radians.
178
189
179
- Leaning a marker away from the camera increases the value of `rot_x`, while
180
- leaning it towards the camera decreases it. A value of 0 indicates that the
181
- marker is upright.
190
+ Leaning a marker towards the camera increases the value of `rot_x`, while
191
+ leaning it away from the camera decreases it. A value of π or -π indicates
192
+ that the marker is upright.
182
193
183
- yaw
194
+ rot_y
184
195
: Rotation of the marker about the cartesian y-axis, in radians.
185
196
186
- Turning a marker clockwise (as viewed from above) increases the value of
187
- `rot_y`, while turning it anticlockwise decreases it. A value of 0 means
197
+ Turning a marker clockwise (as viewed from above) decreases the value of
198
+ `rot_y`, while turning it anticlockwise increases it. A value of 0 means
188
199
that the marker is perpendicular to the line of sight of the camera.
189
200
190
- roll
201
+ rot_z
191
202
: Rotation of the marker about the cartesian z-axis, in radians.
192
203
193
204
Turning a marker anticlockwise (as viewed from the camera) increases the
194
- value of `rot_z`, while turning it clockwise decreases it. A value of 0
195
- indicates that the marker is upright.
205
+ value of `rot_z`, while turning it clockwise decreases it. A value of π
206
+ or -π indicates that the marker is upright.
196
207
197
- rot_x
198
- : An alias for ` pitch ` .
208
+ roll
209
+ : An alias for ` rot_x ` .
199
210
200
- rot_y
201
- : An alias for ` yaw ` .
211
+ pitch
212
+ : An alias for ` rot_y ` .
202
213
203
- rot_z
204
- : An alias for ` roll ` .
214
+ yaw
215
+ : An alias for ` rot_z ` .
205
216
206
217
rotation_matrix
207
218
: The rotation matrix represented by this orientation. A list of 3 lists, each with 3 items.
208
219
209
220
quaternion
210
221
: The [ Quarternion] ( https://kieranwynn.github.io/pyquaternion/#quaternion-features ) instance represented by this orientation.
211
222
212
- [ ` Spherical ` ] ( #Spherical ) {#Spherical}
223
+ <a id =" Spherical " />
224
+
225
+ [ ` SphericalCoordinate ` ] ( #SphericalCoordinate ) {#SphericalCoordinate}
213
226
---------------
214
227
215
228
The spherical coordinates system has three values to specify a specific point in space.
216
229
217
- ![ A visual representation of Spherical coordinates. Source: SourceBots] ({{ site.baseurl }}/images/content/vision/spherical.png)
230
+ distance
231
+ : The radial distance, the distance from the origin to the point, in millimetres.
232
+
233
+ theta
234
+ : This is the angle from directly in front of the camera to the vector which
235
+ points to the location in the horizontal plane. A positive value indicates a
236
+ counter-clockwise rotation. Zero is at the centre of the image.
237
+
238
+ phi
239
+ : The polar angle from the y-axis of the camera "down" to the vector which
240
+ points to the location, in radians. Zero is directly upward.
218
241
219
- - r - The radial distance, the distance from the origin to the point, in millimetres.
220
- - θ (theta) - The angle from the azimuth to the point, in radians.
221
- - φ (phi) - The polar angle from the plane of the camera to the point, in radians.
242
+ Also available are two computed angles which express the same location slightly differently:
222
243
223
244
rot_x
224
- : Rotation around the X-axis, in radians, corresponding to ` theta ` on the diagram.
245
+ : Approximate rotation around the X-axis, in radians.
246
+ This is the angle from the camera's horizontal plane to the vector which
247
+ points to the location. Zero is at the centre of the image. Values increase
248
+ towards the bottom of the image.
225
249
226
250
rot_y
227
- : Rotation around the Y-axis, in radians, corresponding to ` phi ` on the diagram.
228
-
229
- dist
230
- : Distance, in millimetres, corresponding to ` r ` on the diagram.
251
+ : Rotation around the Y-axis, in radians. This is similar to ` theta ` , however
252
+ values increase towards the right of the image. Zero is at the centre of the image.
231
253
232
254
The camera is located at the origin, where the coordinates are (0, 0, 0).
0 commit comments