04-11-2021 03:00 AM
When doing stereo vision on FPGA, there was an error in calling xfopencv in HLS to complete camera calibration and lens correction. Ask the seniors for guidance.
An error occurred in calling xfopencv in HLS to complete camera calibration and lens correction. Did not get the correct image,but got ALL BLACK img.
I have repeatedly read UG902 and UG1233 about the definition of the following functions:
The program flow is to first call the xf::InitUndistortRectifyMapInverse() method to get mapx and mapy, and then use mapx and mapy as the parameters of xf::remap().
But for the xf::InitUndistortRectifyMapInverse() method, you need to pass in 7 parameters:
cameraMatrix, distCoeffs, ir, mapxLMat, mapyLMat, 9, 5
Among them, ir is the matrix obtained by multiplying the new coordinate system matrix and the rotation matrix and then taking the inverse according to the definition in the document. But in a xilinx post, the reply is to directly invert the rotation matrix.
I have tried both of the above solutions, but the image is still completely black.
And how to set the WIN_ROWS parameter in the report method? The default is 2. Is it okay to keep the default?
Attached is my program code.
Hope someone can point out my mistake, thank you very much! ! !