opencv4nodejs icon indicating copy to clipboard operation
opencv4nodejs copied to clipboard

A binding for `OpenCV::magnitude`.

Open issuefiler opened this issue 3 years ago • 4 comments

Could you please implement a binding for OpenCV::magnitude, just like how https://github.com/justadudewhohacks/opencv4nodejs/pull/15 was done,

so that I could do

const magnitudes = await matrix_1.magnitudeAsync(matrix_2);

or

const magnitudes = await OpenCV.magnitudeAsync(matrix_1, matrix_2);

?

issuefiler avatar Nov 14 '22 18:11 issuefiler

I’ve noticed .hMul, .add, .sqrt methods of opencv4nodejs, which I used instead, don’t have their asynchronous versions. Why is that? And do you think .magnitude should have an asynchronous binding?

issuefiler avatar Nov 15 '22 00:11 issuefiler

The Async implementation is a generic implementation, so it is available mostly anywhere.

please consider finding an iso-prototyped function for magnitude(a,b) then simply duplicate the code, and that will work, with less than 2 works hours.

PR is our friend :)

Do not be scared by this code base.

UrielCh avatar Nov 15 '22 08:11 UrielCh

Does that mean that the asynchronous variants of the .hMul/.add/.sqrt methods, .hMulAsync/.addAsync/.sqrtAsync, will also be available?

issuefiler avatar Nov 15 '22 16:11 issuefiler

yep. Implement it once, get it twice 😄

But you must write it twice in the typings files.

that is also the case for optional parameters, all optional parameters can be provided directly, or provided as an optional object.

UrielCh avatar Nov 17 '22 12:11 UrielCh