Changeset 604 in 3DVCSoftware for branches/HTM-DEV-2.0-dev0/source/Lib
- Timestamp:
- 31 Aug 2013, 20:04:13 (11 years ago)
- Location:
- branches/HTM-DEV-2.0-dev0/source/Lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-2.0-dev0/source/Lib/TAppCommon/TAppComCamPara.cpp
r603 r604 611 611 } 612 612 613 614 613 Void 615 614 TAppComCamPara::xGetGeometryData( Int iView, UInt uiFrame, Double& rdFocalLength, Double& rdPosition, Double& rdCameraShift, Bool& rbInterpolated ) 616 615 { 617 616 UInt uiFoundLine = -1; 617 #if H_3D_FIX_REN_WARNING 618 if ( !xGetCameraDataRow( iView, uiFrame, uiFoundLine ) && xIsIn( m_aiSortedBaseViews, iView )) 619 #else 618 620 if ( !xGetCameraDataRow( iView, uiFrame, uiFoundLine ) ) 621 #endif 619 622 { 620 623 AOT( m_aadCameraParameters[ uiFoundLine ].size() < 6 ); … … 632 635 Int iDummy; 633 636 637 #if H_3D_FIX_REN_WARNING 638 if( !xGetLeftRightView( iView, m_aiSortedBaseViews, iLeftView, iRightView, iDummy, iDummy ) || 639 #else 634 640 if( !xGetLeftRightView( iView, m_aiViewsInCfgFile, iLeftView, iRightView, iDummy, iDummy ) || 641 #endif 635 642 xGetCameraDataRow( iLeftView, uiFrame, uiLeftViewLine ) || 636 643 xGetCameraDataRow( iRightView, uiFrame, uiRightViewLine ) 637 644 ) 638 645 { 646 #if H_3D_FIX_REN_WARNING 647 std::cerr << "No left or no right base view next to view " << (Double)iView / m_dViewNumPrec << " for Frame " << uiFrame << " given in CameraParameterFile" << std::endl; 648 #else 639 649 std::cerr << "No Left or no Right View next to View " << (Double)iView / m_dViewNumPrec << " for Frame " << uiFrame << " given in CameraParameterFile" << std::endl; 650 #endif 640 651 AOT(true); 641 652 exit( EXIT_FAILURE ); … … 841 852 Int iLog2DivLuma = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision; AOF( iLog2DivLuma > 0 ); 842 853 Int iLog2DivChroma = iLog2DivLuma + 1; 843 #if !H_3D_FIX_REN_WARNING 854 844 855 Double dMaxDispDev = 0.0; 845 856 Double dMaxRndDispDvL = 0.0; 846 857 Double dMaxRndDispDvC = 0.0; 847 #endif 858 848 859 for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ ) 849 860 { … … 887 898 // integer-valued look-up tables 888 899 Int64 iTempScale = (Int64)uiDepthValue * iScale; 889 #if !H_3D_FIX_REN_WARNING890 900 Int64 iTestScale = ( iTempScale + iOffset ); // for checking accuracy of camera parameters 891 #endif892 901 Int64 iShiftLuma = ( iTempScale + iOffsetLuma ) >> iLog2DivLuma; 893 902 Int64 iShiftChroma = ( iTempScale + iOffsetChroma ) >> iLog2DivChroma; … … 896 905 897 906 // maximum deviation 898 #if H_3D_ FIX_REN_WARNING907 #if H_3D_REN_MAX_DEV_OUT 899 908 m_dMaxShiftDeviation = std::max( m_dMaxShiftDeviation, fabs( Double( (Int) iShiftLuma ) - dShiftLuma ) / Double( 1 << m_iLog2Precision ) ); 900 #e lse909 #endif 901 910 dMaxDispDev = std::max( dMaxDispDev, fabs( Double( (Int) iTestScale ) - dShiftLuma * Double( 1 << iLog2DivLuma ) ) / Double( 1 << iLog2DivLuma ) ); 902 911 dMaxRndDispDvL = std::max( dMaxRndDispDvL, fabs( Double( (Int) iShiftLuma ) - dShiftLuma ) ); 903 912 dMaxRndDispDvC = std::max( dMaxRndDispDvC, fabs( Double( (Int) iShiftChroma ) - dShiftChroma ) ); 904 #endif905 913 } 906 914 … … 912 920 } 913 921 914 #if !H_3D_FIX_REN_WARNING915 922 // check maximum deviation 916 923 Double dMaxAllowedDispDev = Double( 1 << m_iLog2Precision ) / Double( 1 << m_uiCamParsCodedPrecision ); // counting only the impact of camera parameter rounding … … 934 941 } 935 942 } 936 #endif937 943 } 938 944 … … 1036 1042 m_bCamParsCodedPrecSet = false; 1037 1043 1038 #if H_3D_ FIX_REN_WARNING1044 #if H_3D_REN_MAX_DEV_OUT 1039 1045 m_dMaxShiftDeviation = -1; 1040 1046 #endif … … 1167 1173 if( m_aiViewsInCfgFile.size() < 2 ) 1168 1174 { 1169 std::cerr << "Failed reading config file" << std::endl;1175 std::cerr << "Failed reading config file" << std::endl; 1170 1176 std::cerr << "At least two views must be given" << std::endl; 1171 1177 exit( EXIT_FAILURE ); … … 1332 1338 else 1333 1339 { 1334 for( UInt uiFrame = m_uiFirstFrameId; uiFrame <= m_uiLastFrameId; uiFrame++ ) 1335 { 1336 Bool bInterpolatedCur; 1337 xGetGeometryData( m_aiBaseViews[ uiBaseView ], uiFrame, dDummy, dDummy, dDummy, bInterpolatedCur ); 1338 xGetZNearZFar ( m_aiBaseViews[ uiBaseView ], uiFrame, dDummy, dDummy ); 1339 1340 if( bInterpolatedCur ) 1340 for( UInt uiFrame = m_uiFirstFrameId; uiFrame <= m_uiLastFrameId; uiFrame++ ) 1341 1341 { 1342 std::cerr << "Error: CameraParameters for BaseView " << (Double)m_aiBaseViews[ uiBaseView ] / m_dViewNumPrec << " and Frame " << uiFrame << " not defined. " << std::endl; 1343 exit( EXIT_FAILURE ); 1342 Bool bInterpolatedCur; 1343 xGetGeometryData( m_aiBaseViews[ uiBaseView ], uiFrame, dDummy, dDummy, dDummy, bInterpolatedCur ); 1344 xGetZNearZFar ( m_aiBaseViews[ uiBaseView ], uiFrame, dDummy, dDummy ); 1345 1346 if( bInterpolatedCur ) 1347 { 1348 std::cerr << "Error: CameraParameters for BaseView " << (Double)m_aiBaseViews[ uiBaseView ] / m_dViewNumPrec << " and Frame " << uiFrame << " not defined. " << std::endl; 1349 exit( EXIT_FAILURE ); 1350 } 1344 1351 } 1345 1352 } 1346 1347 } 1348 } 1353 } 1354 #if H_3D_FIX_REN_WARNING 1355 Bool bIgnoreFirst = true; 1356 for( UInt uiERView = 0; uiERView < m_aiSynthViews.size() && !m_bSetupFromCoded; uiERView++ ) 1357 { 1358 if ( xIsIn(m_aiViewsInCfgFile, m_aiSynthViews[ uiERView ] ) ) 1359 { 1360 if ( bIgnoreFirst ) 1361 { 1362 std::cout << "Ignoring CameraParameterFile entries for virtual view(s): " ; 1363 //GT: Integer precision virtual view camera parameters are always interpolated from coded views camera parameters. 1364 bIgnoreFirst = false; 1365 } 1366 std::cout << (Double)m_aiSynthViews[ uiERView ] / m_dViewNumPrec << " " ; 1367 } 1368 } 1369 if ( !bIgnoreFirst ) 1370 { 1371 std::cout << std::endl; 1372 } 1373 #endif 1349 1374 1350 1375 Bool bInterpolateFirst = true; … … 1365 1390 if ( bInterpolateFirst ) 1366 1391 { 1392 #if H_3D_FIX_REN_WARNING 1393 std::cout << "Interpolating camera parameters for virtual view(s): " ; 1394 #else 1367 1395 std::cout << "Interpolating Camera Parameters for View(s) " ; 1396 #endif 1368 1397 bInterpolateFirst = false; 1369 1398 } … … 1469 1498 } 1470 1499 1500 #if H_3D_FIX_REN_WARNING 1501 Bool 1502 TAppComCamPara::xIsIn( std::vector<Int>& rVec, Int iElem) 1503 { 1504 Bool bFound = false; 1505 for (Int idx = 0; idx < rVec.size() && !bFound; idx++) 1506 { 1507 bFound = bFound || rVec[idx] == iElem; 1508 } 1509 return bFound; 1510 } 1511 #endif 1512 1471 1513 Int TAppComCamPara::getRelDistLeft( Int iSynthViewIdx, Int iLeftViewIdx, Int iRightViewIdx ) 1472 1514 { -
branches/HTM-DEV-2.0-dev0/source/Lib/TAppCommon/TAppComCamPara.h
r603 r604 67 67 Bool m_bCamParsCodedPrecSet; ///< Coded Cam Para precision set for current frame; 68 68 69 #if H_3D_ FIX_REN_WARNING69 #if H_3D_REN_MAX_DEV_OUT 70 70 Double m_dMaxShiftDeviation; ///< Maximum deviation of shifts with integer precision compare to double precision 71 71 #endif … … 129 129 Void xSetupBaseViewsFromCoded (); 130 130 Void xSetupBaseViews ( Char* pchBaseViewNumbers, UInt uiNumBaseViews ); 131 #if H_3D_FIX_REN_WARNING 132 Bool xIsIn ( std::vector<Int>& rVec, Int iNumber); 133 #endif 134 131 135 132 136 // functions for getting and setting scales and offsets … … 183 187 UInt getCurFrameId () { return m_iCurrentFrameId; } 184 188 static Void convertNumberString ( Char* pchViewNumberString, std::vector<Int>& raiViewNumbers, Double dViewNumPrec ); 185 #if H_3D_ FIX_REN_WARNING189 #if H_3D_REN_MAX_DEV_OUT 186 190 Double getMaxShiftDeviation () { return m_dMaxShiftDeviation; }; 187 191 #endif … … 217 221 Int** getCodedOffset () { return m_aaiCodedOffset; } 218 222 }; 219 220 221 223 222 224 -
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TypeDef.h
r603 r604 141 141 142 142 ///////////////////////////////////////////////////////////////////////////////////////// 143 /////////////////////////////////// NEW ADOPTIONS ///////////////////////////////143 /////////////////////////////////// HTM-8.0 INTEGRATIONS ////////////////////////////// 144 144 ///////////////////////////////////////////////////////////////////////////////////////// 145 145 … … 196 196 #endif 197 197 198 #define H_3D_REN_MAX_DEV_OUT 0 // Output maximal possible shift deviation 199 198 200 /// FIXES 199 201 #define H_3D_FIX_BVSP 1 // DV from NBDV instead of DoNBDV should be used … … 201 203 #define H_3D_FIX_REN 1 // fix of erroneous inpainting for renderer 202 204 #define H_3D_FIX_REN_WARNING 1 // fix of warning related to camera parameter precision 205 203 206 #define H_3D_FIX_UINT_WARNING 1 // explicit in VSD 204 207 #endif // H_3D 208 209 210 ///////////////////////////////////////////////////////////////////////////////////////// 211 /////////////////////////////////// HTM-8.1 INTEGRATIONS ////////////////////////////// 212 ///////////////////////////////////////////////////////////////////////////////////////// 213 214 // Please put HTM-8.1 Integration defines here, when possible 215 216 217 205 218 206 219 /////////////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.