当前位置: 首页>>代码示例>>Python>>正文


Python Mapper.get_points方法代码示例

本文整理汇总了Python中mapper.Mapper.get_points方法的典型用法代码示例。如果您正苦于以下问题:Python Mapper.get_points方法的具体用法?Python Mapper.get_points怎么用?Python Mapper.get_points使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mapper.Mapper的用法示例。


在下文中一共展示了Mapper.get_points方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_a_colour_can_be_changed

# 需要导入模块: from mapper import Mapper [as 别名]
# 或者: from mapper.Mapper import get_points [as 别名]
    def test_a_colour_can_be_changed(self):
        img = cv2.imread(os.path.join(self.test_data_path,'GreenThresholdTest.png'),1)
        threshold = 20
        initial_expected = [0,0,0,-1,-1] 
        initial_colour = [128,128,128]
        new_expected = [-1,-1,-1,-1,-1]
        new_colour = [64,64,64]
        mapper = Mapper(initial_colour, threshold)
        initial_result = mapper.get_points(img)
        self.assertEquals(initial_expected,initial_result)

        mapper.set_colour(new_colour)
        new_result = mapper.get_points(img)
        self.assertEquals(new_expected,new_result)
开发者ID:MaxPRafferty,项目名称:ImageBuilder,代码行数:16,代码来源:tests.py

示例2: test_given_an_colour_image_and_specific_colour_a_point_map_returned

# 需要导入模块: from mapper import Mapper [as 别名]
# 或者: from mapper.Mapper import get_points [as 别名]
 def test_given_an_colour_image_and_specific_colour_a_point_map_returned(self):
     img = cv2.imread(os.path.join(self.test_data_path,'SimpleTestImage2.png'),1)
     expected = [i for i in range(0,20)]
     colour = [255,128,0]
     threshold = 0
     mapper = Mapper(colour,threshold)
     actual = mapper.get_points(img)
     self.assertEquals(expected,actual)
开发者ID:MaxPRafferty,项目名称:ImageBuilder,代码行数:10,代码来源:tests.py

示例3: test_given_a_threshold_items_in_threshold_work_for_blue

# 需要导入模块: from mapper import Mapper [as 别名]
# 或者: from mapper.Mapper import get_points [as 别名]
 def test_given_a_threshold_items_in_threshold_work_for_blue(self):
     img = cv2.imread(os.path.join(self.test_data_path,'BlueThresholdTest.png'),1)
     threshold = 20
     expected = [0,0,0,-1,-1] 
     colour = [128,128,128]
     mapper = Mapper(colour, threshold)
     actual = mapper.get_points(img)
     self.assertEquals(expected,actual)
开发者ID:MaxPRafferty,项目名称:ImageBuilder,代码行数:10,代码来源:tests.py

示例4: test_given_an_image_with_no_points_a_point_map_returned

# 需要导入模块: from mapper import Mapper [as 别名]
# 或者: from mapper.Mapper import get_points [as 别名]
 def test_given_an_image_with_no_points_a_point_map_returned(self):
     img = cv2.imread(os.path.join(self.test_data_path,'SimpleTestImage5.png'),1)
     expected = [-1 for i in range(0,20)]
     colour = [255,255,255]
     threshold = 0
     mapper = Mapper(colour,threshold)
     actual = mapper.get_points(img)
     self.assertEquals(expected,actual)
开发者ID:MaxPRafferty,项目名称:ImageBuilder,代码行数:10,代码来源:tests.py

示例5: test_a_threshold_can_be_changed

# 需要导入模块: from mapper import Mapper [as 别名]
# 或者: from mapper.Mapper import get_points [as 别名]
 def test_a_threshold_can_be_changed(self):
     img = cv2.imread(os.path.join(self.test_data_path,'GreenThresholdTest.png'),1)
     initial_threshold = 20
     new_threshold = 21
     expected = [0,0,0,0,0] 
     colour = [128,128,128]
     mapper = Mapper(colour, initial_threshold)
     mapper.set_threshold(new_threshold)
     actual = mapper.get_points(img)
     self.assertEquals(expected,actual)
开发者ID:MaxPRafferty,项目名称:ImageBuilder,代码行数:12,代码来源:tests.py


注:本文中的mapper.Mapper.get_points方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。