Docsity

Lab Assignment for Introduction to Computer Vision | CSE 185, Assignments of Computer Science

Toggle sidebar
bg1
Lab Assignment #1
Hardcopy due Wed. 9/24 by midnight
(submit in class, in lab, or under my office door)
Title: Binary image rendering using halftoning.
The following figure shows ten shades of gray approximated by dot patterns. Each gray level is
represented by a 3 x 3 pattern of black and white dots. A 3 x 3 area full of black dots is the
approximation to gray-level black, or 0. Similarly, a 3 x 3 area of white dots represents gray level 9,
or white. The other dot patterns are approximations to gray levels in between these two extremes. A
gray-level printing scheme based on dot patterns such as these is called "halftoning."
(a) Write a halftoning function that converts a gray scale image with values 0-255 to a
binary (two-valued) image using the dot patterns below. The input and output images should
have the same size. Your function should also scale the gray levels of the input image to
span the full halftoning range. The input and output images should be of datatype uint8.
(b) Write a program to generate a test pattern image consisting of a gray scale wedge of size
256 x 256, whose first column is all 0's, the next column is all 1's, and so on, with the last
column being 255's. Convert this image using your halftoning function. Print the original
and halftone images.
(c) Render and print book Figs. 2.22(a) through (c) using your halftoning function (no need
to print the originals). Do your results agree with the conclusions arrived at in the text in
pgs. 64-65 and Fig. 2.23? Explain. You can download the required figures from the book
web site.
Notes:
• Your function should be able to process images of any size, not just multiples of 3. Come up with
a scheme to handle the edges when a dimension is not a multiple of 3.
• For question (c), it might be better to evaluate the results using the monitor rather than printouts.
The printer might perform some kind of halftoning processing to render the images.
• The directions above are deliberately not very detailed. Part of the exercise is interpreting what is
meant by the directions. Please ask questions as needed.
pf2

Partial preview of the text

Download Lab Assignment for Introduction to Computer Vision | CSE 185 and more Assignments Computer Science in PDF only on Docsity!

Lab Assignment

Hardcopy due Wed. 9/24 by midnight

(submit in class, in lab, or under my office door)

Title: Binary image rendering using halftoning. The following figure shows ten shades of gray approximated by dot patterns. Each gray level is represented by a 3 x 3 pattern of black and white dots. A 3 x 3 area full of black dots is the approximation to gray-level black , or 0. Similarly, a 3 x 3 area of white dots represents gray level 9, or white. The other dot patterns are approximations to gray levels in between these two extremes. A gray-level printing scheme based on dot patterns such as these is called "halftoning." (a) Write a halftoning function that converts a gray scale image with values 0-255 to a binary (two-valued) image using the dot patterns below. The input and output images should have the same size. Your function should also scale the gray levels of the input image to span the full halftoning range. The input and output images should be of datatype uint8. (b) Write a program to generate a test pattern image consisting of a gray scale wedge of size 256 x 256, whose first column is all 0's, the next column is all 1's, and so on, with the last column being 255's. Convert this image using your halftoning function. Print the original and halftone images. (c) Render and print book Figs. 2.22(a) through (c) using your halftoning function (no need to print the originals). Do your results agree with the conclusions arrived at in the text in pgs. 64-65 and Fig. 2.23? Explain. You can download the required figures from the book web site.

Notes:

  • Your function should be able to process images of any size, not just multiples of 3. Come up with a scheme to handle the edges when a dimension is not a multiple of 3.
  • For question (c), it might be better to evaluate the results using the monitor rather than printouts. The printer might perform some kind of halftoning processing to render the images.
  • The directions above are deliberately not very detailed. Part of the exercise is interpreting what is meant by the directions. Please ask questions as needed.