Hi, I'm using OpenCV 3.2. In Ubuntu 16 and ROS Kinetic, initUndistortRectifyMap method works well. However in Ubuntu 14 and ROS Indigo, initUndistortRectifyMap method throws segmentation fault. How can I solve this problem. Here my source code.
double left_K_array[9] = {597.1097521605675, 0.0, 347.63854815045744, 0.0, 596.4001364332671, 224.437236712643, 0.0, 0.0, 1.0};
double left_D_array[4] = {-0.4004496392598547, 0.19050457839257873, 0.00044124127310643773, -0.0028168245512799526};
double left_R_array[9] = {0.9999981271651781, -0.0012861392988823535, -0.0014462060157307741, 0.001273435625893902, 0.9999608983018283, -0.008751013033202502, 0.0014574044883866881, 0.008749154993737752, 0.9999606633558406};
double left_P_array[12] = {598.1045682828319, 0.0, 316.94952392578125, 0.0, 0.0, 598.1045682828319, 244.39208221435547, 0.0, 0.0, 0.0, 1.0, 0.0};
double right_K_array[9] = {598.6108688018368, 0.0, 298.3515214908845, 0.0, 599.2241883823533, 262.80305450499503, 0.0, 0.0, 1.0};
double right_D_array[4] = {-0.40413263574076447, 0.1948797724228192, 0.0005653616334116255, -0.004673877723474734};
double right_R_array[9] = {0.9999632630389491, 0.0015264370954696002, 0.008434605046514125, -0.0016001828733401033, 0.999960495231354, 0.0087434198936667, -0.008420925558926182, -0.008756595597529438, 0.9999262023000859};
double right_P_array[12] = {598.1045682828319, 0.0, 316.94952392578125, -70.87906420629835, 0.0, 598.1045682828319, 244.39208221435547, 0.0, 0.0, 0.0, 1.0, 0.0};
Mat left_K = Mat(3, 3, CV_64F, (void*)left_K_array);
Mat left_D = Mat(1, 4, CV_64F, (void*)left_D_array);
Mat left_R = Mat(3, 3, CV_64F, (void*)left_R_array);
Mat left_P = Mat(3, 4, CV_64F, (void*)left_P_array);
Mat right_K = Mat(3, 3, CV_64F, (void*)right_K_array);
Mat right_D = Mat(1, 4, CV_64F, (void*)right_D_array);
Mat right_R = Mat(3, 3, CV_64F, (void*)right_R_array);
Mat right_P = Mat(3, 4, CV_64F, (void*)right_P_array);
Mat cam1map1, cam1map2, cam2map1, cam2map2;
Size rectified_image_size = Size(640, 480);
initUndistortRectifyMap(left_K, left_D, left_R, left_P, rectified_image_size, CV_32FC1, cam1map1, cam1map2);
initUndistortRectifyMap(right_K, right_D, right_R, right_P, rectified_image_size, CV_32FC1, cam2map1, cam2map2);