ROS compilation error

The error is as follows:

/home/sxj/catkin_ws/src/kcf_track/src/kcftracker.cpp: In member function 'cv::Mat KCFTracker::getFeatures(const cv::Mat&, bool, float)':
/home/sxj/catkin_ws/src /kcf_track/src/kcftracker.cpp:410:26: error: conversion from 'cv::Mat' to non-scalar type 'IplImage' {aka '_IplImage'} requested
  410 | IplImage z_ipl = z;
      | ^
make[2 ]: *** [kcf_track/CMakeFiles/kcf_node.dir/build.make:90:kcf_track/CMakeFiles/kcf_node.dir/src/kcftracker.cpp.o] Error 1
make[2]: *** Waiting for incomplete task....
make[1]: *** [CMakeFiles/Makefile2:5638:kcf_track/CMakeFiles/kcf_node.dir/all] Error 2
make: *** [Makefile:146:all] Error 2
Invoking "make -j16 -l16" failed

 Solution:

It has given a hint: /home/sxj/catkin_ws/src/kcf_track/src/kcftracker.cpp

Find this kcftracker.cpp according to the path and open it for modification

Before modification: IplImage z_ipl = z;

After modification: IplImage z_ipl = cvIplImage(z);

The reason is the conversion between Mat type and IplImage type

Before OpenCV version 3.8 (including 3.8), the above syntax is correct. After version 3.8, it is necessary to use cvIplImage to complete.


 

Guess you like

Origin blog.csdn.net/m0_60657960/article/details/130083634
Recommended