You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To my surprise, the problem was in np.gradient. Everything got fixed when I changed to float32. Maybe the images are too big (1024, 1344)?
diff --git a/imreg/metrics/metric.py b/imreg/metrics/metric.py
index b1fd29b..f141853 100644
--- a/imreg/metrics/metric.py
+++ b/imreg/metrics/metric.py
@@ -104,7 +104,7 @@ class Residual(Metric):
| p = number of parameters.
"""
grad = np.gradient(warpedImage)
grad = np.gradient(np.asarray(warpedImage, dtype=np.float32))
dIx = grad[1].flatten()
dIy = grad[0].flatten()
Activity
hgrecco commentedon Oct 16, 2012
I also get segfault when the sampler is Nearest, Bilinear or Spline
hgrecco commentedon Oct 16, 2012
To my surprise, the problem was in np.gradient. Everything got fixed when I changed to float32. Maybe the images are too big (1024, 1344)?
diff --git a/imreg/metrics/metric.py b/imreg/metrics/metric.py
index b1fd29b..f141853 100644
--- a/imreg/metrics/metric.py
+++ b/imreg/metrics/metric.py
@@ -104,7 +104,7 @@ class Residual(Metric):
| p = number of parameters.
"""