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
f86e3156
Commit
f86e3156
authored
Aug 05, 2014
by
Bellaktris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
another try
parent
97d602ff
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
26 deletions
+36
-26
whitebalance.rst
modules/xphoto/doc/colorbalance/whitebalance.rst
+3
-3
denoising.rst
modules/xphoto/doc/denoising/denoising.rst
+1
-1
annf.hpp
modules/xphoto/src/annf.hpp
+1
-0
dct_image_denoising.cpp
modules/xphoto/src/dct_image_denoising.cpp
+8
-3
gcgraph.hpp
modules/xphoto/src/gcgraph.hpp
+4
-0
photomontage.hpp
modules/xphoto/src/photomontage.hpp
+19
-19
No files found.
modules/xphoto/doc/colorbalance/whitebalance.rst
View file @
f86e3156
...
...
@@ -5,9 +5,9 @@ Automatic white balance correction
balanceWhite
------------
.. ocv:function:: (const Mat &src, Mat &dst, const int algorithmType,
const float inputMin = 0.0f, const float inputMax = 255.0f,
const float outputMin = 0.0f, const float outputMax = 255.0f)
.. ocv:function::
void balanceWhite
(const Mat &src, Mat &dst, const int algorithmType,
const float inputMin = 0.0f, const float inputMax = 255.0f,
const float outputMin = 0.0f, const float outputMax = 255.0f)
The function implements different algorithm of automatic white balance, i.e.
it tries to map image's white color to perceptual white (this can be violated
...
...
modules/xphoto/doc/denoising/denoising.rst
View file @
f86e3156
...
...
@@ -5,7 +5,7 @@ Image denoising techniques
dctDenoising
------------
.. ocv:function:: (const Mat &src, Mat &dst, const float sigma)
.. ocv:function::
void dctDenoising
(const Mat &src, Mat &dst, const float sigma)
The function implements simple dct-based denoising,
link: http://www.ipol.im/pub/art/2011/ys-dct/.
...
...
modules/xphoto/src/annf.hpp
View file @
f86e3156
...
...
@@ -40,6 +40,7 @@
#ifndef __ANNF_HPP__
#define __ANNF_HPP__
#include <vector>
#include "algo.hpp"
static
void
plusToMinusUpdate
(
const
cv
::
Mat
&
current
,
cv
::
Mat
&
next
,
const
int
dx
,
const
int
dy
)
...
...
modules/xphoto/src/dct_image_denoising.cpp
View file @
f86e3156
...
...
@@ -54,6 +54,11 @@
namespace
cv
{
void
grayDctDenoising
(
const
Mat
&
,
Mat
&
,
const
double
,
const
int
);
void
rgbDctDenoising
(
const
Mat
&
,
Mat
&
,
const
double
,
const
int
);
void
dctDenoising
(
const
Mat
&
,
Mat
&
,
const
double
,
const
int
);
struct
grayDctDenoisingInvoker
:
public
ParallelLoopBody
{
public
:
...
...
@@ -71,9 +76,9 @@ namespace cv
const
double
thresh
;
// thresholding estimate
};
grayDctDenoisingInvoker
::
grayDctDenoisingInvoker
(
const
Mat
&
src
,
std
::
vector
<
Mat
>
&
patches
,
const
double
sigma
,
const
int
psize
)
:
src
(
src
),
patches
(
patches
),
sigma
(
sigma
),
thresh
(
3
*
sigma
),
psize
(
psize
)
{}
grayDctDenoisingInvoker
::
grayDctDenoisingInvoker
(
const
Mat
&
_src
,
std
::
vector
<
Mat
>
&
_
patches
,
const
double
_sigma
,
const
int
_
psize
)
:
src
(
_src
),
patches
(
_patches
),
sigma
(
_sigma
),
thresh
(
3
*
_sigma
),
psize
(
_
psize
)
{}
grayDctDenoisingInvoker
::~
grayDctDenoisingInvoker
(){}
void
grayDctDenoisingInvoker
::
operator
()
(
const
Range
&
range
)
const
...
...
modules/xphoto/src/gcgraph.hpp
View file @
f86e3156
...
...
@@ -42,6 +42,10 @@
#ifndef _CV_GCGRAPH_H_
#define _CV_GCGRAPH_H_
#include <vector>
#include <opencv2/core.hpp>
template
<
class
TWeight
>
class
GCGraph
{
public
:
...
...
modules/xphoto/src/photomontage.hpp
View file @
f86e3156
...
...
@@ -75,7 +75,7 @@ private:
public
:
Photomontage
<
Tp
>
*
main
;
ParallelExpansion
(
Photomontage
<
Tp
>
*
main
)
:
main
(
main
){}
ParallelExpansion
(
Photomontage
<
Tp
>
*
_main
)
:
main
(
_
main
){}
~
ParallelExpansion
(){};
void
operator
()
(
const
cv
::
Range
&
range
)
const
...
...
@@ -109,10 +109,10 @@ setWeights(GCGraph <double> &graph, const cv::Point &pA, const cv::Point &pB, co
if
(
lA
==
lB
)
{
/** Link from A to B **/
double
weightAB
=
dist
(
typename
images
[
lA
].
at
<
Tp
>
(
pA
),
typename
images
[
lA
].
at
<
Tp
>
(
pB
),
typename
images
[
lX
].
at
<
Tp
>
(
pA
),
typename
images
[
lX
].
at
<
Tp
>
(
pB
)
);
double
weightAB
=
dist
(
images
[
lA
].
at
<
typename
Tp
>
(
pA
),
images
[
lA
].
at
<
typename
Tp
>
(
pB
),
images
[
lX
].
at
<
typename
Tp
>
(
pA
),
images
[
lX
].
at
<
typename
Tp
>
(
pB
)
);
graph
.
addEdges
(
int
(
pA
.
y
*
width
+
pA
.
x
),
int
(
pB
.
y
*
width
+
pB
.
x
),
weightAB
,
weightAB
);
}
else
...
...
@@ -120,24 +120,24 @@ setWeights(GCGraph <double> &graph, const cv::Point &pA, const cv::Point &pB, co
int
X
=
graph
.
addVtx
();
/** Link from X to sink **/
double
weightXS
=
dist
(
typename
images
[
lA
].
at
<
Tp
>
(
pA
),
typename
images
[
lA
].
at
<
Tp
>
(
pB
),
typename
images
[
lB
].
at
<
Tp
>
(
pA
),
typename
images
[
lB
].
at
<
Tp
>
(
pB
)
);
double
weightXS
=
dist
(
images
[
lA
].
at
<
typename
Tp
>
(
pA
),
images
[
lA
].
at
<
typename
Tp
>
(
pB
),
images
[
lB
].
at
<
typename
Tp
>
(
pA
),
images
[
lB
].
at
<
typename
Tp
>
(
pB
)
);
graph
.
addTermWeights
(
X
,
0
,
weightXS
);
/** Link from A to X **/
double
weightAX
=
dist
(
typename
images
[
lA
].
at
<
Tp
>
(
pA
),
typename
images
[
lA
].
at
<
Tp
>
(
pB
),
typename
images
[
lX
].
at
<
Tp
>
(
pA
),
typename
images
[
lX
].
at
<
Tp
>
(
pB
)
);
double
weightAX
=
dist
(
images
[
lA
].
at
<
typename
Tp
>
(
pA
),
images
[
lA
].
at
<
typename
Tp
>
(
pB
),
images
[
lX
].
at
<
typename
Tp
>
(
pA
),
images
[
lX
].
at
<
typename
Tp
>
(
pB
)
);
graph
.
addEdges
(
int
(
pA
.
y
*
width
+
pA
.
x
),
X
,
weightAX
,
weightAX
);
/** Link from X to B **/
double
weightXB
=
dist
(
typename
images
[
lX
].
at
<
Tp
>
(
pA
),
typename
images
[
lX
].
at
<
Tp
>
(
pB
),
typename
images
[
lB
].
at
<
Tp
>
(
pA
),
typename
images
[
lB
].
at
<
Tp
>
(
pB
)
);
double
weightXB
=
dist
(
images
[
lX
].
at
<
typename
Tp
>
(
pA
),
images
[
lX
].
at
<
typename
Tp
>
(
pB
),
images
[
lB
].
at
<
typename
Tp
>
(
pA
),
images
[
lB
].
at
<
typename
Tp
>
(
pB
)
);
graph
.
addEdges
(
X
,
int
(
pB
.
y
*
width
+
pB
.
x
),
weightXB
,
weightXB
);
}
}
...
...
@@ -242,9 +242,9 @@ assignResImage(cv::Mat &img)
}
template
<
typename
Tp
>
Photomontage
<
Tp
>::
Photomontage
(
const
std
::
vector
<
cv
::
Mat
>
&
images
,
const
std
::
vector
<
cv
::
Mat
>
&
masks
)
Photomontage
(
const
std
::
vector
<
cv
::
Mat
>
&
_images
,
const
std
::
vector
<
cv
::
Mat
>
&
_
masks
)
:
images
(
images
),
masks
(
masks
),
height
(
int
(
images
[
0
].
rows
)),
width
(
int
(
images
[
0
].
cols
)),
images
(
_images
),
masks
(
_
masks
),
height
(
int
(
images
[
0
].
rows
)),
width
(
int
(
images
[
0
].
cols
)),
type
(
images
[
0
].
type
()),
x_i
(
height
,
width
,
CV_32SC1
),
channels
(
images
[
0
].
channels
()),
lsize
(
int
(
images
.
size
())),
labelings
(
images
.
size
()),
distances
(
images
.
size
())
{
...
...
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