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
615e7b27
Commit
615e7b27
authored
Dec 10, 2012
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added SIMD optimization of Edge-Aware Demosaicing in case of CV_8U
parent
07744ccf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
demosaicing.cpp
modules/imgproc/src/demosaicing.cpp
+0
-0
test_color.cpp
modules/imgproc/test/test_color.cpp
+14
-13
No files found.
modules/imgproc/src/demosaicing.cpp
View file @
615e7b27
This diff is collapsed.
Click to expand it.
modules/imgproc/test/test_color.cpp
View file @
615e7b27
...
...
@@ -1991,8 +1991,8 @@ static void test_Bayer2RGB_EdgeAware_8u(const Mat& src, Mat& dst, int code)
{
// red
D
[
0
]
=
S
[
0
];
D
[
1
]
=
(
std
::
abs
(
S
[
-
1
]
-
S
[
1
])
>
std
::
abs
(
S
[
step
]
-
S
[
-
step
])
?
(
S
[
step
]
+
S
[
-
step
]
)
:
(
S
[
-
1
]
+
S
[
1
]
))
/
2
;
D
[
2
]
=
((
S
[
-
step
-
1
]
+
S
[
-
step
+
1
]
+
S
[
step
-
1
]
+
S
[
step
+
1
])
/
4
);
D
[
1
]
=
(
std
::
abs
(
S
[
-
1
]
-
S
[
1
])
>
std
::
abs
(
S
[
step
]
-
S
[
-
step
])
?
(
S
[
step
]
+
S
[
-
step
]
+
1
)
:
(
S
[
-
1
]
+
S
[
1
]
+
1
))
/
2
;
D
[
2
]
=
((
S
[
-
step
-
1
]
+
S
[
-
step
+
1
]
+
S
[
step
-
1
]
+
S
[
step
+
1
]
+
2
)
/
4
);
if
(
!
blue
)
std
::
swap
(
D
[
0
],
D
[
2
]);
}
...
...
@@ -2002,8 +2002,8 @@ static void test_Bayer2RGB_EdgeAware_8u(const Mat& src, Mat& dst, int code)
for
(
int
x
=
1
;
x
<
size
.
width
;
x
+=
2
,
S
+=
2
,
D
+=
2
*
dcn
)
{
D
[
0
]
=
S
[
0
];
D
[
1
]
=
(
std
::
abs
(
S
[
-
1
]
-
S
[
1
])
>
std
::
abs
(
S
[
step
]
-
S
[
-
step
])
?
(
S
[
step
]
+
S
[
-
step
]
)
:
(
S
[
-
1
]
+
S
[
1
]
))
/
2
;
D
[
2
]
=
((
S
[
-
step
-
1
]
+
S
[
-
step
+
1
]
+
S
[
step
-
1
]
+
S
[
step
+
1
])
/
4
);
D
[
1
]
=
(
std
::
abs
(
S
[
-
1
]
-
S
[
1
])
>
std
::
abs
(
S
[
step
]
-
S
[
-
step
])
?
(
S
[
step
]
+
S
[
-
step
]
+
1
)
:
(
S
[
-
1
]
+
S
[
1
]
+
1
))
/
2
;
D
[
2
]
=
((
S
[
-
step
-
1
]
+
S
[
-
step
+
1
]
+
S
[
step
-
1
]
+
S
[
step
+
1
]
+
2
)
/
4
);
if
(
!
blue
)
std
::
swap
(
D
[
0
],
D
[
2
]);
}
...
...
@@ -2013,9 +2013,9 @@ static void test_Bayer2RGB_EdgeAware_8u(const Mat& src, Mat& dst, int code)
for
(
int
x
=
2
;
x
<
size
.
width
;
x
+=
2
,
S
+=
2
,
D
+=
2
*
dcn
)
{
D
[
0
]
=
(
S
[
-
1
]
+
S
[
1
])
/
2
;
D
[
0
]
=
(
S
[
-
1
]
+
S
[
1
]
+
1
)
/
2
;
D
[
1
]
=
S
[
0
];
D
[
2
]
=
(
S
[
-
step
]
+
S
[
step
])
/
2
;
D
[
2
]
=
(
S
[
-
step
]
+
S
[
step
]
+
1
)
/
2
;
if
(
!
blue
)
std
::
swap
(
D
[
0
],
D
[
2
]);
}
...
...
@@ -2051,7 +2051,9 @@ static void checkData(const Mat& actual, const Mat& reference, cvtest::TS* ts, c
EXPECT_EQ
(
actual
.
depth
(),
reference
.
depth
());
Size
size
=
reference
.
size
();
size
.
width
*=
reference
.
channels
();
int
dcn
=
reference
.
channels
();
size
.
width
*=
dcn
;
for
(
int
y
=
0
;
y
<
size
.
height
&&
next
;
++
y
)
{
const
T
*
A
=
reinterpret_cast
<
const
T
*>
(
actual
.
data
+
actual
.
step
*
y
);
...
...
@@ -2064,10 +2066,15 @@ static void checkData(const Mat& actual, const Mat& reference, cvtest::TS* ts, c
ts
->
printf
(
SUM
,
"
\n
Reference value: %d
\n
"
,
static_cast
<
int
>
(
R
[
x
]));
ts
->
printf
(
SUM
,
"Actual value: %d
\n
"
,
static_cast
<
int
>
(
A
[
x
]));
ts
->
printf
(
SUM
,
"(y, x): (%d, %d)
\n
"
,
y
,
x
/
reference
.
channels
());
ts
->
printf
(
SUM
,
"Channel pos: %d
\n
"
,
x
%
reference
.
channels
());
ts
->
printf
(
SUM
,
"Pattern: %s
\n
"
,
type
);
ts
->
printf
(
SUM
,
"Bayer image type: %s"
,
bayer_type
);
#undef SUM
Mat
diff
;
absdiff
(
actual
,
reference
,
diff
);
EXPECT_EQ
(
countNonZero
(
diff
.
reshape
(
1
)
>
1
),
0
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_BAD_ACCURACY
);
ts
->
set_gtest_status
();
...
...
@@ -2173,12 +2180,6 @@ TEST(ImgProc_Bayer2RGBA, accuracy)
Mat
diff
;
absdiff
(
actual
,
reference
,
diff
);
cv
::
Rect
r
(
0
,
ssize
.
height
-
5
,
7
,
5
);
std
::
cout
<<
"Actual: "
<<
std
::
endl
<<
actual
(
r
)
<<
std
::
endl
<<
std
::
endl
;
std
::
cout
<<
"Reference: "
<<
std
::
endl
<<
reference
(
r
)
<<
std
::
endl
<<
std
::
endl
;
std
::
cout
<<
"Difference: "
<<
std
::
endl
<<
diff
(
r
)
<<
std
::
endl
<<
std
::
endl
;
EXPECT_EQ
(
countNonZero
(
diff
.
reshape
(
1
)
>
1
),
0
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_BAD_ACCURACY
);
...
...
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