Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ArtecCaptureSDK::ErrorCode ArtecScannerBase::loadDistortionTable( unsigned int correctHash, const std::wstring& pathToCalibration )
- {
- fs::path dirName = pathToCalibration;
- if(!fs::exists(dirName) || !fs::is_directory(dirName))
- return ErrorCode_InvalidOperation;
- fs::directory_iterator end;
- for (fs::directory_iterator dirIt(dirName); dirIt != end; ++dirIt)
- {
- if(fs::is_regular_file(dirIt->path()) && fs::extension(dirIt->path()) == ".corr")
- {
- if (!distortionTable_->load_from_protoBuf(dirIt->path().string().c_str()) )
- continue;
- std::string tab_pack;
- distortionTable_->save_to_protoBuf_str( tab_pack );
- unsigned int hash = _crc32((const unsigned char*)tab_pack.c_str(), tab_pack.length());
- if (hash == correctHash)
- {
- ILog* log = getArtecSDKLog();
- if (log)
- log->verbose(L"Tabulation file successfully loaded");
- return ErrorCode_OK;
- }
- }
- }
- return ErrorCode_InvalidOperation;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement