Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV imgcodecs.hpp file not found error

Tags:

c++

opencv

I'm trying to compile a C++ program that uses OpenCV to score the similarity of two images:

Image Histogram Compare

When I g++ compile the file:

'opencv2/imgcodecs.hpp' file not found

#include "opencv2/imgcodecs.hpp"

I updated the opencv formula on Mac OS X. I re-ran brew install, but I still get this error.

mdfind imgcodecs.hpp -name

returns nothing - the file is nowhere on my system.

Does anyone know my imgcodecs is not included, and how to include it? I'm really novice at C and OpenCV, and enormously grateful for any help.

like image 768
metalaureate Avatar asked Aug 08 '14 02:08

metalaureate


1 Answers

I notice that you are looking at tutorial code on the master branch (aka 3.0.0). It uses an imgcodecs module that is not present in earlier versions of OpenCV (e.g. 2.4.9).

Check which version of OpenCV you have (it seems not 3.0.0) and use a matching version of tutorial code (e.g. OpenCV 2.4.9 Histograms_Matching/EqualizeHist_Demo.cpp)

like image 157
Bull Avatar answered Nov 06 '22 06:11

Bull