def segmentDebrisWall(point1):

    inputObj = om.findObjectByName('pointcloud snapshot')
    polyData = shallowCopy(inputObj.polyData)

    viewPlaneNormal = np.array(getSegmentationView().camera().GetViewPlaneNormal())

    polyData, origin, normal = applyPlaneFit(polyData, distanceThreshold=0.02, expectedNormal=viewPlaneNormal, perpendicularAxis=viewPlaneNormal,
                                             searchOrigin=point1, searchRadius=0.25, angleEpsilon=0.7, returnOrigin=True)


    planePoints = thresholdPoints(polyData, 'dist_to_plane', [-0.02, 0.02])
    updatePolyData(planePoints, 'unbounded plane points', parent=getDebugFolder(), visible=False)


    planePoints = applyVoxelGrid(planePoints, leafSize=0.03)
    planePoints = labelOutliers(planePoints, searchRadius=0.06, neighborsInSearchRadius=10)

    updatePolyData(planePoints, 'voxel plane points', parent=getDebugFolder(), colorByName='is_outlier', visible=False)

    planePoints = thresholdPoints(planePoints, 'is_outlier', [0, 0])

    planePoints = labelDistanceToPoint(planePoints, point1)
    clusters = extractClusters(planePoints, clusterTolerance=0.10)
    clusters.sort(key=lambda x: vtkNumpy.getNumpyFromVtk(x, 'distance_to_point').min())

    planePoints = clusters[0]
    planeObj = updatePolyData(planePoints, 'debris plane points', parent=getDebugFolder(), visible=False)


    perpAxis = [0,0,-1]
    perpAxis /= np.linalg.norm(perpAxis)
    edgeAxis = np.cross(normal, perpAxis)

    edgePoints = computeEdge(planePoints, edgeAxis, perpAxis)
    edgePoints = vtkNumpy.getVtkPolyDataFromNumpyPoints(edgePoints)
    updatePolyData(edgePoints, 'edge points', parent=getDebugFolder(), visible=False)


    linePoint, lineDirection, _ = applyLineFit(edgePoints)

    #binCounts = computePointCountsAlongAxis(planePoints, lineDirection)


    xaxis = lineDirection
    yaxis = normal

    zaxis = np.cross(xaxis, yaxis)

    if 0 < np.dot(zaxis, [0, 0, 1]):
        zaxis *= -1
        xaxis *= -1

    pts = vtkNumpy.getNumpyFromVtk(planePoints, 'Points')

    dists = np.dot(pts-linePoint, xaxis)

    p1 = linePoint + xaxis*np.min(dists)
    p2 = linePoint + xaxis*np.max(dists)

    p1 = projectPointToPlane(p1, origin, normal)
    p2 = projectPointToPlane(p2, origin, normal)

    d = DebugData()
    d.addSphere(p1, radius=0.01)
    d.addSphere(p2, radius=0.01)
    d.addLine(p1, p2)
    edgeObj = updatePolyData(d.getPolyData(), 'debris plane edge', parent=planeObj, visible=True)
    edgeObj.points = [p1, p2]

    t = getTransformFromAxes(xaxis, yaxis, zaxis)
    t.PostMultiply()
    t.Translate(p1)

    updateFrame(t, 'debris plane frame', parent=planeObj, visible=False)

    refFrame = vtk.vtkTransform()
    refFrame.PostMultiply()
    refFrame.SetMatrix(t.GetMatrix())
    refFrame.Translate(-xaxis + yaxis + zaxis*20.0)
    updateFrame(refFrame, 'debris reference frame', parent=planeObj, visible=False)
dataset/ETHPy150Open RobotLocomotion/director/src/python/director/segmentation.py/segmentDebrisWall/swapped operands of `<`