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
9f2edc11
Commit
9f2edc11
authored
Aug 07, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12173 from gdemarcq:Decolor_corrections
parents
377e51df
fb2b26c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
contrast_preserve.hpp
modules/photo/src/contrast_preserve.hpp
+4
-4
No files found.
modules/photo/src/contrast_preserve.hpp
View file @
9f2edc11
...
...
@@ -159,12 +159,12 @@ void Decolor::gradvector(const Mat &img, vector <double> &grad) const
for
(
int
i
=
0
;
i
<
height
;
i
++
)
for
(
int
j
=
0
;
j
<
width
;
j
++
)
grad
[
i
*
height
+
j
]
=
d_trans
.
at
<
float
>
(
i
,
j
);
grad
[
i
*
width
+
j
]
=
d_trans
.
at
<
float
>
(
i
,
j
);
const
int
offset
=
width
*
height
;
for
(
int
i
=
0
;
i
<
height
;
i
++
)
for
(
int
j
=
0
;
j
<
width
;
j
++
)
grad
[
offset
+
i
*
height
+
j
]
=
d1_trans
.
at
<
float
>
(
i
,
j
);
grad
[
offset
+
i
*
width
+
j
]
=
d1_trans
.
at
<
float
>
(
i
,
j
);
}
void
Decolor
::
colorGrad
(
const
Mat
&
img
,
vector
<
double
>
&
Cg
)
const
...
...
@@ -212,7 +212,7 @@ void Decolor::weak_order(const Mat &im, vector <double> &alf) const
if
((
h
+
w
)
>
800
)
{
const
double
sizefactor
=
double
(
800
)
/
(
h
+
w
);
resize
(
im
,
img
,
Size
(
cvRound
(
h
*
sizefactor
),
cvRound
(
w
*
sizefactor
)));
resize
(
im
,
img
,
Size
(
cvRound
(
w
*
sizefactor
),
cvRound
(
h
*
sizefactor
)));
}
else
{
...
...
@@ -260,7 +260,7 @@ void Decolor::grad_system(const Mat &im, vector < vector < double > > &polyGrad,
if
((
h
+
w
)
>
800
)
{
const
double
sizefactor
=
double
(
800
)
/
(
h
+
w
);
resize
(
im
,
img
,
Size
(
cvRound
(
h
*
sizefactor
),
cvRound
(
w
*
sizefactor
)));
resize
(
im
,
img
,
Size
(
cvRound
(
w
*
sizefactor
),
cvRound
(
h
*
sizefactor
)));
}
else
{
...
...
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