示例
使用
let src = cv.imread('canvasInput');
let dst = new cv.Mat();
let low = new cv.Mat(src.rows, src.cols, src.type(), [0, 0, 0, 0]);
let high = new cv.Mat(src.rows, src.cols, src.type(), [150, 150, 150, 255]);
// You can try more different parameters
cv.inRange(src, low, high, dst);
cv.imshow('canvasOutput', dst);
src.delete();
dst.delete();
low.delete();
high.delete();
- src 是输入的数组
- lowerb 是包含 lowerb 的最小值数组或分量
- upperb 是包含 upperb 的最大值数组或分量
- 输出的数组,大小和通道数与 src 一样,并且是 CV_8V 的类型
参考文章
- https://blog.csdn.net/qq78442761/article/details/83016909
- https://stackoverflow.com/questions/69360003/place-an-image-over-another-image-using-opencv-js
- https://stackoverflow.com/questions/68624755/opencvjs-convert-python-to-javascript
- https://blog.csdn.net/duwangthefirst/article/details/79971212
- https://stackoverflow.com/questions/27684267/hough-transform-line-location-opencv