Skip to content

fix the bug in pyrUp#22184

Merged
alalek merged 3 commits intoopencv:3.4from
heavyrain-lzy:fixbug_pyrUp
Jul 3, 2022
Merged

fix the bug in pyrUp#22184
alalek merged 3 commits intoopencv:3.4from
heavyrain-lzy:fixbug_pyrUp

Conversation

@heavyrain-lzy
Copy link
Copy Markdown
Contributor

@heavyrain-lzy heavyrain-lzy commented Jul 3, 2022

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

@heavyrain-lzy
Copy link
Copy Markdown
Contributor Author

heavyrain-lzy commented Jul 3, 2022

fix the bug in pyrUp:
When deal with the right boder in multi-channels image, the code forget to multiply the "cn" to calculate the "index".
The bug exists in all the branch and tags.

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 for contribution!

We don't have coverage of tests for the mentioned line.

Please prepare simple regression test which covers this case (to avoid regression in the future).
You could use test scheme similar to TEST(Imgproc_Filter2D, dftFilter2d_regression_13179) with some small image data (e.g., 8x8 pixels).
Test should fail without the patch and pass with this patch.


As a bug fix this patch should go into 3.4 branch first.
We will merge changes from 3.4 into 4.x regularly (weekly/bi-weekly).

Please:

  • change "base" branch of this PR: 4.x => 3.4 (use "Edit" button near PR title)
  • rebase your commits from 4.x onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/4.x
    (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 needs to re-open PR, apply changes "inplace".

@heavyrain-lzy heavyrain-lzy changed the base branch from master to 3.4 July 3, 2022 07:41
@heavyrain-lzy heavyrain-lzy changed the base branch from 3.4 to master July 3, 2022 07:42
@heavyrain-lzy heavyrain-lzy changed the base branch from master to 3.4 July 3, 2022 07:50
@heavyrain-lzy heavyrain-lzy changed the base branch from 3.4 to master July 3, 2022 07:54
@heavyrain-lzy heavyrain-lzy changed the base branch from master to 3.4 July 3, 2022 07:55
@heavyrain-lzy
Copy link
Copy Markdown
Contributor Author

Thanks for the suggestions. I have complete the code change according to the commends.

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.

Well done! Thank you for contribution 👍

@alalek alalek merged commit 6360c3b into opencv:3.4 Jul 3, 2022
@alalek alalek mentioned this pull request Jul 26, 2022
This was referenced Aug 14, 2022
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.

2 participants