Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
ff211371
O
Opencv
项目概览
Greenplum
/
Opencv
10 个月 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ff211371
编写于
10月 17, 2020
作者:
V
Vincent Rabaud
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace FLANNException by CV_Error.
上级
d1594174
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
30 addition
and
32 deletion
+30
-32
modules/flann/include/opencv2/flann/all_indices.h
modules/flann/include/opencv2/flann/all_indices.h
+3
-3
modules/flann/include/opencv2/flann/autotuned_index.h
modules/flann/include/opencv2/flann/autotuned_index.h
+0
-1
modules/flann/include/opencv2/flann/composite_index.h
modules/flann/include/opencv2/flann/composite_index.h
+0
-1
modules/flann/include/opencv2/flann/flann_base.hpp
modules/flann/include/opencv2/flann/flann_base.hpp
+3
-3
modules/flann/include/opencv2/flann/general.h
modules/flann/include/opencv2/flann/general.h
+10
-0
modules/flann/include/opencv2/flann/hierarchical_clustering_index.h
...ann/include/opencv2/flann/hierarchical_clustering_index.h
+2
-2
modules/flann/include/opencv2/flann/index_testing.h
modules/flann/include/opencv2/flann/index_testing.h
+1
-1
modules/flann/include/opencv2/flann/kdtree_index.h
modules/flann/include/opencv2/flann/kdtree_index.h
+0
-1
modules/flann/include/opencv2/flann/kdtree_single_index.h
modules/flann/include/opencv2/flann/kdtree_single_index.h
+0
-1
modules/flann/include/opencv2/flann/kmeans_index.h
modules/flann/include/opencv2/flann/kmeans_index.h
+3
-3
modules/flann/include/opencv2/flann/linear_index.h
modules/flann/include/opencv2/flann/linear_index.h
+0
-1
modules/flann/include/opencv2/flann/lsh_index.h
modules/flann/include/opencv2/flann/lsh_index.h
+0
-1
modules/flann/include/opencv2/flann/matrix.h
modules/flann/include/opencv2/flann/matrix.h
+0
-2
modules/flann/include/opencv2/flann/nn_index.h
modules/flann/include/opencv2/flann/nn_index.h
+0
-1
modules/flann/include/opencv2/flann/params.h
modules/flann/include/opencv2/flann/params.h
+1
-1
modules/flann/include/opencv2/flann/random.h
modules/flann/include/opencv2/flann/random.h
+0
-2
modules/flann/include/opencv2/flann/saving.h
modules/flann/include/opencv2/flann/saving.h
+7
-7
modules/flann/src/precomp.hpp
modules/flann/src/precomp.hpp
+0
-1
未找到文件。
modules/flann/include/opencv2/flann/all_indices.h
浏览文件 @
ff211371
...
...
@@ -82,7 +82,7 @@ struct index_creator
nnIndex
=
new
LshIndex
<
Distance
>
(
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<False,VectorSpace,Distance>
nnIndex
=
new
LshIndex
<
Distance
>
(
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<False,False,Distance>
nnIndex
=
new
LshIndex
<
Distance
>
(
dataset
,
params
,
distance
);
break
;
default:
throw
FLANNException
(
"Unknown index type"
);
FLANN_THROW
(
cv
::
Error
::
StsBadArg
,
"Unknown index type"
);
}
return
nnIndex
;
...
...
modules/flann/include/opencv2/flann/autotuned_index.h
浏览文件 @
ff211371
...
...
@@ -34,7 +34,6 @@
#include <sstream>
#include "general.h"
#include "nn_index.h"
#include "ground_truth.h"
#include "index_testing.h"
...
...
modules/flann/include/opencv2/flann/composite_index.h
浏览文件 @
ff211371
...
...
@@ -33,7 +33,6 @@
//! @cond IGNORED
#include "general.h"
#include "nn_index.h"
#include "kdtree_index.h"
#include "kmeans_index.h"
...
...
modules/flann/include/opencv2/flann/flann_base.hpp
浏览文件 @
ff211371
...
...
@@ -82,11 +82,11 @@ NNIndex<Distance>* load_saved_index(const Matrix<typename Distance::ElementType>
IndexHeader
header
=
load_header
(
fin
);
if
(
header
.
data_type
!=
Datatype
<
ElementType
>::
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
);
...
...
modules/flann/include/opencv2/flann/general.h
浏览文件 @
ff211371
...
...
@@ -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_ */
modules/flann/include/opencv2/flann/hierarchical_clustering_index.h
浏览文件 @
ff211371
...
...
@@ -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
();
...
...
modules/flann/include/opencv2/flann/index_testing.h
浏览文件 @
ff211371
...
...
@@ -93,7 +93,7 @@ float search_with_ground_truth(NNIndex<Distance>& index, const Matrix<typename D
if
(
matches
.
cols
<
size_t
(
nn
))
{
Logger
::
info
(
"matches.cols=%d, nn=%d
\n
"
,
matches
.
cols
,
nn
);
throw
FLANNException
(
"Ground truth is not computed for as many neighbors as requested"
);
FLANN_THROW
(
cv
::
Error
::
StsError
,
"Ground truth is not computed for as many neighbors as requested"
);
}
KNNResultSet
<
DistanceType
>
resultSet
(
nn
+
skipMatches
);
...
...
modules/flann/include/opencv2/flann/kdtree_index.h
浏览文件 @
ff211371
...
...
@@ -37,7 +37,6 @@
#include <map>
#include <cstring>
#include "general.h"
#include "nn_index.h"
#include "dynamic_bitset.h"
#include "matrix.h"
...
...
modules/flann/include/opencv2/flann/kdtree_single_index.h
浏览文件 @
ff211371
...
...
@@ -37,7 +37,6 @@
#include <map>
#include <cstring>
#include "general.h"
#include "nn_index.h"
#include "matrix.h"
#include "result_set.h"
...
...
modules/flann/include/opencv2/flann/kmeans_index.h
浏览文件 @
ff211371
...
...
@@ -381,7 +381,7 @@ public:
chooseCenters
=
&
KMeansIndex
::
chooseCentersKMeanspp
;
}
else
{
throw
FLANNException
(
"Unknown algorithm for choosing initial centers."
);
FLANN_THROW
(
cv
::
Error
::
StsBadArg
,
"Unknown algorithm for choosing initial centers."
);
}
cb_index_
=
0.4
f
;
...
...
@@ -453,7 +453,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
();
...
...
@@ -570,7 +570,7 @@ public:
{
int
numClusters
=
centers
.
rows
;
if
(
numClusters
<
1
)
{
throw
FLANNException
(
"Number of clusters must be at least 1"
);
FLANN_THROW
(
cv
::
Error
::
StsBadArg
,
"Number of clusters must be at least 1"
);
}
DistanceType
variance
;
...
...
modules/flann/include/opencv2/flann/linear_index.h
浏览文件 @
ff211371
...
...
@@ -33,7 +33,6 @@
//! @cond IGNORED
#include "general.h"
#include "nn_index.h"
namespace
cvflann
...
...
modules/flann/include/opencv2/flann/lsh_index.h
浏览文件 @
ff211371
...
...
@@ -42,7 +42,6 @@
#include <map>
#include <vector>
#include "general.h"
#include "nn_index.h"
#include "matrix.h"
#include "result_set.h"
...
...
modules/flann/include/opencv2/flann/matrix.h
浏览文件 @
ff211371
...
...
@@ -35,8 +35,6 @@
#include <stdio.h>
#include "general.h"
namespace
cvflann
{
...
...
modules/flann/include/opencv2/flann/nn_index.h
浏览文件 @
ff211371
...
...
@@ -31,7 +31,6 @@
#ifndef OPENCV_FLANN_NNINDEX_H
#define OPENCV_FLANN_NNINDEX_H
#include "general.h"
#include "matrix.h"
#include "result_set.h"
#include "params.h"
...
...
modules/flann/include/opencv2/flann/params.h
浏览文件 @
ff211371
...
...
@@ -77,7 +77,7 @@ T get_param(const IndexParams& params, cv::String name)
return
it
->
second
.
cast
<
T
>
();
}
else
{
throw
FLANNException
(
cv
::
String
(
"Missing parameter '"
)
+
name
+
cv
::
String
(
"' in the parameters given"
));
FLANN_THROW
(
cv
::
Error
::
StsBadArg
,
cv
::
String
(
"Missing parameter '"
)
+
name
+
cv
::
String
(
"' in the parameters given"
));
}
}
...
...
modules/flann/include/opencv2/flann/random.h
浏览文件 @
ff211371
...
...
@@ -37,8 +37,6 @@
#include <cstdlib>
#include <vector>
#include "general.h"
namespace
cvflann
{
...
...
modules/flann/include/opencv2/flann/saving.h
浏览文件 @
ff211371
...
...
@@ -112,11 +112,11 @@ inline IndexHeader load_header(FILE* stream)
size_t
read_size
=
fread
(
&
header
,
sizeof
(
header
),
1
,
stream
);
if
(
read_size
!=
(
size_t
)
1
)
{
throw
FLANNException
(
"Invalid index file, cannot read"
);
FLANN_THROW
(
cv
::
Error
::
StsError
,
"Invalid index file, cannot read"
);
}
if
(
strcmp
(
header
.
signature
,
FLANN_SIGNATURE_
)
!=
0
)
{
throw
FLANNException
(
"Invalid index file, wrong signature"
);
FLANN_THROW
(
cv
::
Error
::
StsError
,
"Invalid index file, wrong signature"
);
}
return
header
;
...
...
@@ -150,7 +150,7 @@ void load_value(FILE* stream, T& value, size_t count = 1)
{
size_t
read_cnt
=
fread
(
&
value
,
sizeof
(
value
),
count
,
stream
);
if
(
read_cnt
!=
count
)
{
throw
FLANNException
(
"Cannot read from file"
);
FLANN_THROW
(
cv
::
Error
::
StsParseError
,
"Cannot read from file"
);
}
}
...
...
@@ -159,12 +159,12 @@ void load_value(FILE* stream, cvflann::Matrix<T>& value)
{
size_t
read_cnt
=
fread
(
&
value
,
sizeof
(
value
),
1
,
stream
);
if
(
read_cnt
!=
1
)
{
throw
FLANNException
(
"Cannot read from file"
);
FLANN_THROW
(
cv
::
Error
::
StsParseError
,
"Cannot read from file"
);
}
value
.
data
=
new
T
[
value
.
rows
*
value
.
cols
];
read_cnt
=
fread
(
value
.
data
,
sizeof
(
T
),
value
.
rows
*
value
.
cols
,
stream
);
if
(
read_cnt
!=
(
size_t
)(
value
.
rows
*
value
.
cols
))
{
throw
FLANNException
(
"Cannot read from file"
);
FLANN_THROW
(
cv
::
Error
::
StsParseError
,
"Cannot read from file"
);
}
}
...
...
@@ -175,12 +175,12 @@ void load_value(FILE* stream, std::vector<T>& value)
size_t
size
;
size_t
read_cnt
=
fread
(
&
size
,
sizeof
(
size_t
),
1
,
stream
);
if
(
read_cnt
!=
1
)
{
throw
FLANNException
(
"Cannot read from file"
);
FLANN_THROW
(
cv
::
Error
::
StsError
,
"Cannot read from file"
);
}
value
.
resize
(
size
);
read_cnt
=
fread
(
&
value
[
0
],
sizeof
(
T
),
size
,
stream
);
if
(
read_cnt
!=
size
)
{
throw
FLANNException
(
"Cannot read from file"
);
FLANN_THROW
(
cv
::
Error
::
StsError
,
"Cannot read from file"
);
}
}
...
...
modules/flann/src/precomp.hpp
浏览文件 @
ff211371
...
...
@@ -13,7 +13,6 @@
#include "opencv2/flann/index_testing.h"
#include "opencv2/flann/params.h"
#include "opencv2/flann/saving.h"
#include "opencv2/flann/general.h"
// index types
#include "opencv2/flann/all_indices.h"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录