Skip to content

Commit 99b63f5

Browse files
ChristopherKotthoffCiSong10
authored andcommitted
Enhancing RGB Tile Contrast (PatBall1#202)
This pull request enhances the image preprocessing capabilities in detectree2/preprocessing/tiling.py by introducing an optional RGB contrast enhancement feature and fixing some inconsistencies with return values across the tiling functions.
1 parent 6120c2a commit 99b63f5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

detectree2/models/predict.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ def predict_on_data(
6969

7070
if file_ext == ".png":
7171
# RGB image, read with cv2
72-
img = cv2.imread(str(file_name))
73-
if img is None:
72+
cv_img = cv2.imread(str(file_name))
73+
if cv_img is None:
7474
print(f"Failed to read image {file_name} with cv2.")
7575
continue
76-
img = np.array(img) # Explicitly convert to numpy array
76+
img = np.array(cv_img) # Explicitly convert to numpy array
7777
elif file_ext == ".tif":
7878
# Multispectral image, read with rasterio
7979
with rasterio.open(file_name) as src:

0 commit comments

Comments
 (0)