详细介绍可参看CSDN官方介绍,链接地址 http://msdn.microsoft.com/zh-cn/library/hh279678.aspx

 以下是应用中的实例:

 1     
 2 #include <stdexcept>//异常处理库
 3 
 4 //内参数矩阵mK求逆,并打印显示其逆矩阵
 5     try    //异常处理 针对K为奇异矩阵不可逆的情况
 6     {
 7         if (invert(mK,mInvK,cv::DECOMP_LU))    //矩阵求逆,如果矩阵为奇异矩阵,条件不成立
 8         {
 9             std::cout << mInvK << std::endl;//打印显示矩阵数据
10         }
11         else    //K为奇异矩阵
12         {
13             throw std::invalid_argument("Error:Intrinsic parameter K is singular.");
14                 //抛出异常“K为奇异矩阵”
15         }
16     }
17     catch(std::invalid_argument& e)    //获取异常情况
18     {
19         std::cerr << e.what() << std::endl;    //打印异常提醒
20         return -1;
21     }

 

相关文章:

  • 2021-04-02
  • 2021-08-28
猜你喜欢
  • 2022-12-23
  • 2021-12-27
  • 2021-10-23
  • 2021-06-07
  • 2021-07-27
相关资源
相似解决方案