zoukankan      html  css  js  c++  java
  • 3、opencv 图像显示功能

    #include <iostream>
    #include <opencv2/opencv.hpp>
    using namespace cv;
    using namespace std;
    int main()
    {
        Mat img = imread("D:\FOR_SLAM\lena.jpg");
          if (img.empty())
          {
              cout << "error";
              return -1;
           }
          imshow("xx的靓照", img);
          waitKey();
          return 0;
     }

    1、图像的表示

    一般来说,灰度图用2维矩阵表示,彩色(多通道)图像用3维矩阵(MXNX3)表示。对于图像显示来说,目前大部分设备都是用无符号8位整数(类型为CV_8U)表示像素亮度。

    图像数据在计算机内存中的存储顺序为以图像最左上点开始

    如果是多通道图像,比如 RGB 图像,则每个像素用三个字节表示在 OpenCV 中,RGB 图像的通道顺序为 BGR ,存储如
    表 3-2 所示。

    CMakeLists.txt

    CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
    PROJECT(readmap)
    
    FIND_PACKAGE(OpenCV REQUIRED)
    
    ADD_EXECUTABLE(readmap readmap.cpp)
    
    TARGET_LINK_LIBRARIES(readmap ${OpenCV_LIBS})
  • 相关阅读:
    error occurred during initialization of vm
    Service Discovery protocol(SDP)
    nRF51822EK_PRO
    Binder
    android samsung note3  device not found
    BLE pairing vs. bonding
    remote link Centos6.6 Horrible Slow
    depmod -a
    start and end call use itelephony and how to pick up a call
    WebService
  • 原文地址:https://www.cnblogs.com/gary-guo/p/6277814.html
Copyright © 2011-2022 走看看