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
cb999a23
Commit
cb999a23
authored
Aug 05, 2013
by
Fedor Morozov
Browse files
Options
Browse Files
Download
Plain Diff
Mantiuk's tonemapping
parents
17609b90
6df203c4
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
43 deletions
+36
-43
photo.hpp
modules/photo/include/opencv2/photo.hpp
+1
-7
align.cpp
modules/photo/src/align.cpp
+2
-4
hdr_common.cpp
modules/photo/src/hdr_common.cpp
+2
-4
hdr_common.hpp
modules/photo/src/hdr_common.hpp
+2
-4
merge.cpp
modules/photo/src/merge.cpp
+2
-4
tonemap.cpp
modules/photo/src/tonemap.cpp
+11
-13
test_hdr.cpp
modules/photo/test/test_hdr.cpp
+7
-7
cv2.cpp
modules/python/src2/cv2.cpp
+9
-0
No files found.
modules/photo/include/opencv2/photo.hpp
View file @
cb999a23
...
...
@@ -59,8 +59,6 @@ enum
INPAINT_TELEA
=
1
// A. Telea algorithm
};
CV_EXPORTS_W
bool
initModule_photo
();
//! restores the damaged image areas using one of the available intpainting algorithms
CV_EXPORTS_W
void
inpaint
(
InputArray
src
,
InputArray
inpaintMask
,
OutputArray
dst
,
double
inpaintRadius
,
int
flags
);
...
...
@@ -91,11 +89,7 @@ public:
CV_WRAP
virtual
void
setGamma
(
float
gamma
)
=
0
;
};
class
CV_EXPORTS_W
TonemapLinear
:
public
Tonemap
{
};
CV_EXPORTS_W
Ptr
<
TonemapLinear
>
createTonemapLinear
(
float
gamma
=
1.0
f
);
CV_EXPORTS_W
Ptr
<
Tonemap
>
createTonemap
(
float
gamma
=
1.0
f
);
// "Adaptive Logarithmic Mapping For Displaying HighContrast Scenes", Drago et al., 2003
...
...
modules/photo/src/align.cpp
View file @
cb999a23
...
...
@@ -10,8 +10,7 @@
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
...
...
@@ -232,4 +231,4 @@ CV_EXPORTS_W Ptr<AlignMTB> createAlignMTB(int max_bits, int exclude_range)
return
new
AlignMTBImpl
(
max_bits
,
exclude_range
);
}
}
\ No newline at end of file
}
modules/photo/src/hdr_common.cpp
View file @
cb999a23
...
...
@@ -10,8 +10,7 @@
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
...
...
@@ -83,4 +82,4 @@ void mapLuminance(Mat src, Mat dst, Mat lum, Mat new_lum, float saturation)
merge
(
channels
,
dst
);
}
};
\ No newline at end of file
};
modules/photo/src/hdr_common.hpp
View file @
cb999a23
...
...
@@ -10,8 +10,7 @@
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
...
...
@@ -57,4 +56,4 @@ void mapLuminance(Mat src, Mat dst, Mat lum, Mat new_lum, float saturation);
};
#endif
\ No newline at end of file
#endif
modules/photo/src/merge.cpp
View file @
cb999a23
...
...
@@ -10,8 +10,7 @@
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
...
...
@@ -260,4 +259,4 @@ Ptr<MergeMertens> createMergeMertens(float wcon, float wsat, float wexp)
return
new
MergeMertensImpl
(
wcon
,
wsat
,
wexp
);
}
}
\ No newline at end of file
}
modules/photo/src/tonemap.cpp
View file @
cb999a23
...
...
@@ -10,8 +10,7 @@
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
...
...
@@ -48,10 +47,10 @@
namespace
cv
{
class
Tonemap
LinearImpl
:
public
TonemapLinear
class
Tonemap
Impl
:
public
Tonemap
{
public
:
Tonemap
LinearImpl
(
float
gamma
)
:
gamma
(
gamma
),
name
(
"TonemapLinear
"
)
Tonemap
Impl
(
float
gamma
)
:
gamma
(
gamma
),
name
(
"Tonemap
"
)
{
}
...
...
@@ -94,9 +93,9 @@ protected:
float
gamma
;
};
Ptr
<
Tonemap
Linear
>
createTonemapLinear
(
float
gamma
)
Ptr
<
Tonemap
>
createTonemap
(
float
gamma
)
{
return
new
Tonemap
Linear
Impl
(
gamma
);
return
new
TonemapImpl
(
gamma
);
}
class
TonemapDragoImpl
:
public
TonemapDrago
...
...
@@ -117,7 +116,7 @@ public:
_dst
.
create
(
src
.
size
(),
CV_32FC3
);
Mat
img
=
_dst
.
getMat
();
Ptr
<
Tonemap
Linear
>
linear
=
createTonemapLinear
(
1.0
f
);
Ptr
<
Tonemap
>
linear
=
createTonemap
(
1.0
f
);
linear
->
process
(
src
,
img
);
Mat
gray_img
;
...
...
@@ -200,7 +199,7 @@ public:
CV_Assert
(
!
src
.
empty
());
_dst
.
create
(
src
.
size
(),
CV_32FC3
);
Mat
img
=
_dst
.
getMat
();
Ptr
<
Tonemap
Linear
>
linear
=
createTonemapLinear
(
1.0
f
);
Ptr
<
Tonemap
>
linear
=
createTonemap
(
1.0
f
);
linear
->
process
(
src
,
img
);
Mat
gray_img
;
...
...
@@ -284,7 +283,7 @@ public:
CV_Assert
(
!
src
.
empty
());
_dst
.
create
(
src
.
size
(),
CV_32FC3
);
Mat
img
=
_dst
.
getMat
();
Ptr
<
Tonemap
Linear
>
linear
=
createTonemapLinear
(
1.0
f
);
Ptr
<
Tonemap
>
linear
=
createTonemap
(
1.0
f
);
linear
->
process
(
src
,
img
);
Mat
gray_img
;
...
...
@@ -378,7 +377,7 @@ public:
CV_Assert
(
!
src
.
empty
());
_dst
.
create
(
src
.
size
(),
CV_32FC3
);
Mat
img
=
_dst
.
getMat
();
Ptr
<
Tonemap
Linear
>
linear
=
createTonemapLinear
(
1.0
f
);
Ptr
<
Tonemap
>
linear
=
createTonemap
(
1.0
f
);
linear
->
process
(
src
,
img
);
Mat
gray_img
;
...
...
@@ -426,7 +425,7 @@ public:
exp
(
x
,
x
);
mapLuminance
(
img
,
img
,
gray_img
,
x
,
saturation
);
linear
=
createTonemap
Linear
(
gamma
);
linear
=
createTonemap
(
gamma
);
linear
->
process
(
img
,
img
);
}
...
...
@@ -529,4 +528,4 @@ Ptr<TonemapMantiuk> createTonemapMantiuk(float gamma, float scale, float saturat
return
new
TonemapMantiukImpl
(
gamma
,
scale
,
saturation
);
}
}
\ No newline at end of file
}
modules/photo/test/test_hdr.cpp
View file @
cb999a23
...
...
@@ -10,8 +10,7 @@
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
...
...
@@ -61,9 +60,10 @@ void checkEqual(Mat img0, Mat img1, double threshold)
ASSERT_FALSE
(
max
>
threshold
)
<<
max
;
}
void
loadExposureSeq
(
String
path
,
vector
<
Mat
>&
images
,
vector
<
float
>&
times
=
vector
<
float
>
())
static
vector
<
float
>
DEFAULT_VECTOR
;
void
loadExposureSeq
(
String
path
,
vector
<
Mat
>&
images
,
vector
<
float
>&
times
=
DEFAULT_VECTOR
)
{
ifstream
list_file
(
path
+
"list.txt"
);
ifstream
list_file
((
path
+
"list.txt"
).
c_str
()
);
ASSERT_TRUE
(
list_file
.
is_open
());
string
name
;
float
val
;
...
...
@@ -79,7 +79,7 @@ void loadExposureSeq(String path, vector<Mat>& images, vector<float>& times = ve
void
loadResponseCSV
(
String
path
,
Mat
&
response
)
{
response
=
Mat
(
256
,
3
,
CV_32F
);
ifstream
resp_file
(
path
);
ifstream
resp_file
(
path
.
c_str
()
);
for
(
int
i
=
0
;
i
<
256
;
i
++
)
{
for
(
int
channel
=
0
;
channel
<
3
;
channel
++
)
{
resp_file
>>
response
.
at
<
float
>
(
i
,
channel
);
...
...
@@ -97,7 +97,7 @@ TEST(Photo_Tonemap, regression)
loadImage
(
test_path
+
"image.hdr"
,
img
);
float
gamma
=
2.2
f
;
Ptr
<
TonemapLinear
>
linear
=
createTonemapLinear
(
gamma
);
Ptr
<
Tonemap
>
linear
=
createTonemapLinear
(
gamma
);
linear
->
process
(
img
,
result
);
loadImage
(
test_path
+
"linear.png"
,
expected
);
result
.
convertTo
(
result
,
CV_8UC3
,
255
);
...
...
@@ -161,7 +161,7 @@ TEST(Photo_MergeMertens, regression)
string
test_path
=
string
(
cvtest
::
TS
::
ptr
()
->
get_data_path
())
+
"hdr/"
;
vector
<
Mat
>
images
;
loadExposureSeq
(
test_path
+
"exposures/"
,
images
);
loadExposureSeq
((
test_path
+
"exposures/"
).
c_str
()
,
images
);
Ptr
<
MergeMertens
>
merge
=
createMergeMertens
();
...
...
modules/python/src2/cv2.cpp
View file @
cb999a23
...
...
@@ -131,6 +131,15 @@ typedef Ptr<StereoMatcher> Ptr_StereoMatcher;
typedef
Ptr
<
StereoBM
>
Ptr_StereoBM
;
typedef
Ptr
<
StereoSGBM
>
Ptr_StereoSGBM
;
typedef
Ptr
<
Tonemap
>
Ptr_Tonemap
;
typedef
Ptr
<
TonemapDrago
>
Ptr_TonemapDrago
;
typedef
Ptr
<
TonemapReinhardDevlin
>
Ptr_TonemapReinhardDevlin
;
typedef
Ptr
<
TonemapDurand
>
Ptr_TonemapDurand
;
typedef
Ptr
<
AlignMTB
>
Ptr_AlignMTB
;
typedef
Ptr
<
CalibrateDebevec
>
Ptr_CalibrateDebevec
;
typedef
Ptr
<
MergeDebevec
>
Ptr_MergeDebevec
;
typedef
Ptr
<
MergeMertens
>
Ptr_MergeMertens
;
typedef
Ptr
<
cv
::
softcascade
::
ChannelFeatureBuilder
>
Ptr_ChannelFeatureBuilder
;
typedef
SimpleBlobDetector
::
Params
SimpleBlobDetector_Params
;
...
...
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