Beispiel #1
0
int Pose3D::readPose(const std::string& FileName)
{
    FILE* f = fopen(FileName.c_str(), "rb");
    
    if (!f)
        return -1;
        
    int status = readPose(f);
    
    fclose(f);
    return status;
}
Beispiel #2
0
void cv::viz::readTrajectory(OutputArray _traj, const String& files_format, int start, int end, const String& tag)
{
    CV_Assert(_traj.kind() == _InputArray::STD_VECTOR || _traj.kind() == _InputArray::MAT);

    start = max(0, std::min(start, end));
    end = std::max(start, end);

    std::vector<Affine3d> traj;

    for(int i = start; i < end; ++i)
    {
        Affine3d affine;
        bool ok = readPose(cv::format(files_format.c_str(), i), affine, tag);
        if (!ok)
            break;

        traj.push_back(affine);
    }

    Mat(traj).convertTo(_traj, _traj.depth());
}