mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-23 13:10:18 +08:00
Moved image conversion after the verification of the max_value
This commit is contained in:
@@ -137,11 +137,11 @@ def denoise_bilateral(image, Py_ssize_t win_size=5, sigma_range=None,
|
||||
|
||||
max_value = image.max()
|
||||
|
||||
cimage = np.ascontiguousarray(image)
|
||||
|
||||
if max_value == 0.0:
|
||||
raise ValueError("The maximum value found in the image was 0.")
|
||||
|
||||
cimage = np.ascontiguousarray(image)
|
||||
|
||||
out = np.zeros((rows, cols, dims), dtype=np.double)
|
||||
image_data = <double*>cimage.data
|
||||
out_data = <double*>out.data
|
||||
|
||||
Reference in New Issue
Block a user