Skip to content

core: export getCPUFeaturesLine to bindings#16531

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
paroj:featlinepy
Feb 10, 2020
Merged

core: export getCPUFeaturesLine to bindings#16531
opencv-pushbot merged 1 commit intoopencv:3.4from
paroj:featlinepy

Conversation

@paroj
Copy link
Copy Markdown
Contributor

@paroj paroj commented Feb 7, 2020

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 OpenCV (BSD) License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to 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

@asmorkalov
Copy link
Copy Markdown
Contributor

@paroj Thanks for contribution to OpenCV project. Could you add test for Python to check that string reported in bindings is not empty at least. It helps to check regressions with CI in automated way.

@asmorkalov asmorkalov added category: core category: python bindings pr: needs rebase Rebase patch (and squash fixup commits) on the top of target branch pr: needs test New functionality requires minimal tests set labels Feb 10, 2020
@asmorkalov
Copy link
Copy Markdown
Contributor

This patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

So, please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no need to re-open PR, apply changes "inplace".

@alalek
Copy link
Copy Markdown
Member

alalek commented Feb 10, 2020

string reported in bindings is not empty at least

Actually, It can be empty on some platforms or build configurations.

@paroj paroj force-pushed the featlinepy branch 2 times, most recently from f9119b1 to 3167bd0 Compare February 10, 2020 11:16
@paroj paroj changed the base branch from master to 3.4 February 10, 2020 11:17
@paroj paroj force-pushed the featlinepy branch 2 times, most recently from a9d5de6 to a10b951 Compare February 10, 2020 11:28
@paroj paroj changed the base branch from 3.4 to master February 10, 2020 11:28
@paroj
Copy link
Copy Markdown
Contributor Author

paroj commented Feb 10, 2020

This patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

bindings generator in 3.4 does not seem to cope with std::string type, changed back to master

@alalek
Copy link
Copy Markdown
Member

alalek commented Feb 10, 2020

bindings generator in 3.4 does not seem to cope with std::string type

Please add this to cv2.cpp:

 template<>
 PyObject* pyopencv_from(const String& value)
 {
     return PyString_FromString(value.empty() ? "" : value.c_str());
 }
+
+#if CV_VERSION_MAJOR == 3
+template<>
+PyObject* pyopencv_from(const std::string& value)
+{
+    return PyString_FromString(value.empty() ? "" : value.c_str());
+}
+#endif

@paroj paroj changed the base branch from master to 3.4 February 10, 2020 13:05
Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

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

Thank you 👍

opencv-pushbot pushed a commit that referenced this pull request Feb 10, 2020
@opencv-pushbot opencv-pushbot merged commit e13a73d into opencv:3.4 Feb 10, 2020
@alalek alalek mentioned this pull request Feb 10, 2020
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.

4 participants