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


Python BaseFilter.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from nupic.vision.regions.ImageSensorFilters.BaseFilter import BaseFilter [as 别名]
# 或者: from nupic.vision.regions.ImageSensorFilters.BaseFilter.BaseFilter import __init__ [as 别名]
  def __init__(self, xsize, ysize, c, preserveCenterResolution=False, Debug=False):
    """
    Initializes the kernel matrices, a one-time cost, which are then applied to
    each image.

    @param xsize -- The x-dimension size of the desired output
    @param ysize -- The y-dimension size of the desired output
    @param c     -- Paramaterizes how much the image bends (ie. how steep the
                    fish-eye.  c=0 is no distortion.  c=3 is severe.
    @param preserveCenterResolution -- if True, the resolution of the center of the
                    image will be preserved and the edges will be sub-sampled.
                    If False, the center pixels will be blown up to keep the
                    outside corners at the original resolution.
    @param Debug -- Determines whether to compute and save some intermediate
                    data structures for debugging (deltaxmat, deltaymat, scales).
    """

    BaseFilter.__init__(self)

    # Init params
    self._lastOutputImage = None
    self._xsize = xsize
    self._ysize = ysize
    self._c = c
    self._pcr = preserveCenterResolution
    self._debug = Debug
    self._kernelx = None
    self._kernely = None
    self._kernel = None
    self._imgSize = (-1,-1)
开发者ID:CV-IP,项目名称:nupic.vision,代码行数:32,代码来源:LogPolar.py

示例2: __init__

# 需要导入模块: from nupic.vision.regions.ImageSensorFilters.BaseFilter import BaseFilter [as 别名]
# 或者: from nupic.vision.regions.ImageSensorFilters.BaseFilter.BaseFilter import __init__ [as 别名]
  def __init__(self, noiseLevel=0.0, doForeground=True, doBackground=False,
               dynamic=True, noiseThickness=1):
    """
    noiseLevel -- Amount of noise to add, from 0 to 1.0. For black and white
      images, this means the values of noiseLevel fraction of the pixels will
      be flipped (e.g. noiseLevel of 0.2 flips 20 percent of the pixels). For
      grayscale images, each pixel will be modified by up to 255 * noiseLevel
      (either upwards or downwards).
    doForeground -- Whether to add noise to the foreground. For black and white
      images, black pixels are foreground and white pixels are background. For
      grayscale images, any pixel which does not equal the background color
      (the ImageSensor 'background' parameter) is foreground, and the rest is
      background.
    doBackground -- Whether to add noise to the background (see above).
    """

    BaseFilter.__init__(self)

    self.noiseLevel = noiseLevel
    self.doForeground = doForeground
    self.doBackground = doBackground
    self.dynamic = dynamic
    self.noiseThickness = noiseThickness

    # Generate and save our random state
    saveState = numpy.random.get_state()
    numpy.random.seed(0)
    self._randomState = numpy.random.get_state()
    numpy.random.set_state(saveState)
开发者ID:CV-IP,项目名称:nupic.vision,代码行数:31,代码来源:AddNoise.py

示例3: __init__

# 需要导入模块: from nupic.vision.regions.ImageSensorFilters.BaseFilter import BaseFilter [as 别名]
# 或者: from nupic.vision.regions.ImageSensorFilters.BaseFilter.BaseFilter import __init__ [as 别名]
  def __init__(self, factor=1.0, scaleTowardCenter=False):
    """
    Parameters
    ----------
    factor: float
      How much contrast to produce in the output image relative
      to the input image. A factor of 0 returns a solid gray image,
      a factor of 1.0 returns the original image, and higher values
      return higher-contrast images.

    scaleTowardCenter: bool
      If False (the default), uses PIL.ImageEnhance.Contrast.
      If True, scales the pixel values toward 0.5.
    """

    BaseFilter.__init__(self)

    if factor < 0:
      raise ValueError("'factor' must be nonnegative")

    self.factor = factor
    self.scaleTowardCenter = scaleTowardCenter
    if scaleTowardCenter and not (0.0 <= factor <= 1.0):
      raise ValueError("scaleTowardCenter only supports contrast factors "
          "between 0 and 1, inclusive.")
开发者ID:CV-IP,项目名称:nupic.vision,代码行数:27,代码来源:Contrast.py

示例4: __init__

