code: protected void selectBoundaryCorners() {
  		List<Point2D_F64> layout = detector.getLayout();
  
  		Polygon2D_F64 hull = new Polygon2D_F64();
  		UtilPolygons2D_F64.convexHull(layout,hull);
  		UtilPolygons2D_F64.removeAlmostParallel(hull,0.02);
  
  		boundaryIndexes = new int[hull.size()];
  		for (int i = 0; i < hull.size(); i++) {
  			Point2D_F64 h = hull.get(i);
  			boolean matched = false;
  			for (int j = 0; j < layout.size(); j++) {
  				if( h.isIdentical(layout.get(j),1e-6)) {
  					matched = true;
  					boundaryIndexes[i] = j;
  					break;
  				}
  			}
  			if( !matched )
  				throw new RuntimeException("Bug!");
  		}
  
  	}
docs: Selects points which will be the corners in the boundary. Finds the convex hull.