GithubHelp home page GithubHelp logo

2d_rle's Introduction

二维行程编码

文件说明

  • .\2D_RLE文件夹中包括项目源代码、运行时所需的库以及可执行程序
  • .\data文件夹中包括图像数据及两幅图像经二维行程编码得到的编码文件,编码文件的文件名对应图像的文件名,扩展名为*.cqa

环境配置

由于项目需要打开图像进行处理,所以需要安装opencv库,opencv官网戳这里,配置可以参考各大论坛,这里有一个简单的免安装配置方法可以参考一下

运行说明

  • 项目使用Visual Studio 2013编写,可以在该版本或更高版本VS上编译运行,或者可以直接运行2D_RLE.exe,也可以得到同样的结果

  • 程序2D_RLE.exe可以接受没有参数,此时默认图片位置为./data/test.jpg,编码文件位置为./data/code.cqa;也可以接受2个参数作为图像位置编码文件位置,请注意:在输入图片位置时请使用/而不是\来表示文件夹路径。例如在命令行里以下两种输入方式都是合法的:

     2D_RLE
     2D_RLE input.bmp code.out
  • 程序2D_RLE.exe运行后

    • 首先读取一张图片
    • 然后通过二维行程编码进行压缩并写入编码文件
    • 再将编码文件读入并解码为图像
    • 最后在屏幕上显示原图像以及经编码解码处理后的图像
  • 其中一次运行截图如下:

运行结果截图

编码文件格式说明

  • 编码文件为二进制文件,格式如下表:
含义 rows cols index0 value0 index1 value1 index2 ...
占用空间 4字节 4字节 4字节 1字节 4字节 1字节 4字节 ...
  • 具体说明如下:
    • 编码文件中第1-4字节表示图像的行数
    • 编码文件中第5-8字节表示图像的列数
    • 编码文件中接下来每5个字节代表二维行程编码中的一组数据{index,value}

2d_rle's People

Contributors

chaiqingao avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.