Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaScript: CV_OUT reference parameters are not handled properly #21070

Open
alalek opened this issue Nov 17, 2021 · 1 comment
Open

JavaScript: CV_OUT reference parameters are not handled properly #21070

alalek opened this issue Nov 17, 2021 · 1 comment
Labels
bug category: javascript (js) effort: few weeks Contribution / porting of a new/existed algorithm. With samples / tests / docs / tutorials

Comments

@alalek
Copy link
Member

alalek commented Nov 17, 2021

reproducer (test case): #21045 (commit)

JavaScript doesn't know anything about references. Parameters are passed by values.
So bindings should be updated.


Design options

Group outputs into:

  • ✖ "object" (dictionary). Good for debugging (parameter names can be used). User code may not require changes if extra output parameter is added. Parameter rename would break user code.
  • ✔ Array. Similar to Python (which returns tuple). Existed JS manual wrappers using this scheme

Note: ES6 destructuring assignment supports both arrays and objects.

Handling of arrays (OutputArray, InputOutputArray, CV_OUT Mat references):

  • ✔ - include (Python behaves like that)
  • ✖ - exclude arrays from result

/cc @huningxin

@recursiveway
Copy link

@alalek can I start working on it

@asmorkalov asmorkalov modified the milestones: 4.8.0, 4.9.0 May 5, 2023
@asmorkalov asmorkalov modified the milestones: 4.9.0, 4.10.0 Oct 20, 2023
@asmorkalov asmorkalov removed this from the 4.10.0 milestone Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug category: javascript (js) effort: few weeks Contribution / porting of a new/existed algorithm. With samples / tests / docs / tutorials
Projects
None yet
Development

No branches or pull requests

3 participants