Closed ps-george closed 5 years ago
Code used:
#include "config_warp_xf.h"
void accel_warp(xf::Mat<XF_8UC1, XF_HEIGHT, XF_WIDTH, NPC1> &_src, xf::Mat<TYPE, XF_HEIGHT, XF_WIDTH, NPC1> &_dst)
{
const int pROWS = XF_HEIGHT;
const int pCOLS = XF_WIDTH;
const int pNPC1 = XF_NPPC8;
const int pDepth = pROWS * pCOLS;
#pragma HLS INTERFACE m_axi port=_src depth=pDepth offset=slave bundle=gmem
#pragma HLS INTERFACE m_axi port=_dst depth=pDepth offset=slave bundle=gmem
#pragma HLS INTERFACE s_axilite port=return bundle=control
#pragma HLS dataflow
float H[9] = {
0.86, 0.5, 10.38,
-0.5, 0.86, -20.34,
0, 0, 1
};
xf::warpPerspective<TRANSTYPE,XF_8UC1,XF_HEIGHT, XF_WIDTH,NPC1>(_src, _dst,H);
}
Hello @ps-george,
The resource utilization estimate depends on:
It is not clear from your code, what values you had set for the above. Also, it is highly recommended to use Warptransform function to perform the perspective and affine geometric transformations, that would provide a better performance, at a lesser cost of resources compared to WarpAffine and WarpPerspective.
Yes, ideally we would like to be using warptransform so that we can have streaming access, however had a couple of problems with that function, I'll open a separate issue for that.
WarpPerspective function is deprecated from 2019.1 release. WarpTransform is the recommended function to use.
Mentioned in #41, after solving the synthesis issue with warppspective, the synthesis result was too large to fit onto the target board.
For reference I hand-coded an implementation of the same inverse warp mapping.
Is there are a restriction of the use of the xf_warpperspective function? Perhaps it is only designed for larger boards and executes extremely fast?
xfopencv warp
hand coded warp