Exemplo n.º 1
0
bool updateMat(const MatT& new_mat, MatT& my_mat, cv::Mat_<double>& cv_mat, int rows, int cols)
{
  if ((my_mat == new_mat) && (my_mat.size() == cv_mat.rows*cv_mat.cols))
    return false;
  my_mat = new_mat;
  // D may be empty if camera is uncalibrated or distortion model is non-standard
  cv_mat = (my_mat.size() == 0) ? cv::Mat_<double>() : cv::Mat_<double>(rows, cols, &my_mat[0]);
  return true;
}
Exemplo n.º 2
0
bool updateMat(const MatT& new_mat, MatT& my_mat, MatU& cv_mat)
{
  if ((my_mat == new_mat) && (my_mat.size() == cv_mat.rows*cv_mat.cols))
    return false;
  my_mat = new_mat;
  // D may be empty if camera is uncalibrated or distortion model is non-standard
  cv_mat = MatU(&my_mat[0]);
  return true;
}
Exemplo n.º 3
0
void benchmarkMultiplyHost(MatT& A) {
    // If we multiply a vector of 1s we should see our result equal 0 (if our
    // RBF-FD weights are good)
    std::vector<double> x(A.size(), 1);
    std::vector<double> b(A.size(), 1);
    b = viennacl::linalg::prod(A, x);

    std::cout << "l1   Norm: " << viennacl::linalg::norm_1(b) << std::endl;
    std::cout << "l2   Norm: " << viennacl::linalg::norm_2(b) << std::endl;
    std::cout << "linf Norm: " << viennacl::linalg::norm_inf(b) << std::endl;
}