本文整理汇总了Python中cube.Cube.find_position方法的典型用法代码示例。如果您正苦于以下问题:Python Cube.find_position方法的具体用法?Python Cube.find_position怎么用?Python Cube.find_position使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cube.Cube
的用法示例。
在下文中一共展示了Cube.find_position方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: find_orange_corner
# 需要导入模块: from cube import Cube [as 别名]
# 或者: from cube.Cube import find_position [as 别名]
def find_orange_corner(self, img_hsv, kinect, polyline, is_left):
stencil = FormStencil([polyline])
img_hsv_mask = stencil.apply(img_hsv)
orange_corner = Cube('orange')
if is_left:
return orange_corner.find_position(img_hsv_mask, kinect, self.PIXEL_SHIFT)
return orange_corner.find_position(img_hsv_mask, kinect, -self.PIXEL_SHIFT)
示例2: attempt_get_position
# 需要导入模块: from cube import Cube [as 别名]
# 或者: from cube.Cube import find_position [as 别名]
def attempt_get_position(self, kinect, attempt_no):
new_position = None
img_hsv = self.get_masked_hsv(kinect, attempt_no)
purple_corner = Cube('purple')
green_corner = Cube('forest_green')
purple_position = purple_corner.find_position(img_hsv, kinect)
green_position = green_corner.find_position(img_hsv, kinect)
if purple_corner.is_valid_position(purple_position):
new_position = self.test_other_corners(img_hsv, kinect, purple_corner, 0)
elif green_corner.is_valid_position(green_position):
new_position = self.test_other_corners(img_hsv, kinect, green_corner, math.pi / 2)
return new_position