camera-client 0.2.1__tar.gz → 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: camera-client
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: Python SDK for camera calibration and projection transformations - handle lens distortion, coordinate transformations, and 3D ray casting with symbolic expressions.
5
5
  Author-email: Alexander Abramov <extremal.ru@gmail.com>
6
6
  License: MIT
@@ -334,8 +334,17 @@ The calibration file is a NumPy `.npz` archive containing:
334
334
  - `exp_im2ray`: Image to ray direction transformation
335
335
 
336
336
  ### Metadata
337
- - `im_width`, `im_height`: Image dimensions in pixels
337
+ - `format_version`: Version string of the data format
338
+ - `camera_id`: Integer identifier for the camera
339
+ - `plan_url`: URL or path to the ground plan image
338
340
  - `plan_scale`: Scale factor for ground plane coordinates (pixels per meter)
341
+ - `plan_width`: Width of the ground plan in pixels
342
+ - `plan_height`: Height of the ground plan in pixels
343
+ - `im_src_url`: URL or path to the source (distorted) camera image
344
+ - `im_ctd_url`: URL or path to the corrected (undistorted) camera image
345
+ - `im_width`: Width of the camera image in pixels
346
+ - `im_height`: Height of the camera image in pixels
347
+ - `ctd_geometry`: JSON object with geometry data in CTD coordinates (efov_polygons, counting_lines)
339
348
 
340
349
  ## Requirements
341
350
 
@@ -304,8 +304,17 @@ The calibration file is a NumPy `.npz` archive containing:
304
304
  - `exp_im2ray`: Image to ray direction transformation
305
305
 
306
306
  ### Metadata
307
- - `im_width`, `im_height`: Image dimensions in pixels
307
+ - `format_version`: Version string of the data format
308
+ - `camera_id`: Integer identifier for the camera
309
+ - `plan_url`: URL or path to the ground plan image
308
310
  - `plan_scale`: Scale factor for ground plane coordinates (pixels per meter)
311
+ - `plan_width`: Width of the ground plan in pixels
312
+ - `plan_height`: Height of the ground plan in pixels
313
+ - `im_src_url`: URL or path to the source (distorted) camera image
314
+ - `im_ctd_url`: URL or path to the corrected (undistorted) camera image
315
+ - `im_width`: Width of the camera image in pixels
316
+ - `im_height`: Height of the camera image in pixels
317
+ - `ctd_geometry`: JSON object with geometry data in CTD coordinates (efov_polygons, counting_lines)
309
318
 
310
319
  ## Requirements
311
320
 
@@ -29,7 +29,16 @@ class CameraProjection:
29
29
  """
30
30
  data = cam_archive_data
31
31
 
32
+ self.camera_id = data["camera_id"]
33
+ self.ctd_geometry = data["ctd_geometry"]
34
+
32
35
  self.plan_scale = float(data["plan_scale"])
36
+ self.plan_url = str(data["plan_url"])
37
+ self.plan_width = int(data["plan_width"])
38
+ self.plan_height = int(data["plan_height"])
39
+
40
+ self.im_src_url = str(data["im_src_url"])
41
+ self.im_ctd_url = str(data["im_ctd_url"])
33
42
  self.im_width = int(data["im_width"])
34
43
  self.im_height = int(data["im_height"])
35
44
  self.im_wh_size = (self.im_width, self.im_height)
@@ -1,3 +1,4 @@
1
+ import json
1
2
  import numpy as np
2
3
  import sympy as sp
3
4
 
@@ -11,9 +12,16 @@ def read_npz_file(filename):
11
12
 
12
13
  Returns:
13
14
  dict: Dictionary containing the following keys:
15
+ - format_version (str): Version string of the data format
16
+ - camera_id (int): Integer identifier for the camera
17
+ - plan_url (str): URL or path to the ground plan image
14
18
  - plan_scale (float): Scale factor for ground plane coordinates (pixels per meter)
15
- - im_width (int): Width of the image in pixels
16
- - im_height (int): Height of the image in pixels
19
+ - plan_width (int): Width of the ground plan in pixels
20
+ - plan_height (int): Height of the ground plan in pixels
21
+ - im_src_url (str): URL or path to the source (distorted) camera image
22
+ - im_ctd_url (str): URL or path to the corrected (undistorted) camera image
23
+ - im_width (int): Width of the camera image in pixels
24
+ - im_height (int): Height of the camera image in pixels
17
25
  - src2ctd (np.ndarray): Map of coordinates for undistorted (corrected) image.
18
26
  Shape: (height, width, 2) where channel 0 is X, channel 1 is Y
19
27
  - ctd2src (np.ndarray): Map of coordinates for distorted (raw) image based on undistorted.
@@ -25,10 +33,24 @@ def read_npz_file(filename):
25
33
  - exp_gnd2im (sp.Expr): Sympy expression for ground to image coordinate transformation
26
34
  - exp_key_point (sp.Expr): Sympy expression for keypoint coordinates
27
35
  - exp_im2ray (sp.Expr): Sympy expression for image to ray direction transformation
36
+ - ctd_geometry (dict): JSON object containing geometry data in CTD coordinate system:
37
+ - efov_polygons: Polygons defining effective field of view in CTD coordinates
38
+ - counting_lines: Polylines for counting forward/backward track intersections
28
39
  """
