Ignore:
Timestamp:
17 Oct 2013, 20:17:10 (11 years ago)
Author:
kwu-htm
Message:

Clean up and revised according to the guideline.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-8.2-dev0-KWU/source/Lib/TAppCommon/TAppComCamPara.cpp

    r636 r637  
    15261526}
    15271527#endif
    1528 
    1529 
    1530 #if KWU_RC_MADPRED_E0227
    1531 Void
    1532   TAppComCamPara::getZNearZFar( Int iView, UInt uiFrame, Double& rdZNear, Double& rdZFar )
    1533 {
    1534   UInt uiFoundLine = -1;
    1535   if( !xGetCameraDataRow( m_aiBaseViews[iView], uiFrame, uiFoundLine ) || !( m_aadCameraParameters[ uiFoundLine ].size() < 8 ) )
    1536   {
    1537     rdZNear = m_aadCameraParameters[ uiFoundLine ][ 6 ];
    1538     rdZFar  = m_aadCameraParameters[ uiFoundLine ][ 7 ];
    1539   }
    1540   else
    1541   {
    1542     std::cerr << "No ZNear or no ZFar for View " << (Double)iView / m_dViewNumPrec << " and Frame " << uiFrame << " given in CameraParameterFile" << std::endl;
    1543     exit( EXIT_FAILURE );
    1544   }
    1545 }
    1546 
    1547 
    1548 Void
    1549   TAppComCamPara::getGeometryData( Int iView, UInt uiFrame, Double& rdFocalLength, Double& rdPosition, Double& rdCameraShift, Bool& rbInterpolated )
    1550 {
    1551   UInt uiFoundLine = -1;
    1552   if ( !xGetCameraDataRow( m_aiBaseViews[iView], uiFrame, uiFoundLine ) )
    1553   {
    1554     AOT( m_aadCameraParameters[ uiFoundLine ].size() < 6 );
    1555     rbInterpolated = false;
    1556     rdFocalLength =  m_aadCameraParameters[ uiFoundLine ][ 3 ];
    1557     rdPosition    =  m_aadCameraParameters[ uiFoundLine ][ 4 ];
    1558     rdCameraShift =  m_aadCameraParameters[ uiFoundLine ][ 5 ];
    1559   }
    1560   else
    1561   {
    1562     UInt uiLeftViewLine;
    1563     UInt uiRightViewLine;
    1564     Int  iLeftView;
    1565     Int  iRightView;
    1566     Int  iDummy;
    1567 
    1568     if( !xGetLeftRightView( iView, m_aiViewsInCfgFile, iLeftView, iRightView, iDummy, iDummy ) ||
    1569       xGetCameraDataRow( iLeftView,  uiFrame, uiLeftViewLine  )                             ||
    1570       xGetCameraDataRow( iRightView, uiFrame, uiRightViewLine )
    1571       )
    1572     {
    1573       std::cerr << "No Left or no Right View next to View " << (Double)iView / m_dViewNumPrec << " for Frame " << uiFrame << " given in CameraParameterFile" << std::endl;
    1574       AOT(true);
    1575       exit( EXIT_FAILURE );
    1576     }
    1577     AOT( m_aadCameraParameters[ uiLeftViewLine  ].size() < 6 );
    1578     AOT( m_aadCameraParameters[ uiRightViewLine ].size() < 6 );
    1579 
    1580     // Linear Interpolation
    1581     Double dFactor = ( (Double)( iView - iLeftView ) ) / ( (Double)( iRightView - iLeftView ) );
    1582     rdFocalLength  = m_aadCameraParameters[ uiLeftViewLine ][ 3 ] + dFactor * ( m_aadCameraParameters[ uiRightViewLine ][ 3 ] - m_aadCameraParameters[ uiLeftViewLine ][ 3 ] );
    1583     rdPosition     = m_aadCameraParameters[ uiLeftViewLine ][ 4 ] + dFactor * ( m_aadCameraParameters[ uiRightViewLine ][ 4 ] - m_aadCameraParameters[ uiLeftViewLine ][ 4 ] );
    1584     rdCameraShift  = m_aadCameraParameters[ uiLeftViewLine ][ 5 ] + dFactor * ( m_aadCameraParameters[ uiRightViewLine ][ 5 ] - m_aadCameraParameters[ uiLeftViewLine ][ 5 ] );
    1585     rbInterpolated = true;
    1586   }
    1587 }
    1588 #endif
Note: See TracChangeset for help on using the changeset viewer.