Image-Leptonica

 view release on metacpan or  search on metacpan

lib/Image/Leptonica/Func/morphapp.pm  view on Meta::CPAN

              sequence (string specifying sequence of operations)
              dispsep (horizontal separation in pixels between
                       successive displays; use zero to suppress display)
      Return: pixd, or null on error

  Notes:
      (1) This applies the morph sequence to the image, but only allows
          changes in pixs for pixels under the background of pixm.
      (5) If pixm is NULL, this is just pixMorphSequence().

=head2 pixRemoveMatchedPattern

l_int32 pixRemoveMatchedPattern ( PIX *pixs, PIX *pixp, PIX *pixe, l_int32 x0, l_int32 y0, l_int32 dsize )

  pixRemoveMatchedPattern()

      Input:  pixs (input image, 1 bpp)
              pixp (pattern to be removed from image, 1 bpp)
              pixe (image after erosion by Sel that approximates pixp, 1 bpp)
              x0, y0 (center of Sel)
              dsize (number of pixels on each side by which pixp is
                     dilated before being subtracted from pixs;
                     valid values are {0, 1, 2, 3, 4})
      Return: 0 if OK, 1 on error

  Notes:
    (1) This is in-place.
    (2) You can use various functions in selgen to create a Sel
        that is used to generate pixe from pixs.
    (3) This function is applied after pixe has been computed.
        It finds the centroid of each c.c., and subtracts
        (the appropriately dilated version of) pixp, with the center
        of the Sel used to align pixp with pixs.

=head2 pixRunHistogramMorph

NUMA * pixRunHistogramMorph ( PIX *pixs, l_int32 runtype, l_int32 direction, l_int32 maxsize )

  pixRunHistogramMorph()

      Input:  pixs
              runtype (L_RUN_OFF, L_RUN_ON)
              direction (L_HORIZ, L_VERT)
              maxsize  (size of largest runlength counted)
      Return: numa of run-lengths

=head2 pixSeedfillMorph

PIX * pixSeedfillMorph ( PIX *pixs, PIX *pixm, l_int32 maxiters, l_int32 connectivity )

  pixSeedfillMorph()

      Input:  pixs (seed)
              pixm (mask)
              maxiters (use 0 to go to completion)
              connectivity (4 or 8)
      Return: pixd (after filling into the mask) or null on error

  Notes:
    (1) This is in general a very inefficient method for filling
        from a seed into a mask.  Use it for a small number of iterations,
        but if you expect more than a few iterations, use
        pixSeedfillBinary().
    (2) We use a 3x3 brick SEL for 8-cc filling and a 3x3 plus SEL for 4-cc.

=head2 pixSelectiveConnCompFill

PIX * pixSelectiveConnCompFill ( PIX *pixs, l_int32 connectivity, l_int32 minw, l_int32 minh )

  pixSelectiveConnCompFill()

      Input:  pixs (binary)
              connectivity (4 or 8)
              minw  (minimum width to consider; use 0 or 1 for any width)
              minh  (minimum height to consider; use 0 or 1 for any height)
      Return: pix (with holes filled in selected c.c.), or null on error

=head2 pixTophat

PIX * pixTophat ( PIX *pixs, l_int32 hsize, l_int32 vsize, l_int32 type )

  pixTophat()

      Input:  pixs
              hsize (of Sel; must be odd; origin implicitly in center)
              vsize (ditto)
              type   (L_TOPHAT_WHITE: image - opening
                      L_TOPHAT_BLACK: closing - image)
      Return: pixd, or null on error

  Notes:
      (1) Sel is a brick with all elements being hits
      (2) If hsize = vsize = 1, returns an image with all 0 data.
      (3) The L_TOPHAT_WHITE flag emphasizes small bright regions,
          whereas the L_TOPHAT_BLACK flag emphasizes small dark regions.
          The L_TOPHAT_WHITE tophat can be accomplished by doing a
          L_TOPHAT_BLACK tophat on the inverse, or v.v.

=head2 pixUnionOfMorphOps

PIX * pixUnionOfMorphOps ( PIX *pixs, SELA *sela, l_int32 type )

  pixUnionOfMorphOps()

      Input:  pixs (binary)
              sela
              type (L_MORPH_DILATE, etc.)
      Return: pixd (union of the specified morphological operation
                    on pixs for each Sel in the Sela), or null on error

=head2 pixaCentroids

PTA * pixaCentroids ( PIXA *pixa )

  pixaCentroids()

      Input:  pixa of components (1 or 8 bpp)
      Return: pta of centroids relative to the UL corner of
              each pix, or null on error

  Notes:
      (1) An error message is returned if any pix has something other



( run in 0.450 second using v1.01-cache-2.11-cpan-71847e10f99 )