Merge pull request #22184 from heavyrain-lzy:fixbug_pyrUp
* fix the bug in pyrUp * add test case for pyrUp * coding style
This commit is contained in:
parent
e313603aac
commit
6360c3bf46
@ -963,7 +963,7 @@ pyrUp_( const Mat& _src, Mat& _dst, int)
|
||||
|
||||
if (dsize.width > ssize.width*2)
|
||||
{
|
||||
row[(_dst.cols-1) + x] = row[dx + cn];
|
||||
row[(_dst.cols-1) * cn + x] = row[dx + cn];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
19
modules/imgproc/test/test_pyramid.cpp
Normal file
19
modules/imgproc/test/test_pyramid.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
// This file is part of OpenCV project.
|
||||
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||
// of this distribution and at http://opencv.org/license.html.
|
||||
|
||||
#include "test_precomp.hpp"
|
||||
|
||||
namespace opencv_test { namespace {
|
||||
|
||||
TEST(Imgproc_PyrUp, pyrUp_regression_22184)
|
||||
{
|
||||
Mat src(100, 100, CV_16UC3, Scalar::all(255));
|
||||
Mat dst(100 * 2 + 1, 100 * 2 + 1, CV_16UC3, Scalar::all(0));
|
||||
pyrUp(src, dst, Size(dst.cols, dst.rows));
|
||||
double min_val = 0;
|
||||
minMaxLoc(dst, &min_val);
|
||||
ASSERT_GT(cvRound(min_val), 0);
|
||||
}
|
||||
|
||||
}} // namespace
|
||||
Loading…
Reference in New Issue
Block a user