Skip to content

fix cast in text detection sample#20742

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
UnaNancyOwen:fix_text_detection
Sep 24, 2021
Merged

fix cast in text detection sample#20742
opencv-pushbot merged 1 commit intoopencv:3.4from
UnaNancyOwen:fix_text_detection

Conversation

@UnaNancyOwen
Copy link
Copy Markdown
Contributor

This pull request will fix text detection sample.
cv.line() accepts only input int type point. Therefor, it is need cast to int type.

This is an error to be fixed by this pull request.

Traceback (most recent call last):
  File "text_detection.py", line 239, in <module>
    main()
  File "text_detection.py", line 227, in main
    cv.line(frame, p1, p2, (0, 255, 0), 1)
cv2.error: OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'line'
> Overload resolution failed:
>  - Can't parse 'pt1'. Sequence item with index 0 has a wrong type
>  - Can't parse 'pt1'. Sequence item with index 0 has a wrong type

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 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

Related change in OpenCV Python bindings: #19312

@asmorkalov asmorkalov added the pr: needs rebase Rebase patch (and squash fixup commits) on the top of target branch label Sep 24, 2021
@asmorkalov
Copy link
Copy Markdown
Contributor

The patch with strict type checks that I mentioned was merged to 3.4 branch and merged to master then. It means that the same issue happens with example in 3.4. So 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".

@UnaNancyOwen UnaNancyOwen changed the base branch from master to 3.4 September 24, 2021 06:53
@UnaNancyOwen
Copy link
Copy Markdown
Contributor Author

@asmorkalov Thanks, I've done it. If you have any problem, please let me know. :)

@asmorkalov asmorkalov removed the pr: needs rebase Rebase patch (and squash fixup commits) on the top of target branch label Sep 24, 2021
@asmorkalov asmorkalov self-requested a review September 24, 2021 08:02
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

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

👍

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