java.lang.Object
imagingbook.common.edges.CannyEdgeDetector
- All Implemented Interfaces:
EdgeDetector
This class implements a Canny edge detector for grayscale and RGB images. See Sec. 16.3 (Alg. 16.3) of [1] for more
detail. The edge detector is "lazy" in the sense that it performs local non- maximum suppression and edge tracing
only when the results are explicitly queried (by the methods getEdgeBinary() and getEdgeTraces()).
[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).
- Version:
- 2022/09/04 converted to implement interface, use
PixelPack
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionConstructor using default parameters.Constructor using specific parameters. -
Method Summary
Modifier and TypeMethodDescriptionReturns a binary edge image, obtained by rendering the detected edge traces.Returns the calculated edge magnitude for each pixel as aFloatProcessor.Returns the calculated edge orientation for each pixel as aFloatProcessor.Returns a list of detectedEdgeTraceinstances.
-
Constructor Details
-
CannyEdgeDetector
Constructor using default parameters.- Parameters:
ip- the image to be processed
-
CannyEdgeDetector
Constructor using specific parameters.- Parameters:
ip- the image to be processedparams- aCannyEdgeDetector.Parametersobject
-
-
Method Details
-
getEdgeMagnitude
Description copied from interface:EdgeDetectorReturns the calculated edge magnitude for each pixel as aFloatProcessor.- Specified by:
getEdgeMagnitudein interfaceEdgeDetector- Returns:
- the edge magnitude map
-
getEdgeOrientation
Description copied from interface:EdgeDetectorReturns the calculated edge orientation for each pixel as aFloatProcessor.- Specified by:
getEdgeOrientationin interfaceEdgeDetector- Returns:
- the edge orientation map
-
getEdgeBinary
Returns a binary edge image, obtained by rendering the detected edge traces. See alsogetEdgeTraces()- Returns:
- a binary image (
ByteProcessor)
-
getEdgeTraces
Returns a list of detectedEdgeTraceinstances.- Returns:
- a list of
EdgeTraceinstances
-