Ask Your Question

Revision history [back]

(1) this funtion getFileName distinguishes between the image name and the path name.May it help you .

void getFileName(const string& filepath, string& name,string& lastname){
    vector<string> spilt_path;
    SplitString(filepath, spilt_path, "\\");
    int spiltsize = spilt_path.size();
    string filename = "";
    if (spiltsize != 0){
        filename = spilt_path[spiltsize-1];
        vector<string> spilt_name;
        SplitString(filename, spilt_name, ".");
        int name_size = spilt_name.size();
        if (name_size != 0)
            name = spilt_name[0];
        lastname = spilt_name[name_size-1];
    }
}

(2) try "./baxter_right_cam.png" install of "/baxter_right_cam.png",and find it out.