29
40
  data = np.load(filename)
30
41
 
42
+ format_version = str(data["format_version"])
43
+ camera_id = int(data["camera_id"])
44
+
45
+ # Plan options
46
+ plan_url = str(data["plan_url"])
31
47
  plan_scale = data["plan_scale"]
48
+ plan_width = data["plan_width"]
49
+ plan_height = data["plan_height"]
50
+
51
+ # Camera image options
52
+ im_src_url = str(data["im_src_url"])
53
+ im_ctd_url = str(data["im_ctd_url"])
32
54
  im_width = data["im_width"]
33
55
  im_height = data["im_height"]
34
56
 
@@ -46,20 +68,36 @@ def read_npz_file(filename):
46
68
  exp_key_point = sp.sympify(str(data["exp_key_point"]))
47
69
  exp_im2ray = sp.sympify(str(data["exp_im2ray"]))
48
70
 
71
+ # Ctd image geometry
72
+ ctd_geometry = json.loads(str(data["ctd_geometry"]))
73
+
49
74
  # Don't forget to close the file
50
75
  data.close()
51
76
 
52
77
  return {
78
+ "camera_id": camera_id,
79
+ # Plan options
80
+ "plan_url": plan_url,
53
81
  "plan_scale": plan_scale,
82
+ "plan_width": plan_width,
83
+ "plan_height": plan_height,
84
+ # Camera image option
85
+ "im_src_url": im_src_url,
86
+ "im_ctd_url": im_ctd_url,
54
87
  "im_width": im_width,
55
88
  "im_height": im_height,
89
+ # Distortion coords maps
56
90
  "src2ctd": src2ctd,
57
91
  "ctd2src": ctd2src,
58
- "map_scale_h": map_scale_h,
59
- "map_scale_w": map_scale_w,
60
- "map_scale_vang": map_scale_vang,
92
+ # Perspective projection expressions
61
93
  "exp_im2gnd": exp_im2gnd,
62
94
  "exp_gnd2im": exp_gnd2im,
63
95
  "exp_key_point": exp_key_point,
64
96
  "exp_im2ray": exp_im2ray,
97
+ # Scale maps
98
+ "map_scale_h": map_scale_h,
99
+ "map_scale_w": map_scale_w,
100
+ "map_scale_vang": map_scale_vang,
101
+ # Ctd image geometry
102
+ "ctd_geometry": ctd_geometry,
65
103
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: camera-client
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: Python SDK for camera calibration and projection transformations - handle lens distortion, coordinate transformations, and 3D ray casting with symbolic expressions.
5
5
  Author-email: Alexander Abramov <extremal.ru@gmail.com>
6
6
  License: MIT
@@ -334,8 +334,17 @@ The calibration file is a NumPy `.npz` archive containing:
334
334
  - `exp_im2ray`: Image to ray direction transformation
335
335
 
336
336
  ### Metadata
337
- - `im_width`, `im_height`: Image dimensions in pixels
337
+ - `format_version`: Version string of the data format
338
+ - `camera_id`: Integer identifier for the camera
339
+ - `plan_url`: URL or path to the ground plan image
338
340
  - `plan_scale`: Scale factor for ground plane coordinates (pixels per meter)
341
+ - `plan_width`: Width of the ground plan in pixels
342
+ - `plan_height`: Height of the ground plan in pixels
343
+ - `im_src_url`: URL or path to the source (distorted) camera image
344
+ - `im_ctd_url`: URL or path to the corrected (undistorted) camera image
345
+ - `im_width`: Width of the camera image in pixels
346
+ - `im_height`: Height of the camera image in pixels
347
+ - `ctd_geometry`: JSON object with geometry data in CTD coordinates (efov_polygons, counting_lines)
339
348
 
340
349
  ## Requirements
341
350
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "camera-client"
7
- version = "0.2.1"
7
+ version = "0.2.3"
8
8
  description = "Python SDK for camera calibration and projection transformations - handle lens distortion, coordinate transformations, and 3D ray casting with symbolic expressions."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.7"
File without changes
File without changes
File without changes
File without changes