director.segmentationroutines module

Routines and Fitting algorithms Fitting: means where ALL other non-object points have been removed, determining the transform frame of the object

Segment: means seperating clusters from a single cloud

class director.segmentationroutines.CameraViewProvider(camera)[source]

Bases: object

getViewDirection()[source]
getViewFrame()[source]
getViewOrigin()[source]
class director.segmentationroutines.RobotModelGroundHeightProvider(model)[source]

Bases: object

getGroundHeight()[source]
class director.segmentationroutines.RobotModelViewProvider(model)[source]

Bases: object

getViewDirection()[source]
getViewFrame()[source]
getViewOrigin()[source]
class director.segmentationroutines.SegmentationContext(groundHeightProvider, viewProvider)[source]

Bases: object

Maintains an abstraction between the fitting scene and a robot Assumes point cloud is world aligned, with z up Provides access to (1) ground height, (2) location of the head frame, (3) view direction

Can be configured: (a) Default mode: populated continously by EST_ROBOT_STATE

  1. and (3) set seperately
  1. Autonomy: where (2) gives (3)
  2. Populated programmatically. e.g: - for unit testing - where ground plane from feet cannot be used
static getGlobalInstance()[source]
getGroundHeight()[source]
getViewDirection()[source]
getViewFrame()[source]
getViewOrigin()[source]
static initWithCamera(camera, userGroundHeight)[source]
static initWithRobot(model)[source]
static initWithUser(userGroundHeight, userViewFrame, viewAxis=0)[source]
static installGlobalInstance(inst)[source]
class director.segmentationroutines.UserGroundHeightProvider(groundHeight)[source]

Bases: object

getGroundHeight()[source]
class director.segmentationroutines.UserViewProvider(viewFrame, viewAxis)[source]

Bases: object

getViewDirection()[source]
getViewFrame()[source]
getViewOrigin()[source]
director.segmentationroutines.applyEuclideanClustering(dataObj, clusterTolerance=0.05, minClusterSize=100, maxClusterSize=1000000.0)[source]
director.segmentationroutines.applyLineFit(dataObj, distanceThreshold=0.02)[source]
director.segmentationroutines.applyVoxelGrid(polyData, leafSize=0.01)[source]
director.segmentationroutines.extractClusters(polyData, clusterInXY=False, **kwargs)[source]

Segment a single point cloud into smaller clusters using Euclidean Clustering

director.segmentationroutines.fitDrillBarrel(drillPoints, forwardDirection, plane_origin, plane_normal)[source]

Given a point cloud which ONLY contains points from a barrell drill, standing upright and the equations of a table its resting on, and the general direction of the robot Fit a barrell drill

director.segmentationroutines.getDebugFolder()[source]
director.segmentationroutines.intersectLineWithPlane(line_point, line_ray, plane_point, plane_normal)[source]

Find the intersection between a line and a plane http://www.scratchapixel.com/lessons/3d-basic-lessons/lesson-7-intersecting-simple-shapes/ray-plane-and-ray-disk-intersection/

director.segmentationroutines.labelOutliers(dataObj, searchRadius=0.03, neighborsInSearchRadius=10)[source]
director.segmentationroutines.labelPointDistanceAlongAxis(polyData, axis, origin=None, resultArrayName='distance_along_axis')[source]
director.segmentationroutines.projectPointToPlane(point, origin, normal)[source]
director.segmentationroutines.sparsifyStereoCloud(polyData)[source]

Take in a typical Stereo Camera Point Cloud Filter it down to about the density of a lidar point cloud and remove outliers