<< Chapter < Page Chapter >> Page >
Block diagram of the error diffusion method.

[link] is a block diagram that illustrates the method of error diffusion.The current input pixel f ( i , j ) is modified by means of past quantization errors to give a modified input f ˜ ( i , j ) . This pixel is then quantized to a binary value by Q , using some threshold T . The error e ( i , j ) is defined as

e ( i , j ) = f ˜ ( i , j ) - b ( i , j )

where b ( i , j ) is the quantized binary image.

The error e ( i , j ) of quantizing the current pixel is is diffused to "future" pixels by means of a two-dimensionalweighting filter h ( i , j ) , known as the diffusion filter . The process of modifying an input pixel by past errors can berepresented by the following recursive relationship.

f ˜ ( i , j ) = f ( i , j ) + k , l S h ( k , l ) e ( i - k , j - l )

The most popular error diffusion method, proposed by Floyd and Steinberg, uses the diffusion filter shown in [link] . Since the filter coefficients sum to one,the local average value of the quantized image is equal to the local average gray scale value. [link] shows the halftone image produced by Floydand Steinberg error diffusion. Compared to the ordered dither halftoning, the error diffusion method can be seen to have better contrast performance.However, it can be seen in [link] that error diffusion tends to create "streaking" artifacts, known as worm patterns.

The error diffusion filter proposed by Floyd and Steinberg.
A halftone image produced by the Floyd and Steinberg error diffusion method.

Halftoning exercise

Download the file house.tif for the following section.

If your display software (e.g Matlab) resizes your image before rendering, a halftoned image will probably notbe rendered properly. For example, a subsampling filter will result in gray pixels in the displayedimage! To prevent this in Matlab, use the truesize command just after the image command. This will assign one monitor pixel for each image pixel.

We will now implement the halftoning techniques described above. Savethe result of each method in MAT files so that you may later analyze and compare their performance.Download the image file house.tif and read it into Matlab. Print out a copy of this image.

First try the simple thresholding technique based on [link] , using T = 108 , and display the result. In Matlab, an easy way to threshold an image X is to use the command Y = 255*(X>T); . Label the quantized image, and print it out.

Now create an "absolute error" image by subtracting the binary from the original image, and then taking the absolute value.The degree to which the original image is present in the error image is a measure of signal dependence of the quantization error.Label and print out the error image.

Compute the mean square error (MSE), which is defined by

M S E = 1 N M i , j { f ( i , j ) - b ( i , j ) } 2

where N M is the total number of pixels in each image. Note the MSE on the printout of the quantized image.

Now try implementing Bayer dithering of size 4. You will first have to compute the dither pattern. The index matrix fora dither pattern of size 4 is given by

I ( i , j ) = 12 8 10 6 4 16 2 14 9 5 11 7 1 13 3 15 .

Based on this index matrix and [link] , create the corresponding threshold matrix.

For ordered dithering, it is easiest to perform the thresholding of the image all at once.This can be done by creating a large threshold matrix by repeating the 4 × 4 dither pattern. For example, the command T = [T T; T T]; will increase the dimensions of T by 2. If this is repeated until T is at least as large as the original image, T can then be trimmed so that is is the same size as the image. The thresholding can then be performed using the command Y = 255*(X>T); .

As above, compute an error image and calculate the MSE. Print out the quantized image, the error image, and note the MSE.

Now try halftoning via the error diffusion technique, using a threshold T = 108 and the diffusion filter in [link] . It is most straightforward to implement this by performing the followingsteps on each pixel in raster order:

  1. Initialize an output image matrix with zeros.
  2. Quantize the current pixel using using the threshold T , and place the result in the output matrix.
  3. Compute the quantization error by subtracting the binary pixel from the gray scale pixel.
  4. Add scaled versions of this error to “future” pixels of the original image, as depictedby the diffusion filter of [link] .
  5. Move on to the next pixel.

You do not have to quantize the outer border of the image.

As above, compute an error image and calculate the MSE. Print out the quantized image, the error image, and note the MSE.

The human visual system naturally lowpass filters halftone images. To analyze this phenomenon, filter each of the halftone images withthe Gaussian lowpass filter h that you loaded in the previous section (from ycbcr.mat ), and measure the MSE of the filtered versions. Make a table that containsthe MSE's for both filtered and nonfiltered halftone images for each of the three methods. Does lowpass filtering reduce the MSE for each method?

