当前位置: 首页>>代码示例>>C++>>正文


C++ matrix::Get_Dimensions方法代码示例

本文整理汇总了C++中matrix::Get_Dimensions方法的典型用法代码示例。如果您正苦于以下问题:C++ matrix::Get_Dimensions方法的具体用法?C++ matrix::Get_Dimensions怎么用?C++ matrix::Get_Dimensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matrix的用法示例。


在下文中一共展示了matrix::Get_Dimensions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: isfinite

/*
 *      You can use GPU for that
 * */
void
Transform_Cloud (    matrix <Point_XYZI> & In_Cloud,
                     matrix <Point_XYZI> & Out_Cloud,
                     Eigen::Affine3f & Transform )
{
    if ( & In_Cloud != & Out_Cloud )
        Out_Cloud.Set_Dimensions ( In_Cloud.Get_Dimensions() );

    // Dataset might contain NaNs and Infs, so check for them first,
    // otherwise we get errors during the multiplication (?)
    for (size_t i = 0; i < In_Cloud.Get_Num_Of_Elem (); ++i) {

        XYZI cur_point = In_Cloud.data[i];

        if (    ! isfinite (cur_point.x) || 
                ! isfinite (cur_point.y) || 
                ! isfinite (cur_point.z) )
            continue;

        // FIXME - rewrite - 
        // too complex 
        // use SSE ???
        Eigen::Matrix<float, 3, 1> pt ( cur_point.x, cur_point.y, cur_point.z );
        XYZI result;
        result.x = static_cast<float> (Transform (0, 0) * pt.coeffRef (0) + Transform (0, 1) * pt.coeffRef (1) + Transform (0, 2) * pt.coeffRef (2) + Transform (0, 3));
        result.y = static_cast<float> (Transform (1, 0) * pt.coeffRef (0) + Transform (1, 1) * pt.coeffRef (1) + Transform (1, 2) * pt.coeffRef (2) + Transform (1, 3));
        result.z = static_cast<float> (Transform (2, 0) * pt.coeffRef (0) + Transform (2, 1) * pt.coeffRef (1) + Transform (2, 2) * pt.coeffRef (2) + Transform (2, 3));
        result.w = cur_point.w;
        Out_Cloud.data[i] = result;
    }
}
开发者ID:jing-vision,项目名称:3deye,代码行数:34,代码来源:math_utils.cpp


注:本文中的matrix::Get_Dimensions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。