Search code examples
opencvhomebrew

How can I install opencv2 with brew under OSX


Recently, I installed opencv with the following command:

brew install opencv

I found opencv3 was installed in dir /usr/include and /usr/lib. But what I want is opencv2. How can install opencv2 with the brew command?


Solution

  • The easiest way to find the answer is to use brew search to look for available packages. So, in your case:

    brew search opencv
    

    There you will see the package opencv@2 listed. So, you need:

    brew install opencv@2