justadudewhohacks / justadudewhohacks/opencv4nodejs

Flip image error occur with using simultaneous variable

Open
#738 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5.1k
Forks
826
PR merge metrics
No merged PRs in 30d

Description

**I am trying to get opposite rotate value when the image is flipped. I got the opposite value but I got image undefined error each time. What is the wrong thing I did?**

```
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);
```

**error:**

```
-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)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.