# 需要导入模块: from nupic.vision.regions.ImageSensorFilters.BaseFilter import BaseFilter [as 别名]
# 或者: from nupic.vision.regions.ImageSensorFilters.BaseFilter.BaseFilter import __init__ [as 别名]
  def __init__(self, level=1):
    """
    @param level -- Number of times to blur.
    """

    BaseFilter.__init__(self)

    self.level = level
开发者ID:jaredweiss,项目名称:nupic.vision,代码行数:10,代码来源:GaussianBlur.py

示例5: __init__

# 需要导入模块: from nupic.vision.regions.ImageSensorFilters.BaseFilter import BaseFilter [as 别名]
# 或者: from nupic.vision.regions.ImageSensorFilters.BaseFilter.BaseFilter import __init__ [as 别名]
  def __init__(self, shiftSize=1):
    """
    @param stepSize -- number of pixels to shift
    """

    BaseFilter.__init__(self)

    self.shiftSize = shiftSize
开发者ID:jaredweiss,项目名称:nupic.vision,代码行数:10,代码来源:Thicken.py

示例6: __init__

# 需要导入模块: from nupic.vision.regions.ImageSensorFilters.BaseFilter import BaseFilter [as 别名]
# 或者: from nupic.vision.regions.ImageSensorFilters.BaseFilter.BaseFilter import __init__ [as 别名]
 def __init__(self, difficulty = 0.5, seed=None, reproducible=False):
   """
   @param seed -- Seed value for random number generator, to produce
     reproducible results.
   @param reproducible -- Whether to seed the random number generator based
     on a hash of the image pixels upon each call to process().
   'seed' and 'reproducible' cannot be used together.
   """
   BaseFilter.__init__(self, seed, reproducible)
开发者ID:CV-IP,项目名称:nupic.vision,代码行数:11,代码来源:Flip.py

示例7: __init__

# 需要导入模块: from nupic.vision.regions.ImageSensorFilters.BaseFilter import BaseFilter [as 别名]
# 或者: from nupic.vision.regions.ImageSensorFilters.BaseFilter.BaseFilter import __init__ [as 别名]
  def __init__(self, width, height):
    """
    ** DEPRECATED **
    @param width -- Target width, in pixels.
    @param height -- Target height, in pixels.
    """

    BaseFilter.__init__(self)

    self.width = width
    self.height = height
开发者ID:CV-IP,项目名称:nupic.vision,代码行数:13,代码来源:PadToFit.py

示例8: __init__

# 需要导入模块: from nupic.vision.regions.ImageSensorFilters.BaseFilter import BaseFilter [as 别名]
# 或者: from nupic.vision.regions.ImageSensorFilters.BaseFilter.BaseFilter import __init__ [as 别名]
 def __init__(self, seed=None, reproducible=False, both=False):
     """
 @param seed -- Seed value for random number generator, to produce
   reproducible results.
 @param reproducible -- Whether to seed the random number generator based
   on a hash of the image pixels upon each call to process().
 'seed' and 'reproducible' cannot be used together.
 both -- Whether to also pass through the original image.
 """
     BaseFilter.__init__(self, seed, reproducible)
     self.both = both
开发者ID:numenta,项目名称:nupic.vision,代码行数:13,代码来源:Mirror.py

示例9: __init__

# 需要导入模块: from nupic.vision.regions.ImageSensorFilters.BaseFilter import BaseFilter [as 别名]
# 或者: from nupic.vision.regions.ImageSensorFilters.BaseFilter.BaseFilter import __init__ [as 别名]
  def __init__(self, box):
    """
    @param box -- 4-tuple specifying the left, top, right, and bottom coords.
    """

    BaseFilter.__init__(self)

    if box[2] <= box[0] or box[3] <= box[1]:
      raise RuntimeError('Specified box has zero width or height')

    self.box = box
开发者ID:CV-IP,项目名称:nupic.vision,代码行数:13,代码来源:Crop.py

示例10: __init__

# 需要导入模块: from nupic.vision.regions.ImageSensorFilters.BaseFilter import BaseFilter [as 别名]
# 或者: from nupic.vision.regions.ImageSensorFilters.BaseFilter.BaseFilter import __init__ [as 别名]
 def __init__(self, difficulty = 0.5, seed=None, reproducible=False):
   """
   @param difficulty -- Value between 0.0 and 1.0 that controls the intensity of the gradient applied.
   @param seed -- Seed value for random number generator, to produce
     reproducible results.
   @param reproducible -- Whether to seed the random number generator based
     on a hash of the image pixels upon each call to process().
   'seed' and 'reproducible' cannot be used together.
   """
   BaseFilter.__init__(self, seed, reproducible)
   self.difficulty = difficulty
   self.types = ('horizontal', 'vertical', 'circular')
   self.gradientImages = {}
