Commit 71cc3bdc authored by Félix Hartmann's avatar Félix Hartmann
Browse files

[bugfix] When the organ is brighter than the background, the skeleton

detection algorithm used to start in the wrong direction, before going
backward in the required direction. This is now corrected.
parent 65d9737c
......@@ -403,8 +403,11 @@ def get_min_max(z, coupure=0.1):
ib2 = flatnonzero(gradz == -1.0)
if len(ib1) > 0 and len(ib2) > 0:
ib1 = ib1[0]
ib2 = ib2[-1]
if ib1[0] <= ib2[0]: # the organ is brighter than the background
ib1 = ib1[0]
ib2 = ib2[-1]
else: # the organ is darker than the background
ib1, ib2 = ib2[0], ib1[-1]
else:
ib1 = None
ib2 = None
......@@ -1133,8 +1136,6 @@ def traite_tige2(xc, yc, R, pas, cutoff=5):
Smoothed x-coordinates of points along the tige.
smoothed_y : 1-D ndarray
Smoothed y-coordinates of points along the tige.
dy : 1-D ndarray
Differentials of the smoothed y-coordinates along the tige.
angle : 1-D ndarray
Angle along the tige.
s : 1-D ndarray
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment