@photivra/engine 0.2.0 → 0.4.0

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.
Files changed (89) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/CITATION.cff +1 -1
  3. package/README.md +58 -10
  4. package/dist/camera/equivalent-focal-length.d.ts +34 -0
  5. package/dist/camera/equivalent-focal-length.d.ts.map +1 -0
  6. package/dist/camera/equivalent-focal-length.js +33 -0
  7. package/dist/camera/equivalent-focal-length.js.map +1 -0
  8. package/dist/camera/field-of-view.d.ts +40 -3
  9. package/dist/camera/field-of-view.d.ts.map +1 -1
  10. package/dist/camera/field-of-view.js +66 -24
  11. package/dist/camera/field-of-view.js.map +1 -1
  12. package/dist/core/calculation-result.d.ts.map +1 -1
  13. package/dist/core/calculation-result.js +14 -2
  14. package/dist/core/calculation-result.js.map +1 -1
  15. package/dist/core/configuration-error.d.ts +9 -0
  16. package/dist/core/configuration-error.d.ts.map +1 -0
  17. package/dist/core/configuration-error.js +13 -0
  18. package/dist/core/configuration-error.js.map +1 -0
  19. package/dist/core/evidence-provenance.d.ts +40 -0
  20. package/dist/core/evidence-provenance.d.ts.map +1 -0
  21. package/dist/core/evidence-provenance.js +79 -0
  22. package/dist/core/evidence-provenance.js.map +1 -0
  23. package/dist/core/image-formation.d.ts +70 -0
  24. package/dist/core/image-formation.d.ts.map +1 -0
  25. package/dist/core/image-formation.js +335 -0
  26. package/dist/core/image-formation.js.map +1 -0
  27. package/dist/index.d.ts +15 -3
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +15 -3
  30. package/dist/index.js.map +1 -1
  31. package/dist/motion/camera-rotation.d.ts +91 -0
  32. package/dist/motion/camera-rotation.d.ts.map +1 -0
  33. package/dist/motion/camera-rotation.js +157 -0
  34. package/dist/motion/camera-rotation.js.map +1 -0
  35. package/dist/optics/focus-breathing.d.ts +73 -0
  36. package/dist/optics/focus-breathing.d.ts.map +1 -0
  37. package/dist/optics/focus-breathing.js +77 -0
  38. package/dist/optics/focus-breathing.js.map +1 -0
  39. package/dist/optics/illumination-vignetting.d.ts +59 -0
  40. package/dist/optics/illumination-vignetting.d.ts.map +1 -0
  41. package/dist/optics/illumination-vignetting.js +107 -0
  42. package/dist/optics/illumination-vignetting.js.map +1 -0
  43. package/dist/optics/lateral-chromatic-aberration.d.ts +93 -0
  44. package/dist/optics/lateral-chromatic-aberration.d.ts.map +1 -0
  45. package/dist/optics/lateral-chromatic-aberration.js +174 -0
  46. package/dist/optics/lateral-chromatic-aberration.js.map +1 -0
  47. package/dist/optics/psf-foundation.d.ts +102 -0
  48. package/dist/optics/psf-foundation.d.ts.map +1 -0
  49. package/dist/optics/psf-foundation.js +164 -0
  50. package/dist/optics/psf-foundation.js.map +1 -0
  51. package/dist/optics/radial-distortion.d.ts +91 -0
  52. package/dist/optics/radial-distortion.d.ts.map +1 -0
  53. package/dist/optics/radial-distortion.js +198 -0
  54. package/dist/optics/radial-distortion.js.map +1 -0
  55. package/dist/output/capture-geometry.d.ts +225 -0
  56. package/dist/output/capture-geometry.d.ts.map +1 -0
  57. package/dist/output/capture-geometry.js +478 -0
  58. package/dist/output/capture-geometry.js.map +1 -0
  59. package/dist/schema/validation.d.ts +1 -8
  60. package/dist/schema/validation.d.ts.map +1 -1
  61. package/dist/schema/validation.js +2 -11
  62. package/dist/schema/validation.js.map +1 -1
  63. package/dist/sensor/architecture.d.ts +40 -0
  64. package/dist/sensor/architecture.d.ts.map +1 -0
  65. package/dist/sensor/architecture.js +98 -0
  66. package/dist/sensor/architecture.js.map +1 -0
  67. package/dist/sensor/radiometry-readiness.d.ts +111 -0
  68. package/dist/sensor/radiometry-readiness.d.ts.map +1 -0
  69. package/dist/sensor/radiometry-readiness.js +294 -0
  70. package/dist/sensor/radiometry-readiness.js.map +1 -0
  71. package/dist/sensor/sensor-geometry.d.ts +99 -0
  72. package/dist/sensor/sensor-geometry.d.ts.map +1 -0
  73. package/dist/sensor/sensor-geometry.js +71 -0
  74. package/dist/sensor/sensor-geometry.js.map +1 -0
  75. package/dist/simulation/poc-simulation.d.ts +93 -1
  76. package/dist/simulation/poc-simulation.d.ts.map +1 -1
  77. package/dist/simulation/poc-simulation.js +308 -24
  78. package/dist/simulation/poc-simulation.js.map +1 -1
  79. package/docs/API_STYLE.md +35 -2
  80. package/docs/ARCHITECTURE.md +179 -1
  81. package/docs/IMAGE_FORMATION.md +142 -0
  82. package/docs/MOTION_AND_SIGNAL.md +52 -1
  83. package/docs/PHYSICS_FOUNDATION.md +190 -3
  84. package/docs/POC_API.md +73 -7
  85. package/docs/PROVENANCE.md +24 -0
  86. package/docs/PSF_FOUNDATION.md +133 -0
  87. package/docs/STABILIZATION.md +17 -4
  88. package/docs/USAGE.md +657 -3
  89. package/package.json +1 -1
