다음 코드는 OpenCV의 카메라 보정 프로그램의 일부입니다. 나는이 프로그램을 실행할 때 오류가 발생합니다 : 그것은 말한다구성 파일은 어디에 배치해야합니까?
나는
c:/Nn/default.xml
에 구성 파일을 배치하지만 난 여전히할 수있는이 오류가
구성 파일을 열 수 없습니다 코드의 잘못된 점을 알려주십시오. 파일을 잘못된 경로에 배치 했습니까?
int main(int argc, char* argv[])
{
help();
Settings s;
const string inputSettingsFile = argc > 1 ? argv[1] : "c:/Nn/default.xml";
FileStorage fs(inputSettingsFile, FileStorage::READ); // Read the settings
if (!fs.isOpened())
{
cout << "Could not open the configuration file: \"" << inputSettingsFile << "\"" << endl;
return -1;
}
fs["Settings"] >> s;
fs.release(); // close Settings file
if (!s.goodInput)
{
cout << "Invalid input detected. Application stopping. " << endl;
return -1;
}
vector<vector<Point2f> > imagePoints;
Mat cameraMatrix, distCoeffs;
Size imageSize;
int mode = s.inputType == Settings::IMAGE_LIST ? CAPTURING : DETECTION;
clock_t prevTimestamp = 0;
const Scalar RED(0,0,255), GREEN(0,255,0);
const char ESC_KEY = 27;