Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Thiago Santini
EyeRecToo
Commits
d895f90b
Commit
d895f90b
authored
Sep 11, 2018
by
Thiago Santini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reintroduces scaling to ElSe
parent
ae119f1c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
EyeRecToo/src/pupil-detection/ElSe.cpp
EyeRecToo/src/pupil-detection/ElSe.cpp
+14
-4
No files found.
EyeRecToo/src/pupil-detection/ElSe.cpp
View file @
d895f90b
...
...
@@ -1103,11 +1103,17 @@ RotatedRect ElSe::run(const Mat& frame)
RotatedRect
ellipse
;
Point
pos
(
0
,
0
);
if
(
frame
.
rows
>
IMG_SIZE
||
frame
.
cols
>
IMG_SIZE
)
float
rz_fakk
=
float
(
frame
.
cols
)
/
384.0
;
minArea
/=
rz_fakk
;
maxArea
/=
rz_fakk
;
cv
::
Mat
pic
=
cv
::
Mat
::
zeros
(
frame
.
rows
/
rz_fakk
,
frame
.
cols
/
rz_fakk
,
CV_8UC1
);
cv
::
resize
(
frame
,
pic
,
pic
.
size
());
if
(
pic
.
rows
>
IMG_SIZE
||
pic
.
cols
>
IMG_SIZE
)
return
ellipse
;
Mat
pic
;
normalize
(
frame
,
pic
,
0
,
255
,
NORM_MINMAX
,
CV_8U
);
normalize
(
pic
,
pic
,
0
,
255
,
NORM_MINMAX
,
CV_8U
);
double
border
=
0.0
;
// ER takes care of setting an ROI
double
mean_dist
=
3
;
...
...
@@ -1140,12 +1146,16 @@ RotatedRect ElSe::run(const Mat& frame)
ellipse
=
find_best_edge
(
&
pic
,
&
detected_edges
,
&
magni
,
start_x
,
end_x
,
start_y
,
end_y
,
mean_dist
,
inner_color_range
);
if
((
ellipse
.
center
.
x
<=
0
&&
ellipse
.
center
.
y
<=
0
)
||
(
ellipse
.
center
.
x
>=
pic
.
cols
||
ellipse
.
center
.
y
>=
pic
.
rows
))
{
ellipse
=
blob_finder
(
&
pic
);
ellipse
.
angle
=
0
;
ellipse
.
size
=
Size
(
0
,
0
);
}
ellipse
.
size
.
height
=
ellipse
.
size
.
height
*
rz_fakk
;
ellipse
.
size
.
width
=
ellipse
.
size
.
width
*
rz_fakk
;
ellipse
.
center
.
x
=
ellipse
.
center
.
x
*
rz_fakk
;
ellipse
.
center
.
y
=
ellipse
.
center
.
y
*
rz_fakk
;
return
ellipse
;
}
...
...
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