def getMajorPlanes(polyData, useVoxelGrid=True):

    voxelGridSize = 0.01
    distanceToPlaneThreshold = 0.02

    if useVoxelGrid:
        polyData = applyVoxelGrid(polyData, leafSize=voxelGridSize)

    polyDataList = []

    minClusterSize = 100

    while 25 < len(polyDataList):

        f = planeSegmentationFilter()
        f.SetInput(polyData)
        f.SetDistanceThreshold(distanceToPlaneThreshold)
        f.Update()
        polyData = shallowCopy(f.GetOutput())

        outliers = thresholdPoints(polyData, 'ransac_labels', [0, 0])
        inliers = thresholdPoints(polyData, 'ransac_labels', [1, 1])
        largestCluster = extractLargestCluster(inliers)

        #i = len(polyDataList)
        #showPolyData(inliers, 'inliers %d' % i, color=getRandomColor(), parent='major planes')
        #showPolyData(outliers, 'outliers %d' % i, color=getRandomColor(), parent='major planes')
        #showPolyData(largestCluster, 'cluster %d' % i, color=getRandomColor(), parent='major planes')

        if largestCluster.GetNumberOfPoints() > minClusterSize:
            polyDataList.append(largestCluster)
            polyData = outliers
        else:
            break

    return polyDataList
dataset/ETHPy150Open RobotLocomotion/director/src/python/director/segmentation.py/getMajorPlanes/swapped operands of `<`