Subversion Repositories seema-scanner

Rev

Rev 90 | Rev 119 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 90 Rev 91
Line 256... Line 256...
256
                                            0,   0,   0, 0, i*i, i*j,
256
                                            0,   0,   0, 0, i*i, i*j,
257
                                            0,   0,   0, 0,   0, j*j);
257
                                            0,   0,   0, 0,   0, j*j);
258
 
258
 
259
        }
259
        }
260
    }
260
    }
261
//std::cout << M << std::endl;
-
 
262
    //M *= 1.0/(l*mn);
-
 
-
 
261
 
263
    cv::completeSymm(M, false);
262
    cv::completeSymm(M, false);
264
//std::cout << M << std::endl;
-
 
-
 
263
 
265
    // solve for axis
264
    // solve for axis
266
    std::vector<float> lambda;
265
    std::vector<float> lambda;
267
    cv::Mat u;
266
    cv::Mat u;
268
    cv::eigen(M, lambda, u);
267
    cv::eigen(M, lambda, u);
269
 
268
 
Line 274... Line 273...
274
            minLambda = lambda[i];
273
            minLambda = lambda[i];
275
            idx = i;
274
            idx = i;
276
        }
275
        }
277
    }
276
    }
278
 
277
 
279
std::cout << "u:" <<  u << std::endl;
-
 
280
 
-
 
281
    axis = u.row(idx).colRange(0, 3);
278
    axis = u.row(idx).colRange(0, 3);
282
    axis /= cv::norm(axis);
279
    axis = cv::normalize(axis);
283
 
280
 
284
    float nx = u.at<float>(idx, 0);
281
    float nx = u.at<float>(idx, 0);
285
    float ny = u.at<float>(idx, 1);
282
    float ny = u.at<float>(idx, 1);
286
    float nz = u.at<float>(idx, 2);
283
    float nz = u.at<float>(idx, 2);
287
    float d  = u.at<float>(idx, 3);
284
    float d  = u.at<float>(idx, 3);