Skip to content
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## [0.9.3] = 2026-02-05
### Added
- Cross sections can be linearized with `CrossSection.linearize`, and rotated and translated with
`CrossSection.rotate_translate`.
- Combinations of cross section and camera config bounding box into wet and dry areas in the bounding box
can be found with a new function `CrossSection.get_bbox_dry_wet`
### Changed
### Deprecated
### Removed
### Fixed
- during optimization of camera pose with `CameraConfig.calibrate` unrealistic combinations of `k1` and `k2`
barrel distortion coefficients were sometimes returned. This is fixed by checking monotonic increase of distortion
from the center to the edges.


## [0.9.2] = 2026-01-15
### Added
### Changed
Expand Down
2 changes: 1 addition & 1 deletion pyorc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""pyorc: free and open-source image-based surface velocity and discharge."""

__version__ = "0.9.2"
__version__ = "0.9.3"

from .api import CameraConfig, CrossSection, Frames, Transect, Velocimetry, Video, get_camera_config, load_camera_config # noqa
from .project import * # noqa
Expand Down
12 changes: 6 additions & 6 deletions pyorc/api/cameraconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ def get_bbox(
z_a: Optional[float] = None,
within_image: Optional[bool] = False,
expand_exterior=True,
exterior_split=400,
) -> Polygon:
"""Get bounding box.

Expand All @@ -485,6 +486,8 @@ def get_bbox(
Set to True to make an attempt to remove parts of the polygon that lie outside of the image field of view
expand_exterior : bool, optional
Set to True to expand the corner points to more points. This is particularly useful for plotting purposes.
exterior_split : int, optional
Amount of subline segments to split bounding box in

Returns
-------
Expand Down Expand Up @@ -516,7 +519,7 @@ def get_bbox(
# distortion on image frame, and to plot partial coverage in the real-world coordinates
coords_expand = np.zeros((0, 2))
for n in range(0, len(coords) - 1):
new_coords = np.linspace(coords[n], coords[n + 1], 100)
new_coords = np.linspace(coords[n], coords[n + 1], exterior_split // 4)
coords_expand = np.r_[coords_expand, new_coords]
coords = coords_expand
if not z_a:
Expand Down Expand Up @@ -915,9 +918,9 @@ def rotate_translate_bbox(self, angle: float = None, xoff: float = None, yoff: f
angle : float, optional
Rotation angle in radians (anti-clockwise) around the center of the bounding box
xoff : float, optional
Translation distance in x direction in CRS units
Translation distance in x direction in m.
yoff : float, optional
Translation distance in y direction in CRS units
Translation distance in y direction in m.

Returns
-------
Expand All @@ -935,9 +938,6 @@ def rotate_translate_bbox(self, angle: float = None, xoff: float = None, yoff: f

# Apply rotation if specified
if angle is not None:
print(angle)
# # Convert to radians
# angle = np.radians(rotation)
# Get centroid as origin
centroid = bbox.centroid
# Apply rotation around centroid
Expand Down
Loading
Loading