Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
433d6c19
Commit
433d6c19
authored
May 21, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1645 from krshrimali:patch-1
parents
206959cd
c3a2b425
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
13 deletions
+19
-13
sampleDetectLandmarks.cpp
modules/face/samples/sampleDetectLandmarks.cpp
+19
-13
No files found.
modules/face/samples/sampleDetectLandmarks.cpp
View file @
433d6c19
...
...
@@ -75,19 +75,26 @@ int main(int argc,char** argv){
resize
(
img
,
img
,
Size
(
460
,
460
),
0
,
0
,
INTER_LINEAR_EXACT
);
facemark
->
getFaces
(
img
,
faces
);
vector
<
vector
<
Point2f
>
>
shapes
;
if
(
facemark
->
fit
(
img
,
faces
,
shapes
))
{
for
(
size_t
i
=
0
;
i
<
faces
.
size
();
i
++
)
// Check if faces detected or not
// Helps in proper exception handling when writing images to the directories.
if
(
faces
.
size
()
!=
0
)
{
if
(
facemark
->
fit
(
img
,
faces
,
shapes
))
{
cv
::
rectangle
(
img
,
faces
[
i
],
Scalar
(
255
,
0
,
0
));
}
for
(
unsigned
long
i
=
0
;
i
<
faces
.
size
();
i
++
){
for
(
unsigned
long
k
=
0
;
k
<
shapes
[
i
].
size
();
k
++
)
cv
::
circle
(
img
,
shapes
[
i
][
k
],
5
,
cv
::
Scalar
(
0
,
0
,
255
),
FILLED
);
for
(
size_t
i
=
0
;
i
<
faces
.
size
();
i
++
)
{
cv
::
rectangle
(
img
,
faces
[
i
],
Scalar
(
255
,
0
,
0
));
}
for
(
unsigned
long
i
=
0
;
i
<
faces
.
size
();
i
++
){
for
(
unsigned
long
k
=
0
;
k
<
shapes
[
i
].
size
();
k
++
)
cv
::
circle
(
img
,
shapes
[
i
][
k
],
5
,
cv
::
Scalar
(
0
,
0
,
255
),
FILLED
);
}
namedWindow
(
"Detected_shape"
);
imshow
(
"Detected_shape"
,
img
);
waitKey
(
0
);
}
namedWindow
(
"Detected_shape"
);
imshow
(
"Detected_shape"
,
img
);
waitKey
(
0
);
}
else
{
cout
<<
"Faces not detected."
<<
endl
;
}
return
0
;
}
\ No newline at end of file
}
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