Skip to content

Commit 6659d55

Browse files
committed
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
2 parents b479508 + e6c9291 commit 6659d55

25 files changed

+73
-40
lines changed

doc/Doxyfile.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ ALIASES += end_toggle="@htmlonly[block] </div> @endhtmlonly"
3939
ALIASES += prev_tutorial{1}="**Prev Tutorial:** \ref \1 \n"
4040
ALIASES += next_tutorial{1}="**Next Tutorial:** \ref \1 \n"
4141
ALIASES += youtube{1}="@htmlonly[block]<div align='center'><iframe title='Video' width='560' height='349' src='https://www.youtube.com/embed/\1?rel=0' frameborder='0' align='middle' allowfullscreen></iframe></div>@endhtmlonly"
42-
TCL_SUBST =
4342
OPTIMIZE_OUTPUT_FOR_C = NO
4443
OPTIMIZE_OUTPUT_JAVA = NO
4544
OPTIMIZE_FOR_FORTRAN = NO

modules/core/include/opencv2/core/mat.hpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,11 +694,16 @@ sub-matrices.
694694
-# Process "foreign" data using OpenCV (for example, when you implement a DirectShow\* filter or
695695
a processing module for gstreamer, and so on). For example:
696696
@code
697-
void process_video_frame(const unsigned char* pixels,
698-
int width, int height, int step)
697+
Mat process_video_frame(const unsigned char* pixels,
698+
int width, int height, int step)
699699
{
700-
Mat img(height, width, CV_8UC3, pixels, step);
701-
GaussianBlur(img, img, Size(7,7), 1.5, 1.5);
700+
// wrap input buffer
701+
Mat img(height, width, CV_8UC3, (unsigned char*)pixels, step);
702+
703+
Mat result;
704+
GaussianBlur(img, result, Size(7, 7), 1.5, 1.5);
705+
706+
return result;
702707
}
703708
@endcode
704709
-# Quickly initialize small matrices and/or get a super-fast element access.

modules/core/include/opencv2/core/vsx_utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ VSX_IMPL_CONV_EVEN_2_4(vec_uint4, vec_double2, vec_ctu, vec_ctuo)
503503
VSX_IMPL_CONV_2VARIANT(vec_int4, vec_float4, vec_cts, vec_cts)
504504
VSX_IMPL_CONV_2VARIANT(vec_float4, vec_int4, vec_ctf, vec_ctf)
505505
// define vec_cts for converting double precision to signed doubleword
506-
// which isn't combitable with xlc but its okay since Eigen only use it for gcc
506+
// which isn't compatible with xlc but its okay since Eigen only uses it for gcc
507507
VSX_IMPL_CONV_2VARIANT(vec_dword2, vec_double2, vec_cts, vec_ctsl)
508508
#endif // Eigen
509509

modules/core/src/matmul.simd.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ transform_8u( const uchar* src, uchar* dst, const float* m, int len, int scn, in
15371537
static void
15381538
transform_16u( const ushort* src, ushort* dst, const float* m, int len, int scn, int dcn )
15391539
{
1540-
#if CV_SIMD && !defined(__aarch64__) && !defined(_M_ARM64)
1540+
#if CV_SIMD
15411541
if( scn == 3 && dcn == 3 )
15421542
{
15431543
int x = 0;

modules/flann/include/opencv2/flann/all_indices.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ struct index_creator
8282
nnIndex = new LshIndex<Distance>(dataset, params, distance);
8383
break;
8484
default:
85-
throw FLANNException("Unknown index type");
85+
FLANN_THROW(cv::Error::StsBadArg, "Unknown index type");
8686
}
8787

8888
return nnIndex;
@@ -111,7 +111,7 @@ struct index_creator<False,VectorSpace,Distance>
111111
nnIndex = new LshIndex<Distance>(dataset, params, distance);
112112
break;
113113
default:
114-
throw FLANNException("Unknown index type");
114+
FLANN_THROW(cv::Error::StsBadArg, "Unknown index type");
115115
}
116116

117117
return nnIndex;
@@ -140,7 +140,7 @@ struct index_creator<False,False,Distance>
140140
nnIndex = new LshIndex<Distance>(dataset, params, distance);
141141
break;
142142
default:
143-
throw FLANNException("Unknown index type");
143+
FLANN_THROW(cv::Error::StsBadArg, "Unknown index type");
144144
}
145145

