Rotations, Quaternions and Geometry¶
Conversions between Euler angles, rotation matrices (real and complex), and quaternions (real and complex), quaternion arithmetic, and 2D/3D geometry primitives.
Euler / matrix / quaternion conversions¶
v_roteu2qr
¶
V_ROTEU2QR - convert Euler angles to real unit quaternion.
v_roteu2qr
¶
Convert Euler angles to real unit quaternion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
str
|
Rotation code string. |
required |
e
|
array_like
|
Euler angles. Shape (K,) or (K, N) where K is the number of xyz rotations in m. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
q |
(ndarray, shape(4) or (4, N))
|
Quaternion(s) [w, x, y, z]. |
Source code in pyvoicebox/v_roteu2qr.py
v_rotqr2eu
¶
V_ROTQR2EU - convert real quaternion to Euler angles.
v_rotqr2eu
¶
Convert real quaternion to Euler angles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
str
|
Rotation code string. |
required |
q
|
(array_like, shape(4) or (4, N))
|
Quaternion(s) [w, x, y, z]. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
e |
(ndarray, shape(K) or (K, N))
|
Euler angles. |
Source code in pyvoicebox/v_rotqr2eu.py
v_roteu2ro
¶
V_ROTEU2RO - convert Euler angles to rotation matrix.
v_roteu2ro
¶
Convert Euler angles to rotation matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
str
|
Rotation code string. |
required |
e
|
array_like
|
Euler angles. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
r |
(ndarray, shape(3, 3) or (3, 3, N))
|
Rotation matrix/matrices. |
Source code in pyvoicebox/v_roteu2ro.py
v_rotro2eu
¶
V_ROTRO2EU - convert rotation matrix to Euler angles.
v_rotro2eu
¶
Convert rotation matrix to Euler angles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
str
|
Rotation code string. |
required |
r
|
(array_like, shape(3, 3) or (3, 3, N))
|
Rotation matrix/matrices. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
e |
(ndarray, shape(K) or (K, N))
|
Euler angles. |
Source code in pyvoicebox/v_rotro2eu.py
v_rotro2qr
¶
V_ROTRO2QR - convert 3x3 rotation matrix to real quaternion.
v_rotro2qr
¶
Convert 3x3 rotation matrix to real quaternion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
r
|
(array_like, shape(3, 3) or (3, 3, N))
|
Rotation matrix/matrices. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
q |
(ndarray, shape(4) or (4, N))
|
Quaternion(s) [w, x, y, z]. |
Source code in pyvoicebox/v_rotro2qr.py
v_rotqr2ro
¶
V_ROTQR2RO - convert real quaternion to 3x3 rotation matrix.
v_rotqr2ro
¶
Convert real quaternion to 3x3 rotation matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q
|
(array_like, shape(4) or (4, N))
|
Real quaternion(s) [w, x, y, z]. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
r |
(ndarray, shape(3, 3) or (3, 3, N))
|
Rotation matrix/matrices. |
Source code in pyvoicebox/v_rotqr2ro.py
v_rotmr2qr
¶
V_ROTMR2QR - convert real quaternion matrices to quaternion vectors.
v_rotmr2qr
¶
Convert real quaternion matrix form to real quaternion vector form.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mr
|
array_like, shape (4m, 4n, ...)
|
Real quaternion matrices. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
qr |
ndarray, shape (4m,) or (4m, n, ...)
|
Real quaternion vectors. |
Source code in pyvoicebox/v_rotmr2qr.py
v_rotqr2mr
¶
V_ROTQR2MR - convert real quaternion vectors to quaternion matrices.
v_rotqr2mr
¶
Convert real quaternion vector form to real quaternion matrix form.
Each quaternion [w, x, y, z] becomes a 4x4 matrix: [[ w, -x, -y, -z], [ x, w, -z, y], [ y, z, w, -x], [ z, -y, x, w]]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qr
|
array_like, shape (4m,) or (4m, n, ...)
|
Real quaternion vectors. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
mr |
ndarray, shape (4m, 4) or (4m, 4n, ...)
|
Real quaternion matrices. |
Source code in pyvoicebox/v_rotqr2mr.py
v_rotmc2qc
¶
V_ROTMC2QC - convert complex quaternion matrices to complex quaternion vectors.
v_rotmc2qc
¶
Convert complex quaternion matrix form to complex quaternion vector form.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mc
|
array_like, shape (2m, 2n, ...)
|
Complex quaternion matrices. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
qc |
ndarray, shape (2m, n, ...) or (2m,) if n=1
|
Complex quaternion vectors. |
Source code in pyvoicebox/v_rotmc2qc.py
v_rotqc2mc
¶
V_ROTQC2MC - convert complex quaternion vectors to complex quaternion matrices.
v_rotqc2mc
¶
Convert complex quaternion vector form to complex quaternion matrix form.
Each quaternion r+ai+bj+ck is stored as a 2x1 complex vector [r+bi, a+ci]. The matrix form is [[r+bi, -a+ci], [a+ci, r-bi]].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qc
|
array_like, shape (2m,) or (2m, n, ...)
|
Complex quaternion vectors. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
mc |
ndarray, shape (2m, 2) or (2m, 2n, ...)
|
Complex quaternion matrices. |
Source code in pyvoicebox/v_rotqc2mc.py
v_rotqc2qr
¶
V_ROTQC2QR - convert complex quaternion to real quaternion.
v_rotqc2qr
¶
Convert complex quaternion [r+jb, a+jc] to real [r, a, b, c].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qc
|
array_like, shape (2m, ...)
|
Complex quaternion vectors. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
qr |
ndarray, shape (4m, ...)
|
Real quaternion vectors. |
Source code in pyvoicebox/v_rotqc2qr.py
v_rotqr2qc
¶
V_ROTQR2QC - convert real quaternion to complex quaternion.
v_rotqr2qc
¶
Convert real quaternion [r, a, b, c] to complex [r+jb, a+jc].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qr
|
array_like, shape (4m, ...)
|
Real quaternion vectors. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
qc |
ndarray, shape (2m, ...)
|
Complex quaternion vectors. |
Source code in pyvoicebox/v_rotqr2qc.py
v_rotax2qr
¶
V_ROTAX2QR - convert rotation axis and angle to quaternion.
v_rotax2qr
¶
Convert rotation axis and angle to quaternion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
(array_like, shape(3))
|
Rotation axis vector (need not be unit length). |
required |
t
|
float
|
Rotation angle in radians. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
q |
(ndarray, shape(4))
|
Quaternion [w, x, y, z]. |
Source code in pyvoicebox/v_rotax2qr.py
v_rotqr2ax
¶
V_ROTQR2AX - convert quaternion to rotation axis and angle.
v_rotqr2ax
¶
Convert quaternion to rotation axis and angle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q
|
(array_like, shape(4))
|
Quaternion [w, x, y, z]. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
a |
(ndarray, shape(3))
|
Unit rotation axis vector. |
t |
float
|
Rotation angle in radians (0 to 2*pi). |
Source code in pyvoicebox/v_rotqr2ax.py
v_rotpl2ro
¶
V_ROTPL2RO - find rotation matrix from plane vectors.
v_rotpl2ro
¶
Find rotation matrix to rotate in the plane containing u and v.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
u
|
(array_like, shape(n))
|
First vector defining the rotation plane. |
required |
v
|
(array_like, shape(n))
|
Second vector defining the rotation plane. |
required |
t
|
float
|
Rotation angle in radians. If omitted, defaults to the angle between u and v. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
r |
(ndarray, shape(n, n))
|
Rotation matrix. |
Source code in pyvoicebox/v_rotpl2ro.py
v_rotro2pl
¶
V_ROTRO2PL - find plane and rotation angle of a rotation matrix.
v_rotro2pl
¶
Find the plane and rotation angle of a rotation matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
r
|
(array_like, shape(n, n))
|
Rotation matrix. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
u |
(ndarray, shape(n))
|
First orthonormal vector defining the rotation plane. |
v |
(ndarray, shape(n))
|
Second orthonormal vector or rotated u. |
t |
float
|
Rotation angle in radians (0 <= t <= pi). |
Source code in pyvoicebox/v_rotro2pl.py
v_rotlu2ro
¶
V_ROTLU2RO - convert look and up directions to rotation matrix.
v_rotlu2ro
¶
Convert look and up directions to a rotation matrix.
The rotation maps the look direction to the negative z-axis and the up direction to lie in the y-z plane with a positive y component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
l
|
(array_like, shape(3) or (3, N))
|
Look direction vector(s). |
required |
u
|
(array_like, shape(3) or (3, N))
|
Up direction vector(s). Default is [0, 0, 1] unless l is a multiple of this, in which case [0, 1, 0]. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
r |
(ndarray, shape(3, 3) or (3, 3, N))
|
Rotation matrix/matrices. |
Source code in pyvoicebox/v_rotlu2ro.py
v_rotro2lu
¶
V_ROTRO2LU - convert rotation matrix to look and up directions.
v_rotro2lu
¶
Convert rotation matrix to look and up directions.
The rotation maps the look direction to the negative z-axis and the up direction to lie in the y-z plane with a positive y component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
r
|
(array_like, shape(3, 3) or (3, 3, N))
|
Rotation matrix/matrices. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
l |
(ndarray, shape(3) or (3, N))
|
Look direction vector(s). |
u |
(ndarray, shape(3) or (3, N))
|
Up direction vector(s). |
Source code in pyvoicebox/v_rotro2lu.py
v_roteucode
¶
V_ROTEUCODE - decode Euler angle rotation code string.
v_roteucode
¶
Decode a string specifying a rotation axis sequence.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
m
|
str
|
Rotation code string. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
mv |
(ndarray, shape(7, k))
|
Decoded rotation parameters where k-1 is the number of rotations. mv[0, j] = rotation code (1-indexed: 1,2,3 for x,y,z; 4-12 for fixed) mv[1, j] = index into euler angle array (1-indexed) mv[2, j] = rotation class (pattern ID, 1-indexed) mv[3, j] = index into vectorized matrix (1-indexed) mv[4, j] = index of other changing element mv[5, j] = sign of sine term mv[6, j] = sign of entry before rotation / inversion flag (last col) mv[3, -1] = scale factor for euler angles mv[6, -1] = -1 to invert rotation (transpose matrix) or +1 |
Source code in pyvoicebox/v_roteucode.py
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | |
v_rotation
¶
V_ROTATION - encode and decode rotation matrices.
v_rotation
¶
Create or decompose a rotation matrix.
(1) r = v_rotation(x, y, angle): rotation in the plane of x and y (2) axis, angle = v_rotation®: decompose 3x3 rotation matrix (3) r = v_rotation(axis, angle): rotation about axis (3D only) (4) r = v_rotation(axis_times_angle): rotation about axis (3D only)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
array_like
|
First vector, rotation matrix, or axis*angle vector. |
required |
y
|
array_like or float
|
Second vector or angle. |
None
|
z
|
float
|
Rotation angle. |
None
|
Returns:
| Type | Description |
|---|---|
Depends on usage mode; see above.
|
|
Source code in pyvoicebox/v_rotation.py
Quaternion arithmetic and mean¶
v_rotqrmean
¶
V_ROTQRMEAN - calculate mean rotation of quaternion array.
v_rotqrmean
¶
Calculate the mean rotation of a quaternion array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q
|
(array_like, shape(4, n))
|
Normalized real quaternion array. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
y |
(ndarray, shape(4))
|
Normalized mean quaternion. |
s |
(ndarray, shape(n))
|
Sign vector such that y = normalize(q @ s). |
v |
float
|
Average squared deviation from the mean quaternion. |
Source code in pyvoicebox/v_rotqrmean.py
v_rotqrvec
¶
V_ROTQRVEC - rotate vectors by quaternion.
v_rotqrvec
¶
Apply a quaternion rotation to a vector array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q
|
(array_like, shape(4))
|
Quaternion [w, x, y, z] (possibly unnormalized). |
required |
x
|
array_like
|
Array of 3D column vectors, shape (3n, ...). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
y |
ndarray
|
Rotated vectors, same shape as x. |
Source code in pyvoicebox/v_rotqrvec.py
v_qrmult
¶
V_QRMULT - Multiply two real quaternion matrices.
v_qrmult
¶
Multiply two real quaternion matrices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q1
|
array_like, shape (4m, n)
|
First quaternion matrix. |
required |
q2
|
array_like, shape (4n, r)
|
Second quaternion matrix. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
q |
ndarray, shape (4m, r)
|
Matrix product. |
Source code in pyvoicebox/v_qrmult.py
v_qrdivide
¶
V_QRDIVIDE - Divide two real quaternions.
v_qrdivide
¶
Divide two real quaternions: q = q1/q2 such that q1 = q*q2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q1
|
(array_like, shape(4))
|
First quaternion [r, i, j, k]. |
required |
q2
|
(array_like, shape(4))
|
Second quaternion. If omitted, returns inverse of q1. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
q |
(ndarray, shape(4))
|
Quotient quaternion. |
Source code in pyvoicebox/v_qrdivide.py
v_qrdotmult
¶
V_QRDOTMULT - Element-wise quaternion multiplication.
v_qrdotmult
¶
Multiply two real quaternion arrays element-wise (Hadamard product).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q1
|
array_like, shape (4n, ...)
|
First quaternion array. |
required |
q2
|
array_like, shape (4n, ...)
|
Second quaternion array. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
q |
ndarray, shape (4n, ...)
|
Element-wise quaternion product. |
Source code in pyvoicebox/v_qrdotmult.py
v_qrdotdiv
¶
V_QRDOTDIV - Element-wise quaternion division.
v_qrdotdiv
¶
Divide two real quaternion arrays element-wise.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
array_like, shape (4n, ...)
|
First quaternion array. |
required |
y
|
array_like, shape (4n, ...)
|
Second quaternion array. If omitted, returns inverse of x. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
q |
ndarray, shape (4n, ...)
|
Element-wise quaternion quotient. |
Source code in pyvoicebox/v_qrdotdiv.py
v_qrabs
¶
V_QRABS - Absolute value and normalization of real quaternions.
v_qrabs
¶
Absolute value and normalization of real quaternions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q1
|
array_like, shape (4n, ...)
|
Real quaternion array. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
m |
(ndarray, shape(n, ...))
|
Quaternion magnitudes. |
q |
ndarray, shape (4n, ...)
|
Normalized quaternions (unit magnitude). |
Source code in pyvoicebox/v_qrabs.py
v_qrpermute
¶
V_QRPERMUTE - Transpose or permute a quaternion array.
v_qrpermute
¶
Transpose or permute a quaternion array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
array_like, shape (4m, ...)
|
Real quaternion array. |
required |
p
|
array_like
|
New order of dimensions (0-based). Default transposes first two dims. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
y |
ndarray
|
Permuted quaternion array. |
Source code in pyvoicebox/v_qrpermute.py
Geometry¶
v_polygonarea
¶
V_POLYGONAREA - calculate polygon area.
v_polygonarea
¶
Calculate the area of a polygon using the shoelace formula.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p
|
(array_like, shape(n, 2))
|
Polygon vertices. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
a |
float
|
Signed area (positive if vertices are counter-clockwise). |
Source code in pyvoicebox/v_polygonarea.py
v_polygonwind
¶
V_POLYGONWIND - test if points are inside a polygon.
v_polygonwind
¶
Calculate the winding number for points with respect to a polygon.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p
|
(array_like, shape(n, 2))
|
Polygon vertices. |
required |
x
|
(array_like, shape(m, 2))
|
Points to test. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
w |
(ndarray, shape(m))
|
Winding number for each point. For a CCW polygon, 0=outside, 1=inside. |
Source code in pyvoicebox/v_polygonwind.py
v_polygonxline
¶
V_POLYGONXLINE - find where a line crosses a polygon.
v_polygonxline
¶
Find where a line crosses a polygon.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p
|
(array_like, shape(n, 2))
|
Polygon vertices. |
required |
l
|
(array_like, shape(3))
|
Line in the form l @ [x, y, 1] = 0. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
xc |
(ndarray, shape(k, 2))
|
Crossing point coordinates. |
ec |
(ndarray, shape(k))
|
Edge indices (1-indexed) where crossings occur. |
tc |
(ndarray, shape(k))
|
Parametric positions along the line. |
xy0 |
(ndarray, shape(2))
|
Starting point of the parametric line. |
Source code in pyvoicebox/v_polygonxline.py
v_minspane
¶
V_MINSPANE - minimum spanning tree using Euclidean distance.
v_minspane
¶
Calculate minimum spanning tree using Euclidean distance.
Uses Delaunay triangulation to find candidate edges, then applies Kruskal's algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
(array_like, shape(n, d))
|
d-dimensional data points. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
p |
(ndarray, shape(n - 1))
|
Parent node indices (1-indexed). Node n is the root. |
s |
(ndarray, shape(n - 1))
|
Edge indices sorted by ascending Euclidean distance (1-indexed). |
Source code in pyvoicebox/v_minspane.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
v_imagehomog
¶
V_IMAGEHOMOG - apply homography transformation to an image.
v_imagehomog
¶
Apply a homography transformation to an image with bilinear interpolation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
im
|
(ndarray, shape(ny, nx) or (ny, nx, nc))
|
Input image (uint8). |
required |
h
|
(ndarray, shape(3, 3))
|
Homography matrix. Default is identity. |
None
|
m
|
str
|
Mode string: 'c' central coordinates, 'k' clip to original, 'x' extend, 't' trim blank rows/cols. |
''
|
clip
|
array_like
|
Clipping specification. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ih |
ndarray
|
Transformed image (uint8). |
xa |
ndarray
|
X axis coordinates. |
ya |
ndarray
|
Y axis coordinates. |
Source code in pyvoicebox/v_imagehomog.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
v_rectifyhomog
¶
V_RECTIFYHOMOG - apply rectifying homographies to an image set.
v_rectifyhomog
¶
Apply rectifying homographies to an image set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ims
|
list of ndarray
|
List of input images. |
required |
roc
|
(ndarray, shape(3, 3) or (3, 3, nc))
|
Rotation matrices from world to camera coordinates. |
None
|
k0
|
float or ndarray
|
Camera matrix or focal length. |
None
|
mode
|
str
|
Mode string. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
imr |
list of ndarray
|
Rectified images. |
xa |
list of ndarray
|
X axis for each image. |
ya |
list of ndarray
|
Y axis for each image. |
Source code in pyvoicebox/v_rectifyhomog.py
v_skew3d
¶
V_SKEW3D - convert between vector and skew-symmetric matrix.
v_skew3d
¶
Convert between a vector and the corresponding skew-symmetric matrix.
v_skew3d is its own inverse: v_skew3d(v_skew3d(x)) == x.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
array_like
|
Input vector or matrix. Size must be (3,), (3, 3), (6,), or (4, 4). |
required |
m
|
str
|
Mode string: 'n' normalize, 'z' orthogonalize. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
y |
ndarray
|
Output matrix or vector. |
Source code in pyvoicebox/v_skew3d.py
v_upolyhedron
¶
V_UPOLYHEDRON - calculate uniform polyhedron characteristics.
This is a simplified implementation that supports the most common polyhedra by name or index. The full MATLAB implementation supports all 75+ uniform polyhedra with Wythoff symbol computation.
v_upolyhedron
¶
Calculate uniform polyhedron characteristics.
This is a simplified implementation supporting common polyhedra.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
w
|
int or str
|
Polyhedron specification (index or name). |
required |
md
|
str
|
Mode string. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
vlist |
ndarray
|
Vertex list with columns [x, y, z, d, n, e, t]. |
Source code in pyvoicebox/v_upolyhedron.py
v_sphrharm
¶
V_SPHRHARM - Forward and inverse spherical harmonic transform (stub).
The full implementation is very complex. A basic stub is provided.
v_sphrharm
¶
Forward and inverse spherical harmonic transform.
This is a complex function with many modes. A basic version is available through scipy.special.sph_harm for individual harmonics.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Full spherical harmonic transform implementation pending. Use scipy.special.sph_harm for individual harmonics. |