Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
0ca3e31d
Commit
0ca3e31d
authored
Aug 02, 2014
by
biagio montesano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed some asserts
parent
df38bca3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
28 deletions
+13
-28
descriptor.hpp
...descriptor/include/opencv2/line_descriptor/descriptor.hpp
+2
-2
binary_descriptor.cpp
modules/line_descriptor/src/binary_descriptor.cpp
+10
-26
precomp.hpp
modules/line_descriptor/src/precomp.hpp
+1
-0
No files found.
modules/line_descriptor/include/opencv2/line_descriptor/descriptor.hpp
View file @
0ca3e31d
...
...
@@ -236,10 +236,10 @@ class CV_EXPORTS_W BinaryDescriptor : public Algorithm
int
OctaveKeyLines
(
cv
::
Mat
&
image
,
ScaleLines
&
keyLines
);
/* the local gaussian coefficient applied to the orthogonal line direction within each band */
std
::
vector
<
float
>
gaussCoefL_
;
std
::
vector
<
double
>
gaussCoefL_
;
/* the global gaussian coefficient applied to each row within line support region */
std
::
vector
<
float
>
gaussCoefG_
;
std
::
vector
<
double
>
gaussCoefG_
;
/* descriptor parameters */
Params
params
;
...
...
modules/line_descriptor/src/binary_descriptor.cpp
View file @
0ca3e31d
...
...
@@ -209,7 +209,7 @@ void BinaryDescriptor::operator()( InputArray image, InputArray mask, CV_OUT std
maskMat
=
mask
.
getMat
();
/* initialize output matrix */
descriptors
.
create
(
Size
(
32
,
keylines
.
size
()
),
CV_8UC1
);
descriptors
.
create
(
Size
(
32
,
(
int
)
keylines
.
size
()
),
CV_8UC1
);
/* store reference to output matrix */
descrMat
=
descriptors
.
getMat
();
...
...
@@ -260,12 +260,11 @@ int BinaryDescriptor::descriptorSize() const
static
inline
int
get2Pow
(
int
i
)
{
if
(
i
>=
0
&&
i
<=
7
)
return
pow
(
2
,
(
double
)
i
);
return
(
int
)
pow
(
2
,
(
double
)
i
);
else
{
CV_Assert
(
false
);
return
-
1
;
throw
std
::
runtime_error
(
"Invalid power argument"
);
}
}
...
...
@@ -276,7 +275,7 @@ unsigned char BinaryDescriptor::binaryConversion( float* f1, float* f2 )
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
if
(
f1
[
i
]
>
f2
[
i
]
)
result
+=
get2Pow
(
i
);
result
+=
(
uchar
)
get2Pow
(
i
);
}
return
result
;
...
...
@@ -287,12 +286,7 @@ unsigned char BinaryDescriptor::binaryConversion( float* f1, float* f2 )
void
BinaryDescriptor
::
detect
(
const
Mat
&
image
,
CV_OUT
std
::
vector
<
KeyLine
>&
keylines
,
const
Mat
&
mask
)
{
if
(
mask
.
data
!=
NULL
&&
(
mask
.
size
()
!=
image
.
size
()
||
mask
.
type
()
!=
CV_8UC1
)
)
{
std
::
cout
<<
"Mask error while detecting lines: "
<<
"please check its dimensions and that data type is CV_8UC1"
<<
std
::
endl
;
CV_Assert
(
false
);
}
throw
std
::
runtime_error
(
"Mask error while detecting lines: please check its dimensions and that data type is CV_8UC1"
);
else
detectImpl
(
image
,
keylines
,
mask
);
...
...
@@ -305,14 +299,10 @@ void BinaryDescriptor::detect( const std::vector<Mat>& images, std::vector<std::
for
(
size_t
counter
=
0
;
counter
<
images
.
size
();
counter
++
)
{
if
(
masks
[
counter
].
data
!=
NULL
&&
(
masks
[
counter
].
size
()
!=
images
[
counter
].
size
()
||
masks
[
counter
].
type
()
!=
CV_8UC1
)
)
{
std
::
cout
<<
"Masks error while detecting lines: "
<<
"please check their dimensions and that data types are CV_8UC1"
<<
std
::
endl
;
throw
std
::
runtime_error
(
"Masks error while detecting lines: please check their dimensions and that data types are CV_8UC1"
);
CV_Assert
(
false
);
}
detectImpl
(
images
[
counter
],
keylines
[
counter
],
masks
[
counter
]
);
else
detectImpl
(
images
[
counter
],
keylines
[
counter
],
masks
[
counter
]
);
}
}
...
...
@@ -327,10 +317,7 @@ void BinaryDescriptor::detectImpl( const Mat& imageSrc, std::vector<KeyLine>& ke
/*check whether image depth is different from 0 */
if
(
image
.
depth
()
!=
0
)
{
std
::
cout
<<
"Warning, depth image!= 0"
<<
std
::
endl
;
CV_Assert
(
false
);
}
throw
std
::
runtime_error
(
"Warning, depth image!= 0"
);
/* create a pointer to self */
BinaryDescriptor
*
bn
=
const_cast
<
BinaryDescriptor
*>
(
this
);
...
...
@@ -415,10 +402,7 @@ void BinaryDescriptor::computeImpl( const Mat& imageSrc, std::vector<KeyLine>& k
/*check whether image's depth is different from 0 */
if
(
image
.
depth
()
!=
0
)
{
std
::
cout
<<
"Error, depth of image != 0"
<<
std
::
endl
;
CV_Assert
(
false
);
}
throw
std
::
runtime_error
(
"Error, depth of image != 0"
);
/* keypoints list can't be empty */
if
(
keylines
.
size
()
==
0
)
...
...
modules/line_descriptor/src/precomp.hpp
View file @
0ca3e31d
...
...
@@ -60,6 +60,7 @@
#include <algorithm>
#include <bitset>
#include <time.h>
#include <stdexcept>
#include "opencv2/line_descriptor.hpp"
...
...
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