146146
return nnIndex;

modules/flann/include/opencv2/flann/autotuned_index.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434

3535
#include <sstream>
3636

37-
#include "general.h"
3837
#include "nn_index.h"
3938
#include "ground_truth.h"
4039
#include "index_testing.h"

modules/flann/include/opencv2/flann/composite_index.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434
//! @cond IGNORED
3535

36-
#include "general.h"
3736
#include "nn_index.h"
3837
#include "kdtree_index.h"
3938
#include "kmeans_index.h"

modules/flann/include/opencv2/flann/flann_base.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ NNIndex<Distance>* load_saved_index(const Matrix<typename Distance::ElementType>
8282
IndexHeader header = load_header(fin);
8383
if (header.data_type != Datatype<ElementType>::type()) {
8484
fclose(fin);
85-
throw FLANNException("Datatype of saved index is different than of the one to be created.");
85+
FLANN_THROW(cv::Error::StsError, "Datatype of saved index is different than of the one to be created.");
8686
}
8787
if ((size_t(header.rows) != dataset.rows)||(size_t(header.cols) != dataset.cols)) {
8888
fclose(fin);
89-
throw FLANNException("The index saved belongs to a different dataset");
89+
FLANN_THROW(cv::Error::StsError, "The index saved belongs to a different dataset");
9090
}
9191

9292
IndexParams params;
@@ -140,7 +140,7 @@ class Index : public NNIndex<Distance>
140140
{
141141
FILE* fout = fopen(filename.c_str(), "wb");
142142
if (fout == NULL) {
143-
throw FLANNException("Cannot open file");
143+
FLANN_THROW(cv::Error::StsError, "Cannot open file");
144144
}
145145
save_header(fout, *nnIndex_);
146146
saveIndex(fout);

modules/flann/include/opencv2/flann/general.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#ifndef OPENCV_FLANN_GENERAL_H_
3232
#define OPENCV_FLANN_GENERAL_H_
3333

34+
#if CV_VERSION_MAJOR <= 4
35+
3436
//! @cond IGNORED
3537

3638
#include "opencv2/core.hpp"
@@ -48,6 +50,14 @@ class FLANNException : public cv::Exception
4850

4951
}
5052

53+
#define FLANN_THROW(TYPE, STR) throw FLANNException(STR)
54+
55+
#else
56+
57+
#define FLANN_THROW(TYPE, STR) CV_Error(TYPE, STR)
58+
59+
#endif
60+
5161
//! @endcond
5262

5363
#endif /* OPENCV_FLANN_GENERAL_H_ */

modules/flann/include/opencv2/flann/hierarchical_clustering_index.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ class HierarchicalClusteringIndex : public NNIndex<Distance>
382382
chooseCenters = &HierarchicalClusteringIndex::GroupWiseCenterChooser;
383383
}
384384
else {
385-
throw FLANNException("Unknown algorithm for choosing initial centers.");
385+
FLANN_THROW(cv::Error::StsError, "Unknown algorithm for choosing initial centers.");
386386
}
387387

388388
root = new NodePtr[trees_];
@@ -446,7 +446,7 @@ class HierarchicalClusteringIndex : public NNIndex<Distance>
446446
void buildIndex() CV_OVERRIDE
447447
{
448448
if (branching_<2) {
449-
throw FLANNException("Branching factor must be at least 2");
449+
FLANN_THROW(cv::Error::StsError, "Branching factor must be at least 2");
450450
}
451451

452452
free_indices();

0 commit comments

Comments
 (0)