courtvision.vis
load_image(file_name)
Loads the image with OpenCV.
Source code in courtvision/vis.py
245 246 247 248 249 250 251 |
|
load_timg(file_name)
Loads the image with OpenCV and converts to torch.Tensor.
Source code in courtvision/vis.py
238 239 240 241 242 |
|
log_court_layout(camera_matrix, image_width, image_height, translation_vector, rotation_vector, court_mesh_path)
summary
Parameters:
Name | Type | Description | Default |
---|---|---|---|
camera_matrix |
np.array
|
description |
required |
image_width |
int
|
description |
required |
image_height |
int
|
description |
required |
translation_vector |
np.array
|
description |
required |
rotation_vector |
np.array
|
description |
required |
court_mesh_path |
Path
|
description |
required |
Source code in courtvision/vis.py
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 |
|
plot_3d_lines(xs, ys, zs, plt_axis=None, view_init=(90.0, 0.0, 0.0))
plots lines on a Axes3D
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xs |
np.array
|
array of x start and stop coordinates |
required |
ys |
np.array
|
array of y start and stop coordinates |
required |
zs |
np.array
|
array of z start and stop coordinates |
required |
plt_axis |
None | Axes3D
|
Axes3D to draw on. If not given one will be created Defaults to None. |
None
|
view_init |
tuple[float, float, float]
|
Position of the camera to view. Defaults to (90., 0., 0.). |
(90.0, 0.0, 0.0)
|
Returns:
Name | Type | Description |
---|---|---|
Axes3D |
Axes3D
|
matplotlib ax that can be added to or shown. |
Source code in courtvision/vis.py
202 203 204 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 |
|
plot_coords(img, src_coords, show=True, thickness=2)
Draws lines on 'img'.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
img |
np.array
|
description |
required |
src_coords |
np.array
|
description |
required |
show |
bool
|
description. Defaults to True. |
True
|
Source code in courtvision/vis.py
160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
|
plot_n_images_in_a_grid(images, n_cols=3)
draws a grid of images
Parameters:
Name | Type | Description | Default |
---|---|---|---|
images |
list[np.array]
|
images to draw on - this is inplace |
required |
n_cols |
int
|
number of cols. Defaults to 3. |
3
|
Returns:
Name | Type | Description |
---|---|---|
tuple |
fig, ax
|
matplotlib fig and ax |
Source code in courtvision/vis.py
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
|