diff --git a/modules/bgsegm/src/bgfg_gsoc.cpp b/modules/bgsegm/src/bgfg_gsoc.cpp index b034fb6a254..0bec405f7a9 100644 --- a/modules/bgsegm/src/bgfg_gsoc.cpp +++ b/modules/bgsegm/src/bgfg_gsoc.cpp @@ -70,7 +70,7 @@ const float LSBPtau = 0.05f; inline int LSBPDist32(unsigned n) { #if defined(__GNUC__) || defined(__clang__) return __builtin_popcount(n); -#elif defined(_MSC_VER) && !(defined(_M_ARM) || defined(_M_ARM64)) +#elif defined(_MSC_VER) return __popcnt(n); #else // Taken from http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel diff --git a/modules/cudafeatures2d/src/fast.cpp b/modules/cudafeatures2d/src/fast.cpp index e2c13b06b2b..5138ec0b89c 100644 --- a/modules/cudafeatures2d/src/fast.cpp +++ b/modules/cudafeatures2d/src/fast.cpp @@ -66,6 +66,7 @@ namespace { public: FAST_Impl(int threshold, bool nonmaxSuppression, int max_npoints); + ~FAST_Impl(); virtual void detect(InputArray _image, std::vector& keypoints, InputArray _mask); virtual void detectAsync(InputArray _image, OutputArray _keypoints, InputArray _mask, Stream& stream); @@ -95,6 +96,12 @@ namespace FAST_Impl::FAST_Impl(int threshold, bool nonmaxSuppression, int max_npoints) : threshold_(threshold), nonmaxSuppression_(nonmaxSuppression), max_npoints_(max_npoints) { + cudaSafeCall( cudaMalloc(&d_counter, sizeof(unsigned int)) ); + } + + FAST_Impl::~FAST_Impl() + { + cudaSafeCall( cudaFree(d_counter) ); } void FAST_Impl::detect(InputArray _image, std::vector& keypoints, InputArray _mask) @@ -116,8 +123,6 @@ namespace { using namespace cv::cuda::device::fast; - cudaSafeCall( cudaMalloc(&d_counter, sizeof(unsigned int)) ); - const GpuMat img = _image.getGpuMat(); const GpuMat mask = _mask.getGpuMat(); @@ -165,8 +170,6 @@ namespace kpLoc.colRange(0, count).copyTo(locRow, stream); keypoints.row(1).setTo(Scalar::all(0), stream); } - - cudaSafeCall( cudaFree(d_counter) ); } void FAST_Impl::convert(InputArray _gpu_keypoints, std::vector& keypoints) diff --git a/modules/cudev/test/test_warp.cu b/modules/cudev/test/test_warp.cu index 72d0643148c..10f98ac1016 100644 --- a/modules/cudev/test/test_warp.cu +++ b/modules/cudev/test/test_warp.cu @@ -237,6 +237,9 @@ TEST(WarpAffine, Rotation) TEST(WarpPerspective, Rotation) { + if (cvtest::skipUnstableTests) + throw SkipTestException("Skip unstable test: https://github.com/opencv/opencv/issues/27813"); + const Size size = randomSize(100, 400); Mat src = randomMat(size, CV_32FC1, 0, 1); diff --git a/modules/dpm/samples/cascade_detect_camera.cpp b/modules/dpm/samples/cascade_detect_camera.cpp index d384d547bb1..fd64be4835e 100644 --- a/modules/dpm/samples/cascade_detect_camera.cpp +++ b/modules/dpm/samples/cascade_detect_camera.cpp @@ -87,8 +87,8 @@ int main( int argc, char** argv ) // use web camera VideoCapture capture(0); - capture.set(CAP_PROP_FRAME_WIDTH, 320); - capture.set(CAP_PROP_FRAME_HEIGHT, 240); + capture.set(cv::CAP_PROP_FRAME_WIDTH, 320); + capture.set(cv::CAP_PROP_FRAME_HEIGHT, 240); if ( !capture.isOpened() ) { diff --git a/modules/fastcv/src/allocator.cpp b/modules/fastcv/src/allocator.cpp index 6658b00d4c6..f85bc409a84 100644 --- a/modules/fastcv/src/allocator.cpp +++ b/modules/fastcv/src/allocator.cpp @@ -45,7 +45,7 @@ cv::UMatData* QcAllocator::allocate(int dims, const int* sizes, int type, { if( step ) { - if( data0 && step[i] != CV_AUTOSTEP ) + if( data0 && step[i] != cv::Mat::AUTO_STEP ) { CV_Assert(total <= step[i]); total = step[i]; diff --git a/modules/xfeatures2d/src/agast.cpp b/modules/xfeatures2d/src/agast.cpp index b6c87ad23ff..975eaab3433 100644 --- a/modules/xfeatures2d/src/agast.cpp +++ b/modules/xfeatures2d/src/agast.cpp @@ -50,7 +50,7 @@ namespace cv namespace xfeatures2d { -#if (defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64)) +#if (defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64) || defined(_M_ARM64) || defined(__aarch64__) || defined(__arm__)) static void AGAST_5_8(InputArray _img, std::vector& keypoints, int threshold) { @@ -7446,7 +7446,7 @@ static void OAST_9_16(InputArray _img, std::vector& keypoints, int thr -#else // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64)) +#else // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64) || defined(_M_ARM64) || defined(__aarch64__) || defined(__arm__)) static void AGAST_ALL(InputArray _img, std::vector& keypoints, int threshold, AgastFeatureDetector::DetectorType agasttype) { @@ -7934,7 +7934,7 @@ static void OAST_9_16(InputArray _img, std::vector& keypoints, int thr AGAST_ALL(_img, keypoints, threshold, AgastFeatureDetector::OAST_9_16); } -#endif // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64)) +#endif // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64) || defined(_M_ARM64) || defined(__aarch64__) || defined(__arm__)) class AgastFeatureDetector_Impl CV_FINAL : public AgastFeatureDetector { diff --git a/modules/xfeatures2d/src/agast_score.cpp b/modules/xfeatures2d/src/agast_score.cpp index 913cc778942..96523bff9cd 100644 --- a/modules/xfeatures2d/src/agast_score.cpp +++ b/modules/xfeatures2d/src/agast_score.cpp @@ -92,7 +92,7 @@ void makeAgastOffsets(int pixel[16], int rowStride, AgastFeatureDetector::Detect pixel[k] = offsets[k][0] + offsets[k][1] * rowStride; } -#if (defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64)) +#if (defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64) || defined(_M_ARM64) || defined(__aarch64__) || defined(__arm__)) // 16 pixel mask template<> int agast_cornerScore(const uchar* ptr, const int pixel[], int threshold) @@ -9375,7 +9375,7 @@ int agast_cornerScore(const uchar* ptr, const i b_test = (bmin + bmax) / 2; } } -#else // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64)) +#else // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64) || defined(_M_ARM64) || defined(__aarch64__) || defined(__arm__)) 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(const uchar* ptr, const i return AGAST_ALL_SCORE(ptr, pixel, threshold, AgastFeatureDetector::OAST_9_16); } -#endif // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64)) +#endif // !(defined __i386__ || defined(_M_IX86) || defined __x86_64__ || defined(_M_X64) || defined(_M_ARM64) || defined(__aarch64__) || defined(__arm__)) } } // namespace cv diff --git a/modules/ximgproc/CMakeLists.txt b/modules/ximgproc/CMakeLists.txt index 3f5c7b0a61f..8ea7f2c4585 100644 --- a/modules/ximgproc/CMakeLists.txt +++ b/modules/ximgproc/CMakeLists.txt @@ -1,2 +1,2 @@ set(the_description "Extended image processing module. It includes edge-aware filters and etc.") -ocv_define_module(ximgproc opencv_core opencv_imgproc opencv_3d opencv_stereo opencv_imgcodecs opencv_video WRAP python java objc) +ocv_define_module(ximgproc opencv_core opencv_imgproc opencv_3d opencv_stereo opencv_imgcodecs opencv_video WRAP python java objc js) diff --git a/modules/ximgproc/misc/js/gen_dict.json b/modules/ximgproc/misc/js/gen_dict.json new file mode 100644 index 00000000000..ff14d78703d --- /dev/null +++ b/modules/ximgproc/misc/js/gen_dict.json @@ -0,0 +1,12 @@ +{ + "whitelist": + { + "": ["createEdgeDrawing"], + "ximgproc_EdgeDrawing": ["setParams", "detectEdges", "getEdgeImage"], + "ximgproc_EdgeDrawing_Params": ["Params", "PFmode"] + }, + "namespace_prefix_override": + { + "ximgproc": "" + } +}