Canny Edge
Unstable API
0.8.0
@project-lakechain/canny-edge-detector
The Canny edge detector makes it possible to extract the edges of images using the Canny edge algorithm. To do so, it takes images as an input, and produces images with the edges extracted as an output. This can be very useful for a variety of machine-learning applications, including image conditioning in image generation.
Original Image | Result Image |
---|---|
📏 Edge Extraction
To use this middleware, you import it in your CDK stack and instantiate it as part of a pipeline.
Thresholds
You can customize the lower and upper threshold values of the hysterisis procedure used in the Canny edge detection algorithm.
💁 The default values are
100
for the lower threshold and200
for the upper thresholds.
Aperture size
The aperture size represents the size of the Sobel kernel used for edge detection.
You can customize it using the withApertureSize
API.
💁 The default value is set to
3
.
L2 Gradient
The L2 gradient is a boolean value that specifies whether to use the equation for finding gradient magnitude.
You can customize it using the withL2Gradient
API.
💁 The default value is set to
false
.
🏗️ Architecture
This middleware runs within a Lambda compute, and packages OpenCV to perform the Canny edge detection.
🏷️ Properties
Supported Inputs
Mime Type | Description |
---|---|
image/jpeg | JPEG image |
image/png | PNG image |
image/bmp | BMP image |
image/webp | WebP image |
Supported Outputs
Mime Type | Description |
---|---|
image/png | PNG image |
Supported Compute Types
Type | Description |
---|---|
CPU | This middleware only supports CPU compute. |
📖 Examples
- Canny Edge Detection Pipeline - An example showcasing how to perform canny edge detection on images.