Skip to content

Commit

Permalink
Merge branch '907-fix_resampling_for_negative_axis' into 'master'
Browse files Browse the repository at this point in the history
Fix du resampling pour les images avec axes négatifs

Closes #907

See merge request 3d/cars-park/cars!742
  • Loading branch information
dyoussef committed Sep 26, 2024
2 parents e01d1da + afcdc91 commit 1bc96d8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cars/applications/resampling/resampling_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,11 @@ def resample_image(
top = math.floor(np.amin(grid_as_array[1, ...]))
bottom = math.ceil(np.amax(grid_as_array[1, ...]))

transform = rio.Affine(*np.abs(img_reader.transform))
# transform xmin and xmax positions to index
(top, bottom, left, right) = (
abstract_geometry.min_max_to_index_min_max(
left, right, top, bottom, img_reader.transform
left, right, top, bottom, transform
)
)

Expand All @@ -347,8 +348,6 @@ def resample_image(
img_window = img_window.round_lengths()

# Compute offset
transform = img_reader.transform

res_x = float(abs(transform[0]))
res_y = float(abs(transform[4]))
tile_bounds = list(bounds(img_window, transform))
Expand Down

0 comments on commit 1bc96d8

Please sign in to comment.