当前位置:   article > 正文

热力图_c++ opencv 热力图

c++ opencv 热力图
  1. #include "StdAfx.h"
  2. //#include <opencv2/contrib/contrib.hpp>
  3. //#include <opencv2/core/core.hpp>
  4. //#include <opencv2/highgui/highgui.hpp>
  5. #include <opencv2/highgui/highgui.hpp>
  6. #include <opencv2/imgproc/imgproc.hpp>
  7. #include <opencv2/core/core.hpp>
  8. using namespace cv;
  9. using namespace cv;
  10. int main()
  11. {
  12. // Get the path to the image, if it was given
  13. // if no arguments were given.
  14. // string filename;
  15. // if (argc > 1) {
  16. // filename = string(argv[1]);
  17. // }
  18. // The following lines show how to apply a colormap on a given image
  19. // and show it with cv::imshow example with an image. An exception is
  20. // thrown if the path to the image is invalid.
  21. Mat img0 = imread("D://code//avitoimgae//avitoimgae//avitoimgae//aa.jpg");
  22. // Throw an exception, if the image can't be read:
  23. if(img0.empty()) {
  24. CV_Error(CV_StsBadArg, "Sample image is empty. Please adjust your path, so it points to a valid input image!");
  25. }
  26. // Holds the colormap version of the image:
  27. Mat cm_img0;
  28. // Apply the colormap:
  29. applyColorMap(img0, cm_img0, COLORMAP_JET);
  30. // Show the result:
  31. imshow("img0", img0);
  32. imshow("cm_img0", cm_img0);
  33. waitKey(0);
  34. return 0;
  35. }



声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/秋刀鱼在做梦/article/detail/760885
推荐阅读
相关标签
  

闽ICP备14008679号