Skip to content

Commit 396675f

Browse files
committed
Merge branch 4.x
2 parents bdd093b + 9bfa192 commit 396675f

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

modules/face/samples/sample_face_swapping.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ void divideIntoTriangles(Rect rect, vector<Point2f> &points, vector< vector<int>
4747
pt[0] = Point2f(triangle[0], triangle[1]);
4848
pt[1] = Point2f(triangle[2], triangle[3]);
4949
pt[2] = Point2f(triangle[4], triangle[5]);
50-
if ( rect.contains(pt[0]) && rect.contains(pt[1]) && rect.contains(pt[2])){
50+
// Workaround for https://github.com/opencv/opencv/issues/26016
51+
// To keep its behaviour, pt casts to Point_<int>.
52+
if ( rect.contains(Point_<int>(pt[0])) && rect.contains(Point_<int>(pt[1])) && rect.contains(Point_<int>(pt[2]))){
5153
for(int j = 0; j < 3; j++)
5254
for(size_t k = 0; k < points.size(); k++)
5355
if(abs(pt[j].x - points[k].x) < 1.0 && abs(pt[j].y - points[k].y) < 1)
@@ -199,4 +201,4 @@ int main( int argc, char** argv)
199201
destroyAllWindows();
200202
}
201203
return 0;
202-
}
204+
}

modules/rapid/src/rapid.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ static std::vector<int> getSilhoutteVertices(const Size& imsize, const std::vect
1616
Mat_<int> img1(imsize, 0);
1717
Rect img_rect({0, 0}, imsize);
1818
for (int i = 0; i < pts2d.rows; i++) {
19-
if (img_rect.contains(pts2d(i))) {
19+
// Workaround for https://github.com/opencv/opencv/issues/26016
20+
// To keep its behaviour, pts2d casts to Point_<int>.
21+
if (img_rect.contains(Point_<int>(pts2d(i)))) {
2022
img1(pts2d(i)) = i + 1;
2123
}
2224
}
@@ -132,7 +134,10 @@ static void sampleControlPoints(int num, Contour3DSampler& sampler, const Rect&
132134
auto pt2d = sampler.current2D();
133135

134136
// skip points too close to border
135-
if (!roi.contains(pt2d))
137+
//
138+
// Workaround for https://github.com/opencv/opencv/issues/26016
139+
// To keep its behaviour, pt2d casts to Point_<int>.
140+
if (!roi.contains(Point_<int>(pt2d)))
136141
continue;
137142

138143
opts3d.push_back(sampler.current3D());

modules/viz/misc/python/test/test_viz_simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def test_viz_show_cloud_random_color(self):
179179
def test_viz_show_cloud_masked(self):
180180
dragon_cloud,_,_ = cv.viz.readCloud(self.find_file("viz/dragon.ply"))
181181

182-
qnan = np.NAN
182+
qnan = np.nan
183183
for idx in range(dragon_cloud.shape[0]):
184184
if idx % 15 != 0:
185185
dragon_cloud[idx,:] = qnan

modules/xfeatures2d/test/test_features2d.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,9 @@ class FeatureDetectorUsingMaskTest : public cvtest::BaseTest
438438

439439
for(size_t k=0; k<points.size(); ++k)
440440
{
441-
if ( !whiteArea.contains(points[k]) )
441+
// Workaround for https://github.com/opencv/opencv/issues/26016
442+
// To keep its behaviour, points casts to Point_<int>.
443+
if ( !whiteArea.contains(Point_<int>(points[k])) )
442444
{
443445
ts->printf(cvtest::TS::LOG, "The feature point is outside of the mask.");
444446
ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_OUTPUT);

modules/xfeatures2d/test/test_keypoints.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ class CV_FeatureDetectorKeypointsTest : public cvtest::BaseTest
8686
{
8787
const KeyPoint& kp = keypoints[i];
8888

89-
if(!r.contains(kp.pt))
89+
// Workaround for https://github.com/opencv/opencv/issues/26016
90+
// To keep its behaviour, kp.pt casts to Point_<int>.
91+
if(!r.contains(Point_<int>(kp.pt)))
9092
{
9193
ts->printf(cvtest::TS::LOG, "KeyPoint::pt is out of image (x=%f, y=%f).\n", kp.pt.x, kp.pt.y);
9294
ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_OUTPUT);

0 commit comments

Comments
 (0)