diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
index ec7d7cd3b3..7faa6f7d84 100644
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -39,7 +39,6 @@ ALIASES += end_toggle="@htmlonly[block] @endhtmlonly"
ALIASES += prev_tutorial{1}="**Prev Tutorial:** \ref \1 \n"
ALIASES += next_tutorial{1}="**Next Tutorial:** \ref \1 \n"
ALIASES += youtube{1}="@htmlonly[block]
@endhtmlonly"
-TCL_SUBST =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
diff --git a/modules/core/include/opencv2/core/mat.hpp b/modules/core/include/opencv2/core/mat.hpp
index 3d80cbf410..c6375f6824 100644
--- a/modules/core/include/opencv2/core/mat.hpp
+++ b/modules/core/include/opencv2/core/mat.hpp
@@ -694,11 +694,16 @@ sub-matrices.
-# Process "foreign" data using OpenCV (for example, when you implement a DirectShow\* filter or
a processing module for gstreamer, and so on). For example:
@code
- void process_video_frame(const unsigned char* pixels,
- int width, int height, int step)
+ Mat process_video_frame(const unsigned char* pixels,
+ int width, int height, int step)
{
- Mat img(height, width, CV_8UC3, pixels, step);
- GaussianBlur(img, img, Size(7,7), 1.5, 1.5);
+ // wrap input buffer
+ Mat img(height, width, CV_8UC3, (unsigned char*)pixels, step);
+
+ Mat result;
+ GaussianBlur(img, result, Size(7, 7), 1.5, 1.5);
+
+ return result;
}
@endcode
-# Quickly initialize small matrices and/or get a super-fast element access.
diff --git a/modules/core/include/opencv2/core/vsx_utils.hpp b/modules/core/include/opencv2/core/vsx_utils.hpp
index 08ae890175..d7962517df 100644
--- a/modules/core/include/opencv2/core/vsx_utils.hpp
+++ b/modules/core/include/opencv2/core/vsx_utils.hpp
@@ -503,7 +503,7 @@ VSX_IMPL_CONV_EVEN_2_4(vec_uint4, vec_double2, vec_ctu, vec_ctuo)
VSX_IMPL_CONV_2VARIANT(vec_int4, vec_float4, vec_cts, vec_cts)
VSX_IMPL_CONV_2VARIANT(vec_float4, vec_int4, vec_ctf, vec_ctf)
// define vec_cts for converting double precision to signed doubleword
- // which isn't combitable with xlc but its okay since Eigen only use it for gcc
+ // which isn't compatible with xlc but its okay since Eigen only uses it for gcc
VSX_IMPL_CONV_2VARIANT(vec_dword2, vec_double2, vec_cts, vec_ctsl)
#endif // Eigen
diff --git a/modules/core/src/matmul.simd.hpp b/modules/core/src/matmul.simd.hpp
index 38973ea1a4..c828e2906d 100644
--- a/modules/core/src/matmul.simd.hpp
+++ b/modules/core/src/matmul.simd.hpp
@@ -1537,7 +1537,7 @@ transform_8u( const uchar* src, uchar* dst, const float* m, int len, int scn, in
static void
transform_16u( const ushort* src, ushort* dst, const float* m, int len, int scn, int dcn )
{
-#if CV_SIMD && !defined(__aarch64__) && !defined(_M_ARM64)
+#if CV_SIMD
if( scn == 3 && dcn == 3 )
{
int x = 0;
diff --git a/modules/flann/include/opencv2/flann/all_indices.h b/modules/flann/include/opencv2/flann/all_indices.h
index 2de18af24a..03877ab6ad 100644
--- a/modules/flann/include/opencv2/flann/all_indices.h
+++ b/modules/flann/include/opencv2/flann/all_indices.h
@@ -82,7 +82,7 @@ struct index_creator
nnIndex = new LshIndex(dataset, params, distance);
break;
default:
- throw FLANNException("Unknown index type");
+ FLANN_THROW(cv::Error::StsBadArg, "Unknown index type");
}
return nnIndex;
@@ -111,7 +111,7 @@ struct index_creator
nnIndex = new LshIndex(dataset, params, distance);
break;
default:
- throw FLANNException("Unknown index type");
+ FLANN_THROW(cv::Error::StsBadArg, "Unknown index type");
}
return nnIndex;
@@ -140,7 +140,7 @@ struct index_creator
nnIndex = new LshIndex(dataset, params, distance);
break;
default:
- throw FLANNException("Unknown index type");
+ FLANN_THROW(cv::Error::StsBadArg, "Unknown index type");
}
return nnIndex;
diff --git a/modules/flann/include/opencv2/flann/autotuned_index.h b/modules/flann/include/opencv2/flann/autotuned_index.h
index 54a60a73d6..d90f739aff 100644
--- a/modules/flann/include/opencv2/flann/autotuned_index.h
+++ b/modules/flann/include/opencv2/flann/autotuned_index.h
@@ -34,7 +34,6 @@
#include
-#include "general.h"
#include "nn_index.h"
#include "ground_truth.h"
#include "index_testing.h"
diff --git a/modules/flann/include/opencv2/flann/composite_index.h b/modules/flann/include/opencv2/flann/composite_index.h
index bcf0827c9f..f1af41ac26 100644
--- a/modules/flann/include/opencv2/flann/composite_index.h
+++ b/modules/flann/include/opencv2/flann/composite_index.h
@@ -33,7 +33,6 @@
//! @cond IGNORED
-#include "general.h"
#include "nn_index.h"
#include "kdtree_index.h"
#include "kmeans_index.h"
diff --git a/modules/flann/include/opencv2/flann/flann_base.hpp b/modules/flann/include/opencv2/flann/flann_base.hpp
index 0f23930024..258ec38d20 100644
--- a/modules/flann/include/opencv2/flann/flann_base.hpp
+++ b/modules/flann/include/opencv2/flann/flann_base.hpp
@@ -82,11 +82,11 @@ NNIndex* load_saved_index(const Matrix
IndexHeader header = load_header(fin);
if (header.data_type != Datatype::type()) {
fclose(fin);
- throw FLANNException("Datatype of saved index is different than of the one to be created.");
+ FLANN_THROW(cv::Error::StsError, "Datatype of saved index is different than of the one to be created.");
}
if ((size_t(header.rows) != dataset.rows)||(size_t(header.cols) != dataset.cols)) {
fclose(fin);
- throw FLANNException("The index saved belongs to a different dataset");
+ FLANN_THROW(cv::Error::StsError, "The index saved belongs to a different dataset");
}
IndexParams params;
@@ -140,7 +140,7 @@ public:
{
FILE* fout = fopen(filename.c_str(), "wb");
if (fout == NULL) {
- throw FLANNException("Cannot open file");
+ FLANN_THROW(cv::Error::StsError, "Cannot open file");
}
save_header(fout, *nnIndex_);
saveIndex(fout);
diff --git a/modules/flann/include/opencv2/flann/general.h b/modules/flann/include/opencv2/flann/general.h
index ac848d6230..29fa8be121 100644
--- a/modules/flann/include/opencv2/flann/general.h
+++ b/modules/flann/include/opencv2/flann/general.h
@@ -31,6 +31,8 @@
#ifndef OPENCV_FLANN_GENERAL_H_
#define OPENCV_FLANN_GENERAL_H_
+#if CV_VERSION_MAJOR <= 4
+
//! @cond IGNORED
#include "opencv2/core.hpp"
@@ -48,6 +50,14 @@ public:
}
+#define FLANN_THROW(TYPE, STR) throw FLANNException(STR)
+
+#else
+
+#define FLANN_THROW(TYPE, STR) CV_Error(TYPE, STR)
+
+#endif
+
//! @endcond
#endif /* OPENCV_FLANN_GENERAL_H_ */
diff --git a/modules/flann/include/opencv2/flann/hierarchical_clustering_index.h b/modules/flann/include/opencv2/flann/hierarchical_clustering_index.h
index b7a650ff00..2d39d4f0f6 100644
--- a/modules/flann/include/opencv2/flann/hierarchical_clustering_index.h
+++ b/modules/flann/include/opencv2/flann/hierarchical_clustering_index.h
@@ -382,7 +382,7 @@ public:
chooseCenters = &HierarchicalClusteringIndex::GroupWiseCenterChooser;
}
else {
- throw FLANNException("Unknown algorithm for choosing initial centers.");
+ FLANN_THROW(cv::Error::StsError, "Unknown algorithm for choosing initial centers.");
}
root = new NodePtr[trees_];
@@ -446,7 +446,7 @@ public:
void buildIndex() CV_OVERRIDE
{
if (branching_<2) {
- throw FLANNException("Branching factor must be at least 2");
+ FLANN_THROW(cv::Error::StsError, "Branching factor must be at least 2");
}
free_indices();
diff --git a/modules/flann/include/opencv2/flann/index_testing.h b/modules/flann/include/opencv2/flann/index_testing.h
index f3d147588d..207adef449 100644
--- a/modules/flann/include/opencv2/flann/index_testing.h
+++ b/modules/flann/include/opencv2/flann/index_testing.h
@@ -93,7 +93,7 @@ float search_with_ground_truth(NNIndex& index, const Matrix resultSet(nn+skipMatches);
diff --git a/modules/flann/include/opencv2/flann/kdtree_index.h b/modules/flann/include/opencv2/flann/kdtree_index.h
index 5a3d9d7fe0..603fdbd421 100644
--- a/modules/flann/include/opencv2/flann/kdtree_index.h
+++ b/modules/flann/include/opencv2/flann/kdtree_index.h
@@ -37,7 +37,6 @@
#include