Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
6ad0cd7e
Commit
6ad0cd7e
authored
Mar 07, 2010
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OpenCV: cosmetics.
parent
bdcee194
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
modules/video_filter/opencv_example.cpp
modules/video_filter/opencv_example.cpp
+5
-10
No files found.
modules/video_filter/opencv_example.cpp
View file @
6ad0cd7e
...
...
@@ -184,33 +184,28 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
//perform face detection
cvClearMemStorage
(
p_filter
->
p_sys
->
p_storage
);
CvSeq
*
faces
=
NULL
;
if
(
p_filter
->
p_sys
->
p_cascade
)
{
//we should make some of these params config variables
faces
=
cvHaarDetectObjects
(
p_img
[
0
],
p_filter
->
p_sys
->
p_cascade
,
CvSeq
*
faces
=
cvHaarDetectObjects
(
p_img
[
0
],
p_filter
->
p_sys
->
p_cascade
,
p_filter
->
p_sys
->
p_storage
,
1.15
,
5
,
CV_HAAR_DO_CANNY_PRUNING
,
cvSize
(
20
,
20
)
);
//create the video_filter_region_info_t struct
CvRect
*
r
;
if
(
faces
&&
(
faces
->
total
>
0
))
{
//msg_Dbg( p_filter, "Found %d face(s)", faces->total );
free
(
p_filter
->
p_sys
->
event_info
.
p_region
);
p_filter
->
p_sys
->
event_info
.
p_region
=
NULL
;
if
(
NULL
==
(
p_filter
->
p_sys
->
event_info
.
p_region
=
(
video_filter_region_info_t
*
)
malloc
(
faces
->
total
*
sizeof
(
video_filter_region_info_t
))))
{
p_filter
->
p_sys
->
event_info
.
p_region
=
(
video_filter_region_info_t
*
)
calloc
(
faces
->
total
,
sizeof
(
video_filter_region_info_t
));
if
(
!
p_filter
->
p_sys
->
event_info
.
p_region
)
return
NULL
;
}
memset
(
p_filter
->
p_sys
->
event_info
.
p_region
,
0
,
faces
->
total
*
sizeof
(
video_filter_region_info_t
));
p_filter
->
p_sys
->
event_info
.
i_region_size
=
faces
->
total
;
}
//populate the video_filter_region_info_t struct
for
(
i
=
0
;
i
<
(
faces
?
faces
->
total
:
0
);
i
++
)
{
r
=
(
CvRect
*
)
cvGetSeqElem
(
faces
,
i
);
CvRect
*
r
=
(
CvRect
*
)
cvGetSeqElem
(
faces
,
i
);
pt1
.
x
=
r
->
x
*
scale
;
pt2
.
x
=
(
r
->
x
+
r
->
width
)
*
scale
;
pt1
.
y
=
r
->
y
*
scale
;
...
...
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