OpenCVSharp4 基础知识

之前已经已经熟悉了怎么读取保存图片,加载视频,摄像头。接下来介绍下OpenCV中基础知识。

  • 常见数据类型
    1. Vec对象类型


      Lesson3-1.jpg

      其命名格式为Vec+维度+数据类型。如Vec3f表示维度是3,数据类型是float

    2. Point对象类型


      Lesson3-2.jpg

      命名格式:Point+维度+数据类型,Point默认是Point2i。

    3. Size对象类型


      Lesson3-3.jpg
    4. Rect对象类型


      Lesson3-4.jpg
  • matrix的基本运算
    此处部详解,具体参照线性代数即可。
  • 基本数据存储
    OpenCV中内置的FileStorage提供了文件的读取写入,支持的格式如下
        //
        // 摘要:
        //     File storage mode
        [Flags]
        public enum Mode
        {
            //
            // 摘要:
            //     The storage is open for reading
            Read = 0,
            //
            // 摘要:
            //     flag, auto format
            FormatAuto = 0,
            //
            // 摘要:
            //     The storage is open for writing
            Write = 1,
            //
            // 摘要:
            //     The storage is open for appending
            Append = 2,
            //
            // 摘要:
            //     flag, read data from source or write data to the internal buffer (which is returned
            //     by FileStorage::release)
            Memory = 4,
            //
            // 摘要:
            //     flag, XML format
            FormatXml = 8,
            //
            // 摘要:
            //     flag, YAML format
            FormatYaml = 16,
            //
            // 摘要:
            //     flag, write rawdata in Base64 by default. (consider using WRITE_BASE64)
            Base64 = 64,
            //
            // 摘要:
            //     flag, enable both WRITE and BASE64
            WriteBase64 = 65
        }

yaml相对比较常见。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。