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
892cc8aa
Commit
892cc8aa
authored
Jun 08, 2010
by
Ilya Lysenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed FernDescriptorMatch and undid change of FernClassifier
parent
ab8861fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
descriptors.cpp
modules/features2d/src/descriptors.cpp
+4
-4
planardetect.cpp
modules/features2d/src/planardetect.cpp
+1
-1
No files found.
modules/features2d/src/descriptors.cpp
View file @
892cc8aa
...
...
@@ -549,15 +549,15 @@ void FernDescriptorMatch::trainFernClassifier()
assert
(
params
.
filename
.
empty
()
);
vector
<
Point2f
>
points
;
vector
<
Ptr
<
Mat
>
>
refimgs
(
collection
.
images
.
size
()
)
;
vector
<
Ptr
<
Mat
>
>
refimgs
;
vector
<
int
>
labels
;
for
(
size_t
imageIdx
=
0
;
imageIdx
<
collection
.
images
.
size
();
imageIdx
++
)
{
refimgs
[
imageIdx
]
=
new
Mat
(
collection
.
images
[
imageIdx
]);
for
(
size_t
pointIdx
=
0
;
pointIdx
<
collection
.
points
[
imageIdx
].
size
();
pointIdx
++
)
{
refimgs
.
push_back
(
new
Mat
(
collection
.
images
[
imageIdx
]));
points
.
push_back
(
collection
.
points
[
imageIdx
][
pointIdx
].
pt
);
labels
.
push_back
(
image
Idx
);
labels
.
push_back
(
point
Idx
);
}
}
...
...
@@ -572,7 +572,7 @@ void FernDescriptorMatch::calcBestProbAndMatchIdx( const Mat& image, const Point
{
(
*
classifier
)(
image
,
pt
,
signature
);
bestProb
=
0
;
bestProb
=
-
FLT_MAX
;
bestMatchIdx
=
-
1
;
for
(
size_t
ci
=
0
;
ci
<
(
size_t
)
classifier
->
getClassCount
();
ci
++
)
{
...
...
modules/features2d/src/planardetect.cpp
View file @
892cc8aa
...
...
@@ -853,7 +853,7 @@ void FernClassifier::train(const vector<Point2f>& points,
for
(
i
=
0
;
i
<
nsamples
;
i
++
)
{
Point2f
pt
=
points
[
i
];
const
Mat
&
src
=
labels
.
empty
()
?
*
refimgs
[
i
]
:
*
refimgs
[
labels
[
i
]
];
const
Mat
&
src
=
*
refimgs
[
i
];
int
classId
=
labels
.
empty
()
?
i
:
labels
[
i
];
if
(
verbose
&&
(
i
+
1
)
*
progressBarSize
/
nsamples
!=
i
*
progressBarSize
/
nsamples
)
putchar
(
'.'
);
...
...
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