A simple DisplayImage code like this is working fine:
#include <opencv2/highgui/highgui.hpp>
// #include <opencv2/contrib/contrib.hpp>
using namespace cv;
int main()
{
Mat img = imread("5.jpg");
imshow("opencvtest",img);
waitKey(0);
return 0;
}
but showing the following error while including contrib.hpp:
How to include contrib.hpp and use its functions like faceRecognizer?
SnShine : g++ -ggdb `pkg-config --cflags opencv` -o `basename opencvtest.cpp .cpp` opencvtest.cpp `pkg-config --libs opencv`
In file included from opencvtest.cpp:2:0:
/usr/local/include/opencv2/contrib/contrib.hpp:79:9: error: ‘CvHistogram’ does not name a type
CvHistogram *fHistogram;
^
/usr/local/include/opencv2/contrib/contrib.hpp:90:5: error: ‘IplImage’ does not name a type
IplImage *imgHueFrame, *imgSaturationFrame, *imgLastGrayFrame, *imgMotionFrame, *imgFilteredFrame;
^
/usr/local/include/opencv2/contrib/contrib.hpp:91:5: error: ‘IplImage’ does not name a type
IplImage *imgShrinked, *imgTemp, *imgGrayFrame, *imgHSVFrame;
^
/usr/local/include/opencv2/contrib/contrib.hpp:94:19: error: ‘IplImage’ has not been declared
void initData(IplImage *src, int widthDivider, int heightDivider);
^
/usr/local/include/opencv2/contrib/contrib.hpp:109:26: error: ‘IplImage’ has not been declared
virtual void process(IplImage *inputBGRImage, IplImage *outputHueMask);
^
/usr/local/include/opencv2/contrib/contrib.hpp:109:51: error: ‘IplImage’ has not been declared
virtual void process(IplImage *inputBGRImage, IplImage *outputHueMask);
^
/usr/local/include/opencv2/contrib/contrib.hpp:208:30: error: ‘IplImage’ has not been declared
void initDepthValues(IplImage *maskImage, IplImage *depthMap);
^
/usr/local/include/opencv2/contrib/contrib.hpp:208:51: error: ‘IplImage’ has not been declared
void initDepthValues(IplImage *maskImage, IplImage *depthMap);
^
/usr/local/include/opencv2/contrib/contrib.hpp:210:26: error: ‘IplImage’ has not been declared
void extractInfo(IplImage *maskImage, IplImage *depthMap, bool initDepth);
^
/usr/local/include/opencv2/contrib/contrib.hpp:210:47: error: ‘IplImage’ has not been declared
void extractInfo(IplImage *maskImage, IplImage *depthMap, bool initDepth);
^
/usr/local/include/opencv2/contrib/contrib.hpp:214:24: error: ‘IplImage’ has not been declared
bool meanShift(IplImage *maskImage, IplImage *depthMap, int maxIteration, bool initDepth);
^
/usr/local/include/opencv2/contrib/contrib.hpp:214:45: error: ‘IplImage’ has not been declared
bool meanShift(IplImage *maskImage, IplImage *depthMap, int maxIteration, bool initDepth);
^
/usr/local/include/opencv2/contrib/contrib.hpp:247:62: error: ‘IplImage’ has not been declared
void findOptimumSearchWindow(SearchWindow &searchWindow, IplImage *maskImage, IplImage *depthMap, int maxIteration, int resizeMethod, bool initDepth);
^
/usr/local/include/opencv2/contrib/contrib.hpp:247:83: error: ‘IplImage’ has not been declared
void findOptimumSearchWindow(SearchWindow &searchWindow, IplImage *maskImage, IplImage *depthMap, int maxIteration, int resizeMethod, bool initDepth);
^
In file included from opencvtest.cpp:2:0:
/usr/local/include/opencv2/contrib/contrib.hpp:253:16: error: ‘IplImage’ has not been declared
void track(IplImage *maskImage, IplImage *depthMap, int resizeMethod, bool resetSearch, int minKernelMass = MinKernelMass);
^
/usr/local/include/opencv2/contrib/contrib.hpp:253:37: error: ‘IplImage’ has not been declared
void track(IplImage *maskImage, IplImage *depthMap, int resizeMethod, bool resetSearch, int minKernelMass = MinKernelMass);
^
/usr/local/include/opencv2/contrib/contrib.hpp:274:23: error: ‘vector’ does not name a type
Octree( const vector<Point3f>& points, int maxLevels = 10, int minPoints = 20 );
^
/usr/local/include/opencv2/contrib ...
(more)