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
913d4541
Commit
913d4541
authored
Jun 14, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduced some tegra stubs
parent
a98d6b62
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
122 deletions
+18
-122
imgwarp.cpp
modules/imgproc/src/imgwarp.cpp
+9
-20
thresh.cpp
modules/imgproc/src/thresh.cpp
+9
-102
No files found.
modules/imgproc/src/imgwarp.cpp
View file @
913d4541
...
...
@@ -2839,6 +2839,11 @@ void cv::warpAffine( InputArray _src, OutputArray _dst,
CV_Assert
(
(
M0
.
type
()
==
CV_32F
||
M0
.
type
()
==
CV_64F
)
&&
M0
.
rows
==
2
&&
M0
.
cols
==
3
);
M0
.
convertTo
(
matM
,
matM
.
type
());
#ifdef HAVE_TEGRA_OPTIMIZATION
if
(
tegra
::
warpAffine
(
src
,
dst
,
M
,
flags
,
borderType
,
borderValue
)
)
return
;
#endif
if
(
!
(
flags
&
WARP_INVERSE_MAP
)
)
{
double
D
=
M
[
0
]
*
M
[
4
]
-
M
[
1
]
*
M
[
3
];
...
...
@@ -2851,22 +2856,6 @@ void cv::warpAffine( InputArray _src, OutputArray _dst,
M
[
2
]
=
b1
;
M
[
5
]
=
b2
;
}
#ifdef HAVE_TEGRA_OPTIMIZATION
if
(
borderType
==
BORDER_REPLICATE
)
{
if
(
tegra
::
warpAffine
(
src
,
dst
,
M
,
interpolation
,
borderType
,
borderValue
)
)
return
;
}
else
{
double
warp_mat
[
6
];
Mat
warp_m
(
2
,
3
,
CV_64F
,
warp_mat
);
M0
.
convertTo
(
warp_m
,
warp_m
.
type
());
if
(
tegra
::
warpAffine
(
src
,
dst
,
warp_mat
,
interpolation
,
borderType
,
borderValue
)
)
return
;
}
#endif
int
x
,
y
,
x1
,
y1
,
width
=
dst
.
cols
,
height
=
dst
.
rows
;
AutoBuffer
<
int
>
_abdelta
(
width
*
2
);
int
*
adelta
=
&
_abdelta
[
0
],
*
bdelta
=
adelta
+
width
;
...
...
@@ -2995,14 +2984,14 @@ void cv::warpPerspective( InputArray _src, OutputArray _dst, InputArray _M0,
CV_Assert
(
(
M0
.
type
()
==
CV_32F
||
M0
.
type
()
==
CV_64F
)
&&
M0
.
rows
==
3
&&
M0
.
cols
==
3
);
M0
.
convertTo
(
matM
,
matM
.
type
());
if
(
!
(
flags
&
WARP_INVERSE_MAP
)
)
invert
(
matM
,
matM
);
#ifdef HAVE_TEGRA_OPTIMIZATION
if
(
tegra
::
warpPerspective
(
src
,
dst
,
M
,
interpolation
,
borderType
,
borderValue
)
)
if
(
tegra
::
warpPerspective
(
src
,
dst
,
M
,
flags
,
borderType
,
borderValue
)
)
return
;
#endif
if
(
!
(
flags
&
WARP_INVERSE_MAP
)
)
invert
(
matM
,
matM
);
int
x
,
y
,
x1
,
y1
,
width
=
dst
.
cols
,
height
=
dst
.
rows
;
int
bh0
=
std
::
min
(
BLOCK_SZ
/
2
,
height
);
...
...
modules/imgproc/src/thresh.cpp
View file @
913d4541
...
...
@@ -60,39 +60,8 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type )
}
#ifdef HAVE_TEGRA_OPTIMIZATION
switch
(
type
)
{
case
THRESH_BINARY
:
if
(
tegra
::
thresh_8u_binary
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
,
maxval
))
{
return
;
}
break
;
case
THRESH_BINARY_INV
:
if
(
tegra
::
thresh_8u_binary_inv
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
,
maxval
))
{
return
;
}
break
;
case
THRESH_TRUNC
:
if
(
tegra
::
thresh_8u_trunc
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
))
{
return
;
}
break
;
case
THRESH_TOZERO
:
if
(
tegra
::
thresh_8u_tozero
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
))
{
return
;
}
break
;
case
THRESH_TOZERO_INV
:
if
(
tegra
::
thresh_8u_tozero_inv
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
))
{
if
(
tegra
::
thresh_8u
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
,
maxval
,
type
))
return
;
}
break
;
}
#endif
switch
(
type
)
...
...
@@ -264,7 +233,7 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type )
const
uchar
*
src
=
(
const
uchar
*
)(
_src
.
data
+
_src
.
step
*
i
);
uchar
*
dst
=
(
uchar
*
)(
_dst
.
data
+
_dst
.
step
*
i
);
j
=
j_scalar
;
#if CV_ENABLE_UNROLLED
#if CV_ENABLE_UNROLLED
for
(
;
j
<=
roi
.
width
-
4
;
j
+=
4
)
{
uchar
t0
=
tab
[
src
[
j
]];
...
...
@@ -279,7 +248,7 @@ thresh_8u( const Mat& _src, Mat& _dst, uchar thresh, uchar maxval, int type )
dst
[
j
+
2
]
=
t0
;
dst
[
j
+
3
]
=
t1
;
}
#endif
#endif
for
(
;
j
<
roi
.
width
;
j
++
)
dst
[
j
]
=
tab
[
src
[
j
]];
}
...
...
@@ -307,41 +276,12 @@ thresh_16s( const Mat& _src, Mat& _dst, short thresh, short maxval, int type )
roi
.
width
*=
roi
.
height
;
roi
.
height
=
1
;
}
#ifdef HAVE_TEGRA_OPTIMIZATION
switch
(
type
)
{
case
THRESH_BINARY
:
if
(
tegra
::
thresh_16s_binary
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
,
maxval
))
{
if
(
tegra
::
thresh_16s
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
,
maxval
,
type
))
return
;
}
break
;
case
THRESH_BINARY_INV
:
if
(
tegra
::
thresh_16s_binary_inv
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
,
maxval
))
{
return
;
}
break
;
case
THRESH_TRUNC
:
if
(
tegra
::
thresh_16s_trunc
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
))
{
return
;
}
break
;
case
THRESH_TOZERO
:
if
(
tegra
::
thresh_16s_tozero
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
))
{
return
;
}
break
;
case
THRESH_TOZERO_INV
:
if
(
tegra
::
thresh_16s_tozero_inv
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
))
{
return
;
}
break
;
}
#endif
switch
(
type
)
{
case
THRESH_BINARY
:
...
...
@@ -510,40 +450,10 @@ thresh_32f( const Mat& _src, Mat& _dst, float thresh, float maxval, int type )
}
#ifdef HAVE_TEGRA_OPTIMIZATION
switch
(
type
)
{
case
THRESH_BINARY
:
if
(
tegra
::
thresh_32f_binary
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
,
maxval
))
{
if
(
tegra
::
thresh_32f
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
,
maxval
,
type
))
return
;
}
break
;
case
THRESH_BINARY_INV
:
if
(
tegra
::
thresh_32f_binary_inv
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
,
maxval
))
{
return
;
}
break
;
case
THRESH_TRUNC
:
if
(
tegra
::
thresh_32f_trunc
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
))
{
return
;
}
break
;
case
THRESH_TOZERO
:
if
(
tegra
::
thresh_32f_tozero
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
))
{
return
;
}
break
;
case
THRESH_TOZERO_INV
:
if
(
tegra
::
thresh_32f_tozero_inv
(
_src
,
_dst
,
roi
.
width
,
roi
.
height
,
thresh
))
{
return
;
}
break
;
}
#endif
switch
(
type
)
{
case
THRESH_BINARY
:
...
...
@@ -820,7 +730,7 @@ double cv::threshold( InputArray _src, OutputArray _dst, double thresh, double m
Mat
dst
=
_dst
.
getMat
();
int
nStripes
=
1
;
#if defined HAVE_TBB && defined
HAVE_TEGRA_OPTIMIZATION
#if defined HAVE_TBB && defined
ANDROID
nStripes
=
4
;
#endif
...
...
@@ -849,7 +759,6 @@ double cv::threshold( InputArray _src, OutputArray _dst, double thresh, double m
}
else
{
//thresh_8u( src, dst, (uchar)ithresh, (uchar)imaxval, type );
parallel_for
(
BlockedRange
(
0
,
nStripes
),
ThresholdRunner
(
src
,
dst
,
nStripes
,
(
uchar
)
ithresh
,
(
uchar
)
imaxval
,
type
));
}
...
...
@@ -879,14 +788,12 @@ double cv::threshold( InputArray _src, OutputArray _dst, double thresh, double m
}
else
{
//thresh_16s( src, dst, (short)ithresh, (short)imaxval, type );
parallel_for
(
BlockedRange
(
0
,
nStripes
),
ThresholdRunner
(
src
,
dst
,
nStripes
,
(
short
)
ithresh
,
(
short
)
imaxval
,
type
));
}
}
else
if
(
src
.
depth
()
==
CV_32F
)
{
//thresh_32f( src, dst, (float)thresh, (float)maxval, type );
parallel_for
(
BlockedRange
(
0
,
nStripes
),
ThresholdRunner
(
src
,
dst
,
nStripes
,
(
float
)
thresh
,
(
float
)
maxval
,
type
));
}
...
...
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