Hi,
Looking for help creating OpenVX remap tables (vx_remap) from the output of cv::initUndistortRectifyMap. I am currently doing this as follows:
cv::Size size(cameras->frameWidth, cameras->frameHeight);
cv::initUndistortRectifyMap(cameras->getCameraMatrix(),
cameras->getDistCoeffs(),
R, P,
size,
CV_32FC1,
remapX, remapY);
cv::initUndistortRectifyMap(cameras->getCameraMatrix(),
cameras->getDistCoeffs(),
R, P,
size,
CV_32FC1,
remapX, remapY);
int sfw = size.width, sfh = size.height;
int dfw = size.width, dfh = size.height;
remapTable = vxCreateRemap(context, sfw, sfh, dfw, dfh);
remapTable = vxCreateRemap(context, sfw, sfh, dfw, dfh);
vx_status status;
for(int y = 0; y < dfh; y++) {
for(int x = 0; x < dfw; x++) {
status = vxSetRemapPoint(remapTable,
x, y,
(vx_float32)remapX.at<float>(y, x),
(vx_float32)remapY.at<float>(y, x));
status = vxSetRemapPoint(remapTable,
x, y,
(vx_float32)remapX.at<float>(y, x),
(vx_float32)remapY.at<float>(y, x));
}
}
When I subsequently try to rectify images using cv::remap(), all is fine. However, when I try to rectify using vxuRemap() with the remapTable I built above, the images are not correct (i.e, there are striped lines, mirroring, distortion, etc.). So Iām obviously not converting the remap tables correctly. Any help here would be appreciated.
Thanks!