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
9bda0546
Commit
9bda0546
authored
Jul 14, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6769 from andy-held:cuda_optflow_error_calc
parents
df5d51f1
8d43e2b9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
pyrlk.cu
modules/cudaoptflow/src/cuda/pyrlk.cu
+14
-2
No files found.
modules/cudaoptflow/src/cuda/pyrlk.cu
View file @
9bda0546
...
...
@@ -344,6 +344,18 @@ namespace pyrlk
return ret;
}
template <typename T>
struct DenormalizationFactor
{
static const float factor = 1.0;
};
template <>
struct DenormalizationFactor<uchar>
{
static const float factor = 255.0;
};
template <int cn, int PATCH_X, int PATCH_Y, bool calcErr, typename T>
__global__ void sparseKernel(const float2* prevPts, float2* nextPts, uchar* status, float* err, const int level, const int rows, const int cols)
{
...
...
@@ -532,7 +544,7 @@ namespace pyrlk
nextPts[blockIdx.x] = nextPt;
if (calcErr)
err[blockIdx.x] = static_cast<float>(errval) / (
cn * c_winSize_x * c_winSize_y)
;
err[blockIdx.x] = static_cast<float>(errval) / (
::min(cn, 3) * c_winSize_x * c_winSize_y) * DenormalizationFactor<T>::factor
;
}
}
...
...
@@ -725,7 +737,7 @@ namespace pyrlk
nextPts[blockIdx.x] = nextPt;
if (calcErr)
err[blockIdx.x] = static_cast<float>(errval) / (
3 *
c_winSize_x * c_winSize_y);
err[blockIdx.x] = static_cast<float>(errval) / (
::min(cn, 3)*
c_winSize_x * c_winSize_y);
}
} // __global__ void sparseKernel_
...
...
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