-
public class EdgeEdge detection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public @interfaceEdge.EdgeOrientationFlag
-
Field Summary
Fields Modifier and Type Field Description public final static intL_HORIZONTAL_EDGESpublic final static intL_VERTICAL_EDGESpublic final static intL_ALL_EDGES
-
Method Summary
Modifier and Type Method Description static PixpixSobelEdgeFilter(Pix pixs, int orientFlag)Performs a Sobel edge detecting filter. -
-
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)
-
-
-
-