OpenVX based implementation for integral image HAL API.
This commit is contained in:
parent
dd379ec9fd
commit
058f93d9e8
46
3rdparty/openvx/include/openvx_hal.hpp
vendored
46
3rdparty/openvx/include/openvx_hal.hpp
vendored
@ -100,6 +100,24 @@ struct VX_Traits<short>
|
||||
};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VX_Traits<uint>
|
||||
{
|
||||
enum {
|
||||
ImgType = VX_DF_IMAGE_U32,
|
||||
DataType = VX_TYPE_UINT32
|
||||
};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VX_Traits<int>
|
||||
{
|
||||
enum {
|
||||
ImgType = VX_DF_IMAGE_S32,
|
||||
DataType = VX_TYPE_INT32
|
||||
};
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VX_Traits<float>
|
||||
{
|
||||
@ -1018,6 +1036,32 @@ inline int ovx_hal_cvtOnePlaneYUVtoBGR(const uchar * a, size_t astep, uchar * b,
|
||||
return CV_HAL_ERROR_OK;
|
||||
}
|
||||
|
||||
inline int ovx_hal_integral(int depth, int sdepth, int , const uchar * a, size_t astep, uchar * b, size_t bstep, uchar * c, size_t , uchar * d, size_t , int w, int h, int cn)
|
||||
{
|
||||
if (depth != CV_8U || sdepth != CV_32S || c != NULL || d != NULL || cn != 1)
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
try
|
||||
{
|
||||
vxContext * ctx = vxContext::getContext();
|
||||
vxImage ia(*ctx, a, astep, w, h);
|
||||
vxImage ib(*ctx, (unsigned int *)(b+bstep+sizeof(unsigned int)), bstep, w, h);
|
||||
vxErr::check(vxuIntegralImage(ctx->ctx, ia.img, ib.img));
|
||||
memset(b, 0, (w+1)*sizeof(unsigned int));
|
||||
b += bstep;
|
||||
for (int i = 0; i < h; i++, b += bstep)
|
||||
{
|
||||
*((unsigned int*)b) = 0;
|
||||
}
|
||||
}
|
||||
catch (vxErr & e)
|
||||
{
|
||||
e.print();
|
||||
return CV_HAL_ERROR_UNKNOWN;
|
||||
}
|
||||
return CV_HAL_ERROR_OK;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
// functions redefinition
|
||||
// ...
|
||||
@ -1096,5 +1140,7 @@ inline int ovx_hal_cvtOnePlaneYUVtoBGR(const uchar * a, size_t astep, uchar * b,
|
||||
#define cv_hal_cvtBGRtoThreePlaneYUV ovx_hal_cvtBGRtoThreePlaneYUV
|
||||
#undef cv_hal_cvtOnePlaneYUVtoBGR
|
||||
#define cv_hal_cvtOnePlaneYUVtoBGR ovx_hal_cvtOnePlaneYUVtoBGR
|
||||
#undef cv_hal_integral
|
||||
#define cv_hal_integral ovx_hal_integral
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user