Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
b5ecb1d3
Commit
b5ecb1d3
authored
Oct 31, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #111 from taka-no-me/algorithm/addParam-short
parents
74fe158f
ad982f4e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
7 deletions
+29
-7
algorithm.cpp
modules/core/src/algorithm.cpp
+17
-6
perf_fast.cpp
modules/features2d/perf/perf_fast.cpp
+1
-0
perf_input.cpp
modules/highgui/perf/perf_input.cpp
+5
-0
perf_output.cpp
modules/highgui/perf/perf_output.cpp
+5
-0
perf_warp.cpp
modules/imgproc/perf/perf_warp.cpp
+1
-1
No files found.
modules/core/src/algorithm.cpp
View file @
b5ecb1d3
...
...
@@ -415,6 +415,8 @@ void AlgorithmInfo::write(const Algorithm* algo, FileStorage& fs) const
cv
::
write
(
fs
,
pname
,
algo
->
get
<
int
>
(
pname
));
else
if
(
p
.
type
==
Param
::
BOOLEAN
)
cv
::
write
(
fs
,
pname
,
(
int
)
algo
->
get
<
bool
>
(
pname
));
else
if
(
p
.
type
==
Param
::
SHORT
)
cv
::
write
(
fs
,
pname
,
(
int
)
algo
->
get
<
short
>
(
pname
));
else
if
(
p
.
type
==
Param
::
REAL
)
cv
::
write
(
fs
,
pname
,
algo
->
get
<
double
>
(
pname
));
else
if
(
p
.
type
==
Param
::
STRING
)
...
...
@@ -430,7 +432,10 @@ void AlgorithmInfo::write(const Algorithm* algo, FileStorage& fs) const
nestedAlgo
->
write
(
fs
);
}
else
CV_Error
(
CV_StsUnsupportedFormat
,
"unknown/unsupported parameter type"
);
{
string
msg
=
format
(
"unknown/unsupported type of '%s' parameter == %d"
,
pname
.
c_str
(),
p
.
type
);
CV_Error
(
CV_StsUnsupportedFormat
,
msg
.
c_str
());
}
}
}
...
...
@@ -446,7 +451,7 @@ void AlgorithmInfo::read(Algorithm* algo, const FileNode& fn) const
const
FileNode
n
=
fn
[
pname
];
if
(
n
.
empty
()
)
continue
;
if
(
p
.
type
==
Param
::
INT
)
if
(
p
.
type
==
Param
::
INT
||
p
.
type
==
Param
::
SHORT
)
{
int
val
=
(
int
)
n
;
info
->
set
(
algo
,
pname
.
c_str
(),
p
.
type
,
&
val
,
true
);
...
...
@@ -486,7 +491,10 @@ void AlgorithmInfo::read(Algorithm* algo, const FileNode& fn) const
info
->
set
(
algo
,
pname
.
c_str
(),
p
.
type
,
&
nestedAlgo
,
true
);
}
else
CV_Error
(
CV_StsUnsupportedFormat
,
"unknown/unsupported parameter type"
);
{
string
msg
=
format
(
"unknown/unsupported type of '%s' parameter == %d"
,
pname
.
c_str
(),
p
.
type
);
CV_Error
(
CV_StsUnsupportedFormat
,
msg
.
c_str
());
}
}
}
...
...
@@ -589,7 +597,7 @@ void AlgorithmInfo::set(Algorithm* algo, const char* parameter, int argType, con
GetSetParam
f
;
f
.
set_int
=
p
->
setter
;
if
(
argType
==
Param
::
INT
||
argType
==
Param
::
BOOLEAN
||
argType
==
Param
::
REAL
)
if
(
argType
==
Param
::
INT
||
argType
==
Param
::
BOOLEAN
||
argType
==
Param
::
REAL
||
argType
==
Param
::
SHORT
)
{
if
(
!
(
p
->
type
==
Param
::
INT
||
p
->
type
==
Param
::
REAL
||
p
->
type
==
Param
::
BOOLEAN
||
(
p
->
type
==
Param
::
SHORT
&&
argType
==
Param
::
INT
))
)
{
...
...
@@ -805,7 +813,10 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* parameter, int argTyp
*
(
Ptr
<
Algorithm
>*
)((
uchar
*
)
algo
+
p
->
offset
);
}
else
CV_Error
(
CV_StsBadArg
,
"Unknown/unsupported parameter type"
);
{
string
message
=
getErrorMessageForWrongArgumentInGetter
(
algo
->
name
(),
parameter
,
p
->
type
,
argType
);
CV_Error
(
CV_StsBadArg
,
message
);
}
}
...
...
@@ -864,7 +875,7 @@ void AlgorithmInfo::addParam(Algorithm& algo, const char* parameter,
void
(
Algorithm
::*
setter
)(
int
),
const
string
&
help
)
{
addParam_
(
algo
,
parameter
,
ParamType
<
in
t
>::
type
,
&
value
,
readOnly
,
addParam_
(
algo
,
parameter
,
ParamType
<
shor
t
>::
type
,
&
value
,
readOnly
,
(
Algorithm
::
Getter
)
getter
,
(
Algorithm
::
Setter
)
setter
,
help
);
}
...
...
modules/features2d/perf/perf_fast.cpp
View file @
b5ecb1d3
...
...
@@ -31,6 +31,7 @@ PERF_TEST_P(fast, detect, testing::Combine(
declare
.
in
(
frame
);
Ptr
<
FeatureDetector
>
fd
=
Algorithm
::
create
<
FeatureDetector
>
(
"Feature2D.FASTX"
);
ASSERT_FALSE
(
fd
==
0
);
fd
->
set
(
"threshold"
,
20
);
fd
->
set
(
"nonmaxSuppression"
,
true
);
fd
->
set
(
"type"
,
type
);
...
...
modules/highgui/perf/perf_input.cpp
View file @
b5ecb1d3
...
...
@@ -6,6 +6,8 @@ using namespace perf;
using
std
::
tr1
::
make_tuple
;
using
std
::
tr1
::
get
;
#ifndef ANDROID
typedef
perf
::
TestBaseWithParam
<
String
>
VideoCapture_Reading
;
PERF_TEST_P
(
VideoCapture_Reading
,
ReadFile
,
testing
::
Values
(
"highgui/video/big_buck_bunny.avi"
,
...
...
@@ -23,3 +25,5 @@ PERF_TEST_P(VideoCapture_Reading, ReadFile, testing::Values( "highgui/video/big_
bool
dummy
=
cap
.
isOpened
();
SANITY_CHECK
(
dummy
);
}
#endif //ANDROID
\ No newline at end of file
modules/highgui/perf/perf_output.cpp
View file @
b5ecb1d3
...
...
@@ -6,6 +6,8 @@ using namespace perf;
using
std
::
tr1
::
make_tuple
;
using
std
::
tr1
::
get
;
#ifndef ANDROID
typedef
std
::
tr1
::
tuple
<
String
,
bool
>
VideoWriter_Writing_t
;
typedef
perf
::
TestBaseWithParam
<
VideoWriter_Writing_t
>
VideoWriter_Writing
;
...
...
@@ -28,3 +30,5 @@ PERF_TEST_P(VideoWriter_Writing, WriteFrame,
bool
dummy
=
writer
.
isOpened
();
SANITY_CHECK
(
dummy
);
}
#endif //ANDROID
\ No newline at end of file
modules/imgproc/perf/perf_warp.cpp
View file @
b5ecb1d3
...
...
@@ -139,7 +139,7 @@ PERF_TEST_P( TestWarpPerspectiveNear_t, WarpPerspectiveNear,
warpPerspective
(
src
,
dst
,
warpMat
,
size
,
interType
,
borderMode
,
Scalar
::
all
(
150
)
);
}
SANITY_CHECK
(
dst
);
SANITY_CHECK
(
dst
,
1
);
}
PERF_TEST_P
(
TestRemap
,
remap
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment