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
537a3611
Commit
537a3611
authored
Apr 19, 2011
by
Alexey Kazakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The bug was fixed
parent
e9a5bbc0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
6 deletions
+34
-6
objdetect.hpp
modules/objdetect/include/opencv2/objdetect/objdetect.hpp
+13
-3
cascadedetect.cpp
modules/objdetect/src/cascadedetect.cpp
+21
-3
No files found.
modules/objdetect/include/opencv2/objdetect/objdetect.hpp
View file @
537a3611
...
...
@@ -347,9 +347,16 @@ public:
double
scaleFactor
=
1.1
,
int
minNeighbors
=
3
,
int
flags
=
0
,
Size
minSize
=
Size
(),
Size
maxSize
=
Size
()
);
CV_WRAP
virtual
void
detectMultiScale
(
const
Mat
&
image
,
CV_OUT
vector
<
Rect
>&
objects
,
vector
<
int
>&
rejectLevels
,
double
scaleFactor
=
1.1
,
int
minNeighbors
=
3
,
int
flags
=
0
,
Size
minSize
=
Size
(),
Size
maxSize
=
Size
(),
bool
outputRejectLevels
=
false
,
vector
<
int
>&
rejectLevels
=
vector
<
int
>
(
0
));
bool
outputRejectLevels
=
false
);
bool
isOldFormatCascade
()
const
;
...
...
@@ -358,9 +365,12 @@ public:
bool
setImage
(
const
Mat
&
);
protected
:
//virtual bool detectSingleScale( const Mat& image, int stripCount, Size processingRectSize,
// int stripSize, int yStep, double factor, vector<Rect>& candidates );
virtual
bool
detectSingleScale
(
const
Mat
&
image
,
int
stripCount
,
Size
processingRectSize
,
int
stripSize
,
int
yStep
,
double
factor
,
vector
<
Rect
>&
candidates
,
bool
outputRejectLevels
=
false
,
vector
<
int
>&
rejectLevels
=
vector
<
int
>
(
0
)
);
vector
<
int
>&
rejectLevels
,
bool
outputRejectLevels
=
false
);
protected
:
enum
{
BOOST
=
0
};
...
...
modules/objdetect/src/cascadedetect.cpp
View file @
537a3611
...
...
@@ -926,7 +926,7 @@ struct getRect { Rect operator ()(const CvAvgComp& e) const { return e.rect; } }
bool
CascadeClassifier
::
detectSingleScale
(
const
Mat
&
image
,
int
stripCount
,
Size
processingRectSize
,
int
stripSize
,
int
yStep
,
double
factor
,
vector
<
Rect
>&
candidates
,
bool
outputRejectLevels
,
vector
<
int
>&
l
evels
)
vector
<
int
>&
levels
,
bool
outputRejectL
evels
)
{
if
(
!
featureEvaluator
->
setImage
(
image
,
data
.
origWinSize
)
)
return
false
;
...
...
@@ -949,6 +949,14 @@ bool CascadeClassifier::detectSingleScale( const Mat& image, int stripCount, Siz
return
true
;
}
//bool CascadeClassifier::detectSingleScale( const Mat& image, int stripCount, Size processingRectSize,
// int stripSize, int yStep, double factor, vector<Rect>& candidates )
//{
// vector<int> fakeLevels;
// return detectSingleScale( image, stripCount, processingRectSize,
// stripSize, yStep, factor, candidates, fakeLevels, false );
//}
bool
CascadeClassifier
::
isOldFormatCascade
()
const
{
return
!
oldCascade
.
empty
();
...
...
@@ -970,9 +978,10 @@ bool CascadeClassifier::setImage(const Mat& image)
}
void
CascadeClassifier
::
detectMultiScale
(
const
Mat
&
image
,
vector
<
Rect
>&
objects
,
vector
<
int
>&
rejectLevels
,
double
scaleFactor
,
int
minNeighbors
,
int
flags
,
Size
minObjectSize
,
Size
maxObjectSize
,
bool
outputRejectLevels
,
vector
<
int
>&
rejectLevels
)
bool
outputRejectLevels
)
{
const
double
GROUP_EPS
=
0.2
;
...
...
@@ -1042,7 +1051,7 @@ void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& object
#endif
if
(
!
detectSingleScale
(
scaledImage
,
stripCount
,
processingRectSize
,
stripSize
,
yStep
,
factor
,
candidates
,
outputRejectLevels
,
r
ejectLevels
)
)
rejectLevels
,
outputR
ejectLevels
)
)
break
;
}
...
...
@@ -1053,6 +1062,15 @@ void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& object
groupRectangles
(
objects
,
rejectLevels
,
minNeighbors
,
GROUP_EPS
);
}
void
CascadeClassifier
::
detectMultiScale
(
const
Mat
&
image
,
vector
<
Rect
>&
objects
,
double
scaleFactor
,
int
minNeighbors
,
int
flags
,
Size
minObjectSize
,
Size
maxObjectSize
)
{
vector
<
int
>
fakeLevels
;
detectMultiScale
(
image
,
objects
,
fakeLevels
,
scaleFactor
,
minNeighbors
,
flags
,
minObjectSize
,
maxObjectSize
,
false
);
}
bool
CascadeClassifier
::
Data
::
read
(
const
FileNode
&
root
)
{
// load stage params
...
...
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