0

Well, I am going to do some deep learning stuff with opencv.

I have already installed scikit-image and scikit-learn.

  • Where is your question? You should correct your title. Read more about question on StackOverflow hire: https://stackoverflow.com/help/how-to-ask – kris_IV Feb 07 '19 at 18:40
  • `brew install opencv`. https://brew.sh/ – Cris Luengo Feb 07 '19 at 18:41
  • 1
    scikit-image and scikit-learn are Python packages. OpenCV is a C++ library that has a Python port. You don't need Visual C++ for OpenCV at all. Do you intend to use OpenCV in C++ or in Python? – alkasm Feb 07 '19 at 19:38
  • Alex: I need to use openCV3 in python 3.5. any suggestions? – aditianny sharma Feb 07 '19 at 20:09
  • Did you try `pip install opencv`? (Maybe that needs to be `opencv2` or `opencv3`, I don't know, try it out!) – Cris Luengo Feb 08 '19 at 05:25

1 Answers1

0

No, but you could install some C++ compiler on MacOSX.

Visual C++ is a C++ compiler and IDE for Windows (don't confuse it with Visual Studio Code, which is a cross-platform IDE). You need some compiler for MacOSX, which is a Unix variant and nearly POSIX (it could be certified to some specific POSIX standard, but I don't know which).

Probably, both GCC and Clang are available on MacOSX (see this). You need to find some packaged version of them, perhaps with brew; both compilers work really well. Apple is partly funding Clang. GCC is funded by many other corporations. They both are open source compilers, but with a different license (GCC is mostly GPLv3+). GCC is probably producing some faster code (when optimizing, faster by a few percents only). Clang is probably giving better diagnostics. I actually recommend installing both of them (and using occasionally both of them too).

Take care to install recent versions of GCC & Clang. Both are very active projects, and are progressing quite well.

You probably need to install other things too. E.g. a build automation tool (like GNU make), a version control system (like git), a source code editor (like emacs or vim).

You might even install some fancy IDE like Clion, Code::Blocks, XCode, etc.. I recommend avoiding that, because you need to learn how to compile on the command line. These fancy tools are running the command line compiler under the hoods, and you really need to understand what they are doing (and hiding from you). Actually C and C++ are somehow not IDE friendly (you really need to understand what the compiler is doing). In both C11 specification (n1570) and in C++11 specification (n3337) the notion of translation unit and of preprocessing is important (and sadly, IDEs tend to hide these notions).

As remarked in comments, you could install the XCode package (which pulls useful packages like GCC or Clang, etc...), but avoid using the XCode IDE.

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
  • Thank you for answering my question! Which one would you suggest me to install anyway? GCC or Clang? I had a look into these stuff, but I cannot make sure which one will actually work better instead. – aditianny sharma Feb 07 '19 at 17:17
  • "nearly POSIX" No, of the 3 major OSes (Windows, Linux, MacOS), MacOS is the only one that is **certified POSIX**. – Cris Luengo Feb 07 '19 at 18:40
  • Some POSIX functions are not there, e.g. `clock_gettime` – Basile Starynkevitch Feb 07 '19 at 18:41
  • But still, do MacOSX have `clock_gettime`? I don't have any Mac hardware (and I am too old to even try a Hackintosh). Last time I checked (a few years ago, on the Mac of some friend), MacOSX did not have `clock_gettime` (which is POSIX 2008). Perhaps this has changed in recent MacOSX. My guess might be that MacOSX is POSIX2001, not POSIX2008 – Basile Starynkevitch Feb 07 '19 at 19:08
  • That could very well be. – Cris Luengo Feb 07 '19 at 19:27
  • @CrisLuengo: if you have a Mac, can you check if it has `clock_gettime` please? And what precise version of MacOSX? – Basile Starynkevitch Feb 07 '19 at 19:53
  • Basile : what will happen if I will install Xcode ? – aditianny sharma Feb 07 '19 at 19:57
  • XCode is also hiding details about compilation that I tend to think are important to understand. – Basile Starynkevitch Feb 07 '19 at 19:59
  • Basile: so you mean Xcode is not good to install, then ? I mean what you most recommend is GCC ? – aditianny sharma Feb 07 '19 at 20:01
  • I mean that when coding in C or C++ you really need to understand that the *compiler* is doing, and IDEs (such as Xcode) are hiding that. So IDEs are for newbies. You need to understand what the *compiler* is actually doing, and the IDE is not a compiler – Basile Starynkevitch Feb 07 '19 at 20:03
  • Ok.. Well I will be using Python 3.5 with opencv3, thats why I need something like visual C++ 2015 redistribution version. – aditianny sharma Feb 07 '19 at 20:06
  • No, you need a C++ compiler. VisualC++ don't run on MacOSX, only on Windows. Visual Studio Code is an IDE that might run on MacOSX. Yes, the naming similarity is unfortunate – Basile Starynkevitch Feb 07 '19 at 20:15
  • @BasileStarynkevitch By installing Xcode you also install clang and the command line tools. You don't have to use the IDE, you can compile everything from the terminal. This is exactly what the OP needs to do. Aditianny, see [this link](https://medium.com/init27-labs/installation-of-opencv-using-anaconda-mac-faded05a4ef6) for instructions on installing OpenCV through Anaconda. – beaker Feb 07 '19 at 23:21
  • 2
    @Basile: I have MacOS 10.13.6 (one release prior to the latest), and do have `clock_gettime` in ``. The man page states that "These functions first appeared in Mac OSX 10.12". – Cris Luengo Feb 08 '19 at 05:00