Question: Huffman Encoding and Decoding The goal of this task is to encode and decode images using Huffman encoding. As you used Run Length Encoding

Huffman Encoding and Decoding The goal of this task is to encode and decode images using Huffman encoding. As you used Run Length Encoding (RLE) inTask1 for binary images lossless compression (compression technique that does not lose any data in the compression process). Huffman encoding is like RLE and in this task you need to use it for grey scale images. In Huffman encoding we generate variable length code. Shorter codes for frequent values and longer code for less frequent values. There are many resources available about Huffman encoding. Below are some resources: https://en.wikipedia.org/wiki/Huffman coding http://www.cs.nccu.edu.tw/whliao/mm2004/Chapter7.pdf https://www.geeksforgeeks.org/huffman-coding-greedy-algo-3/ Learning outcome Critically analyse a specific topic whilst applying the underlying principles and concepts to the field of study Task 1: Algorithm Your first task is to do research on Huffman Encoding and critically analyse how it works and develop an algorithm for encoder and decoder. Encoder will read grey scale image (png) from disk and generate compressed representation using Huffman encoding. The decoder will read the compressed representation and convert it back to an image. Task 2: Implementation Your second task is to write a code to implement the above algorithms for encoder and decoder. You do not need to design your own data structure. However, you need to read a grey scale image. Find frequencies of each grey value then build Huffman tree to generate variable length codes. Both encoder and decoder will use same tree to encode and decode images. You need to calculate percent compression. Both encoder and decoder must work with 4 bits and 8 bits grey scale images. Test Dataset: For Testing you can select images from Mnist dataset which is the popular database for handwritten digits. Some images from this dataset are available on Moodle. http://yann.lecun.com/exdb/mnist/ https://www.kaggle.com/jidhumohan/mnist-png
Step by Step Solution
There are 3 Steps involved in it
Algorithm Define a function findNumber that takes parameters number lowVal highVal and indentAmt Calculate midVal as the integer average of highVal an... View full answer
Get step-by-step solutions from verified subject matter experts
