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
43f854bc
Commit
43f854bc
authored
Apr 22, 2016
by
Vadzim Piatrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing CLAHE crash with pixels value > 12 bit
parent
0df901b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
clahe.cpp
modules/imgproc/src/clahe.cpp
+7
-7
No files found.
modules/imgproc/src/clahe.cpp
View file @
43f854bc
...
...
@@ -227,7 +227,7 @@ namespace
}
}
template
<
class
T
>
template
<
class
T
,
int
shift
>
class
CLAHE_Interpolation_Body
:
public
cv
::
ParallelLoopBody
{
public
:
...
...
@@ -277,8 +277,8 @@ namespace
float
*
xa_p
,
*
xa1_p
;
};
template
<
class
T
>
void
CLAHE_Interpolation_Body
<
T
>::
operator
()(
const
cv
::
Range
&
range
)
const
template
<
class
T
,
int
shift
>
void
CLAHE_Interpolation_Body
<
T
,
shift
>::
operator
()(
const
cv
::
Range
&
range
)
const
{
float
inv_th
=
1.0
f
/
tileSize_
.
height
;
...
...
@@ -302,7 +302,7 @@ namespace
for
(
int
x
=
0
;
x
<
src_
.
cols
;
++
x
)
{
int
srcVal
=
srcRow
[
x
];
int
srcVal
=
srcRow
[
x
]
>>
shift
;
int
ind1
=
ind1_p
[
x
]
+
srcVal
;
int
ind2
=
ind2_p
[
x
]
+
srcVal
;
...
...
@@ -310,7 +310,7 @@ namespace
float
res
=
(
lutPlane1
[
ind1
]
*
xa1_p
[
x
]
+
lutPlane1
[
ind2
]
*
xa_p
[
x
])
*
ya1
+
(
lutPlane2
[
ind1
]
*
xa1_p
[
x
]
+
lutPlane2
[
ind2
]
*
xa_p
[
x
])
*
ya
;
dstRow
[
x
]
=
cv
::
saturate_cast
<
T
>
(
res
);
dstRow
[
x
]
=
cv
::
saturate_cast
<
T
>
(
res
)
<<
shift
;
}
}
}
...
...
@@ -422,9 +422,9 @@ namespace
cv
::
Ptr
<
cv
::
ParallelLoopBody
>
interpolationBody
;
if
(
_src
.
type
()
==
CV_8UC1
)
interpolationBody
=
cv
::
makePtr
<
CLAHE_Interpolation_Body
<
uchar
>
>
(
src
,
dst
,
lut_
,
tileSize
,
tilesX_
,
tilesY_
);
interpolationBody
=
cv
::
makePtr
<
CLAHE_Interpolation_Body
<
uchar
,
0
>
>
(
src
,
dst
,
lut_
,
tileSize
,
tilesX_
,
tilesY_
);
else
if
(
_src
.
type
()
==
CV_16UC1
)
interpolationBody
=
cv
::
makePtr
<
CLAHE_Interpolation_Body
<
ushort
>
>
(
src
,
dst
,
lut_
,
tileSize
,
tilesX_
,
tilesY_
);
interpolationBody
=
cv
::
makePtr
<
CLAHE_Interpolation_Body
<
ushort
,
4
>
>
(
src
,
dst
,
lut_
,
tileSize
,
tilesX_
,
tilesY_
);
cv
::
parallel_for_
(
cv
::
Range
(
0
,
src
.
rows
),
*
interpolationBody
);
}
...
...
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