Skip to content

Commit 2d05db6

Browse files
committed
Merge pull request opencv#8576 from terfendail:ovx_fixwrappers
2 parents 1c72825 + d873fe6 commit 2d05db6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

3rdparty/openvx/include/ivx.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2508,10 +2508,10 @@ class Convolution : public RefWrapper<vx_convolution>
25082508
{
25092509
if (!areTypesCompatible(TypeToEnum<T>::value, dataType()))
25102510
throw WrapperError(std::string(__func__) + "(): destination type is wrong");
2511-
if (data.size() != size())
2511+
if (data.size()*sizeof(T) != size())
25122512
{
25132513
if (data.size() == 0)
2514-
data.resize(size());
2514+
data.resize(size()/sizeof(T));
25152515
else
25162516
throw WrapperError(std::string(__func__) + "(): destination size is wrong");
25172517
}
@@ -2522,7 +2522,7 @@ class Convolution : public RefWrapper<vx_convolution>
25222522
{
25232523
if (!areTypesCompatible(TypeToEnum<T>::value, dataType()))
25242524
throw WrapperError(std::string(__func__) + "(): source type is wrong");
2525-
if (data.size() != size()) throw WrapperError(std::string(__func__) + "(): source size is wrong");
2525+
if (data.size()*sizeof(T) != size()) throw WrapperError(std::string(__func__) + "(): source size is wrong");
25262526
copyFrom(&data[0]);
25272527
}
25282528

@@ -2670,10 +2670,10 @@ class Matrix : public RefWrapper<vx_matrix>
26702670
{
26712671
if (!areTypesCompatible(TypeToEnum<T>::value, dataType()))
26722672
throw WrapperError(std::string(__func__) + "(): destination type is wrong");
2673-
if (data.size() != size())
2673+
if (data.size()*sizeof(T) != size())
26742674
{
26752675
if (data.size() == 0)
2676-
data.resize(size());
2676+
data.resize(size()/sizeof(T));
26772677
else
26782678
throw WrapperError(std::string(__func__) + "(): destination size is wrong");
26792679
}
@@ -2684,7 +2684,7 @@ class Matrix : public RefWrapper<vx_matrix>
26842684
{
26852685
if (!areTypesCompatible(TypeToEnum<T>::value, dataType()))
26862686
throw WrapperError(std::string(__func__) + "(): source type is wrong");
2687-
if (data.size() != size()) throw WrapperError(std::string(__func__) + "(): source size is wrong");
2687+
if (data.size()*sizeof(T) != size()) throw WrapperError(std::string(__func__) + "(): source size is wrong");
26882688
copyFrom(&data[0]);
26892689
}
26902690

0 commit comments

Comments
 (0)