Ejemplo n.º 1
0
Matrix4x4::Matrix4x4(const Vector& vecForward, const Vector& vecUp, const Vector& vecRight, const Vector& vecPosition)
{
	SetForwardVector(vecForward);
	SetUpVector(vecUp);
	SetRightVector(vecRight);
	SetTranslation(vecPosition);

	m[0][3] = 0;
	m[1][3] = 0;
	m[2][3] = 0;
	m[3][3] = 1;
}
Ejemplo n.º 2
0
DescType DescriptorMakerCpu::ComputeEachDescriptor(cl_float4 ctpoint, cl_float4 ctnormal
                                            , const cl_float4* pointCloud, const cl_int* neighborIndices, int niOffset, int numNeighbs
                                            , bool b_print)
{
    // matrix for linear equation, solution vector
    float linEq[DESC_EQUATION_SIZE];
    float ysol[L_DIM];
    for(int i=0; i<DESC_EQUATION_SIZE; i++)
        linEq[i] = 0;
    for(int i=0; i<L_DIM; i++)
        ysol[i] = 0;

    // set linear equation for matrix A
    // set F'*F part
    SetUpperLeft(ctpoint, pointCloud, neighborIndices, niOffset, numNeighbs, linEq);
    // set G parts
    SetUpperRight(ctnormal, linEq);
    SetLowerLeft(ctnormal, linEq);
    // set b in Ax=b
    SetRightVector(ctpoint, ctnormal, pointCloud, neighborIndices, niOffset, numNeighbs, linEq);

    if(b_print)
        PrintMatrix(L_DIM, L_WIDTH, linEq, "Old: linEq");

    SolveLinearEq(L_DIM, linEq, ysol);

    if(b_print)
        PrintVector(L_DIM, ysol, "Old: ysol");

    // compute shape descriptor by using eigen decomposition
    cl_float4 descriptor = GetDescriptorByEigenDecomp(ysol);

    if(b_print)
        std::cout << "Old: descriptor" << descriptor.x << " " << descriptor.y << " " << descriptor.z << std::endl;
//    if(b_print)
//        qDebug() << "descriptor output" << descriptor;
    return descriptor;
}