Store image resolution and framerate in ar metadata
This commit is contained in:
@@ -22,9 +22,19 @@ namespace OpenVulkano::AR
|
||||
int minRange = metaNode.child("minConfidence").text().as_int();
|
||||
int maxRange = metaNode.child("maxConfidence").text().as_int();
|
||||
const char* depthType = metaNode.child("depthType").text().as_string();
|
||||
uint32_t resX = 1920, resY = 1440;
|
||||
auto resNode = metaNode.child("imageResolution");
|
||||
if (!resNode.empty())
|
||||
{
|
||||
resX = resNode.child("width").text().as_uint();
|
||||
resY = resNode.child("height").text().as_uint();
|
||||
}
|
||||
float frameRate = metaNode.child("frameRate").text().as_float(60);
|
||||
return { ArType::GetFromHumanReadableName(type),
|
||||
ArDepthFormat::GetFromAltName(depthType).value_or(ArDepthFormat::UNAVAILABLE),
|
||||
Math::Range<uint8_t>(minRange, maxRange)
|
||||
Math::Range<uint8_t>(minRange, maxRange),
|
||||
Math::Vector2ui(resX, resY),
|
||||
frameRate
|
||||
};
|
||||
}
|
||||
|
||||
@@ -35,7 +45,9 @@ namespace OpenVulkano::AR
|
||||
return {
|
||||
ArType::GetFromName(meta["Type"].Scalar()),
|
||||
ArDepthFormat::GetFromName(meta["DepthType"].Scalar()).value_or(ArDepthFormat::UNAVAILABLE),
|
||||
Math::Range<uint8_t>(meta["MinConfidence"].as<uint8_t>(), meta["MaxConfidence"].as<uint8_t>())
|
||||
Math::Range<uint8_t>(meta["MinConfidence"].as<uint8_t>(), meta["MaxConfidence"].as<uint8_t>()),
|
||||
Math::Vector2ui(1), // TODO load
|
||||
meta["FrameRate"].as<float>(60)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -72,7 +84,10 @@ namespace OpenVulkano::AR
|
||||
ss << "<arPlatformInfo>\n\t<type>" << type.GetHumanReadableName() << "</type>\n\t<minConfidence>";
|
||||
ss << static_cast<int>(confidenceRange.min) << "</minConfidence>\n\t<maxConfidence>";
|
||||
ss << static_cast<int>(confidenceRange.max) << "</maxConfidence>\n\t<depthType>";
|
||||
ss << depthFormat.GetAltName() << "</depthType>\n</arPlatformInfo>";
|
||||
ss << depthFormat.GetAltName() << "</depthType>";
|
||||
ss << "\n\t<imageResolution><width>" << imageResolution.x << "</width><height>" << imageResolution.y << "</height></imageResolution>";
|
||||
ss << "\n\t<frameRate>" << frameRate << "</frameRate>";
|
||||
ss << "\n</arPlatformInfo>";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
@@ -82,6 +97,8 @@ namespace OpenVulkano::AR
|
||||
ss << "Type: " << type.GetName() << "\nDepthType: " << depthFormat.GetName();
|
||||
ss << "\nMinConfidence: " << static_cast<int>(confidenceRange.min);
|
||||
ss << "\nMaxConfidence: " << static_cast<int>(confidenceRange.max);
|
||||
ss << "\nResolution: \"(" << imageResolution.x << "," << imageResolution.y << ")\"";
|
||||
ss << "\nFrameRate: " << frameRate;
|
||||
return ss.str();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user