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
29d7e471
Commit
29d7e471
authored
Jul 30, 2014
by
biagio montesano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added python macros
parent
03acaf2c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
50 deletions
+50
-50
descriptor.hpp
...descriptor/include/opencv2/line_descriptor/descriptor.hpp
+48
-48
ed_line_detector.hpp
...ptor/include/opencv2/line_descriptor/ed_line_detector.hpp
+2
-2
No files found.
modules/line_descriptor/include/opencv2/line_descriptor/descriptor.hpp
View file @
29d7e471
...
...
@@ -60,45 +60,45 @@ class CV_EXPORTS_W KeyLine
{
public
:
/* orientation of the line */
float
angle
;
CV_PROP_RW
float
angle
;
/* object ID, that can be used to cluster keylines by the line they represent */
int
class_id
;
CV_PROP_RW
int
class_id
;
/* octave (pyramid layer), from which the keyline has been extracted */
int
octave
;
CV_PROP_RW
int
octave
;
/* coordinates of the middlepoint */
Point
pt
;
CV_PROP_RW
Point
pt
;
/* the response, by which the strongest keylines have been selected.
It's represented by the ratio between line's length and maximum between
image's width and height */
float
response
;
CV_PROP_RW
float
response
;
/* minimum area containing line */
float
size
;
CV_PROP_RW
float
size
;
/* lines's extremes in original image */
float
startPointX
;
float
startPointY
;
float
endPointX
;
float
endPointY
;
CV_PROP_RW
float
startPointX
;
CV_PROP_RW
float
startPointY
;
CV_PROP_RW
float
endPointX
;
CV_PROP_RW
float
endPointY
;
/* line's extremes in image it was extracted from */
float
sPointInOctaveX
;
float
sPointInOctaveY
;
float
ePointInOctaveX
;
float
ePointInOctaveY
;
CV_PROP_RW
float
sPointInOctaveX
;
CV_PROP_RW
float
sPointInOctaveY
;
CV_PROP_RW
float
ePointInOctaveX
;
CV_PROP_RW
float
ePointInOctaveY
;
/* the length of line */
float
lineLength
;
CV_PROP_RW
float
lineLength
;
/* number of pixels covered by the line */
unsigned
int
numOfPixels
;
CV_PROP_RW
unsigned
int
numOfPixels
;
/* constructor */
KeyLine
()
CV_WRAP
KeyLine
()
{
}
};
...
...
@@ -128,10 +128,10 @@ class CV_EXPORTS_W BinaryDescriptor : public Algorithm
int
ksize_
;
/* read parameters from a FileNode object and store them (struct function) */
void
read
(
const
FileNode
&
fn
);
CV_WRAP
void
read
(
const
FileNode
&
fn
);
/* store parameters to a FileStorage object (struct function) */
void
write
(
FileStorage
&
fs
)
const
;
CV_WRAP
void
write
(
FileStorage
&
fs
)
const
;
};
...
...
@@ -140,32 +140,32 @@ class CV_EXPORTS_W BinaryDescriptor : public Algorithm
BinaryDescriptor
(
const
BinaryDescriptor
::
Params
&
parameters
=
BinaryDescriptor
::
Params
()
);
/* constructors with smart pointers */
static
Ptr
<
BinaryDescriptor
>
createBinaryDescriptor
();
static
Ptr
<
BinaryDescriptor
>
createBinaryDescriptor
(
Params
parameters
);
CV_WRAP
static
Ptr
<
BinaryDescriptor
>
createBinaryDescriptor
();
CV_WRAP
static
Ptr
<
BinaryDescriptor
>
createBinaryDescriptor
(
Params
parameters
);
/* destructor */
~
BinaryDescriptor
();
/* setters and getters */
int
getNumOfOctaves
();
void
setNumOfOctaves
(
int
octaves
);
int
getWidthOfBand
();
void
setWidthOfBand
(
int
width
);
int
getReductionRatio
();
void
setReductionRatio
(
int
rRatio
);
CV_WRAP
int
getNumOfOctaves
();
CV_WRAP
void
setNumOfOctaves
(
int
octaves
);
CV_WRAP
int
getWidthOfBand
();
CV_WRAP
void
setWidthOfBand
(
int
width
);
CV_WRAP
int
getReductionRatio
();
CV_WRAP
void
setReductionRatio
(
int
rRatio
);
/* reads parameters from a FileNode object and store them (class function ) */
virtual
void
read
(
const
cv
::
FileNode
&
fn
);
CV_WRAP
virtual
void
read
(
const
cv
::
FileNode
&
fn
);
/* stores parameters to a FileStorage object (class function) */
virtual
void
write
(
cv
::
FileStorage
&
fs
)
const
;
CV_WRAP
virtual
void
write
(
cv
::
FileStorage
&
fs
)
const
;
/* requires line detection (only one image) */
CV_WRAP
void
detect
(
const
Mat
&
image
,
CV_OUT
std
::
vector
<
KeyLine
>&
keypoints
,
const
Mat
&
mask
=
Mat
()
);
/* requires line detection (more than one image) */
void
detect
(
const
std
::
vector
<
Mat
>&
images
,
std
::
vector
<
std
::
vector
<
KeyLine
>
>&
keylines
,
const
std
::
vector
<
Mat
>&
masks
=
CV_WRAP
void
detect
(
const
std
::
vector
<
Mat
>&
images
,
std
::
vector
<
std
::
vector
<
KeyLine
>
>&
keylines
,
const
std
::
vector
<
Mat
>&
masks
=
std
::
vector
<
Mat
>
()
)
const
;
/* requires descriptors computation (only one image) */
...
...
@@ -173,17 +173,17 @@ class CV_EXPORTS_W BinaryDescriptor : public Algorithm
void
compute
(
const
Mat
&
image
,
CV_OUT
CV_IN_OUT
std
::
vector
<
KeyLine
>&
keylines
,
CV_OUT
Mat
&
descriptors
,
bool
returnFloatDescr
=
false
)
const
;
/* requires descriptors computation (more than one image) */
void
compute
(
const
std
::
vector
<
Mat
>&
images
,
std
::
vector
<
std
::
vector
<
KeyLine
>
>&
keylines
,
std
::
vector
<
Mat
>&
descriptors
,
bool
returnFloatDescr
=
CV_WRAP
void
compute
(
const
std
::
vector
<
Mat
>&
images
,
std
::
vector
<
std
::
vector
<
KeyLine
>
>&
keylines
,
std
::
vector
<
Mat
>&
descriptors
,
bool
returnFloatDescr
=
false
)
const
;
/* returns descriptor size */
int
descriptorSize
()
const
;
CV_WRAP
int
descriptorSize
()
const
;
/* returns data type */
int
descriptorType
()
const
;
CV_WRAP
int
descriptorType
()
const
;
/* returns norm mode */
int
defaultNorm
()
const
;
CV_WRAP
int
defaultNorm
()
const
;
/* definition of operator () */
CV_WRAP_AS
(
detectAndCompute
)
...
...
@@ -236,20 +236,20 @@ class CV_EXPORTS_W LSDDetector : public Algorithm
public
:
/* constructor */
LSDDetector
()
CV_WRAP
LSDDetector
()
{
}
;
/* constructor with smart pointer */
static
Ptr
<
LSDDetector
>
createLSDDetector
();
CV_WRAP
static
Ptr
<
LSDDetector
>
createLSDDetector
();
/* requires line detection (only one image) */
CV_WRAP
void
detect
(
const
Mat
&
image
,
CV_OUT
std
::
vector
<
KeyLine
>&
keypoints
,
int
scale
,
int
numOctaves
,
const
Mat
&
mask
=
Mat
()
);
/* requires line detection (more than one image) */
void
detect
(
const
std
::
vector
<
Mat
>&
images
,
std
::
vector
<
std
::
vector
<
KeyLine
>
>&
keylines
,
int
scale
,
int
numOctaves
,
CV_WRAP
void
detect
(
const
std
::
vector
<
Mat
>&
images
,
std
::
vector
<
std
::
vector
<
KeyLine
>
>&
keylines
,
int
scale
,
int
numOctaves
,
const
std
::
vector
<
Mat
>&
masks
=
std
::
vector
<
Mat
>
()
)
const
;
private
:
...
...
@@ -273,47 +273,47 @@ class CV_EXPORTS_W BinaryDescriptorMatcher : public Algorithm
public
:
/* for every input descriptor,
find the best matching one (for a pair of images) */
void
match
(
const
Mat
&
queryDescriptors
,
const
Mat
&
trainDescriptors
,
std
::
vector
<
DMatch
>&
matches
,
const
Mat
&
mask
=
Mat
()
)
const
;
CV_WRAP
void
match
(
const
Mat
&
queryDescriptors
,
const
Mat
&
trainDescriptors
,
std
::
vector
<
DMatch
>&
matches
,
const
Mat
&
mask
=
Mat
()
)
const
;
/* for every input descriptor,
find the best matching one (from one image to a set) */
void
match
(
const
Mat
&
queryDescriptors
,
std
::
vector
<
DMatch
>&
matches
,
const
std
::
vector
<
Mat
>&
masks
=
std
::
vector
<
Mat
>
()
);
CV_WRAP
void
match
(
const
Mat
&
queryDescriptors
,
std
::
vector
<
DMatch
>&
matches
,
const
std
::
vector
<
Mat
>&
masks
=
std
::
vector
<
Mat
>
()
);
/* for every input descriptor,
find the best k matching descriptors (for a pair of images) */
void
knnMatch
(
const
Mat
&
queryDescriptors
,
const
Mat
&
trainDescriptors
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
k
,
const
Mat
&
mask
=
Mat
(),
CV_WRAP
void
knnMatch
(
const
Mat
&
queryDescriptors
,
const
Mat
&
trainDescriptors
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
k
,
const
Mat
&
mask
=
Mat
(),
bool
compactResult
=
false
)
const
;
/* for every input descriptor,
find the best k matching descriptors (from one image to a set) */
void
knnMatch
(
const
Mat
&
queryDescriptors
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
k
,
const
std
::
vector
<
Mat
>&
masks
=
std
::
vector
<
Mat
>
(),
CV_WRAP
void
knnMatch
(
const
Mat
&
queryDescriptors
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
int
k
,
const
std
::
vector
<
Mat
>&
masks
=
std
::
vector
<
Mat
>
(),
bool
compactResult
=
false
);
/* for every input descriptor, find all the ones falling in a
certain matching radius (for a pair of images) */
void
radiusMatch
(
const
Mat
&
queryDescriptors
,
const
Mat
&
trainDescriptors
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
CV_WRAP
void
radiusMatch
(
const
Mat
&
queryDescriptors
,
const
Mat
&
trainDescriptors
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
const
Mat
&
mask
=
Mat
(),
bool
compactResult
=
false
)
const
;
/* for every input descriptor, find all the ones falling in a
certain matching radius (from one image to a set) */
void
radiusMatch
(
const
Mat
&
queryDescriptors
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
const
std
::
vector
<
Mat
>&
masks
=
CV_WRAP
void
radiusMatch
(
const
Mat
&
queryDescriptors
,
std
::
vector
<
std
::
vector
<
DMatch
>
>&
matches
,
float
maxDistance
,
const
std
::
vector
<
Mat
>&
masks
=
std
::
vector
<
Mat
>
(),
bool
compactResult
=
false
);
/* store new descriptors to be inserted in dataset */
void
add
(
const
std
::
vector
<
Mat
>&
descriptors
);
CV_WRAP
void
add
(
const
std
::
vector
<
Mat
>&
descriptors
);
/* store new descriptors into dataset */
void
train
();
CV_WRAP
void
train
();
/* constructor with smart pointer */
static
Ptr
<
BinaryDescriptorMatcher
>
createBinaryDescriptorMatcher
();
CV_WRAP
static
Ptr
<
BinaryDescriptorMatcher
>
createBinaryDescriptorMatcher
();
/* clear dataset and internal data */
void
clear
();
CV_WRAP
void
clear
();
/* constructor */
BinaryDescriptorMatcher
();
CV_WRAP
BinaryDescriptorMatcher
();
/* destructor */
~
BinaryDescriptorMatcher
()
...
...
modules/line_descriptor/include/opencv2/line_descriptor/ed_line_detector.hpp
View file @
29d7e471
...
...
@@ -85,7 +85,7 @@ struct EDLineParam
};
#define RELATIVE_ERROR_FACTOR 100.0
#define M
_
LN10 2.30258509299404568402
#define MLN10 2.30258509299404568402
#define log_gamma(x) ((x)>15.0?log_gamma_windschitl(x):log_gamma_lanczos(x))
/* This class is used to detect lines from input image.
...
...
@@ -425,7 +425,7 @@ class EDLineDetector
if
(
double_equal
(
term
,
0.0
)
)
{
/* the first term is almost zero */
if
(
(
double
)
k
>
(
double
)
n
*
p
)
/* at begin or end of the tail? */
return
-
log1term
/
M
_
LN10
-
logNT
;
/* end: use just the first term */
return
-
log1term
/
MLN10
-
logNT
;
/* end: use just the first term */
else
return
-
logNT
;
/* begin: the tail is roughly 1 */
}
...
...
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