开发者ID:CV-IP,项目名称:nupic.vision,代码行数:15,代码来源:Gradient.py

示例11: __init__

# 需要导入模块: from nupic.vision.regions.ImageSensorFilters.BaseFilter import BaseFilter [as 别名]
# 或者: from nupic.vision.regions.ImageSensorFilters.BaseFilter.BaseFilter import __init__ [as 别名]
  def __init__(self, factor=1.0):
    """
    @param factor -- Factor by which to brighten the image, a nonnegative
      number. 0.0 returns a black image, 1.0 returns the original image, and
      higher values return brighter images.
    """

    BaseFilter.__init__(self)

    if factor < 0:
      raise ValueError("'factor' must be a nonnegative number")

    self.factor = factor
开发者ID:jaredweiss,项目名称:nupic.vision,代码行数:15,代码来源:Brightness.py

示例12: __init__

# 需要导入模块: from nupic.vision.regions.ImageSensorFilters.BaseFilter import BaseFilter [as 别名]
# 或者: from nupic.vision.regions.ImageSensorFilters.BaseFilter.BaseFilter import __init__ [as 别名]
  def __init__(self, numRectangles=4, seed=None, reproducible=False):
    """
    @param numRectangles -- Number of rectangles to add.
    @param seed -- Seed value for random number generator, to produce
      reproducible results.
    @param reproducible -- Whether to seed the random number generator based
      on a hash of the image pixels upon each call to process().
    'seed' and 'reproducible' cannot be used together.
    """

    BaseFilter.__init__(self, seed, reproducible)

    self.numRectangles = numRectangles
开发者ID:jaredweiss,项目名称:nupic.vision,代码行数:15,代码来源:Occlusion.py

示例13: __init__

# 需要导入模块: from nupic.vision.regions.ImageSensorFilters.BaseFilter import BaseFilter [as 别名]
# 或者: from nupic.vision.regions.ImageSensorFilters.BaseFilter.BaseFilter import __init__ [as 别名]
 def __init__(self, difficulty = 0.5, seed=None, reproducible=False):
   """
   @param difficulty -- Value between 0.0 and 1.0 that controls how many lines to add in image.
   @param seed -- Seed value for random number generator, to produce
     reproducible results.
   @param reproducible -- Whether to seed the random number generator based
     on a hash of the image pixels upon each call to process().
   'seed' and 'reproducible' cannot be used together.
   """
   BaseFilter.__init__(self, seed, reproducible)
   self.difficulty = difficulty
   #Maximum number of lines to add
   self.maxLines = 10
开发者ID:CV-IP,项目名称:nupic.vision,代码行数:15,代码来源:Lines.py

示例14: __init__

# 需要导入模块: from nupic.vision.regions.ImageSensorFilters.BaseFilter import BaseFilter [as 别名]
# 或者: from nupic.vision.regions.ImageSensorFilters.BaseFilter.BaseFilter import __init__ [as 别名]
  def __init__(self, scales=[1], simultaneous=False):
    """
    ** DEPRECATED **
    @param scales -- List of factors used for scaling. scales = [.5, 1] returns
      two images, one half the size of the original in each dimension, and one
      which is the original image.
    @param simultaneous -- Whether the images should be sent out of the sensor
      simultaneously.
    """

    BaseFilter.__init__(self)

    self.scales = scales
    self.simultaneous = simultaneous
开发者ID:jaredweiss,项目名称:nupic.vision,代码行数:16,代码来源:MultipleScales.py

示例15: __init__

# 需要导入模块: from nupic.vision.regions.ImageSensorFilters.BaseFilter import BaseFilter [as 别名]
# 或者: from nupic.vision.regions.ImageSensorFilters.BaseFilter.BaseFilter import __init__ [as 别名]
  def __init__(self, img=None, threshold=10, maskScale=1.0, blurRadius=0.0):
    """
    @param img -- path to background image(s) to use
    """

    BaseFilter.__init__(self)

    self.bgPath = img
    self.bgImgs = None
    self._rng = random.Random()
    self._rng.seed(42)
    self._threshold = threshold
    self._maskScale = maskScale
    self._blurRadius = blurRadius
开发者ID:CV-IP,项目名称:nupic.vision,代码行数:16,代码来源:AddBackgroundImage.py


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