Laplacian
Unstable API
0.8.0
@project-lakechain/laplacian-image-processor
The Laplacian image processor makes it possible to compute the Laplacian variance of images, and enrich the metadata of the document with the computed variance. This metric is useful for detecting edges in images, and is more generally used as a blur detection metric to identify the blurriness of an image.
Credits Branislav Rodman on Unsplash
đˇ Computing Variance
To use this middleware, you import it in your CDK stack and instantiate it as part of a pipeline.
Depth Level
The Laplacian image processor can be configured to compute the Laplacian variance at different depth levels. This is useful when you want to compute the variance at different scales, and detect edges at different levels of granularity. See the OpenCV data types for more information on the available depth levels.
đ The default value is set to
64F
.
Kernel Size
The kernel size used in the Laplacian algorithm can be configured to compute the variance at different scales. The kernel size is used to compute the second derivative of the image, and is used to customize detection of edges in the image.
đ The default value is set to
3
.
đ Output
The Laplacian image processor does not modify or alter source images in any way. It instead enriches the metadata of their document by setting the variance
field to the output of the captioning result.
đ Click to expand example
âšī¸ Below is an example of a CloudEvent emitted by the Laplacian image processor.
đī¸ Architecture
This middleware runs within a Lambda compute, and packages OpenCV to compute the Laplacian variance of images.
đˇī¸ 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/jpeg | JPEG image |
image/png | PNG image |
image/bmp | BMP image |
image/webp | WebP image |
Supported Compute Types
Type | Description |
---|---|
CPU | This middleware only supports CPU compute. |
đ Examples
- Laplacian Variance Pipeline - An example showcasing how to compute the Laplacian variance of images.