diff --git a/settings.py b/settings.py
index 882141950fab026b18c283b6a04ae36c640e35b5..b59cb0ec75810587625c2a0f58dc416a8e9dcc74 100644
--- a/settings.py
+++ b/settings.py
@@ -18,7 +18,7 @@ DB_DATASET = 'barium'
 ION_DIST = 15
 
 # Relative intensity threshold to differentiate good/bad isotopes (w.r.t. to max intensity)
-INT_THS = 0.55
+INT_THS = 0.45
 
 # Number of iterations before restarting the position's memory
 NUM_ITERATIONS = 5
diff --git a/tools.py b/tools.py
index 040c00561df44ec9e6cd36a330558b70eb4361d2..ab4454adecd0d14dc905c4c3ce0d3a25dd04f41d 100644
--- a/tools.py
+++ b/tools.py
@@ -755,6 +755,7 @@ def plot_detection(image, points):
     Code the image into bytes and return it.
     """
     image = cv2.cvtColor(image, cv2.COLOR_GRAY2BGR)
+
     for point in points:
         if point[2] != 2:
             overlay = image.copy()
@@ -920,11 +921,11 @@ def _measure_gradient(image, coord):
     y = []
     x = []
     for pos in coord:
-        y.append(np.sum(image[pos[0] - 30 : pos[0] + 30, pos[1]], axis=0))
+        y.append(np.sum(image[pos[0] - 15 : pos[0] + 15, pos[1]], axis=0))
         x.append(pos[1])
     m, _ = np.polyfit(x, y, deg=1)
 
-    return m/60
+    return m/30
 
 
 def _ion_intensity(image, center):