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


Python Image.threshold方法代码示例

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


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

示例1: _findGalaxyBulgeBlobs

# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import threshold [as 别名]
    def _findGalaxyBulgeBlobs(galaxy):
        img = galaxy.imageWithoutBackground
        graynp = img.getGrayNumpy()

        stretched = np.array(graynp, dtype=np.float32)*(255.0/graynp.max())
        stretched = Image(stretched)
        return stretched.threshold(220).binarize().invert().findBlobs(minsize=4)
开发者ID:rmclaren,项目名称:Kaggle-GalaxyZoo,代码行数:9,代码来源:Galaxy.py

示例2: Image

# 需要导入模块: from SimpleCV import Image [as 别名]
# 或者: from SimpleCV.Image import threshold [as 别名]
droplets = Image('data_s7.jpg')

## Once you have an image you can do a ton of stuff!
## URL (official documentation) about available methods: 
## http://simplecv.org/docs/SimpleCV.html#i/SimpleCV.ImageClass.Image


## Display the image & the image size
# droplets.show()
# time.sleep(5)
img_size = droplets.size()
# print 'Image size:', img_size


## Convert to black and white (applying a simple threshold value)
droplets = droplets.threshold(75)
# droplets.show()
# time.sleep(5)


## Cropping the image into the four pieces
## The x coords are always the whole size
x = 55
segment_height = img_size[1]/4
y_coords = [i * segment_height for i in range(4)]
# print segment_height, y_coords

avg_sizes = []

for y in y_coords:
	
开发者ID:oOo0oOo,项目名称:Pytut,代码行数:32,代码来源:session7.py


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