Huffman Encoding and Decoding The goal of this task is to encode and decode images using...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
Algorithm Define a function findNumber that takes parameters number lowVal highVal and indentAmt Calculate midVal as the integer average of highVal an... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Data set Theory Assume an informational record with one association parent including matches (a, b) where a can't try not to be a parent of b. (a) Write a Datalog demand which gives the graph of...
-
1. Suppose a company produces a product that sells for $55, has a variable cost per unit of $35, and has fixed costs of $100,000. How many units must the company sell to earn a target profit of...
-
Suppose the economy is initially in equilibrium at an output level of 100 and a price level of 100. The Fed then manages to shift aggregate demand rightward by 20. 1. Illustrate the initial...
-
A cone has base radius r cm and a fixed height of 30 cm. The radius of the base is increasing at a rate of 0.01cms 1 . Find the rate of change of the volume when r = 5.
-
Outline the general strategy used in metagenomics.
-
McCarty Pointers Inc. expects to begin operations on January 1, 2012; it will operate as a specialty sales company that sells laser pointers over the Internet. McCarty expects sales in January 2012...
-
Contemporary psychoanalysis has undergone a paradigm shift from drive reduction to the relational model. The most fundamental difference between relational and classical forms of psychoanalysis is...
-
A 4.0 L sample of O 2 gas has a pressure of 1.0 bar. A 2.0 L sample of N 2 gas has a pressure of 2.0 bar. If these two samples are mixed and then compressed in a 2.0 L vessel, what is the final...
-
It's Happy Hour! Cindy is on her Hens night and decides to shout her friends their first two drinks, why not, it's two for the price of one that means 4 drinks for each person. Bargain! Cindy decides...
-
Clearly define the scope . Defining project scope should include the following areas: Project Objective Product scope description Justification Deliverables Milestones Technical Requirements Limits...
-
What are 3 items that you would find on a Net Worth Statement?
-
Identify and define four personality traits and then provide example of how each could shape consumer behavior?
-
A wire is 28.0 m long at 4.00 o C and is 0.955 cm longer at 35. 0 C. Find the wire's coefficient of linear expansion (in ( o C) -1 )
-
Define its geographical location and boundaries For the Bahamas Norman cay
-
Charles has just started a new job. His employer requires that he contribute 2 percent of his salary to a qualified retirement plan and will match any additional contributions up to 3 percent....
-
1. Below is depicted a graph G constructed by joining two opposite vertices of C12. Some authors call this a "theta graph" because it resembles the Greek letter 0. a. What is the total degree of this...
-
One of the results was there were no significant sex differences in memory for pictures rated less intense (02) or in false-positive rates (12 and 10% for women and men, respectively) (Canli et al.,...
-
You are competing in a swimming race that has eight contestants starting at the same time, one per lane. Two of your friends are in the race as well. The eight lanes are assigned to the eight...
-
As a promotion, a cereal brand is offering a prize in each box, and there are four possible prizes. You would like to collect all four prizes, but you only plan to buy six boxes of the cereal before...
-
Why do you and your business need to be able to communicate well?
-
What are the basic criteria for effective messages?
-
What are the questions for analyzing a business communication situation?
Study smarter with the SolutionInn App