翻转图像时,我试图获得相反的旋转值。我得到了相反的值,但我每次都得到图像未定义的错误。我做错了什么?
const cv = require('/opncvnode/node_modules/opencv4nodejs');
var rotate = 1;
var image = cv.imread('lenna.png');
function flip(image, rotate){
var flip_img = image.flip(1);
var rotate = -(rotate);
return flip_img, rotate;
}
function imageAugmentation(image, rotate){
var image, rotate = flip(image, rotate);
return image, rotate;
}
var image2, angle = imageAugmentation(image, rotate);
console.log(angle);
cv.imshowWait('', image2);
错误:
-1
C:\Users\SHAN\Desktop\Img_aug Final\test.js:20
cv.imshowWait('', image2);
^
Io::ImshowWait - expected arg1 to be an instance of Mat
(Use `node --trace-uncaught ...` to show where the exception was thrown)