In MATLAB, a grey-scale image is stored a a matrix of numbers, all between 0 (black) and 255 (white). Since there are 256 possible values, 8 bits are needed or each pixel, in contrast to a normal integer, which is 64 bits.To save memory, grey-scale images are stored with a special data type, uint8 (unsigned 8-bit integer). In computer terminology, 8 bits = 1 byte. Even at one byte per pixel, a large image can consume a lot of memory. For example, a 1000x1000-pixel image takes 1 million bytes (which is a little less than 1 megabyte, since by convention 1 Mbyte = 2^20 bytes). One technique for reducing the size of an image is quantization - reducing the number of allowable levels from 256 to something smaller. Surprisingly, most images can be quantized by a large factor without losing much information. In this problem, you will quantize a grey-scale image to only 4 levels, so that it could (in principle) be stored as 2 bits per pixel. The template will read in an image file. Your job is to loop over all rows and columns of the image matrix, N, and set each pixel to 0, 1, 2, or 3 as follows: original pixel value new pixel value 0 - 64 0 65 - 128 1 129 - 192 2 193 - 255 3 Use imshow to display the original and modified images so that you can see the effect of the quantization.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Topic Video
Question
In MATLAB, a grey-scale image is stored a a matrix of numbers, all between 0 (black) and 255 (white). Since there are 256 possible values, 8 bits are needed or each pixel, in contrast to a normal integer, which is 64 bits.To save memory, grey-scale images are stored with a special data type, uint8 (unsigned 8-bit integer). In computer terminology, 8 bits = 1 byte. Even at one byte per pixel, a large image can consume a lot of memory. For example, a 1000x1000-pixel image takes 1 million bytes (which is a little less than 1 megabyte, since by convention 1 Mbyte = 2^20 bytes). One technique for reducing the size of an image is quantization - reducing the number of allowable levels from 256 to something smaller. Surprisingly, most images can be quantized by a large factor without losing much information. In this problem, you will quantize a grey-scale image to only 4 levels, so that it could (in principle) be stored as 2 bits per pixel. The template will read in an image file. Your job is to loop over all rows and columns of the image matrix, N, and set each pixel to 0, 1, 2, or 3 as follows: original pixel value new pixel value 0 - 64 0 65 - 128 1 129 - 192 2 193 - 255 3 Use imshow to display the original and modified images so that you can see the effect of the quantization.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education