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
19efe309
Commit
19efe309
authored
Oct 16, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
face: MACE filter workaround
parent
cd8a0a38
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
mace.cpp
modules/face/src/mace.cpp
+11
-3
No files found.
modules/face/src/mace.cpp
View file @
19efe309
...
...
@@ -135,14 +135,22 @@ struct MACEImpl CV_FINAL : MACE {
}
}
Mat
sq
;
cv
::
sqrt
(
D
,
sq
);
Mat_
<
Vec2d
>
DINV
=
TOTALPIXEL
*
size
/
sq
;
#if 0 // https://github.com/opencv/opencv_contrib/issues/1848
// FIXIT What is expected here? complex numbers math?
// D(,)[1] is 0 (always)
Mat sq; cv::sqrt(D, sq); // Per-element sqrt(): sq(,)[1] is 0 (always)
Mat_<Vec2d> DINV = TOTALPIXEL * size / sq; // "per-element" division which provides "Inf"
#else
Mat
sq
;
cv
::
sqrt
(
D
.
reshape
(
1
).
col
(
0
),
sq
);
Mat_
<
Vec2d
>
DINV
(
TOTALPIXEL
,
1
,
Vec2d
(
0
,
0
));
DINV
.
reshape
(
1
).
col
(
0
)
=
TOTALPIXEL
*
size
/
sq
;
#endif
Mat_
<
Vec2d
>
DINV_S
(
TOTALPIXEL
,
size
,
0.0
);
Mat_
<
Vec2d
>
SPLUS_DINV
(
size
,
TOTALPIXEL
,
0.0
);
for
(
int
l
=
0
;
l
<
size
;
l
++
)
{
for
(
int
m
=
0
;
m
<
TOTALPIXEL
;
m
++
)
{
SPLUS_DINV
(
l
,
m
)[
0
]
=
SPLUS
(
l
,
m
)[
0
]
*
DINV
(
m
,
0
)[
0
];
SPLUS_DINV
(
l
,
m
)[
1
]
=
SPLUS
(
l
,
m
)[
1
]
*
DINV
(
m
,
0
)[
1
];
SPLUS_DINV
(
l
,
m
)[
1
]
=
SPLUS
(
l
,
m
)[
1
]
*
DINV
(
m
,
0
)[
1
];
// FIXIT: DINV(,)[1] is 0 (always)
DINV_S
(
m
,
l
)[
0
]
=
S
(
m
,
l
)[
0
]
*
DINV
(
m
,
0
)[
0
];
DINV_S
(
m
,
l
)[
1
]
=
S
(
m
,
l
)[
1
]
*
DINV
(
m
,
0
)[
1
];
}
...
...
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