Set arguments in Xcode 6 OpenCV

189 views Asked by At

I need to load some images and a .txt file from folder in order to create an HDR image with OpenCV 3.0.0 like here. Xcode seems to be linked with OpenCV 3.0.0 as other code samples work, images are loaded when I give the full path. How can I load images and .txt files directly from argument like I do in VS2010? I need to use the code as it is in the example.

    void loadExposureSeq(String path, vector<Mat>& images, vector<float>& times)
{
    path = path + std::string("/");
    ifstream list_file((path + "list.txt").c_str());
    string name;
    float val;
    while(list_file >> name >> val) {
        Mat img = imread(path + name);
        images.push_back(img);
        times.push_back(1 / val);
    }
    list_file.close();
}

I tried to enter the full path in std::string("/") but it didn't work. I am very new to Xcode, please help!

0

There are 0 answers