def add_random_feature_points(self, region_x, region_y, num_points):
"""Add a set number of randomly placed feature points in a region.
Args:
region_x (int): X coordinate of center point of desired region.
region_y (int): Y coordinate of center point of desired region.
num_points (int): Number of feature points to create.
"""
pnts = self.get_region(region_x, region_y)
chosen_indices = random.sample(range(0, len(pnts)), num_points)
chosen_feat_points = [pnts[i] for i in chosen_indices]
for x, y in chosen_feat_points:
self.add_feature_point(region_x, region_y, x, y)
评论列表
文章目录