mirror of
https://github.com/opencv/opencv.git
synced 2025-06-11 11:45:30 +08:00
Switch rows
and cols
in call to Mat.zeros
The correct order is rows then cols: https://docs.opencv.org/4.x/d3/d63/classcv_1_1Mat.html#a56daa006391a670e9cb0cd08e3168c99
This commit is contained in:
parent
20eee64426
commit
b34fc422a2
@ -41,7 +41,7 @@
|
||||
<script src="utils.js" type="text/javascript"></script>
|
||||
<script id="codeSnippet" type="text/code-snippet">
|
||||
let src = cv.imread('canvasInput');
|
||||
let dst = cv.Mat.zeros(src.cols, src.rows, cv.CV_8UC3);
|
||||
let dst = cv.Mat.zeros(src.rows, src.cols, cv.CV_8UC3);
|
||||
cv.cvtColor(src, src, cv.COLOR_RGBA2GRAY, 0);
|
||||
cv.threshold(src, src, 120, 200, cv.THRESH_BINARY);
|
||||
let contours = new cv.MatVector();
|
||||
|
Loading…
Reference in New Issue
Block a user