mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-16 22:35:51 +08:00
Merge branch 4.x
This commit is contained in:
@@ -334,12 +334,28 @@ __device__ __forceinline__ uint shfl_down(uint val, uint delta, int width = warp
|
||||
|
||||
__device__ __forceinline__ signed long long shfl_down(signed long long val, uint delta, int width = warpSize)
|
||||
{
|
||||
#if defined __CUDACC_VER_MAJOR__ < 9
|
||||
union { long long ll; int2 i2; } u;
|
||||
u.ll = val;
|
||||
u.i2.x = __shfl_down(u.i2.x, delta, width);
|
||||
u.i2.y = __shfl_down(u.i2.y, delta, width);
|
||||
return u.ll;
|
||||
#else
|
||||
return __shfl_down(val, delta, width);
|
||||
#endif
|
||||
}
|
||||
|
||||
__device__ __forceinline__ unsigned long long shfl_down(unsigned long long val, uint delta, int width = warpSize)
|
||||
{
|
||||
return (unsigned long long) __shfl_down(val, delta, width);
|
||||
#if defined __CUDACC_VER_MAJOR__ < 9
|
||||
union { unsigned long long ull; uint2 u2; } u;
|
||||
u.ull = val;
|
||||
u.u2.x = __shfl_down(static_cast<int>(u.u2.x), delta, width);
|
||||
u.u2.y = __shfl_down(static_cast<int>(u.u2.y), delta, width);
|
||||
return u.ull;
|
||||
#else
|
||||
return __shfl_down(val, delta, width);
|
||||
#endif
|
||||
}
|
||||
|
||||
__device__ __forceinline__ float shfl_down(float val, uint delta, int width = warpSize)
|
||||
|
@@ -362,7 +362,7 @@ public:
|
||||
/**
|
||||
* \brief Returns a pointer to a new instance of MultiTracker
|
||||
*/
|
||||
CV_WRAP static Ptr<MultiTracker> create();
|
||||
CV_WRAP static Ptr<legacy::MultiTracker> create();
|
||||
|
||||
protected:
|
||||
//!< storage for the tracker algorithms.
|
||||
|
@@ -2,11 +2,15 @@ package org.opencv.test.tracking;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvException;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.Rect2d;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
import org.opencv.tracking.Tracking;
|
||||
import org.opencv.tracking.legacy_Tracker;
|
||||
import org.opencv.tracking.legacy_TrackerTLD;
|
||||
import org.opencv.tracking.legacy_MultiTracker;
|
||||
|
||||
public class TrackerCreateLegacyTest extends OpenCVTestCase {
|
||||
|
||||
@@ -20,4 +24,19 @@ public class TrackerCreateLegacyTest extends OpenCVTestCase {
|
||||
legacy_Tracker tracker = legacy_TrackerTLD.create();
|
||||
}
|
||||
|
||||
public void testCreateLegacyMultiTracker() {
|
||||
legacy_MultiTracker multiTracker = legacy_MultiTracker.create();
|
||||
assert(multiTracker != null);
|
||||
}
|
||||
|
||||
public void testAddLegacyMultiTracker() {
|
||||
legacy_MultiTracker multiTracker = legacy_MultiTracker.create();
|
||||
legacy_Tracker tracker = legacy_TrackerTLD.create();
|
||||
Mat image = new Mat(100, 100, CvType.CV_8UC3);
|
||||
Rect2d boundingBox = new Rect2d(10, 10, 50, 50);
|
||||
|
||||
boolean result = multiTracker.add(tracker, image, boundingBox);
|
||||
assert(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
10
modules/ximgproc/misc/java/gen_dict.json
Normal file
10
modules/ximgproc/misc/java/gen_dict.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"missing_consts": {
|
||||
"Ximgproc": {
|
||||
"public": [
|
||||
["RO_STRICT", 0],
|
||||
["RO_IGNORE_BORDERS", 1]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
21
modules/ximgproc/misc/java/test/XimgprocTest.java
Normal file
21
modules/ximgproc/misc/java/test/XimgprocTest.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package org.opencv.test.ximgproc;
|
||||
|
||||
import org.opencv.core.Core;
|
||||
import org.opencv.core.CvType;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.Point;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.ximgproc.Ximgproc;
|
||||
|
||||
public class XimgprocTest extends OpenCVTestCase {
|
||||
|
||||
public void testHoughPoint2Line() {
|
||||
Mat src = new Mat(80, 80, CvType.CV_8UC1, new org.opencv.core.Scalar(0));
|
||||
Point houghPoint = new Point(40, 40);
|
||||
|
||||
int[] result = Ximgproc.HoughPoint2Line(houghPoint, src, Ximgproc.ARO_315_135, Ximgproc.HDO_DESKEW, Ximgproc.RO_IGNORE_BORDERS);
|
||||
|
||||
assertNotNull(result);
|
||||
assertEquals(4, result.length);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user