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
6ad158db
Commit
6ad158db
authored
Nov 29, 2010
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored gpu::minMaxLoc
parent
437ac1a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
mathfunc.cu
modules/gpu/src/cuda/mathfunc.cu
+10
-6
No files found.
modules/gpu/src/cuda/mathfunc.cu
View file @
6ad158db
...
...
@@ -805,21 +805,25 @@ namespace cv { namespace gpu { namespace mathfunc
T val = ((const T*)src.ptr(0))[0];
T mymin = val, mymax = val;
unsigned int myminloc = 0, mymaxloc = 0;
for (unsigned int y = 0; y < ctheight && y0 + y * blockDim.y < src.rows; ++y)
unsigned int y_end = min(y0 + (ctheight - 1) * blockDim.y + 1, src.rows);
unsigned int x_end = min(x0 + (ctwidth - 1) * blockDim.x + 1, src.cols);
for (unsigned int y = y0; y < y_end; y += blockDim.y)
{
const T* ptr = (const T*)src.ptr(y
0 + y * blockDim.y
);
for (unsigned int x =
0; x < ctwidth && x0 + x * blockDim.x < src.cols; ++
x)
const T* ptr = (const T*)src.ptr(y);
for (unsigned int x =
x0; x < x_end; x += blockDim.
x)
{
val = ptr[x
0 + x * blockDim.x
];
val = ptr[x];
if (val < mymin)
{
mymin = val;
myminloc =
(y0 + y * blockDim.y) * src.cols + x0 + x * blockDim.
x;
myminloc =
y * src.cols +
x;
}
else if (val > mymax)
{
mymax = val;
mymaxloc =
(y0 + y * blockDim.y) * src.cols + x0 + x * blockDim.
x;
mymaxloc =
y * src.cols +
x;
}
}
}
...
...
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