Getting new cv.Point2fVector() is not a constructor error in opencvjs
Hello,
With help of opencv.js, I am tying to use below code in my front-end application but getting error as "new cv.Point2fVector() is not a constructor"
Please guide me how to get use of these below functions or types
var obj_corners = new cv.Point2fVector();
obj_corners[0] = new cv.Point(0,0);
obj_corners[1] = new cv.Point(img1Raw.cols,0);
obj_corners[2] = new cv.Point(img1Raw.cols, img1Raw.rows);
obj_corners[3] = new cv.Point(0, img1Raw.rows);
Well most of the time I've got that issue it was due to improper opencv.js loading and initialization settings, please share you're whole code or at least include the parts where you load your opencv.js file and indicate if you're using the wasm or asm ones
First of all, to create a new point you can simply use an object, like this
I don't think you need
new cv.Point2fVector()
.Instead of usingnew cv.Point2fVector()
need to use its equivalent in JS which might be an array I guess. So try thisIf you tell me how you are going to use your
obj_corners
I might know the solution. For example, if you wanna create a rectangle you can use this