Skip to content

fix: remove extra '/O' modifier for '/IO' arguments#23268

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
VadimLevin:dev/vlevin/bindings-io-arg-modifiers-fix
Mar 10, 2023
Merged

fix: remove extra '/O' modifier for '/IO' arguments#23268
asmorkalov merged 1 commit intoopencv:4.xfrom
VadimLevin:dev/vlevin/bindings-io-arg-modifiers-fix

Conversation

@VadimLevin
Copy link
Copy Markdown
Contributor

Some functions can have arguments that marked with both CV_OUT and CV_IN_OUT modifiers. Example Feature2D::compute

CV_WRAP virtual void compute( InputArray image,
                                  CV_OUT CV_IN_OUT std::vector<KeyPoint>& keypoints,
                                  OutputArray descriptors );

Solution: if argument marked as `CV_IN_OUT keep only '/IO' modifier and remove '/O' one.

fixes #23263

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

if '/IO' in modifiers:
self._modifiers = tuple(filter(lambda s: s != '/O', modifiers))
else:
self._modifiers = tuple(modifiers)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be done in hdr_parser.py instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a good point, I hope there is no generators relying on presence of both modifiers...

@VadimLevin VadimLevin force-pushed the dev/vlevin/bindings-io-arg-modifiers-fix branch from 1a54d25 to e029582 Compare February 17, 2023 09:49
@VadimLevin VadimLevin force-pushed the dev/vlevin/bindings-io-arg-modifiers-fix branch from e029582 to 642942a Compare February 17, 2023 10:08
@asmorkalov asmorkalov self-assigned this Mar 10, 2023
@asmorkalov asmorkalov merged commit 29cc675 into opencv:4.x Mar 10, 2023
@asmorkalov asmorkalov mentioned this pull request May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature2D.compute() error

3 participants