error: request for member ‘fl’ in ‘mapx->cv::Mat::data’, which is of non-class type ‘uchar*’ {aka ‘unsigned char*’} #1

38 Views Asked by At

`

void create_perspecive_undistortion_LUT( Mat *mapx, Mat *mapy, struct ocam_model *ocam_model, float sf)
{
     int i, j;
     int width = mapx->cols; //New width
     int height = mapx->rows;//New height     
     float *data_mapx = mapx->data.fl;
     //float data_mapx = mapx->data.at<float>(1, 1, 1);
     float *data_mapy = mapy->data.fl;
     //float data_mapy = mapy->data.at<float>(1, 1, 1);
     float Nxc = height/2.0;
     float Nyc = width/2.0;
     float Nz  = -width/sf;
     double M[3];
     double m[2];
     
     for (i=0; i<height; i++)
         for (j=0; j<width; j++)
         {   
             M[0] = (i - Nxc);
             M[1] = (j - Nyc);
             M[2] = Nz;
             world2cam(m, M, ocam_model);
             *( data_mapx + i*width+j ) = (float) m[1];
             *( data_mapy + i*width+j ) = (float) m[0];
         }
}

` I was using a Jetson Xavier AGX with Ubuntu 18.04 and ROS Melodic and it's fine but then i need to update to Ubuntu 20.04 and ROS NOETIC and then this error happened. can anyone help?

i tried changing float *data_mapx = mapx->data.fl; float *data_mapy = mapy->data.fl;

to

float data_mapx = mapx->data.at<float>(1, 1, 1); float data_mapy = mapy->data.at<float>(1, 1, 1);

but it doesn't work

0

There are 0 best solutions below