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
1533d044
Commit
1533d044
authored
Jun 24, 2014
by
Aaron Denney
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cdata_weight always positive; fewer multiplications.
parent
d848704b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
stereocsbp.cu
modules/cudastereo/src/cuda/stereocsbp.cu
+3
-3
No files found.
modules/cudastereo/src/cuda/stereocsbp.cu
View file @
1533d044
...
@@ -103,7 +103,7 @@ namespace cv { namespace cuda { namespace device
...
@@ -103,7 +103,7 @@ namespace cv { namespace cuda { namespace device
{
{
static __device__ __forceinline__ float compute(const uchar* left, const uchar* right)
static __device__ __forceinline__ float compute(const uchar* left, const uchar* right)
{
{
return
fmin(cdata_weight * ::abs((int)*left - *right), cdata_weight *
cmax_data_term);
return
cdata_weight * fmin( ::abs((int)*left - *right),
cmax_data_term);
}
}
};
};
template <> struct DataCostPerPixel<3>
template <> struct DataCostPerPixel<3>
...
@@ -114,7 +114,7 @@ namespace cv { namespace cuda { namespace device
...
@@ -114,7 +114,7 @@ namespace cv { namespace cuda { namespace device
float tg = 0.587f * ::abs((int)left[1] - right[1]);
float tg = 0.587f * ::abs((int)left[1] - right[1]);
float tr = 0.299f * ::abs((int)left[2] - right[2]);
float tr = 0.299f * ::abs((int)left[2] - right[2]);
return
fmin(cdata_weight * (tr + tg + tb), cdata_weight *
cmax_data_term);
return
cdata_weight * fmin(tr + tg + tb,
cmax_data_term);
}
}
};
};
template <> struct DataCostPerPixel<4>
template <> struct DataCostPerPixel<4>
...
@@ -128,7 +128,7 @@ namespace cv { namespace cuda { namespace device
...
@@ -128,7 +128,7 @@ namespace cv { namespace cuda { namespace device
float tg = 0.587f * ::abs((int)l.y - r.y);
float tg = 0.587f * ::abs((int)l.y - r.y);
float tr = 0.299f * ::abs((int)l.z - r.z);
float tr = 0.299f * ::abs((int)l.z - r.z);
return
fmin(cdata_weight * (tr + tg + tb), cdata_weight *
cmax_data_term);
return
cdata_weight * fmin(tr + tg + tb,
cmax_data_term);
}
}
};
};
...
...
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