This is an N8N community node. It lets you use OpenCV.js (a version of OpenCV that can run in browsers and Node.JS environments) in your N8N workflows.
OpenCV is an open-source image processing library that contains lots of computer vision algorithms. This node exposes some common OpenCV operations so they can be used in N8N workflows.
For example:
- Image binarization/thresholding:
- Binary operations (e.g. NOT):
- Morphological operators (erosion, dilation, opening, closing):
- Histogram computation
- Various blurring algorithms
- Edge detection algorithms (e.g. Canny, Laplacian)
- Contour detection
Installation
Resources
Development
Follow the installation guide in the n8n community nodes documentation.
- Clone the repo:
git clone https://github.com/jreyesr/n8n-nodes-opencv.git
- Run
pnpm i
to install dependencies. - Open the project in your editor.
- Make changes, fix bugs, or add new operations. To add a new operation:
- If adding a new operation on an existing module (e.g. another thresholding algorithm), add it
on
nodes/OpenCvNode/actions/<module_name>/<new_operation_name>.operation.ts
, and register it onnodes/OpenCvNode/actions/<module_name>/index.ts
- If adding an entirely new module (a broad set of OpenCV functionality, e.g. "object tracking" or "DNNs"), add it
on
nodes/OpenCvNode/actions/<new_module_name>
, and register the new module onnodes/OpenCvNode/OpenCvNode.node.ts
- If adding a new operation on an existing module (e.g. another thresholding algorithm), add it
on
- Run
pnpm lint
to check for errors orpnpm lintfix
to automatically fix errors when possible. - Test the node locally. Refer to Run your node locally for guidance.
- (jreyesr only) Publish the package to npm.
Initial release
- Binary operations (multiple thresholding algorithms, including adaptive algs)
- Morphological operations (erosion, dilation, opening, closing)
- Blurs (box, gaussian, bilateral, ...)
- Convert a color image to grayscale
- Contours and connected components: CC detection, contour drawing
- Edge detection (Canny, Sobel, laplacian, ...)