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
5898dcae
Commit
5898dcae
authored
Aug 12, 2014
by
Alexander Karsakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added ROUNDING_EPS for identical rounding after dividing on different platforms
parent
10b3d00f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
calc_back_project.cl
modules/imgproc/src/opencl/calc_back_project.cl
+5
-2
No files found.
modules/imgproc/src/opencl/calc_back_project.cl
View file @
5898dcae
...
...
@@ -39,6 +39,9 @@
#
define
OUT_OF_RANGE
-1
//
for
identical
rounding
after
dividing
on
different
platforms
#
define
ROUNDING_EPS
0.000001f
#
if
histdims
==
1
__kernel
void
calcLUT
(
__global
const
uchar
*
histptr,
int
hist_step,
int
hist_offset,
int
hist_bins,
...
...
@@ -53,7 +56,7 @@ __kernel void calcLUT(__global const uchar * histptr, int hist_step, int hist_of
{
float lb = ranges[0], ub = ranges[1], gap = (ub - lb) / hist_bins;
value -= lb;
int bin = convert_int_sat_rtn(value / gap);
int bin = convert_int_sat_rtn(value / gap
+ ROUNDING_EPS
);
if (bin >= hist_bins)
lut[x] = OUT_OF_RANGE;
...
...
@@ -101,7 +104,7 @@ __kernel void calcLUT(int hist_bins, __global int * lut, int lut_offset,
{
float lb = ranges[0], ub = ranges[1], gap = (ub - lb) / hist_bins;
value -= lb;
int bin = convert_int_sat_rtn(value / gap);
int bin = convert_int_sat_rtn(value / gap
+ ROUNDING_EPS
);
lut[x] = bin >= hist_bins ? OUT_OF_RANGE : bin;
}
...
...
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