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
84f33d05
Commit
84f33d05
authored
Oct 23, 2014
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor fix for StereoCSBP data cost compute kernel and test
parent
5c07e0b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
stereocsbp.cu
modules/gpu/src/cuda/stereocsbp.cu
+10
-4
test_calib3d.cpp
modules/gpu/test/test_calib3d.cpp
+1
-1
No files found.
modules/gpu/src/cuda/stereocsbp.cu
View file @
84f33d05
...
@@ -103,16 +103,22 @@ namespace cv { namespace gpu { namespace device
...
@@ -103,16 +103,22 @@ namespace cv { namespace gpu { 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);
int l = *(left);
int r = *(right);
return fmin(cdata_weight * ::abs(l - r), cdata_weight * cmax_data_term);
}
}
};
};
template <> struct DataCostPerPixel<3>
template <> struct DataCostPerPixel<3>
{
{
static __device__ __forceinline__ float compute(const uchar* left, const uchar* right)
static __device__ __forceinline__ float compute(const uchar* left, const uchar* right)
{
{
float tb = 0.114f * ::abs((int)left[0] - right[0]);
uchar3 l = *((const uchar3*)left);
float tg = 0.587f * ::abs((int)left[1] - right[1]);
uchar3 r = *((const uchar3*)right);
float tr = 0.299f * ::abs((int)left[2] - right[2]);
float tb = 0.114f * ::abs((int)l.x - r.x);
float tg = 0.587f * ::abs((int)l.y - r.y);
float tr = 0.299f * ::abs((int)l.z - r.z);
return fmin(cdata_weight * (tr + tg + tb), cdata_weight * cmax_data_term);
return fmin(cdata_weight * (tr + tg + tb), cdata_weight * cmax_data_term);
}
}
...
...
modules/gpu/test/test_calib3d.cpp
View file @
84f33d05
...
@@ -158,7 +158,7 @@ GPU_TEST_P(StereoConstantSpaceBP, Regression)
...
@@ -158,7 +158,7 @@ GPU_TEST_P(StereoConstantSpaceBP, Regression)
cv
::
Mat
h_disp
(
disp
);
cv
::
Mat
h_disp
(
disp
);
h_disp
.
convertTo
(
h_disp
,
disp_gold
.
depth
());
h_disp
.
convertTo
(
h_disp
,
disp_gold
.
depth
());
EXPECT_MAT_
NEAR
(
disp_gold
,
h_disp
,
1.0
);
EXPECT_MAT_
SIMILAR
(
disp_gold
,
h_disp
,
1e-4
);
}
}
INSTANTIATE_TEST_CASE_P
(
GPU_Calib3D
,
StereoConstantSpaceBP
,
ALL_DEVICES
);
INSTANTIATE_TEST_CASE_P
(
GPU_Calib3D
,
StereoConstantSpaceBP
,
ALL_DEVICES
);
...
...
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