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
1f33b20b
Commit
1f33b20b
authored
Aug 02, 2014
by
biagio montesano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed some other warnings
parent
e0da9f93
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
24 deletions
+25
-24
lines_extraction.cpp
modules/line_descriptor/samples/lines_extraction.cpp
+2
-2
binary_descriptor.cpp
modules/line_descriptor/src/binary_descriptor.cpp
+4
-4
binary_descriptor_matcher.cpp
modules/line_descriptor/src/binary_descriptor_matcher.cpp
+11
-11
draw.cpp
modules/line_descriptor/src/draw.cpp
+7
-7
ed_line_detector.cpp
modules/line_descriptor/src/ed_line_detector.cpp
+0
-0
precomp.hpp
modules/line_descriptor/src/precomp.hpp
+1
-0
No files found.
modules/line_descriptor/samples/lines_extraction.cpp
View file @
1f33b20b
...
@@ -107,8 +107,8 @@ int main( int argc, char** argv )
...
@@ -107,8 +107,8 @@ int main( int argc, char** argv )
int
B
=
(
rand
()
%
(
int
)
(
255
+
1
)
);
int
B
=
(
rand
()
%
(
int
)
(
255
+
1
)
);
/* get extremes of line */
/* get extremes of line */
Point
pt1
=
Point
(
kl
.
startPointX
,
kl
.
startPointY
);
Point
pt1
=
Point
2f
(
kl
.
startPointX
,
kl
.
startPointY
);
Point
pt2
=
Point
(
kl
.
endPointX
,
kl
.
endPointY
);
Point
pt2
=
Point
2f
(
kl
.
endPointX
,
kl
.
endPointY
);
/* draw line */
/* draw line */
line
(
output
,
pt1
,
pt2
,
Scalar
(
B
,
G
,
R
),
3
);
line
(
output
,
pt1
,
pt2
,
Scalar
(
B
,
G
,
R
),
3
);
...
...
modules/line_descriptor/src/binary_descriptor.cpp
View file @
1f33b20b
...
@@ -610,7 +610,7 @@ int BinaryDescriptor::OctaveKeyLines( cv::Mat& image, ScaleLines &keyLines )
...
@@ -610,7 +610,7 @@ int BinaryDescriptor::OctaveKeyLines( cv::Mat& image, ScaleLines &keyLines )
scale
[
0
]
=
1
;
scale
[
0
]
=
1
;
for
(
int
octaveCount
=
1
;
octaveCount
<
params
.
numOfOctave_
;
octaveCount
++
)
for
(
int
octaveCount
=
1
;
octaveCount
<
params
.
numOfOctave_
;
octaveCount
++
)
{
{
scale
[
octaveCount
]
=
factor
*
scale
[
octaveCount
-
1
]
;
scale
[
octaveCount
]
=
(
float
)
(
factor
*
scale
[
octaveCount
-
1
]
)
;
}
}
/* some variables' declarations */
/* some variables' declarations */
...
@@ -1114,7 +1114,7 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines )
...
@@ -1114,7 +1114,7 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines )
desVec
=
pSingleLine
->
descriptor
.
data
();
desVec
=
pSingleLine
->
descriptor
.
data
();
int
base
=
0
;
int
base
=
0
;
for
(
short
i
=
0
;
i
<
(
short
)
(
NUM_OF_BANDS
*
8
);
++
base
,
i
=
base
*
8
)
for
(
short
i
=
0
;
i
<
(
short
)
(
NUM_OF_BANDS
*
8
);
++
base
,
i
=
(
short
)
(
base
*
8
)
)
{
{
tempM
+=
*
(
desVec
+
i
)
*
*
(
desVec
+
i
);
//desVec[8*i+0] * desVec[8*i+0];
tempM
+=
*
(
desVec
+
i
)
*
*
(
desVec
+
i
);
//desVec[8*i+0] * desVec[8*i+0];
tempM
+=
*
(
desVec
+
i
+
1
)
*
*
(
desVec
+
i
+
1
);
//desVec[8*i+1] * desVec[8*i+1];
tempM
+=
*
(
desVec
+
i
+
1
)
*
*
(
desVec
+
i
+
1
);
//desVec[8*i+1] * desVec[8*i+1];
...
@@ -1130,7 +1130,7 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines )
...
@@ -1130,7 +1130,7 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines )
tempS
=
1
/
sqrt
(
tempS
);
tempS
=
1
/
sqrt
(
tempS
);
desVec
=
pSingleLine
->
descriptor
.
data
();
desVec
=
pSingleLine
->
descriptor
.
data
();
base
=
0
;
base
=
0
;
for
(
short
i
=
0
;
i
<
(
short
)
(
NUM_OF_BANDS
*
8
);
++
base
,
i
=
base
*
8
)
for
(
short
i
=
0
;
i
<
(
short
)
(
NUM_OF_BANDS
*
8
);
++
base
,
i
=
(
short
)
(
base
*
8
)
)
{
{
*
(
desVec
+
i
)
=
*
(
desVec
+
i
)
*
tempM
;
//desVec[8*i] = desVec[8*i] * tempM;
*
(
desVec
+
i
)
=
*
(
desVec
+
i
)
*
tempM
;
//desVec[8*i] = desVec[8*i] * tempM;
*
(
desVec
+
1
+
i
)
=
*
(
desVec
+
1
+
i
)
*
tempM
;
//desVec[8*i+1] = desVec[8*i+1] * tempM;
*
(
desVec
+
1
+
i
)
=
*
(
desVec
+
1
+
i
)
*
tempM
;
//desVec[8*i+1] = desVec[8*i+1] * tempM;
...
@@ -1151,7 +1151,7 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines )
...
@@ -1151,7 +1151,7 @@ int BinaryDescriptor::computeLBD( ScaleLines &keyLines )
{
{
if
(
desVec
[
i
]
>
0.4
)
if
(
desVec
[
i
]
>
0.4
)
{
{
desVec
[
i
]
=
(
float
)
0.4
;
desVec
[
i
]
=
(
float
)
0.4
;
}
}
}
}
...
...
modules/line_descriptor/src/binary_descriptor_matcher.cpp
View file @
1f33b20b
...
@@ -105,7 +105,7 @@ void BinaryDescriptorMatcher::checkKDistances( UINT32 * numres, int k, std::vect
...
@@ -105,7 +105,7 @@ void BinaryDescriptorMatcher::checkKDistances( UINT32 * numres, int k, std::vect
{
{
if
(
(
*
(
numres_tmp
+
j
)
)
>
0
)
if
(
(
*
(
numres_tmp
+
j
)
)
>
0
)
{
{
for
(
int
i
=
0
;
i
<
(
int
)(
*
(
numres_tmp
+
j
)
)
&&
k_to_found
>
0
;
i
++
)
for
(
int
i
=
0
;
i
<
(
int
)
(
*
(
numres_tmp
+
j
)
)
&&
k_to_found
>
0
;
i
++
)
{
{
k_distances
.
push_back
(
j
);
k_distances
.
push_back
(
j
);
k_to_found
--
;
k_to_found
--
;
...
@@ -153,10 +153,10 @@ void BinaryDescriptorMatcher::match( const Mat& queryDescriptors, std::vector<DM
...
@@ -153,10 +153,10 @@ void BinaryDescriptorMatcher::match( const Mat& queryDescriptors, std::vector<DM
/* data validity check */
/* data validity check */
if
(
!
masks
.
empty
()
&&
(
masks
[
itup
->
second
].
rows
!=
queryDescriptors
.
rows
||
masks
[
itup
->
second
].
cols
!=
1
)
)
if
(
!
masks
.
empty
()
&&
(
masks
[
itup
->
second
].
rows
!=
queryDescriptors
.
rows
||
masks
[
itup
->
second
].
cols
!=
1
)
)
{
{
std
::
cout
<<
"Error: mask "
<<
itup
->
second
<<
" in knnMatch function "
<<
"should have "
<<
queryDescriptors
.
rows
<<
" and "
std
::
stringstream
ss
;
<<
"1 column. Program will be terminated"
<<
std
::
endl
;
ss
<<
"Error: mask "
<<
itup
->
second
<<
" in knnMatch function "
<<
"should have "
<<
queryDescriptors
.
rows
<<
" and "
<<
"1 column. Program will be terminated"
;
CV_Assert
(
false
);
throw
std
::
runtime_error
(
ss
.
str
()
);
}
}
/* create a DMatch object if required by mask or if there is
/* create a DMatch object if required by mask or if there is
...
@@ -170,7 +170,7 @@ void BinaryDescriptorMatcher::match( const Mat& queryDescriptors, std::vector<DM
...
@@ -170,7 +170,7 @@ void BinaryDescriptorMatcher::match( const Mat& queryDescriptors, std::vector<DM
dm
.
queryIdx
=
counter
;
dm
.
queryIdx
=
counter
;
dm
.
trainIdx
=
results
[
counter
]
-
1
;
dm
.
trainIdx
=
results
[
counter
]
-
1
;
dm
.
imgIdx
=
itup
->
second
;
dm
.
imgIdx
=
itup
->
second
;
dm
.
distance
=
k_distances
[
0
];
dm
.
distance
=
(
float
)
k_distances
[
0
];
matches
.
push_back
(
dm
);
matches
.
push_back
(
dm
);
}
}
...
@@ -223,7 +223,7 @@ void BinaryDescriptorMatcher::match( const Mat& queryDescriptors, const Mat& tra
...
@@ -223,7 +223,7 @@ void BinaryDescriptorMatcher::match( const Mat& queryDescriptors, const Mat& tra
dm
.
queryIdx
=
counter
;
dm
.
queryIdx
=
counter
;
dm
.
trainIdx
=
results
[
counter
]
-
1
;
dm
.
trainIdx
=
results
[
counter
]
-
1
;
dm
.
imgIdx
=
0
;
dm
.
imgIdx
=
0
;
dm
.
distance
=
k_distances
[
0
];
dm
.
distance
=
(
float
)
k_distances
[
0
];
matches
.
push_back
(
dm
);
matches
.
push_back
(
dm
);
}
}
...
@@ -293,7 +293,7 @@ void BinaryDescriptorMatcher::knnMatch( const Mat& queryDescriptors, const Mat&
...
@@ -293,7 +293,7 @@ void BinaryDescriptorMatcher::knnMatch( const Mat& queryDescriptors, const Mat&
dm
.
queryIdx
=
counter
;
dm
.
queryIdx
=
counter
;
dm
.
trainIdx
=
results
[
j
]
-
1
;
dm
.
trainIdx
=
results
[
j
]
-
1
;
dm
.
imgIdx
=
0
;
dm
.
imgIdx
=
0
;
dm
.
distance
=
k_distances
[
j
-
index
];
dm
.
distance
=
(
float
)
k_distances
[
j
-
index
];
tempVec
.
push_back
(
dm
);
tempVec
.
push_back
(
dm
);
}
}
...
@@ -375,7 +375,7 @@ void BinaryDescriptorMatcher::knnMatch( const Mat& queryDescriptors, std::vector
...
@@ -375,7 +375,7 @@ void BinaryDescriptorMatcher::knnMatch( const Mat& queryDescriptors, std::vector
dm
.
queryIdx
=
counter
;
dm
.
queryIdx
=
counter
;
dm
.
trainIdx
=
results
[
j
]
-
1
;
dm
.
trainIdx
=
results
[
j
]
-
1
;
dm
.
imgIdx
=
itup
->
second
;
dm
.
imgIdx
=
itup
->
second
;
dm
.
distance
=
k_distances
[
j
-
index
];
dm
.
distance
=
(
float
)
k_distances
[
j
-
index
];
tempVector
.
push_back
(
dm
);
tempVector
.
push_back
(
dm
);
}
}
...
@@ -444,7 +444,7 @@ void BinaryDescriptorMatcher::radiusMatch( const Mat& queryDescriptors, const Ma
...
@@ -444,7 +444,7 @@ void BinaryDescriptorMatcher::radiusMatch( const Mat& queryDescriptors, const Ma
dm
.
queryIdx
=
i
;
dm
.
queryIdx
=
i
;
dm
.
trainIdx
=
results
[
j
]
-
1
;
dm
.
trainIdx
=
results
[
j
]
-
1
;
dm
.
imgIdx
=
0
;
dm
.
imgIdx
=
0
;
dm
.
distance
=
k_distances
[
j
-
index
];
dm
.
distance
=
(
float
)
k_distances
[
j
-
index
];
tempVector
.
push_back
(
dm
);
tempVector
.
push_back
(
dm
);
}
}
...
@@ -528,7 +528,7 @@ void BinaryDescriptorMatcher::radiusMatch( const Mat& queryDescriptors, std::vec
...
@@ -528,7 +528,7 @@ void BinaryDescriptorMatcher::radiusMatch( const Mat& queryDescriptors, std::vec
dm
.
queryIdx
=
counter
;
dm
.
queryIdx
=
counter
;
dm
.
trainIdx
=
results
[
j
]
-
1
;
dm
.
trainIdx
=
results
[
j
]
-
1
;
dm
.
imgIdx
=
itup
->
second
;
dm
.
imgIdx
=
itup
->
second
;
dm
.
distance
=
k_distances
[
j
-
index
];
dm
.
distance
=
(
float
)
k_distances
[
j
-
index
];
tempVector
.
push_back
(
dm
);
tempVector
.
push_back
(
dm
);
}
}
...
...
modules/line_descriptor/src/draw.cpp
View file @
1f33b20b
...
@@ -61,7 +61,7 @@ void drawLineMatches( const Mat& img1, const std::vector<KeyLine>& keylines1, co
...
@@ -61,7 +61,7 @@ void drawLineMatches( const Mat& img1, const std::vector<KeyLine>& keylines1, co
}
}
/* initialize random seed: */
/* initialize random seed: */
srand
(
time
(
NULL
)
);
srand
(
(
unsigned
int
)
time
(
NULL
)
);
Scalar
singleLineColorRGB
;
Scalar
singleLineColorRGB
;
if
(
singleLineColor
==
Scalar
::
all
(
-
1
)
)
if
(
singleLineColor
==
Scalar
::
all
(
-
1
)
)
...
@@ -91,13 +91,13 @@ void drawLineMatches( const Mat& img1, const std::vector<KeyLine>& keylines1, co
...
@@ -91,13 +91,13 @@ void drawLineMatches( const Mat& img1, const std::vector<KeyLine>& keylines1, co
for
(
size_t
i
=
0
;
i
<
keylines1
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
keylines1
.
size
();
i
++
)
{
{
KeyLine
k1
=
keylines1
[
i
];
KeyLine
k1
=
keylines1
[
i
];
line
(
outImg
,
Point
(
k1
.
startPointX
,
k1
.
startPointY
),
Point
(
k1
.
endPointX
,
k1
.
endPointY
),
singleLineColorRGB
,
2
);
line
(
outImg
,
Point
2f
(
k1
.
startPointX
,
k1
.
startPointY
),
Point2f
(
k1
.
endPointX
,
k1
.
endPointY
),
singleLineColorRGB
,
2
);
}
}
for
(
size_t
j
=
0
;
j
<
keylines2
.
size
();
j
++
)
for
(
size_t
j
=
0
;
j
<
keylines2
.
size
();
j
++
)
{
{
KeyLine
k2
=
keylines2
[
j
];
KeyLine
k2
=
keylines2
[
j
];
line
(
outImg
,
Point
(
k2
.
startPointX
+
offset
,
k2
.
startPointY
),
Point
(
k2
.
endPointX
+
offset
,
k2
.
endPointY
),
singleLineColorRGB
,
2
);
line
(
outImg
,
Point
2f
(
k2
.
startPointX
+
offset
,
k2
.
startPointY
),
Point2f
(
k2
.
endPointX
+
offset
,
k2
.
endPointY
),
singleLineColorRGB
,
2
);
}
}
}
}
...
@@ -127,13 +127,13 @@ void drawLineMatches( const Mat& img1, const std::vector<KeyLine>& keylines1, co
...
@@ -127,13 +127,13 @@ void drawLineMatches( const Mat& img1, const std::vector<KeyLine>& keylines1, co
matchColorRGB
=
matchColor
;
matchColorRGB
=
matchColor
;
/* draw lines if necessary */
/* draw lines if necessary */
line
(
outImg
,
Point
(
left
.
startPointX
,
left
.
startPointY
),
Point
(
left
.
endPointX
,
left
.
endPointY
),
singleLineColorRGB
,
2
);
line
(
outImg
,
Point
2f
(
left
.
startPointX
,
left
.
startPointY
),
Point2f
(
left
.
endPointX
,
left
.
endPointY
),
singleLineColorRGB
,
2
);
line
(
outImg
,
Point
(
right
.
startPointX
+
offset
,
right
.
startPointY
),
Point
(
right
.
endPointX
+
offset
,
right
.
endPointY
),
singleLineColorRGB
,
line
(
outImg
,
Point
2f
(
right
.
startPointX
+
offset
,
right
.
startPointY
),
Point2f
(
right
.
endPointX
+
offset
,
right
.
endPointY
),
singleLineColorRGB
,
2
);
2
);
/* link correspondent lines */
/* link correspondent lines */
line
(
outImg
,
Point
(
left
.
startPointX
,
left
.
startPointY
),
Point
(
right
.
startPointX
+
offset
,
right
.
startPointY
),
matchColorRGB
,
1
);
line
(
outImg
,
Point
2f
(
left
.
startPointX
,
left
.
startPointY
),
Point2f
(
right
.
startPointX
+
offset
,
right
.
startPointY
),
matchColorRGB
,
1
);
}
}
}
}
}
}
...
@@ -164,7 +164,7 @@ void drawKeylines( const Mat& image, const std::vector<KeyLine>& keylines, Mat&
...
@@ -164,7 +164,7 @@ void drawKeylines( const Mat& image, const std::vector<KeyLine>& keylines, Mat&
KeyLine
k
=
keylines
[
i
];
KeyLine
k
=
keylines
[
i
];
/* draw line */
/* draw line */
line
(
outImage
,
Point
(
k
.
startPointX
,
k
.
startPointY
),
Point
(
k
.
endPointX
,
k
.
endPointY
),
lineColor
,
1
);
line
(
outImage
,
Point
2f
(
k
.
startPointX
,
k
.
startPointY
),
Point2f
(
k
.
endPointX
,
k
.
endPointY
),
lineColor
,
1
);
}
}
}
}
...
...
modules/line_descriptor/src/ed_line_detector.cpp
View file @
1f33b20b
This diff is collapsed.
Click to expand it.
modules/line_descriptor/src/precomp.hpp
View file @
1f33b20b
...
@@ -61,6 +61,7 @@
...
@@ -61,6 +61,7 @@
#include <bitset>
#include <bitset>
#include <time.h>
#include <time.h>
#include <stdexcept>
#include <stdexcept>
#include <sstream>
#include "opencv2/line_descriptor.hpp"
#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