@@ -0,0 +1,91 @@
1
+ import { type CalculationResult } from "../core/calculation-result.js";
2
+ export interface RadialDistortionCoefficients {
3
+ /** Dimensionless r² coefficient. */
4
+ k1: number;
5
+ /** Dimensionless r⁴ coefficient. */
6
+ k2: number;
7
+ /** Dimensionless r⁶ coefficient. */
8
+ k3: number;
9
+ }
10
+ export interface RadialDistortionProfile {
11
+ /**
12
+ * Physical image-plane radius used to normalize field position, in mm.
13
+ * Coefficients are meaningful only with this declared normalization.
14
+ */
15
+ normalizationRadiusMm: number;
16
+ /**
17
+ * Maximum undistorted normalized radius over which this profile is declared
18
+ * valid and must remain one-to-one/invertible.
19
+ */
20
+ maximumNormalizedRadius: number;
21
+ coefficients: RadialDistortionCoefficients;
22
+ }
23
+ export interface LensFieldPointMm {
24
+ /** Image-plane X coordinate relative to the optical axis, in mm. */
25
+ x: number;
26
+ /** Image-plane Y coordinate relative to the optical axis, in mm. */
27
+ y: number;
28
+ }
29
+ export interface CalculateRadialDistortionMappingInput {
30
+ /** Ideal/undistorted image-plane point. */
31
+ imagePointMm: LensFieldPointMm;
32
+ profile: RadialDistortionProfile;
33
+ }
34
+ export interface CalculateInverseRadialDistortionMappingInput {
35
+ /** Distorted image-plane point to inverse-map back to ideal coordinates. */
36
+ distortedImagePointMm: LensFieldPointMm;
37
+ profile: RadialDistortionProfile;
38
+ }
39
+ export interface RadialDistortionMapping {
40
+ direction: "undistorted-to-distorted";
41
+ sourceImagePointMm: LensFieldPointMm;
42
+ mappedImagePointMm: LensFieldPointMm;
43
+ sourceNormalizedRadius: number;
44
+ mappedNormalizedRadius: number;
45
+ radialScale: number;
46
+ deltaMm: {
47
+ x: number;
48
+ y: number;
49
+ distance: number;
50
+ };
51
+ profileMinimumRadialDerivative: number;
52
+ }
53
+ export interface InverseRadialDistortionMapping {
54
+ direction: "distorted-to-undistorted";
55
+ distortedImagePointMm: LensFieldPointMm;
56
+ sourceImagePointMm: LensFieldPointMm;
57
+ distortedNormalizedRadius: number;
58
+ sourceNormalizedRadius: number;
59
+ radialScaleAtSource: number;
60
+ deltaMm: {
61
+ x: number;
62
+ y: number;
63
+ distance: number;
64
+ };
65
+ profileMinimumRadialDerivative: number;
66
+ }
67
+ /**
68
+ * Applies a generic radial lens-distortion field mapping to one ideal
69
+ * image-plane point.
70
+ *
71
+ * The mapping is rotationally symmetric about the optical axis:
72
+ *
73
+ * p_distorted = p_ideal * (1 + k1 r² + k2 r⁴ + k3 r⁶)
74
+ *
75
+ * where r is normalized by the caller-declared physical reference radius.
76
+ *
77
+ * The profile is accepted only when the radial mapping is strictly monotonic
78
+ * over its declared operating radius, which makes inverse destination-to-source
79
+ * sampling well-defined.
80
+ */
81
+ export declare function calculateRadialDistortionMapping(input: CalculateRadialDistortionMappingInput): CalculationResult<RadialDistortionMapping>;
82
+ /**
83
+ * Inverse-maps one distorted image-plane point to its ideal/undistorted source
84
+ * coordinate for destination-to-source renderer sampling.
85
+ *
86
+ * The same profile monotonicity requirement used by the forward mapping makes
87
+ * the inverse unique over the declared operating radius. A deterministic fixed
88
+ * bisection count is used rather than an unconstrained iterative solver.
89
+ */
90
+ export declare function calculateInverseRadialDistortionMapping(input: CalculateInverseRadialDistortionMappingInput): CalculationResult<InverseRadialDistortionMapping>;
91
+ //# sourceMappingURL=radial-distortion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radial-distortion.d.ts","sourceRoot":"","sources":["../../src/optics/radial-distortion.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,+BAA+B,CAAC;AAMvC,MAAM,WAAW,4BAA4B;IAC3C,oCAAoC;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,oCAAoC;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,oCAAoC;IACpC,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,uBAAuB,EAAE,MAAM,CAAC;IAChC,YAAY,EAAE,4BAA4B,CAAC;CAC5C;AAED,MAAM,WAAW,gBAAgB;IAC/B,oEAAoE;IACpE,CAAC,EAAE,MAAM,CAAC;IACV,oEAAoE;IACpE,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,qCAAqC;IACpD,2CAA2C;IAC3C,YAAY,EAAE,gBAAgB,CAAC;IAC/B,OAAO,EAAE,uBAAuB,CAAC;CAClC;AAED,MAAM,WAAW,4CAA4C;IAC3D,4EAA4E;IAC5E,qBAAqB,EAAE,gBAAgB,CAAC;IACxC,OAAO,EAAE,uBAAuB,CAAC;CAClC;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,0BAA0B,CAAC;IACtC,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE;QACP,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,8BAA8B,EAAE,MAAM,CAAC;CACxC;AAED,MAAM,WAAW,8BAA8B;IAC7C,SAAS,EAAE,0BAA0B,CAAC;IACtC,qBAAqB,EAAE,gBAAgB,CAAC;IACxC,kBAAkB,EAAE,gBAAgB,CAAC;IACrC,yBAAyB,EAAE,MAAM,CAAC;IAClC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,OAAO,EAAE;QACP,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,8BAA8B,EAAE,MAAM,CAAC;CACxC;AA2JD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,qCAAqC,GAC3C,iBAAiB,CAAC,uBAAuB,CAAC,CAiD5C;AAED;;;;;;;GAOG;AACH,wBAAgB,uCAAuC,CACrD,KAAK,EAAE,4CAA4C,GAClD,iBAAiB,CAAC,8BAA8B,CAAC,CAiFnD"}
@@ -0,0 +1,198 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ import { approximationResult } from "../core/calculation-result.js";
3
+ import { InvalidScientificInputError, requirePositiveFinite } from "../core/validation.js";
4
+ const INVERSE_BISECTION_ITERATIONS = 80;
5
+ function requireFinite(name, value) {
6
+ if (!Number.isFinite(value)) {
7
+ throw new InvalidScientificInputError(`${name} must be finite.`);
8
+ }
9
+ }
10
+ function radialScale(normalizedRadius, coefficients) {
11
+ const r2 = normalizedRadius * normalizedRadius;
12
+ const r4 = r2 * r2;
13
+ const r6 = r4 * r2;
14
+ return (1 +
15
+ coefficients.k1 * r2 +
16
+ coefficients.k2 * r4 +
17
+ coefficients.k3 * r6);
18
+ }
19
+ function mappedNormalizedRadius(normalizedRadius, coefficients) {
20
+ return normalizedRadius * radialScale(normalizedRadius, coefficients);
21
+ }
22
+ function radialDerivativeFromSquaredRadius(squaredRadius, coefficients) {
23
+ return (1 +
24
+ 3 * coefficients.k1 * squaredRadius +
25
+ 5 * coefficients.k2 * squaredRadius * squaredRadius +
26
+ 7 *
27
+ coefficients.k3 *
28
+ squaredRadius *
29
+ squaredRadius *
30
+ squaredRadius);
31
+ }
32
+ function derivativeCriticalSquaredRadii(coefficients) {
33
+ // d/dr² of the radial derivative:
34
+ // 3 k1 + 10 k2 s + 21 k3 s² = 0, where s = r².
35
+ const a = 21 * coefficients.k3;
36
+ const b = 10 * coefficients.k2;
37
+ const c = 3 * coefficients.k1;
38
+ if (a === 0) {
39
+ return b === 0 ? [] : [-c / b];
40
+ }
41
+ const discriminant = b * b - 4 * a * c;
42
+ if (discriminant < 0) {
43
+ return [];
44
+ }
45
+ const root = Math.sqrt(discriminant);
46
+ return [(-b - root) / (2 * a), (-b + root) / (2 * a)];
47
+ }
48
+ function validateProfile(profile) {
49
+ requirePositiveFinite("profile.normalizationRadiusMm", profile.normalizationRadiusMm);
50
+ requirePositiveFinite("profile.maximumNormalizedRadius", profile.maximumNormalizedRadius);
51
+ requireFinite("profile.coefficients.k1", profile.coefficients.k1);
52
+ requireFinite("profile.coefficients.k2", profile.coefficients.k2);
53
+ requireFinite("profile.coefficients.k3", profile.coefficients.k3);
54
+ const maximumSquaredRadius = profile.maximumNormalizedRadius * profile.maximumNormalizedRadius;
55
+ const candidates = [
56
+ 0,
57
+ maximumSquaredRadius,
58
+ ...derivativeCriticalSquaredRadii(profile.coefficients).filter((value) => value > 0 && value < maximumSquaredRadius)
59
+ ];
60
+ const minimumRadialDerivative = Math.min(...candidates.map((squaredRadius) => radialDerivativeFromSquaredRadius(squaredRadius, profile.coefficients)));
61
+ if (!Number.isFinite(minimumRadialDerivative) ||
62
+ minimumRadialDerivative <= 0) {
63
+ throw new InvalidScientificInputError("Radial distortion profile must remain strictly monotonic over maximumNormalizedRadius so inverse mapping is single-valued.");
64
+ }
65
+ const maximumMappedRadius = mappedNormalizedRadius(profile.maximumNormalizedRadius, profile.coefficients);
66
+ if (!Number.isFinite(maximumMappedRadius) || maximumMappedRadius <= 0) {
67
+ throw new InvalidScientificInputError("Radial distortion profile produces an invalid mapped operating radius.");
68
+ }
69
+ return {
70
+ normalizationRadiusMm: profile.normalizationRadiusMm,
71
+ maximumNormalizedRadius: profile.maximumNormalizedRadius,
72
+ coefficients: { ...profile.coefficients },
73
+ minimumRadialDerivative,
74
+ maximumMappedNormalizedRadius: maximumMappedRadius
75
+ };
76
+ }
77
+ function requirePoint(name, point) {
78
+ requireFinite(`${name}.x`, point.x);
79
+ requireFinite(`${name}.y`, point.y);
80
+ }
81
+ function mappingAssumptions() {
82
+ return [
83
+ "Generic rotationally symmetric radial polynomial field mapping",
84
+ "Distortion is centered on the optical axis; decentering and tangential distortion are not modeled",
85
+ "Normalized radius is image-plane radius divided by the caller-declared normalizationRadiusMm",
86
+ "Radial scale is 1 + k1 r^2 + k2 r^4 + k3 r^6",
87
+ "The declared operating radius is required to remain strictly monotonic so inverse mapping is single-valued",
88
+ "Coefficients are generic caller inputs and do not represent a named lens unless separately calibrated with defensible provenance"
89
+ ];
90
+ }
91
+ /**
92
+ * Applies a generic radial lens-distortion field mapping to one ideal
93
+ * image-plane point.
94
+ *
95
+ * The mapping is rotationally symmetric about the optical axis:
96
+ *
97
+ * p_distorted = p_ideal * (1 + k1 r² + k2 r⁴ + k3 r⁶)
98
+ *
99
+ * where r is normalized by the caller-declared physical reference radius.
100
+ *
101
+ * The profile is accepted only when the radial mapping is strictly monotonic
102
+ * over its declared operating radius, which makes inverse destination-to-source
103
+ * sampling well-defined.
104
+ */
105
+ export function calculateRadialDistortionMapping(input) {
106
+ requirePoint("imagePointMm", input.imagePointMm);
107
+ const profile = validateProfile(input.profile);
108
+ const sourceRadiusMm = Math.hypot(input.imagePointMm.x, input.imagePointMm.y);
109
+ const sourceNormalizedRadius = sourceRadiusMm / profile.normalizationRadiusMm;
110
+ if (sourceNormalizedRadius > profile.maximumNormalizedRadius) {
111
+ throw new InvalidScientificInputError("imagePointMm lies outside the radial distortion profile maximumNormalizedRadius.");
112
+ }
113
+ const scale = radialScale(sourceNormalizedRadius, profile.coefficients);
114
+ const mappedImagePointMm = {
115
+ x: input.imagePointMm.x * scale,
116
+ y: input.imagePointMm.y * scale
117
+ };
118
+ const mappedRadius = sourceNormalizedRadius * scale;
119
+ const deltaX = mappedImagePointMm.x - input.imagePointMm.x;
120
+ const deltaY = mappedImagePointMm.y - input.imagePointMm.y;
121
+ return approximationResult({
122
+ direction: "undistorted-to-distorted",
123
+ sourceImagePointMm: { ...input.imagePointMm },
124
+ mappedImagePointMm,
125
+ sourceNormalizedRadius,
126
+ mappedNormalizedRadius: mappedRadius,
127
+ radialScale: scale,
128
+ deltaMm: {
129
+ x: deltaX,
130
+ y: deltaY,
131
+ distance: Math.hypot(deltaX, deltaY)
132
+ },
133
+ profileMinimumRadialDerivative: profile.minimumRadialDerivative
134
+ }, "generic-radial-lens-distortion", "1.0.0", mappingAssumptions());
135
+ }
136
+ /**
137
+ * Inverse-maps one distorted image-plane point to its ideal/undistorted source
138
+ * coordinate for destination-to-source renderer sampling.
139
+ *
140
+ * The same profile monotonicity requirement used by the forward mapping makes
141
+ * the inverse unique over the declared operating radius. A deterministic fixed
142
+ * bisection count is used rather than an unconstrained iterative solver.
143
+ */
144
+ export function calculateInverseRadialDistortionMapping(input) {
145
+ requirePoint("distortedImagePointMm", input.distortedImagePointMm);
146
+ const profile = validateProfile(input.profile);
147
+ const distortedRadiusMm = Math.hypot(input.distortedImagePointMm.x, input.distortedImagePointMm.y);
148
+ const distortedNormalizedRadius = distortedRadiusMm / profile.normalizationRadiusMm;
149
+ if (distortedNormalizedRadius >
150
+ profile.maximumMappedNormalizedRadius) {
151
+ throw new InvalidScientificInputError("distortedImagePointMm lies outside the mapped radial distortion profile operating radius.");
152
+ }
153
+ let sourceNormalizedRadius = 0;
154
+ if (distortedNormalizedRadius > 0) {
155
+ let lower = 0;
156
+ let upper = profile.maximumNormalizedRadius;
157
+ for (let iteration = 0; iteration < INVERSE_BISECTION_ITERATIONS; iteration += 1) {
158
+ const midpoint = (lower + upper) / 2;
159
+ const mapped = mappedNormalizedRadius(midpoint, profile.coefficients);
160
+ if (mapped < distortedNormalizedRadius) {
161
+ lower = midpoint;
162
+ }
163
+ else {
164
+ upper = midpoint;
165
+ }
166
+ }
167
+ sourceNormalizedRadius = (lower + upper) / 2;
168
+ }
169
+ const scaleAtSource = radialScale(sourceNormalizedRadius, profile.coefficients);
170
+ const sourceImagePointMm = distortedNormalizedRadius === 0
171
+ ? { x: 0, y: 0 }
172
+ : {
173
+ x: input.distortedImagePointMm.x / scaleAtSource,
174
+ y: input.distortedImagePointMm.y / scaleAtSource
175
+ };
176
+ const deltaX = sourceImagePointMm.x - input.distortedImagePointMm.x;
177
+ const deltaY = sourceImagePointMm.y - input.distortedImagePointMm.y;
178
+ return approximationResult({
179
+ direction: "distorted-to-undistorted",
180
+ distortedImagePointMm: {
181
+ ...input.distortedImagePointMm
182
+ },
183
+ sourceImagePointMm,
184
+ distortedNormalizedRadius,
185
+ sourceNormalizedRadius,
186
+ radialScaleAtSource: scaleAtSource,
187
+ deltaMm: {
188
+ x: deltaX,
189
+ y: deltaY,
190
+ distance: Math.hypot(deltaX, deltaY)
191
+ },
192
+ profileMinimumRadialDerivative: profile.minimumRadialDerivative
193
+ }, "generic-inverse-radial-lens-distortion", "1.0.0", [
194
+ ...mappingAssumptions(),
195
+ `Inverse radius is solved with ${INVERSE_BISECTION_ITERATIONS} deterministic bisection iterations`
196
+ ]);
197
+ }
198
+ //# sourceMappingURL=radial-distortion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radial-distortion.js","sourceRoot":"","sources":["../../src/optics/radial-distortion.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,OAAO,EACL,mBAAmB,EAEpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACtB,MAAM,uBAAuB,CAAC;AAkF/B,MAAM,4BAA4B,GAAG,EAAE,C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,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,aAAa,GAAG,WAAW,CAC/B,sBAAsB,EACtB,OAAO,CAAC,YAAY,CACrB,CAAC;IACF,MAAM,kBAAkB,GACtB,yBAAyB,KAAK,CAAC;QAC7B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;QAChB,CAAC,CAAC;YACE,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC,GAAG,aAAa;YAChD,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC,GAAG,aAAa;SACjD,CAAC;IACR,MAAM,MAAM,GACV,kBAAkB,CAAC,CAAC,GAAG,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC;IACvD,MAAM,MAAM,GACV,kBAAkB,CAAC,CAAC,GAAG,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAEvD,OAAO,mBAAmB,CACxB;QACE,SAAS,EAAE,0BAA0B;QACrC,qBAAqB,EAAE;YACrB,GAAG,KAAK,CAAC,qBAAqB;SAC/B;QACD,kBAAkB;QAClB,yBAAyB;QACzB,sBAAsB;QACtB,mBAAmB,EAAE,aAAa;QAClC,OAAO,EAAE;YACP,CAAC,EAAE,MAAM;YACT,CAAC,EAAE,MAAM;YACT,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC;SACrC;QACD,8BAA8B,EAC5B,OAAO,CAAC,uBAAuB;KAClC,EACD,wCAAwC,EACxC,OAAO,EACP;QACE,GAAG,kBAAkB,EAAE;QACvB,iCAAiC,4BAA4B,qCAAqC;KACnG,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,225 @@
1
+ import { type CalculationProvenance, type CalculationResult } from "../core/calculation-result.js";
2
+ import { type NativeImageRaster, type RasterDimensions, type SensorImagingArea } from "../sensor/sensor-geometry.js";
3
+ export type CaptureOrientation = "landscape" | "portrait-clockwise" | "landscape-inverted" | "portrait-counter-clockwise";
4
+ export interface RasterPoint {
5
+ x: number;
6
+ y: number;
7
+ }
8
+ export interface RasterVector {
9
+ x: number;
10
+ y: number;
11
+ }
12
+ /**
13
+ * Integer half-open rectangle in raster coordinates.
14
+ *
15
+ * Coordinates use a top-left origin with +X to the right and +Y downward.
16
+ * The covered extent is [x, x + width) × [y, y + height).
17
+ */
18
+ export interface RasterRect {
19
+ x: number;
20
+ y: number;
21
+ width: number;
22
+ height: number;
23
+ }
24
+ export interface PhysicalBoundsFromOpticalAxisMm {
25
+ left: number;
26
+ right: number;
27
+ top: number;
28
+ bottom: number;
29
+ }
30
+ export interface ResolveCaptureGeometryInput {
31
+ imagingArea: SensorImagingArea;
32
+ nativeRaster: NativeImageRaster;
33
+ orientation: CaptureOrientation;
34
+ /**
35
+ * Active capture rectangle in native sensor raster coordinates.
36
+ *
37
+ * Defaults to the full native raster.
38
+ */
39
+ activeCaptureRect?: RasterRect;
40
+ /**
41
+ * Final digital/output crop in oriented active-capture raster coordinates.
42
+ *
43
+ * Defaults to the full oriented active capture.
44
+ */
45
+ outputCropRect?: RasterRect;
46
+ /**
47
+ * Final output raster after optional digital crop/resampling.
48
+ *
49
+ * Defaults to the output-crop dimensions. The output raster must preserve
50
+ * the crop aspect ratio within a small integer-rounding tolerance.
51
+ */
52
+ outputRaster?: RasterDimensions;
53
+ }
54
+ export interface ResolvedCaptureGeometry {
55
+ native: {
56
+ imagingArea: SensorImagingArea;
57
+ raster: NativeImageRaster;
58
+ };
59
+ activeCapture: {
60
+ nativeRect: RasterRect;
61
+ imagingArea: SensorImagingArea;
62
+ /**
63
+ * Top-left active-area offset from the native imaging-area top-left.
64
+ */
65
+ physicalOffsetMm: {
66
+ x: number;
67
+ y: number;
68
+ };
69
+ /** Active-area center relative to the native optical axis. */
70
+ centerOffsetFromOpticalAxisMm: RasterVector;
71
+ /** Native physical bounds relative to the optical axis. */
72
+ physicalBoundsFromOpticalAxisMm: PhysicalBoundsFromOpticalAxisMm;
73
+ /**
74
+ * Current generic model assumes native image samples uniformly span the
75
+ * declared physical imaging area.
76
+ */
77
+ imagingAreaDerivation: "uniform-native-raster";
78
+ raster: RasterDimensions;
79
+ };
80
+ orientedCapture: {
81
+ orientation: CaptureOrientation;
82
+ imagingArea: SensorImagingArea;
83
+ /** Oriented physical bounds relative to the optical axis. */
84
+ physicalBoundsFromOpticalAxisMm: PhysicalBoundsFromOpticalAxisMm;
85
+ raster: RasterDimensions;
86
+ };
87
+ output: {
88
+ /**
89
+ * Digital/output crop expressed in oriented active-capture coordinates.
90
+ *
91
+ * This crop does not mutate physical sensor identity or active-capture
92
+ * geometry.
93
+ */
94
+ cropRect: RasterRect;
95
+ raster: RasterDimensions;
96
+ /** Physical region retained by the digital/output crop. */
97
+ imagingArea: SensorImagingArea;
98
+ physicalBoundsFromOpticalAxisMm: PhysicalBoundsFromOpticalAxisMm;
99
+ centerOffsetFromOpticalAxisMm: RasterVector;
100
+ sourceRetainedAreaFraction: number;
101
+ /** Pixel-domain resampling from oriented active capture into output. */
102
+ orientedCaptureToOutputScale: {
103
+ x: number;
104
+ y: number;
105
+ axisRelativeDifference: number;
106
+ };
107
+ };
108
+ }
109
+ export interface TransformRasterPointInput {
110
+ point: RasterPoint;
111
+ nativeRaster: NativeImageRaster;
112
+ orientation: CaptureOrientation;
113
+ }
114
+ export interface TransformRasterVectorInput {
115
+ vector: RasterVector;
116
+ orientation: CaptureOrientation;
117
+ }
118
+ export interface TransformRasterRectInput {
119
+ rect: RasterRect;
120
+ nativeRaster: NativeImageRaster;
121
+ orientation: CaptureOrientation;
122
+ }
123
+ export interface CalculateActiveCaptureFieldOfViewInput {
124
+ imagingArea: SensorImagingArea;
125
+ nativeRaster: NativeImageRaster;
126
+ orientation: CaptureOrientation;
127
+ activeCaptureRect?: RasterRect;
128
+ focalLengthMm: number;
129
+ focusDistanceM?: number;
130
+ }
131
+ export interface CalculateOutputFieldOfViewInput {
132
+ imagingArea: SensorImagingArea;
133
+ nativeRaster: NativeImageRaster;
134
+ orientation: CaptureOrientation;
135
+ activeCaptureRect?: RasterRect;
136
+ outputCropRect?: RasterRect;
137
+ focalLengthMm: number;
138
+ focusDistanceM?: number;
139
+ }
140
+ export interface ActiveCaptureFieldOfView {
141
+ orientation: CaptureOrientation;
142
+ horizontalDegrees: number;
143
+ verticalDegrees: number;
144
+ /**
145
+ * Larger of the two opposite-corner diagonal angular spans. For centered
146
+ * crops both diagonal spans are equal.
147
+ */
148
+ diagonalDegrees: number;
149
+ horizontalBoundsDegrees: {
150
+ minimum: number;
151
+ maximum: number;
152
+ };
153
+ verticalBoundsDegrees: {
154
+ minimum: number;
155
+ maximum: number;
156
+ };
157
+ diagonalDegreesByCornerPair: {
158
+ topLeftToBottomRight: number;
159
+ topRightToBottomLeft: number;
160
+ };
161
+ activeImagingArea: SensorImagingArea;
162
+ centerOffsetFromOpticalAxisMm: RasterVector;
163
+ projection: {
164
+ projectionDistanceMm: number;
165
+ provenance: CalculationProvenance;
166
+ };
167
+ }
168
+ export interface OutputFieldOfView {
169
+ orientation: CaptureOrientation;
170
+ horizontalDegrees: number;
171
+ verticalDegrees: number;
172
+ diagonalDegrees: number;
173
+ horizontalBoundsDegrees: {
174
+ minimum: number;
175
+ maximum: number;
176
+ };
177
+ verticalBoundsDegrees: {
178
+ minimum: number;
179
+ maximum: number;
180
+ };
181
+ diagonalDegreesByCornerPair: {
182
+ topLeftToBottomRight: number;
183
+ topRightToBottomLeft: number;
184
+ };
185
+ outputImagingArea: SensorImagingArea;
186
+ centerOffsetFromOpticalAxisMm: RasterVector;
187
+ projection: {
188
+ projectionDistanceMm: number;
189
+ provenance: CalculationProvenance;
190
+ };
191
+ }
192
+ /**
193
+ * Transforms a continuous native raster edge-coordinate point into oriented
194
+ * capture coordinates. Pixel centers can be represented with +0.5 offsets.
195
+ */
196
+ export declare function transformNativeRasterPointToOriented(input: TransformRasterPointInput): RasterPoint;
197
+ /** Transforms an oriented raster edge-coordinate point back to native coordinates. */
198
+ export declare function transformOrientedRasterPointToNative(input: TransformRasterPointInput): RasterPoint;
199
+ /** Rotates a native raster vector into oriented coordinates. */
200
+ export declare function transformNativeRasterVectorToOriented(input: TransformRasterVectorInput): RasterVector;
201
+ /** Rotates an oriented raster vector back into native coordinates. */
202
+ export declare function transformOrientedRasterVectorToNative(input: TransformRasterVectorInput): RasterVector;
203
+ /** Transforms an integer half-open native raster rectangle into oriented coordinates. */
204
+ export declare function transformNativeRasterRectToOriented(input: TransformRasterRectInput): RasterRect;
205
+ /** Transforms an oriented integer half-open rectangle back to native coordinates. */
206
+ export declare function transformOrientedRasterRectToNative(input: TransformRasterRectInput): RasterRect;
207
+ /**
208
+ * Resolves native sensor geometry, active capture, physical camera orientation,
209
+ * and final digital/output geometry without conflating their identities.
210
+ */
211
+ export declare function resolveCaptureGeometry(input: ResolveCaptureGeometryInput): CalculationResult<ResolvedCaptureGeometry>;
212
+ /**
213
+ * Calculates asymmetric horizontal/vertical FOV plus opposite-corner diagonal
214
+ * spans for the active physical capture area after physical camera orientation.
215
+ *
216
+ * Final digital/output crop is intentionally excluded.
217
+ */
218
+ export declare function calculateActiveCaptureFieldOfView(input: CalculateActiveCaptureFieldOfViewInput): CalculationResult<ActiveCaptureFieldOfView>;
219
+ /**
220
+ * Calculates final visible field of view after physical active capture,
221
+ * orientation, and digital/output crop. Output raster resolution does not
222
+ * affect this optical/framing result.
223
+ */
224
+ export declare function calculateOutputFieldOfView(input: CalculateOutputFieldOfViewInput): CalculationResult<OutputFieldOfView>;
225
+ //# sourceMappingURL=capture-geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture-geometry.d.ts","sourceRoot":"","sources":["../../src/output/capture-geometry.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACvB,MAAM,+BAA+B,CAAC;AAMvC,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACvB,M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