From af694231560c81a48c05ae6dad0d0c4bc3955fe4 Mon Sep 17 00:00:00 2001 From: fnands Date: Thu, 15 Jun 2023 15:32:50 +0200 Subject: [PATCH 1/4] Update loader.py Change `np.float` to `np.float32` --- bundle_adjust/loader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bundle_adjust/loader.py b/bundle_adjust/loader.py index de90f38..cacdd5c 100644 --- a/bundle_adjust/loader.py +++ b/bundle_adjust/loader.py @@ -192,11 +192,11 @@ def load_image(path_to_geotiff, offset=None, equalize=False): """ if offset is None: with rasterio.open(path_to_geotiff) as src: - im = src.read().astype(np.float) + im = src.read().astype(np.float32) else: y0, x0, h, w = offset["row0"], offset["col0"], offset["height"], offset["width"] with rasterio.open(path_to_geotiff) as src: - im = src.read(window=((y0, y0 + h), (x0, x0 + w))).squeeze().astype(np.float) + im = src.read(window=((y0, y0 + h), (x0, x0 + w))).squeeze().astype(np.float32) # we only work with 1-band images if len(im.shape) > 2: From 85ca89ddac9db741a917027ecda1d7e50d372ce5 Mon Sep 17 00:00:00 2001 From: fnands Date: Thu, 15 Jun 2023 15:42:16 +0200 Subject: [PATCH 2/4] Update ba_core.py Change `np.bool` to `bool` --- bundle_adjust/ba_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundle_adjust/ba_core.py b/bundle_adjust/ba_core.py index 6f6ea36..0625545 100644 --- a/bundle_adjust/ba_core.py +++ b/bundle_adjust/ba_core.py @@ -458,7 +458,7 @@ def save_heatmap_of_reprojection_error(img_path, p, err, input_ims_footprints_lo track_err_interp = gaussian_filter(track_err_interp, sigma=smooth) # apply mask of image footprints - mask = np.ones((height, width)).astype(np.bool) + mask = np.ones((height, width)).astype(bool) for i, aoi_lonlat in enumerate(input_ims_footprints_lonlat): aoi_utm = geo_utils.utm_geojson_from_lonlat_geojson(aoi_lonlat) pts2d_utm = np.array(aoi_utm["coordinates"][0]) From 097162a7c0c1ffb337ad8e221e3635596036385a Mon Sep 17 00:00:00 2001 From: fnands Date: Thu, 15 Jun 2023 15:46:07 +0200 Subject: [PATCH 3/4] Update ft_opencv.py Change `np.int` to `np.int32` --- bundle_adjust/feature_tracks/ft_opencv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundle_adjust/feature_tracks/ft_opencv.py b/bundle_adjust/feature_tracks/ft_opencv.py index 119aaee..183811f 100644 --- a/bundle_adjust/feature_tracks/ft_opencv.py +++ b/bundle_adjust/feature_tracks/ft_opencv.py @@ -52,7 +52,7 @@ def opencv_detect_SIFT(geotiff_path, mask_path=None, offset=None, tracks_config= if mask_path is not None: mask = np.load(mask_path) - pts2d_colrow = features_i[:, :2].astype(np.int) + pts2d_colrow = features_i[:, :2].astype(np.int32) true_if_obs_inside_aoi = mask[pts2d_colrow[:, 1], pts2d_colrow[:, 0]] > 0 features_i = features_i[true_if_obs_inside_aoi, :] From 2d73aa13643055f77a8d3c289635df5b3de17238 Mon Sep 17 00:00:00 2001 From: fnands Date: Thu, 15 Jun 2023 15:46:52 +0200 Subject: [PATCH 4/4] Update ft_s2p.py Change `np.int` to `np.int32` --- bundle_adjust/feature_tracks/ft_s2p.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundle_adjust/feature_tracks/ft_s2p.py b/bundle_adjust/feature_tracks/ft_s2p.py index f58c850..6a2a115 100644 --- a/bundle_adjust/feature_tracks/ft_s2p.py +++ b/bundle_adjust/feature_tracks/ft_s2p.py @@ -67,7 +67,7 @@ def detect_features_image_sequence(geotiff_paths, mask_paths=None, offsets=None, features_i = features_i[features_i[:, 2] > 1.85, :] # min scale allowed is 1.85 if mask_paths is not None: mask = np.load(mask_paths[i]) - pts2d_colrow = features_i[:, :2].astype(np.int) + pts2d_colrow = features_i[:, :2].astype(np.int32) true_if_obs_inside_aoi = mask[pts2d_colrow[:, 1], pts2d_colrow[:, 0]] > 0 features_i = features_i[true_if_obs_inside_aoi, :]