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
e3f3de84
Commit
e3f3de84
authored
Jan 21, 2011
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
warning fixed
parent
1327789d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
32 deletions
+32
-32
cascadeclassifier.cpp
modules/gpu/src/cascadeclassifier.cpp
+30
-30
cascadeclassifier.cpp
samples/gpu/cascadeclassifier.cpp
+2
-2
No files found.
modules/gpu/src/cascadeclassifier.cpp
View file @
e3f3de84
...
...
@@ -294,38 +294,38 @@ int cv::gpu::CascadeClassifier_GPU::detectMultiScale( const GpuMat& image, GpuMa
return
numDetections
;
}
struct
RectConvert
{
Rect
operator
()(
const
NcvRect32u
&
nr
)
const
{
return
Rect
(
nr
.
x
,
nr
.
y
,
nr
.
width
,
nr
.
height
);
}
NcvRect32u
operator
()(
const
Rect
&
nr
)
const
{
NcvRect32u
rect
;
rect
.
x
=
nr
.
x
;
rect
.
y
=
nr
.
y
;
rect
.
width
=
nr
.
width
;
rect
.
height
=
nr
.
height
;
return
rect
;
}
};
void
groupRectangles
(
std
::
vector
<
NcvRect32u
>
&
hypotheses
,
int
groupThreshold
,
double
eps
,
std
::
vector
<
Ncv32u
>
*
weights
)
struct
RectConvert
{
Rect
operator
()(
const
NcvRect32u
&
nr
)
const
{
return
Rect
(
nr
.
x
,
nr
.
y
,
nr
.
width
,
nr
.
height
);
}
NcvRect32u
operator
()(
const
Rect
&
nr
)
const
{
NcvRect32u
rect
;
rect
.
x
=
nr
.
x
;
rect
.
y
=
nr
.
y
;
rect
.
width
=
nr
.
width
;
rect
.
height
=
nr
.
height
;
return
rect
;
}
};
void
groupRectangles
(
std
::
vector
<
NcvRect32u
>
&
hypotheses
,
int
groupThreshold
,
double
eps
,
std
::
vector
<
Ncv32u
>
*
weights
)
{
vector
<
Rect
>
rects
(
hypotheses
.
size
());
std
::
transform
(
hypotheses
.
begin
(),
hypotheses
.
end
(),
rects
.
begin
(),
RectConvert
());
if
(
weights
)
{
vector
<
Rect
>
rects
(
hypotheses
.
size
());
std
::
transform
(
hypotheses
.
begin
(),
hypotheses
.
end
(),
rects
.
begin
(),
RectConvert
());
if
(
weights
)
{
vector
<
int
>
weights_int
;
weights_int
.
assign
(
weights
->
begin
(),
weights
->
end
());
cv
::
groupRectangles
(
rects
,
weights_int
,
groupThreshold
,
eps
);
}
else
{
cv
::
groupRectangles
(
rects
,
groupThreshold
,
eps
);
}
std
::
transform
(
rects
.
begin
(),
rects
.
end
(),
hypotheses
.
begin
(),
RectConvert
());
hypotheses
.
resize
(
rects
.
size
());
vector
<
int
>
weights_int
;
weights_int
.
assign
(
weights
->
begin
(),
weights
->
end
());
cv
::
groupRectangles
(
rects
,
weights_int
,
groupThreshold
,
eps
);
}
else
{
cv
::
groupRectangles
(
rects
,
groupThreshold
,
eps
);
}
std
::
transform
(
rects
.
begin
(),
rects
.
end
(),
hypotheses
.
begin
(),
RectConvert
());
hypotheses
.
resize
(
rects
.
size
());
}
#if 1
/* loadFromXML implementation switch */
...
...
samples/gpu/cascadeclassifier.cpp
View file @
e3f3de84
...
...
@@ -190,8 +190,8 @@ int main( int argc, const char** argv )
case
'3'
:
font_scale
*=
1.05
;
printf
(
"Fond scale = %g
\n
"
,
font_scale
);
break
;
case
'e'
:
case
'E'
:
font_scale
/=
1.05
;
printf
(
"Fond scale = %g
\n
"
,
font_scale
);
break
;
case
'2'
:
++
minNeighbors
;
printf
(
"Min Neighbors = %
g
\n
"
,
minNeighbors
);
break
;
case
'w'
:
case
'W'
:
minNeighbors
=
max
(
minNeighbors
-
1
,
0
);
printf
(
"Min Neighbors = %
g
\n
"
,
minNeighbors
);
break
;
case
'2'
:
++
minNeighbors
;
printf
(
"Min Neighbors = %
d
\n
"
,
minNeighbors
);
break
;
case
'w'
:
case
'W'
:
minNeighbors
=
max
(
minNeighbors
-
1
,
0
);
printf
(
"Min Neighbors = %
d
\n
"
,
minNeighbors
);
break
;
}
}
...
...
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