Inlab report

  1. Hand in the original image and the three binary images. Make sure that they are all labeled, and that the mean square errors are notedon the binary images.
  2. Compare the performance of the three methods based on the visual quality of the halftoned images.Also compare the resultant MSE's. Is the MSE consistent with the visual quality?
  3. Submit the three error images. Which method appears to be the least signal dependent? Does the signal dependence seem to becorrelated with the visual quality?
  4. Compare the MSE's of the filtered versions with the nonfiltered versions for each method.What is the implication of these observations with respect to how we perceive halftone images.

Questions & Answers

differentiate between demand and supply giving examples
Lambiv Reply
differentiated between demand and supply using examples
Lambiv
what is labour ?
Lambiv
how will I do?
Venny Reply
how is the graph works?I don't fully understand
Rezat Reply
information
Eliyee
devaluation
Eliyee
t
WARKISA
hi guys good evening to all
Lambiv
multiple choice question
Aster Reply
appreciation
Eliyee
explain perfect market
Lindiwe Reply
In economics, a perfect market refers to a theoretical construct where all participants have perfect information, goods are homogenous, there are no barriers to entry or exit, and prices are determined solely by supply and demand. It's an idealized model used for analysis,
Ezea
What is ceteris paribus?
Shukri Reply
other things being equal
AI-Robot
When MP₁ becomes negative, TP start to decline. Extuples Suppose that the short-run production function of certain cut-flower firm is given by: Q=4KL-0.6K2 - 0.112 • Where is quantity of cut flower produced, I is labour input and K is fixed capital input (K-5). Determine the average product of lab
Kelo
Extuples Suppose that the short-run production function of certain cut-flower firm is given by: Q=4KL-0.6K2 - 0.112 • Where is quantity of cut flower produced, I is labour input and K is fixed capital input (K-5). Determine the average product of labour (APL) and marginal product of labour (MPL)
Kelo
yes,thank you
Shukri
Can I ask you other question?
Shukri
what is monopoly mean?
Habtamu Reply
What is different between quantity demand and demand?
Shukri Reply
Quantity demanded refers to the specific amount of a good or service that consumers are willing and able to purchase at a give price and within a specific time period. Demand, on the other hand, is a broader concept that encompasses the entire relationship between price and quantity demanded
Ezea
ok
Shukri
how do you save a country economic situation when it's falling apart
Lilia Reply
what is the difference between economic growth and development
Fiker Reply
Economic growth as an increase in the production and consumption of goods and services within an economy.but Economic development as a broader concept that encompasses not only economic growth but also social & human well being.
Shukri
production function means
Jabir
What do you think is more important to focus on when considering inequality ?
Abdisa Reply
any question about economics?
Awais Reply
sir...I just want to ask one question... Define the term contract curve? if you are free please help me to find this answer 🙏
Asui
it is a curve that we get after connecting the pareto optimal combinations of two consumers after their mutually beneficial trade offs
Awais
thank you so much 👍 sir
Asui
In economics, the contract curve refers to the set of points in an Edgeworth box diagram where both parties involved in a trade cannot be made better off without making one of them worse off. It represents the Pareto efficient allocations of goods between two individuals or entities, where neither p
Cornelius
In economics, the contract curve refers to the set of points in an Edgeworth box diagram where both parties involved in a trade cannot be made better off without making one of them worse off. It represents the Pareto efficient allocations of goods between two individuals or entities,
Cornelius
Suppose a consumer consuming two commodities X and Y has The following utility function u=X0.4 Y0.6. If the price of the X and Y are 2 and 3 respectively and income Constraint is birr 50. A,Calculate quantities of x and y which maximize utility. B,Calculate value of Lagrange multiplier. C,Calculate quantities of X and Y consumed with a given price. D,alculate optimum level of output .
Feyisa Reply
Answer
Feyisa
c
Jabir
the market for lemon has 10 potential consumers, each having an individual demand curve p=101-10Qi, where p is price in dollar's per cup and Qi is the number of cups demanded per week by the i th consumer.Find the market demand curve using algebra. Draw an individual demand curve and the market dema
Gsbwnw Reply
suppose the production function is given by ( L, K)=L¼K¾.assuming capital is fixed find APL and MPL. consider the following short run production function:Q=6L²-0.4L³ a) find the value of L that maximizes output b)find the value of L that maximizes marginal product
Abdureman
types of unemployment
Yomi Reply
What is the difference between perfect competition and monopolistic competition?
Mohammed
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Purdue digital signal processing labs (ece 438). OpenStax CNX. Sep 14, 2009 Download for free at http://cnx.org/content/col10593/1.4
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Purdue digital signal processing labs (ece 438)' conversation and receive update notifications?

Ask