热力图

xiaoxiao2021-02-27  268

#include "StdAfx.h" //#include <opencv2/contrib/contrib.hpp> //#include <opencv2/core/core.hpp> //#include <opencv2/highgui/highgui.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/core/core.hpp> using namespace cv; using namespace cv; int main() { // Get the path to the image, if it was given // if no arguments were given. // string filename; // if (argc > 1) { // filename = string(argv[1]); // } // The following lines show how to apply a colormap on a given image // and show it with cv::imshow example with an image. An exception is // thrown if the path to the image is invalid. Mat img0 = imread("D://code//avitoimgae//avitoimgae//avitoimgae//aa.jpg"); // Throw an exception, if the image can't be read: if(img0.empty()) { CV_Error(CV_StsBadArg, "Sample image is empty. Please adjust your path, so it points to a valid input image!"); } // Holds the colormap version of the image: Mat cm_img0; // Apply the colormap: applyColorMap(img0, cm_img0, COLORMAP_JET); // Show the result: imshow("img0", img0); imshow("cm_img0", cm_img0); waitKey(0); return 0; }

转载请注明原文地址: https://www.6miu.com/read-10207.html

最新回复(0)