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
fcdbe162
Commit
fcdbe162
authored
Dec 16, 2016
by
Rostislav Vasilikhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
openvx_cvt disabled for Khronos, fixed sstep and dstep usage
parent
cf5e976f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
8 deletions
+27
-8
convert.cpp
modules/core/src/convert.cpp
+27
-8
No files found.
modules/core/src/convert.cpp
View file @
fcdbe162
...
@@ -4644,31 +4644,50 @@ static bool _openvx_cvt(const T* src, size_t sstep,
...
@@ -4644,31 +4644,50 @@ static bool _openvx_cvt(const T* src, size_t sstep,
{
{
using
namespace
ivx
;
using
namespace
ivx
;
if
(
!
(
continuousSize
.
width
>
0
&&
continuousSize
.
height
>
0
&&
sstep
>
0
&&
dstep
>
0
))
if
(
!
(
continuousSize
.
width
>
0
&&
continuousSize
.
height
>
0
))
{
{
return
true
;
return
true
;
}
}
CV_Assert
(
sstep
/
sizeof
(
T
)
==
dstep
/
sizeof
(
DT
));
//.height is for number of continuous pieces
//.height is for number of continuous pieces
//.width is for length of one piece
//.width is for length of one piece
Size
imgSize
=
continuousSize
;
Size
imgSize
=
continuousSize
;
if
(
continuousSize
.
height
==
1
)
if
(
continuousSize
.
height
==
1
)
{
{
//continuous case
if
(
sstep
/
sizeof
(
T
)
==
dstep
/
sizeof
(
DT
)
&&
sstep
/
sizeof
(
T
)
>
0
&&
imgSize
.
width
=
sstep
/
sizeof
(
T
);
continuousSize
.
width
%
(
sstep
/
sizeof
(
T
))
==
0
)
imgSize
.
height
=
continuousSize
.
width
/
(
sstep
/
sizeof
(
T
));
{
//continuous n-lines image
imgSize
.
width
=
sstep
/
sizeof
(
T
);
imgSize
.
height
=
continuousSize
.
width
/
(
sstep
/
sizeof
(
T
));
}
else
{
//1-row image with possibly incorrect step
sstep
=
continuousSize
.
width
*
sizeof
(
T
);
dstep
=
continuousSize
.
width
*
sizeof
(
DT
);
}
}
}
int
srcType
=
DataType
<
T
>::
type
,
dstType
=
DataType
<
DT
>::
type
;
try
try
{
{
Context
context
=
Context
::
create
();
Context
context
=
Context
::
create
();
Image
srcImage
=
Image
::
createFromHandle
(
context
,
Image
::
matTypeToFormat
(
DataType
<
T
>::
type
),
// Other conversions are marked as "experimental"
if
(
context
.
vendorID
()
==
VX_ID_KHRONOS
&&
!
(
srcType
==
CV_8U
&&
dstType
==
CV_16S
)
&&
!
(
srcType
==
CV_16S
&&
dstType
==
CV_8U
))
{
return
false
;
}
Image
srcImage
=
Image
::
createFromHandle
(
context
,
Image
::
matTypeToFormat
(
srcType
),
Image
::
createAddressing
(
imgSize
.
width
,
imgSize
.
height
,
Image
::
createAddressing
(
imgSize
.
width
,
imgSize
.
height
,
(
vx_uint32
)
sizeof
(
T
),
(
vx_uint32
)
sstep
),
(
vx_uint32
)
sizeof
(
T
),
(
vx_uint32
)
sstep
),
(
void
*
)
src
);
(
void
*
)
src
);
Image
dstImage
=
Image
::
createFromHandle
(
context
,
Image
::
matTypeToFormat
(
DataType
<
DT
>::
t
ype
),
Image
dstImage
=
Image
::
createFromHandle
(
context
,
Image
::
matTypeToFormat
(
dstT
ype
),
Image
::
createAddressing
(
imgSize
.
width
,
imgSize
.
height
,
Image
::
createAddressing
(
imgSize
.
width
,
imgSize
.
height
,
(
vx_uint32
)
sizeof
(
DT
),
(
vx_uint32
)
dstep
),
(
vx_uint32
)
sizeof
(
DT
),
(
vx_uint32
)
dstep
),
(
void
*
)
dst
);
(
void
*
)
dst
);
...
...
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