Package 

Class Edge


  • 
    public class Edge
    
                        

    Edge detection.

    • Method Summary

      Modifier and Type Method Description
      static Pix pixSobelEdgeFilter(Pix pixs, int orientFlag) Performs a Sobel edge detecting filter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • pixSobelEdgeFilter

         static Pix pixSobelEdgeFilter(Pix pixs, int orientFlag)

        Performs a Sobel edge detecting filter.

        To use both the vertical and horizontal filters, set the orientationflag to L_ALL_EDGES; this sums the abs. value of their outputs,clipped to 255.

        Notes:

        • Invert pixd to see larger gradients as darker (grayscale).
        • To generate a binary image of the edges, threshold the resultusing pixThresholdToBinary(). If the high edge values are to be fg (1),invert after running pixThresholdToBinary().
        • Label the pixels as follows:

          1 4 7

          2 5 8

          3 6 9

          Read the data incrementally across the image and unroll the loop.

        • This runs at about 45 Mpix/sec on a 3 GHz processor.
        Parameters:
        pixs - Source pix (8 bpp; no colormap)
        orientFlag - Edge orientation flag (L_HORIZONTAL_EDGES,L_VERTICAL_EDGES, L_ALL_EDGES)