code: def lbp_transform(
      image, radius, points, ignore_zeros=False, preserve_shape=True
  ):
      """
      transformed = lbp(image, radius, points, ignore_zeros=False, preserve_shape=True)
  
      Compute Linear Binary Pattern Transform
  
      The return value are the transformed pixel values  **histogram** of feature counts, where position ``i``
      corresponds to the number of pixels that had code ``i``. The codes are
      compressed so that impossible codes are not used. Therefore, this is the
      ``i``th feature, not just the feature with binary code ``i``.
  
      Parameters
      ----------
      image : ndarray
          input image (2-D numpy ndarray)
      radius : number (integer or floating point)
          radius (in pixels)
      points : integer
          nr of points to consider
      ignore_zeros : boolean, optional
          whether to ignore zeros. Note that if you set this to ``True``, you
          will need to set ``preserve_shape`` to False. (default: False)
      preserve_shape : boolean, optional
          whether to return an array with the same shape as ``image``. (default:
          True)
  
      Returns
      -------
      features : 1-D numpy ndarray
          histogram of features. See above for a caveat on the interpretation of
          these.
  
      References
      ----------
      Gray Scale and Rotation Invariant Texture Classification with Local Binary Patterns
          Ojala, T. Pietikainen, M. Maenpaa, T. Lecture Notes in Computer Science (Springer)
          2000, ISSU 1842, pages 404-420
      """
      from ..interpolate import shift
      from mahotas.features import _lbp
  
      if ignore_zeros and preserve_shape:
          raise ValueError(
              "mahotas.features.lbp_transform: *ignore_zeros* and *preserve_shape* cannot both be used together"
          )
  
      image = np.asanyarray(image, dtype=np.float64)
      if image.ndim != 2:
          raise ValueError(
              "mahotas.features.lbp_transform: This function is only defined for two dimensional images"
          )
  
      if ignore_zeros:
          Y, X = np.nonzero(image)
  
          def select(im):
              return im[Y, X].ravel()
  
      else:
          select = np.ravel
  
      pixels = select(image)
      angles = np.linspace(0, 2 * np.pi, points + 1)[:-1]
      data = []
      for dy, dx in zip(np.sin(angles), np.cos(angles)):
          data.append(
              select(shift(image, [radius * dy, radius * dx], order=1))
          )
      data = np.array(data)
      codes = (data > pixels).astype(np.int32)
      codes *= 2 ** np.arange(points)[:, np.newaxis]
      codes = codes.sum(0)
      codes = _lbp.map(codes.astype(np.uint32), points)
      if preserve_shape:
          codes = codes.reshape(image.shape)
      return codes
  
imports: import numpy
  from ..histogram import fullhistogram
label_desc: Use image node_id 1 for calling a global function with example usage: lbp_transform(image, radius, points, ignore_zeros, preserve_shape) and returns: codes, im