Skip to content

Commit d3ca275

Browse files
committed
Merge branch 4.x
2 parents 677cdcb + 01fd98d commit d3ca275

File tree

9 files changed

+33
-15
lines changed

9 files changed

+33
-15
lines changed

modules/bgsegm/src/bgfg_gsoc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const float LSBPtau = 0.05f;
7070
inline int LSBPDist32(unsigned n) {
7171
#if defined(__GNUC__) || defined(__clang__)
7272
return __builtin_popcount(n);
73-
#elif defined(_MSC_VER) && !(defined(_M_ARM) || defined(_M_ARM64))
73+
#elif defined(_MSC_VER)
7474
return __popcnt(n);
7575
#else
7676
// Taken from http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel

modules/cudafeatures2d/src/fast.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ namespace
6666
{
6767
public:
6868
FAST_Impl(int threshold, bool nonmaxSuppression, int max_npoints);
69+
~FAST_Impl();
6970

7071
virtual void detect(InputArray _image, std::vector<KeyPoint>& keypoints, InputArray _mask);
7172
virtual void detectAsync(InputArray _image, OutputArray _keypoints, InputArray _mask, Stream& stream);
@@ -95,6 +96,12 @@ namespace
9596
FAST_Impl::FAST_Impl(int threshold, bool nonmaxSuppression, int max_npoints) :
9697
threshold_(threshold), nonmaxSuppression_(nonmaxSuppression), max_npoints_(max_npoints)
9798
{
99+
cudaSafeCall( cudaMalloc(&d_counter, sizeof(unsigned int)) );
100+
}
101+
102+
FAST_Impl::~FAST_Impl()
103+
{
104+
cudaSafeCall( cudaFree(d_counter) );
98105
}
99106

100107
void FAST_Impl::detect(InputArray _image, std::vector<KeyPoint>& keypoints, InputArray _mask)
@@ -116,8 +123,6 @@ namespace
116123
{
117124
using namespace cv::cuda::device::fast;
118125

119-
cudaSafeCall( cudaMalloc(&d_counter, sizeof(unsigned int)) );
120-
121126
const GpuMat img = _image.getGpuMat();
122127
const GpuMat mask = _mask.getGpuMat();
123128

@@ -165,8 +170,6 @@ namespace
165170
kpLoc.colRange(0, count).copyTo(locRow, stream);
166171
keypoints.row(1).setTo(Scalar::all(0), stream);
167172
}
168-
169-
cudaSafeCall( cudaFree(d_counter) );
170173
}
171174

172175
void FAST_Impl::convert(InputArray _gpu_keypoints, std::vector<KeyPoint>& keypoints)

modules/cudev/test/test_warp.cu

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,9 @@ TEST(WarpAffine, Rotation)
237237

238238
TEST(WarpPerspective, Rotation)
239239
{
240+
if (cvtest::skipUnstableTests)
241+
throw SkipTestException("Skip unstable test: https://github.com/opencv/opencv/issues/27813");
242+
240243
const Size size = randomSize(100, 400);
241244

242245
Mat src = randomMat(size, CV_32FC1, 0, 1);

modules/dpm/samples/cascade_detect_camera.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ int main( int argc, char** argv )
8787

8888
// use web camera
8989
VideoCapture capture(0);
90-
capture.set(CAP_PROP_FRAME_WIDTH, 320);
91-
capture.set(CAP_PROP_FRAME_HEIGHT, 240);
90+
capture.set(cv::CAP_PROP_FRAME_WIDTH, 320);
91+
capture.set(cv::CAP_PROP_FRAME_HEIGHT, 240);
9292

9393
if ( !capture.isOpened() )
9494
{

modules/fastcv/src/allocator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ cv::UMatData* QcAllocator::allocate(int dims, const int* sizes, int type,
4545
{
4646
if( step )
4747
{
48-
if( data0 && step[i] != CV_AUTOSTEP )
48+
if( data0 && step[i] != cv::Mat::AUTO_STEP )
4949
{
5050
CV_Assert(total <= step[i]);
5151
total = step[i];

modules/xfeatures2d/src/agast.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace cv
5050
namespace xfeatures2d
5151
{
5252

53-
#if (defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64))
53+
#if (defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64) || defined(_M_ARM64) || defined(__aarch64__) || defined(__arm__))
5454

5555
static void AGAST_5_8(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold)
5656
{
@@ -7446,7 +7446,7 @@ static void OAST_9_16(InputArray _img, std::vector<KeyPoint>& keypoints, int thr
74467446

74477447

74487448

7449-
#else // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64))
7449+
#else // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64) || defined(_M_ARM64) || defined(__aarch64__) || defined(__arm__))
74507450

74517451
static void AGAST_ALL(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, AgastFeatureDetector::DetectorType agasttype)
74527452
{
@@ -7934,7 +7934,7 @@ static void OAST_9_16(InputArray _img, std::vector<KeyPoint>& keypoints, int thr
79347934
AGAST_ALL(_img, keypoints, threshold, AgastFeatureDetector::OAST_9_16);
79357935
}
79367936

7937-
#endif // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64))
7937+
#endif // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64) || defined(_M_ARM64) || defined(__aarch64__) || defined(__arm__))
79387938

79397939
class AgastFeatureDetector_Impl CV_FINAL : public AgastFeatureDetector
79407940
{

modules/xfeatures2d/src/agast_score.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void makeAgastOffsets(int pixel[16], int rowStride, AgastFeatureDetector::Detect
9292
pixel[k] = offsets[k][0] + offsets[k][1] * rowStride;
9393
}
9494

95-
#if (defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64))
95+
#if (defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64) || defined(_M_ARM64) || defined(__aarch64__) || defined(__arm__))
9696
// 16 pixel mask
9797
template<>
9898
int agast_cornerScore<AgastFeatureDetector::OAST_9_16>(const uchar* ptr, const int pixel[], int threshold)
@@ -9375,7 +9375,7 @@ int agast_cornerScore<AgastFeatureDetector::AGAST_5_8>(const uchar* ptr, const i
93759375
b_test = (bmin + bmax) / 2;
93769376
}
93779377
}
9378-
#else // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64))
9378+
#else // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64) || defined(_M_ARM64) || defined(__aarch64__) || defined(__arm__))
93799379

93809380

93819381
int agast_tree_search(const uint32_t table_struct32[], int pixel_[], const unsigned char* const ptr, int threshold)
@@ -9860,7 +9860,7 @@ int agast_cornerScore<AgastFeatureDetector::OAST_9_16>(const uchar* ptr, const i
98609860
return AGAST_ALL_SCORE(ptr, pixel, threshold, AgastFeatureDetector::OAST_9_16);
98619861
}
98629862

9863-
#endif // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64))
9863+
#endif // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64) || defined(_M_ARM64) || defined(__aarch64__) || defined(__arm__))
98649864

98659865
}
98669866
} // namespace cv

modules/ximgproc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
set(the_description "Extended image processing module. It includes edge-aware filters and etc.")
2-
ocv_define_module(ximgproc opencv_core opencv_imgproc opencv_3d opencv_stereo opencv_imgcodecs opencv_video WRAP python java objc)
2+
ocv_define_module(ximgproc opencv_core opencv_imgproc opencv_3d opencv_stereo opencv_imgcodecs opencv_video WRAP python java objc js)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"whitelist":
3+
{
4+
"": ["createEdgeDrawing"],
5+
"ximgproc_EdgeDrawing": ["setParams", "detectEdges", "getEdgeImage"],
6+
"ximgproc_EdgeDrawing_Params": ["Params", "PFmode"]
7+
},
8+
"namespace_prefix_override":
9+
{
10+
"ximgproc": ""
11+
}
12+
}

0 commit comments

Comments
 (0)