Skip to content

Commit f7cf147

Browse files
committed
Merge branch 4.x
2 parents d031ffd + ea9f108 commit f7cf147

File tree

5 files changed

+68
-2
lines changed

5 files changed

+68
-2
lines changed

modules/cudev/include/opencv2/cudev/warp/shuffle.hpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,28 @@ __device__ __forceinline__ uint shfl_down(uint val, uint delta, int width = warp
334334

335335
__device__ __forceinline__ signed long long shfl_down(signed long long val, uint delta, int width = warpSize)
336336
{
337+
#if defined __CUDACC_VER_MAJOR__ < 9
338+
union { long long ll; int2 i2; } u;
339+
u.ll = val;
340+
u.i2.x = __shfl_down(u.i2.x, delta, width);
341+
u.i2.y = __shfl_down(u.i2.y, delta, width);
342+
return u.ll;
343+
#else
337344
return __shfl_down(val, delta, width);
345+
#endif
338346
}
339347

340348
__device__ __forceinline__ unsigned long long shfl_down(unsigned long long val, uint delta, int width = warpSize)
341349
{
342-
return (unsigned long long) __shfl_down(val, delta, width);
350+
#if defined __CUDACC_VER_MAJOR__ < 9
351+
union { unsigned long long ull; uint2 u2; } u;
352+
u.ull = val;
353+
u.u2.x = __shfl_down(static_cast<int>(u.u2.x), delta, width);
354+
u.u2.y = __shfl_down(static_cast<int>(u.u2.y), delta, width);
355+
return u.ull;
356+
#else
357+
return __shfl_down(val, delta, width);
358+
#endif
343359
}
344360

345361
__device__ __forceinline__ float shfl_down(float val, uint delta, int width = warpSize)

modules/tracking/include/opencv2/tracking/tracking_legacy.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ class CV_EXPORTS_W MultiTracker : public Algorithm
362362
/**
363363
* \brief Returns a pointer to a new instance of MultiTracker
364364
*/
365-
CV_WRAP static Ptr<MultiTracker> create();
365+
CV_WRAP static Ptr<legacy::MultiTracker> create();
366366

367367
protected:
368368
//!< storage for the tracker algorithms.

modules/tracking/misc/java/test/TrackerCreateLegacyTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
import org.opencv.core.Core;
44
import org.opencv.core.CvException;
5+
import org.opencv.core.CvType;
6+
import org.opencv.core.Mat;
7+
import org.opencv.core.Rect2d;
58
import org.opencv.test.OpenCVTestCase;
69

710
import org.opencv.tracking.Tracking;
811
import org.opencv.tracking.legacy_Tracker;
912
import org.opencv.tracking.legacy_TrackerTLD;
13+
import org.opencv.tracking.legacy_MultiTracker;
1014

1115
public class TrackerCreateLegacyTest extends OpenCVTestCase {
1216

@@ -20,4 +24,19 @@ public void testCreateLegacyTrackerTLD() {
2024
legacy_Tracker tracker = legacy_TrackerTLD.create();
2125
}
2226

27+
public void testCreateLegacyMultiTracker() {
28+
legacy_MultiTracker multiTracker = legacy_MultiTracker.create();
29+
assert(multiTracker != null);
30+
}
31+
32+
public void testAddLegacyMultiTracker() {
33+
legacy_MultiTracker multiTracker = legacy_MultiTracker.create();
34+
legacy_Tracker tracker = legacy_TrackerTLD.create();
35+
Mat image = new Mat(100, 100, CvType.CV_8UC3);
36+
Rect2d boundingBox = new Rect2d(10, 10, 50, 50);
37+
38+
boolean result = multiTracker.add(tracker, image, boundingBox);
39+
assert(result);
40+
}
41+
2342
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"missing_consts": {
3+
"Ximgproc": {
4+
"public": [
5+
["RO_STRICT", 0],
6+
["RO_IGNORE_BORDERS", 1]
7+
]
8+
}
9+
}
10+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package org.opencv.test.ximgproc;
2+
3+
import org.opencv.core.Core;
4+
import org.opencv.core.CvType;
5+
import org.opencv.core.Mat;
6+
import org.opencv.core.Point;
7+
import org.opencv.test.OpenCVTestCase;
8+
import org.opencv.ximgproc.Ximgproc;
9+
10+
public class XimgprocTest extends OpenCVTestCase {
11+
12+
public void testHoughPoint2Line() {
13+
Mat src = new Mat(80, 80, CvType.CV_8UC1, new org.opencv.core.Scalar(0));
14+
Point houghPoint = new Point(40, 40);
15+
16+
int[] result = Ximgproc.HoughPoint2Line(houghPoint, src, Ximgproc.ARO_315_135, Ximgproc.HDO_DESKEW, Ximgproc.RO_IGNORE_BORDERS);
17+
18+
assertNotNull(result);
19+
assertEquals(4, result.length);
20+
}
21+
}

0 commit comments

Comments
 (0)