Skip to content
Snippets Groups Projects
extrCalibration.cpp 35.4 KiB
Newer Older
  • Learn to ignore specific revisions
  •             mDefaultHeightVariance = pow(mDefaultHeightStdDev, 2);
            }
        }
    
        if(subElem.hasAttribute("MAX_DH"))
    
        {
            mDefaultHeightMax = subElem.attribute("MAX_DH").toDouble();
        }
    
        if(subElem.hasAttribute("AVG_PX"))
    
        {
            mPixelAvg = subElem.attribute("AVG_PX").toDouble();
        }
    
        if(subElem.hasAttribute("SD_PX"))
    
        {
            mPixelStdDev = subElem.attribute("SD_PX").toDouble();
            if(mPixelStdDev < 0)
            {
                mPixelVariance = -1;
    
        if(subElem.hasAttribute("MAX_PX"))
    
        {
            mPixelMax = subElem.attribute("MAX_PX").toDouble();
        }
    
        if(subElem.hasAttribute("USED_HEIGHT"))
    
        {
            mUsedDefaultHeight = subElem.attribute("USED_HEIGHT").toDouble();
        }
    
        auto data = getData();
    
        mValid    = !std::any_of(data.begin(), data.end(), [](double a) { return !std::isfinite(a) || a < 0; });
    
    }
    
    void ReprojectionError::setXml(QDomElement &elem) const
    {
        QDomElement subElem = elem.ownerDocument().createElement("REPROJECTION_ERROR");
    
        subElem.setAttribute("AVG_PH", mPointHeightAvg);
        subElem.setAttribute("SD_PH", mPointHeightStdDev);
        subElem.setAttribute("MAX_PH", mPointHeightMax);
        subElem.setAttribute("AVG_DH", mDefaultHeightAvg);
        subElem.setAttribute("SD_DH", mDefaultHeightStdDev);
        subElem.setAttribute("MAX_DH", mDefaultHeightMax);
        subElem.setAttribute("AVG_PX", mPixelAvg);
        subElem.setAttribute("SD_PX", mPixelStdDev);
        subElem.setAttribute("MAX_PX", mPixelMax);
        subElem.setAttribute("USED_HEIGHT", mUsedDefaultHeight);
    
        elem.appendChild(subElem);
    }
    
    
    double ReprojectionError::pointHeightAvg() const
    {
    
    double ReprojectionError::pointHeightStdDev() const
    {
    
    double ReprojectionError::pointHeightVariance() const
    {
    
    double ReprojectionError::pointHeightMax() const
    {
    
    double ReprojectionError::defaultHeightAvg() const
    {
    
    double ReprojectionError::defaultHeightStdDev() const
    {
    
    double ReprojectionError::defaultHeightVariance() const
    {
    
    double ReprojectionError::defaultHeightMax() const
    {
    
    double ReprojectionError::pixelAvg() const
    {
    
    double ReprojectionError::pixelStdDev() const
    {
    
    double ReprojectionError::pixelVariance() const
    {
    
    double ReprojectionError::pixelMax() const
    {
    
    double ReprojectionError::usedDefaultHeight() const
    {