namespace cv::ml not found - xcode - C++ [closed]
Hi guys. I'm using XCode IDE in my project and I'm trying to create a machine learning program using the ml lib. However, I'm getting an error when I try to use the namespace cv::ml. My includes are:
#include "opencv2/core/core.hpp"
#include "opencv2/ml/ml.hpp"
#include <cstdio>
#include <vector>
#include <iostream>
using namespace std;
using namespace cv;
using namespace cv::ml; --> In this line I get the error: "expected namespace name"
I guess that this error is related to some configuration that I hasn't applied on XCode. I'm using libc++ as standard lib and I already tried to change to libstdc++ (the problem persists). I also tried to use the objects in ml namespace using the fully qualified name, i.e. cv::ml::SomeMethod for example, but I get the error: "no member named ml in the namespace cv". The include of "opencv2/ml/ml.hpp" isn't generating errors.
Question is: How can I add this namespace (ml) to my project in XCode?
Hm. You're right. I was trying to use the command cv::ml::RTrees. The correct command for version 2.4 is the CvRTrees (I found that weird, because to me everything that begin with Cv... was part of the old API, the C API, but it seems to be not true). Thank you very much berak!
The ML module was about the last module that got transfered to the new C++ interface. THat only happened when going to the 3.0 interface. In 2.4.11 there was already a C++ backend partially, but the names where still C-style.
I think for using EM in 2.4.13 version , one gotta add #include "opencv2/legacy/legacy.hpp" before using CvEM