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
b87a8a57
Commit
b87a8a57
authored
May 11, 2017
by
sovrasov
Committed by
Vladislav Sovrasov
May 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set LUT for Robertson weights function to zero on borders
parent
2055bcc8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
hdr_common.cpp
modules/photo/src/hdr_common.cpp
+5
-1
test_hdr.cpp
modules/photo/test/test_hdr.cpp
+2
-7
No files found.
modules/photo/src/hdr_common.cpp
View file @
b87a8a57
...
...
@@ -73,9 +73,13 @@ Mat RobertsonWeights()
{
Mat
weight
(
LDR_SIZE
,
1
,
CV_32FC3
);
float
q
=
(
LDR_SIZE
-
1
)
/
4.0
f
;
float
e4
=
exp
(
4.
f
);
float
scale
=
e4
/
(
e4
-
1.
f
);
float
shift
=
1
/
(
1.
f
-
e4
);
for
(
int
i
=
0
;
i
<
LDR_SIZE
;
i
++
)
{
float
value
=
i
/
q
-
2.0
f
;
value
=
exp
(
-
value
*
value
)
;
value
=
scale
*
exp
(
-
value
*
value
)
+
shift
;
weight
.
at
<
Vec3f
>
(
i
)
=
Vec3f
::
all
(
value
);
}
return
weight
;
...
...
modules/photo/test/test_hdr.cpp
View file @
b87a8a57
...
...
@@ -208,17 +208,12 @@ TEST(Photo_MergeRobertson, regression)
vector
<
Mat
>
images
;
vector
<
float
>
times
;
loadExposureSeq
(
test_path
+
"exposures/"
,
images
,
times
);
Ptr
<
MergeRobertson
>
merge
=
createMergeRobertson
();
Mat
result
,
expected
;
loadImage
(
test_path
+
"merge/robertson.hdr"
,
expected
);
merge
->
process
(
images
,
result
,
times
);
Ptr
<
Tonemap
>
map
=
createTonemap
();
map
->
process
(
result
,
result
);
map
->
process
(
expected
,
expected
);
checkEqual
(
expected
,
result
,
1e-2
f
,
"MergeRobertson"
);
checkEqual
(
expected
,
result
,
5.
f
,
"MergeRobertson"
);
}
TEST
(
Photo_CalibrateDebevec
,
regression
)
...
...
@@ -252,5 +247,5 @@ TEST(Photo_CalibrateRobertson, regression)
Ptr
<
CalibrateRobertson
>
calibrate
=
createCalibrateRobertson
();
calibrate
->
process
(
images
,
response
,
times
);
checkEqual
(
expected
,
response
,
1e-
3
f
,
"CalibrateRobertson"
);
checkEqual
(
expected
,
response
,
1e-
1
f
,
"CalibrateRobertson"
);
}
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