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


Python Image.dl方法代码示例

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


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

示例1: circleDistance

# 需要导入模块: from SimpleCV.ImageClass import Image [as 别名]
# 或者: from SimpleCV.ImageClass.Image import dl [as 别名]
    def circleDistance(self):
        """
        **SUMMARY**

        Compare the hull mask to an ideal circle and count the number of pixels
        that deviate as a fraction of total area of the ideal circle.

        **RETURNS**

        The difference, as a percentage, between the hull of our blob and an idealized
        circle of our blob. 

        """
        w = self.mHullMask.width
        h = self.mHullMask.height

        idealcircle = Image((w, h))
        radius = min(w, h) / 2
        idealcircle.dl().circle((w / 2, h / 2), radius, filled=True, color=Color.WHITE)
        idealcircle = idealcircle.applyLayers()
        print self.mHullMask
        print idealcircle
        print self.mHullMask.width
        print self.mHullMask.height
        print idealcircle.width
        print idealcircle.height
        netdiff = (idealcircle - self.mHullMask) + (self.mHullMask - idealcircle)
        numblack, numwhite = netdiff.histogram(2)
        return float(numwhite) / (radius * radius * np.pi)
开发者ID:rick446,项目名称:SimpleCV,代码行数:31,代码来源:Blob.py

示例2: circleDistance

# 需要导入模块: from SimpleCV.ImageClass import Image [as 别名]
# 或者: from SimpleCV.ImageClass.Image import dl [as 别名]
 def circleDistance(self):
     """
     Compare the hull mask to an ideal circle and count the number of pixels
     that deviate as a fraction of total area of the ideal circle
     """
     idealcircle = Image((self.width(), self.height()))
     radius = min(self.width(), self.height()) / 2
     idealcircle.dl().circle((self.width()/2, self.height()/2), radius, filled= True, color=Color.WHITE)
     idealcircle = idealcircle.applyLayers()
     
     netdiff = (idealcircle - self.mHullMask) + (self.mHullMask - idealcircle)
     numblack, numwhite = netdiff.histogram(2)
     return float(numwhite) / (radius * radius * np.pi)
开发者ID:ChrisCTX,项目名称:SimpleCV,代码行数:15,代码来源:Blob.py


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