RFC_FUNCTION_DESC_HANDLE getFunctionHandle(const SAP_UC* functionName) { RFC_PARAMETER_DESC parDescPathname = { iU("PATHNAME"), RFCTYPE_CHAR, RFC_IMPORT, 100, 200, 0, 0, 0, 0, 0}; RFC_PARAMETER_DESC parDescPort = { iU("PORT"), RFCTYPE_CHAR, RFC_IMPORT, 10, 20, 0, 0, 0, 0, 0}; RFC_FUNCTION_DESC_HANDLE funcDesc = RfcCreateFunctionDesc(functionName, 0); RfcAddParameter(funcDesc, &parDescPathname, 0); RfcAddParameter(funcDesc, &parDescPort, 0); return funcDesc; }
const CPoint3DCAMERA CTriangulator::getPointTriangulatedAdaptive( const cv::Mat& p_matImageRIGHT, const cv::KeyPoint& p_cKeyPointLEFT, const CDescriptor& p_matReferenceDescriptorLEFT ) const { //ds buffer keypoint size const float& fKeyPointSize( p_cKeyPointLEFT.size ); //ds get keypoint to eigen space const CPoint2DInCameraFrame vecReference( CWrapperOpenCV::fromCVVector( p_cKeyPointLEFT.pt ) ); const int32_t iUReference( vecReference(0) ); //ds keypoint buffer std::vector< cv::KeyPoint > vecPoolKeyPoints( m_uAdaptiveSteps ); //ds start point int32_t iU( iUReference+m_uAdaptiveSteps ); assert( 0 < iUReference ); //ds scan to the left while( 0 < iU ) { for( uint32_t u = 0; u < m_uAdaptiveSteps; ++u ) { vecPoolKeyPoints[u] = cv::KeyPoint( iU, vecReference(1), fKeyPointSize ); --iU; } //ds compute descriptors cv::Mat matPoolDescriptors; m_pExtractor->compute( p_matImageRIGHT, vecPoolKeyPoints, matPoolDescriptors ); //ds if we managed to compute descriptors if( !vecPoolKeyPoints.empty( ) ) { //ds match the descriptors std::vector< cv::DMatch > vecMatches; m_pMatcher->match( p_matReferenceDescriptorLEFT, matPoolDescriptors, vecMatches ); //ds if we found matches if( !vecMatches.empty( ) ) { //ds make sure the matcher returned a valid ID assert( static_cast< std::vector< cv::KeyPoint >::size_type >( vecMatches[0].trainIdx ) < m_uAdaptiveSteps ); //ds check match quality if( m_fMatchingDistanceCutoff > vecMatches[0].distance ) { //ds get the matching keypoint const CPoint2DInCameraFrame vecMatch( CWrapperOpenCV::fromCVVector( vecPoolKeyPoints[vecMatches[0].trainIdx].pt ) ); //ds triangulated 3d point return CMiniVisionToolbox::getPointStereoLinearTriangulationSVDLS( vecReference, vecMatch, m_pCameraSTEREO->m_pCameraLEFT->m_matProjection, m_pCameraSTEREO->m_pCameraRIGHT->m_matProjection ); } } } } //ds no match found if still here throw CExceptionNoMatchFound( "no match found" ); }