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
ec668ce3
Commit
ec668ce3
authored
Jul 18, 2013
by
Fedor Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation
parent
a29ce401
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
132 additions
and
53 deletions
+132
-53
mymath.sty
doc/mymath.sty
+0
-42
grfmt_hdr.cpp
modules/highgui/src/grfmt_hdr.cpp
+13
-8
hdr_imaging.rst
modules/photo/doc/hdr_imaging.rst
+117
-0
photo.rst
modules/photo/doc/photo.rst
+2
-0
align.cpp
modules/photo/src/align.cpp
+0
-3
No files found.
doc/mymath.sty
View file @
ec668ce3
\ProvidesPackage
{
mymath
}
\newcommand
{
\matTT
}
[9]
{
\[
\left
|
\begin
{
array
}{
ccc
}
#
1
&
#
2
&
#
3
\\
#
4
&
#
5
&
#
6
\\
#
7
&
#
8
&
#
9
\end
{
array
}
\right
|
\]
}
\newcommand
{
\fork
}
[4]
{
\left\{
\begin{array}
{
l l
}
#1
&
\mbox
{
#2
}
\\
#3
&
\mbox
{
#4
}
\\
\end{array}
\right
.
}
\newcommand
{
\forkthree
}
[6]
{
\left\{
\begin{array}
{
l l
}
#1
&
\mbox
{
#2
}
\\
#3
&
\mbox
{
#4
}
\\
#5
&
\mbox
{
#6
}
\\
\end{array}
\right
.
}
\newcommand
{
\vecthree
}
[3]
{
\begin{bmatrix}
#1
\\
#2
\\
#3
\end{bmatrix}
}
\newcommand
{
\vecthreethree
}
[9]
{
\begin{bmatrix}
#1
&
#2
&
#3
\\
#4
&
#5
&
#6
\\
#7
&
#8
&
#9
\end{bmatrix}
}
modules/highgui/src/grfmt_hdr.cpp
View file @
ec668ce3
...
...
@@ -78,17 +78,19 @@ bool HdrDecoder::readHeader()
return
true
;
}
bool
HdrDecoder
::
readData
(
Mat
&
img
)
bool
HdrDecoder
::
readData
(
Mat
&
_
img
)
{
Mat
img
(
m_height
,
m_width
,
CV_32FC3
);
if
(
!
file
)
{
readHeader
();
}
if
(
img
.
cols
!=
m_width
||
img
.
rows
!=
m_height
||
img
.
type
()
!=
CV_32FC3
)
{
CV_Error
(
Error
::
StsError
,
"HDR decoder: bad mat"
);
}
RGBE_ReadPixels_RLE
(
file
,
const_cast
<
float
*>
(
img
.
ptr
<
float
>
()),
img
.
cols
,
img
.
rows
);
fclose
(
file
);
file
=
NULL
;
if
(
_img
.
depth
()
==
img
.
depth
())
{
img
.
convertTo
(
_img
,
_img
.
type
());
}
else
{
img
.
convertTo
(
_img
,
_img
.
type
(),
255
);
}
return
true
;
}
...
...
@@ -115,10 +117,13 @@ HdrEncoder::~HdrEncoder()
{
}
bool
HdrEncoder
::
write
(
const
Mat
&
img
,
const
std
::
vector
<
int
>&
params
)
bool
HdrEncoder
::
write
(
const
Mat
&
_
img
,
const
std
::
vector
<
int
>&
params
)
{
if
(
img
.
type
()
!=
CV_32FC3
)
{
CV_Error
(
Error
::
StsBadArg
,
"HDR encoder: need 32FC3 mat"
);
Mat
img
;
if
(
_img
.
depth
()
==
CV_32F
)
{
_img
.
convertTo
(
img
,
CV_32FC3
);
}
else
{
_img
.
convertTo
(
img
,
CV_32FC3
,
1
/
255.0
f
);
}
if
(
!
(
params
.
empty
()
||
params
[
0
]
==
HDR_NONE
||
params
[
0
]
==
HDR_RLE
))
{
CV_Error
(
Error
::
StsBadArg
,
"HDR encoder: wrong compression param"
);
...
...
modules/photo/doc/hdr_imaging.rst
0 → 100644
View file @
ec668ce3
HDR imaging
==========
.. highlight:: cpp
makeHDR
-----------
Creates HDR image from a set of bracketed exposures using algorithm by Debevec and Malik.
"Recovering High Dynamic Range Radiance Maps from Photographs", Debevec, Malik, 1997
.. ocv:function:: void makeHDR(InputArrayOfArrays srcImgs, const std::vector<float>& expTimes, OutputArray dst, bool align = false)
:param src_imgs: vector of 8-bit 3-channel images
:param exp_times: exposure times for each of source images
:param dst: output image
:param align: if true, images are first aligned using median threshold bitmap algorithm. See :ocv:func:`getExpShift`.
tonemap
-----------
Tonemaps image.
.. ocv:function:: tonemap(InputArray src, OutputArray dst, int algorithm, const std::vector<float>& params = std::vector<float>())
:param src: input HDR image
:param dst: floating-point image in [0; 1] range
:param algorithm:
* TONEMAP_LINEAR - simple linear mapping
* TONEMAP_DRAGO - "Adaptive Logarithmic Mapping For Displaying HighContrast Scenes", Drago et al., 2003
* TONEMAP_REINHARD - "Dynamic Range Reduction Inspired by Photoreceptor Physiology", Reinhard, Devlin, 2005
* TONEMAP_DURAND - "Fast Bilateral Filtering for the Display of High-Dynamic-Range Images", Durand, Dorsey, 2002
:param params: vector of parameters for specified algorithm.
If some parameters are missing default values are used.
The first element is gamma value for gamma correction.
* TONEMAP_LINEAR:
No parameters.
* TONEMAP_DRAGO:
params[1] - value for bias function. Range [0.7, 0.9], default 0.85.
* TONEMAP_REINHARD:
params[1] - result intensity. Range [-8, 8], default 0.
params[2] - chromatic adaptation. Range [0, 1], default 0.
params[3] - light adaptation. Range [0, 1], default 0;
* TONEMAP_DURAND:
params[1] - result contrast on logarithmic scale.
params[2] - bilateral filter sigma in the color space.
params[3] - bilateral filter sigma in the coordinate space.
exposureFusion
-----------
Fuses a bracketed exposure sequence into a single image without converting to HDR first.
"Exposure Fusion", Mertens et al., 2007
.. ocv:function:: exposureFusion(InputArrayOfArrays src_imgs, OutputArray dst, bool align = false, float wc = 1, float ws = 1, float we = 0)
:param src_imgs: vector of 8-bit 3-channel images
:param dst: output image. Although it's a floating-point image tonemapping is not necessary.
:param align: if true, images are first aligned using median threshold bitmap algorithm. See :ocv:func:`getExpShift`.
:param wc: contrast factor weight
:param ws: saturation factor weight
:param we: well-exposedness factor weight
getExpShift
-----------
Calculates translation vector that can be used to align img1 with img0.
Uses median threshold bitmap algorithm by Ward.
"Fast, Robust Image Registration for Compositing High Dynamic Range Photographs from Handheld Exposures", Ward, 2003
.. ocv:function:: getExpShift(InputArray img0, InputArray img1, int max_bits = 6, int exclude_range = 4)
:param img0: 8-bit 1-channel image
:param img1: 8-bit 1-channel image
:param max_bits: logarithm to the base 2 of maximal shift in each dimension
:param exclude_range: range value for exclusion bitmap. Refer to the article.
shiftMat
-----------
Shifts image filling the new regions with zeros.
.. ocv:function:: shiftMat(InputArray src, Point shift, OutputArray dst)
:param src: input image
:param shift: shift vector
:param dst: output image
\ No newline at end of file
modules/photo/doc/photo.rst
View file @
ec668ce3
...
...
@@ -9,3 +9,4 @@ photo. Computational Photography
inpainting
denoising
hdr_imaging
\ No newline at end of file
modules/photo/src/align.cpp
View file @
ec668ce3
...
...
@@ -102,9 +102,6 @@ static void computeBitmaps(Mat& img, Mat& tb, Mat& eb, int exclude_range)
void
shiftMat
(
InputArray
_src
,
Point
shift
,
OutputArray
_dst
)
{
Mat
src
=
_src
.
getMat
();
if
(
src
.
depth
()
!=
CV_8U
)
{
CV_Error
(
Error
::
StsBadArg
,
"Image must have CV_8U depth."
);
}
_dst
.
create
(
src
.
size
(),
src
.
type
());
Mat
dst
=
_dst
.
getMat
();
...
...
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