Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

Commit 81ba41f4 authored by jad's avatar jad

Mathilde changes

parent 1490ccec
......@@ -95,12 +95,8 @@ class ImageProcessorStairs(NodeActivate):
stairs_lines = clusterbis[i_max]
#LOWER STAIRS
length = len(stairs_lines)
lowest_st_nb = 4
if length > lowest_st_nb:
lowest_stairs_lines = stairs_lines[length-lowest_st_nb:length,:]
else:
lowest_stairs_lines = stairs_lines
lowest_stairs_lines = tools.findLowerStairs(stairs_lines, lowest_st_nb)
low_x_moy, low_y_moy = tools.findMiddle(lowest_stairs_lines)
x_moy, y_moy = tools.findMiddle(stairs_lines)
......
......@@ -112,12 +112,8 @@ class ImageProcessorStairsUp(NodeActivate):
stairs_lines = clusterbis[i_max]
#LOWER STAIRS
length = len(stairs_lines)
lowest_st_nb = 4
if length > lowest_st_nb:
lowest_stairs_lines = stairs_lines[length-lowest_st_nb:length,:]
else:
lowest_stairs_lines = stairs_lines
lowest_stairs_lines = tools.findLowerStairs(stairs_lines, lowest_st_nb)
a_st,b_st = np.mean(lowest_stairs_lines[:,5]),np.mean(lowest_stairs_lines[:,6])
stairs_angle = np.arctan2(b_st,a_st)
low_x_moy, low_y_moy = tools.findMiddle(lowest_stairs_lines)
......
......@@ -298,6 +298,14 @@ def findLowestStair(linesArray):
y = [linesArray[:,1],linesArray[:,3]]
return np.max(y)
def findLowerStairs(stairsLinesArray,lowest_st_nb):
length = len(stairsLinesArray)
if length > lowest_st_nb:
lowest_stairs_lines = stairs_lines[length-lowest_st_nb:length,:]
else:
lowest_stairs_lines = stairs_lines
return lowest_stairs_lines
# unused exceptions
class NoStairs(Exception):
def __init__(self):
......
Markdown is supported
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