当前位置:网站首页>Hefei University of technology information theory and coding course design, including code, visual interface, course design report
Hefei University of technology information theory and coding course design, including code, visual interface, course design report
2022-07-23 05:20:00 【Martin_ ctf】
Course design of information theory and coding in Hefei University of Technology , With code , Visual interface , Course design report
Students who want the source code click here
It must be done
Binary Huffman coding is applied to any input string sequence 、fano code 、 Run length coding and Arithmetic coding , Give the coding result 、 Coding efficiency ; And realize the corresponding decoding operation .
Choose a question
Yes, one BMP First, binary Huffman coding and run length coding are carried out for the gray-scale image of format , According to the result of Huffman coding, the run length coding is transformed into binary sequence .( Pixels are encoded by Hoffman , Run with equal length code ). And design the corresponding decoding .
Development tools and environments
Editing tools :Visual Studio Code
Compiler tools :python 3.9.7
Interface tools :PyQt5 designer
The library used :math; Pillow 8.4.0; PyQt5 5.15.4;
Module partition
As shown in the figure below , There are five buttons , Realize the corresponding functions of five topics , Call five python File for corresponding coding . Enter the encoded string in the text box , Click on different buttons , You can get the character and its corresponding code , Coding results , Decoding result and coding efficiency .Huffman Encoded as Huffman.py,Fano Encoded as fano.py, The run length code is run_length2.py, The arithmetic code is signal.py, The gray image is encoded as bmp_huffman.py, The source file of the main interface is main.ui and UI_main.py, The main function is main.py Be responsible for unified management of coding program and interface program . The following figure shows the main window of the software :
The following is the module division of each sub file :
Huffman.py The division of modules
| The name of the function | Function input | Output function |
|---|---|---|
| Class node | Huffman Node parameters | A node |
| get_text_count() | Encoded string | Characters and corresponding probabilities |
| create_nodes() | Character string | Node list |
| create_huffman_tree() | Node list | Huffman Trees and root nodes |
| huffman_encoding() | Character frequency and Huffman Trees | The string and average code length of each node |
| encode_str() | Text and node list | Encoded string |
| decode_str() | Encoded string and node list | Decoded string |
| get_H() | Characters and corresponding probabilities | The entropy of the source |
fano.py The division of modules
| The name of the function | Function input | Output function |
|---|---|---|
| Class node | fano Node parameters | A node |
| get_text_count() | Encoded string | Characters and corresponding probabilities |
| create_nodes() | Character string | Node list |
| fano_encode() | Node list and character corresponding probability | Each node is compiled into a string |
| encode_str() | Text and node list | Encoded string |
| decode_str() | List of encoded string nodes | Decoded string |
| get_H() | Characters and corresponding probabilities | The entropy of the source |
| get_average_code_length() | Node list | Average code length |
run_lenggth2.py Module partition
| The name of the function | Function input | Output function |
|---|---|---|
| get_text_count() | Encoded string | Characters and corresponding probabilities |
| get_max_bin_length() | Encoded string | Maximum binary length of run length code |
| encode_str() | Encoded string and run list | Encoded string |
| decode_str() | Encoded string and run list | Decoded string |
| get_H() | Characters and corresponding probabilities | The entropy of the source |
signal.py The division of modules
| The name of the function | Function input | Output function |
|---|---|---|
| get_text_count() | Encoded string | The entropy and average code length of characters and their corresponding probabilities and sources |
| encode_str() | The corresponding probability of encoded string and character | Decimal decimals compiled |
| ten2bin() | Decimal number | Binary decimals |
| decode_str() | The corresponding probability of decimal decimals and characters | Decoded string |
bmp_huffman.py The division of modules
| The name of the function | Function input | Output function |
|---|---|---|
| Class node | Huffman Node parameters | A node |
| get_image_list() | Image path ( Images ) | List of pixel values , Itinerary list , Maximum binary length |
| get_image_list_count() | List of pixel values | A character , Frequency dictionary and corresponding character probability |
| create_nodes() | Character string | Node list |
| create_huffman_tree() | Node list | Huffman Trees and root nodes |
| huffman_encoding() | Character frequency and Huffman Trees | The string and average code length of each node |
| encode_str() | List of pixel values , Node list , Run table | Encoded string |
| decode_str() | Encoded string and node list | Decoded string |
| get_H() | Characters and corresponding probabilities | The entropy of the source |
| get_average_length() | Run list and node list | Average code length |
| compare() | Image path , Decode string and pixel value list | Whether the decoding is consistent |
Interface function
As shown in the figure Click the corresponding button to realize the corresponding function

Students who want the source code click here
Students who want the source code click here
Students who want the source code click here
边栏推荐
- Introduction to zo1x (functional safety verification)
- GIC Introduction (II) - use of gic400
- File preview (access local resources through URL)
- Druid source code read 6-preparedstatementpool source code and usage scenario analysis
- leetcode-646. 最长数对链
- 仅用5000行代码,在全志V853上AI渲染出一亿幅山水画
- Leetcode - 494. Objectifs et
- 代码随想录笔记_链表_206反转链表
- BOM&DOM
- MQ入门教程
猜你喜欢
随机推荐
Modify oracle19c to monitor IP and restart under Linux centos7 environment
libcurl重定向
Methods and steps of packaging a uniapp project as a desktop application
代码随想录笔记_链表_206反转链表
Apple 注销账户 Revoke Token
获取电脑硬件信息
Leetcode-494. objectives and
APB protocol details vs. 3.0-4.0-5.0
JS - - date Object & Ternary expression
Leetcode-172. zero after factorial
我的Redis整理
leetcode-494.目标和
Leetcode-528. random selection by weight
Introduction to basic knowledge of GIC (I)
西瓜书机器学习笔记——朴素贝叶斯
递归函数实现素数判断
Druid源码阅读9-DruidDataSource和DruidConnection中的状态
leetcode-213.打家劫舍 II
jQ 数据在后台输出拼成完成的记录表,弹出事件没有效果
Leetcode-343. integer splitting







