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
0cf76073
Commit
0cf76073
authored
Dec 17, 2013
by
Roman Donchenko
Committed by
OpenCV Buildbot
Dec 17, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1993 from StevenPuttemans:feature_2862
parents
11071dd2
e4b41d38
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
object_categorization.rst
modules/features2d/doc/object_categorization.rst
+3
-3
features2d.hpp
modules/features2d/include/opencv2/features2d.hpp
+1
-1
bagofwords.cpp
modules/features2d/src/bagofwords.cpp
+1
-1
bagofwords_classification.cpp
samples/cpp/bagofwords_classification.cpp
+6
-6
No files found.
modules/features2d/doc/object_categorization.rst
View file @
0cf76073
...
...
@@ -27,7 +27,7 @@ Lixin Fan, Jutta Willamowski, Cedric Bray, 2004. ::
void add( const Mat& descriptors );
const vector<Mat>& getDescriptors() const;
int descrip
o
torsCount() const;
int descriptorsCount() const;
virtual void clear();
...
...
@@ -56,11 +56,11 @@ Returns a training set of descriptors.
BOWTrainer::descrip
o
torsCount
BOWTrainer::descriptorsCount
---------------------------------
Returns the count of all descriptors stored in the training set.
.. ocv:function:: int BOWTrainer::descrip
o
torsCount() const
.. ocv:function:: int BOWTrainer::descriptorsCount() const
...
...
modules/features2d/include/opencv2/features2d.hpp
View file @
0cf76073
...
...
@@ -1453,7 +1453,7 @@ public:
void
add
(
const
Mat
&
descriptors
);
const
std
::
vector
<
Mat
>&
getDescriptors
()
const
;
int
descrip
o
torsCount
()
const
;
int
descriptorsCount
()
const
;
virtual
void
clear
();
...
...
modules/features2d/src/bagofwords.cpp
View file @
0cf76073
...
...
@@ -72,7 +72,7 @@ const std::vector<Mat>& BOWTrainer::getDescriptors() const
return
descriptors
;
}
int
BOWTrainer
::
descrip
o
torsCount
()
const
int
BOWTrainer
::
descriptorsCount
()
const
{
return
descriptors
.
empty
()
?
0
:
size
;
}
...
...
samples/cpp/bagofwords_classification.cpp
View file @
0cf76073
...
...
@@ -2146,12 +2146,12 @@ static Mat trainVocabulary( const string& filename, VocData& vocData, const Voca
while
(
images
.
size
()
>
0
)
{
if
(
bowTrainer
.
descrip
o
torsCount
()
>
maxDescCount
)
if
(
bowTrainer
.
descriptorsCount
()
>
maxDescCount
)
{
#ifdef DEBUG_DESC_PROGRESS
cout
<<
"Breaking due to full memory ( descriptors count = "
<<
bowTrainer
.
descrip
o
torsCount
()
cout
<<
"Breaking due to full memory ( descriptors count = "
<<
bowTrainer
.
descriptorsCount
()
<<
"; descriptor size in bytes = "
<<
descByteSize
<<
"; all used memory = "
<<
bowTrainer
.
descrip
o
torsCount
()
*
descByteSize
<<
endl
;
<<
bowTrainer
.
descriptorsCount
()
*
descByteSize
<<
endl
;
#endif
break
;
}
...
...
@@ -2182,7 +2182,7 @@ static Mat trainVocabulary( const string& filename, VocData& vocData, const Voca
for
(
int
i
=
0
;
i
<
descCount
;
i
++
)
{
if
(
usedMask
[
i
]
&&
bowTrainer
.
descrip
o
torsCount
()
<
maxDescCount
)
if
(
usedMask
[
i
]
&&
bowTrainer
.
descriptorsCount
()
<
maxDescCount
)
bowTrainer
.
add
(
imageDescriptors
.
row
(
i
)
);
}
}
...
...
@@ -2190,7 +2190,7 @@ static Mat trainVocabulary( const string& filename, VocData& vocData, const Voca
#ifdef DEBUG_DESC_PROGRESS
cout
<<
images
.
size
()
<<
" images left, "
<<
images
[
randImgIdx
].
id
<<
" processed - "
<<
/* descs_extracted << "/" << image_descriptors.rows << " extracted - " << */
cvRound
((
static_cast
<
double
>
(
bowTrainer
.
descrip
o
torsCount
())
/
static_cast
<
double
>
(
maxDescCount
))
*
100.0
)
cvRound
((
static_cast
<
double
>
(
bowTrainer
.
descriptorsCount
())
/
static_cast
<
double
>
(
maxDescCount
))
*
100.0
)
<<
" % memory used"
<<
(
imageDescriptors
.
empty
()
?
" -> no descriptors extracted, skipping"
:
""
)
<<
endl
;
#endif
...
...
@@ -2198,7 +2198,7 @@ static Mat trainVocabulary( const string& filename, VocData& vocData, const Voca
images
.
erase
(
images
.
begin
()
+
randImgIdx
);
}
cout
<<
"Maximum allowed descriptor count: "
<<
maxDescCount
<<
", Actual descriptor count: "
<<
bowTrainer
.
descrip
o
torsCount
()
<<
endl
;
cout
<<
"Maximum allowed descriptor count: "
<<
maxDescCount
<<
", Actual descriptor count: "
<<
bowTrainer
.
descriptorsCount
()
<<
endl
;
cout
<<
"Training vocabulary..."
<<
endl
;
vocabulary
=
bowTrainer
.
cluster
();
...
...
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