OpenCV自带颜色表

  //图片路径
  QString appPath = QCoreApplication::applicationDirPath();
  imagePath = appPath + "/A.jpg";

  //读取图像
  img = cv::imread(imagePath.toStdString());
  if (img.empty())
    return;

  cv::namedWindow("input", cv::WINDOW_AUTOSIZE);

  cv::Mat dst;

  int color_map = COLORMAP_AUTUMN;
  while (true)
  {
    int c = cv::waitKey(2000);
    if (c == 27) {
      break;
    }
    applyColorMap(img, dst, color_map%21);
    color_map++;
    cv::imshow("input", dst);
  }

  cv::waitKey(0);
  cv::destroyAllWindows();


推荐一个零声学院项目课,个人觉得老师讲得不错,分享给大家:
零声白金学习卡(含基础架构/高性能存储/golang云原生/音视频/Linux内核)
https://xxetb.xet.tech/s/3Zqhgt

相关推荐

  1. OpenCV颜色

    2024-03-23 05:22:01       43 阅读
  2. openCv颜色

    2024-03-23 05:22:01       52 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-23 05:22:01       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-23 05:22:01       106 阅读
  3. 在Django里面运行非项目文件

    2024-03-23 05:22:01       87 阅读
  4. Python语言-面向对象

    2024-03-23 05:22:01       96 阅读

热门阅读

  1. cordova cordova-hot-code-push-plugin 插件热更新

    2024-03-23 05:22:01       37 阅读
  2. 图书管理借阅系统(SpringBoot项目)

    2024-03-23 05:22:01       33 阅读
  3. 【WPF应用7】 基本控件-Grid 布局的详解与示例

    2024-03-23 05:22:01       46 阅读
  4. 初识Golang,Golang 中的结构体和方法

    2024-03-23 05:22:01       38 阅读
  5. 2024年奥莱利科技趋势报告解析

    2024-03-23 05:22:01       40 阅读