1. Homepage
  2. Programming
  3. EIE4512 - Digital Image Processing - Assignment #1 Histogram Equalization and Matching

EIE4512 - Digital Image Processing - Assignment #1 Histogram Equalization and Matching

Engage in a Conversation
CUHKEIE4512Digital Image ProcessingPythonOpenCVHistogram Equalization and MatchingSpatial Filtering

EIE4512 - Digital Image Processing Assignment #1 CourseNana.COM

Problem 1 (5 points) CourseNana.COM

Instructor: Zhen Li
Due on 2024/06/21 23:59 pm CourseNana.COM

Part I Written Exercises CourseNana.COM

A common measure of transmission for digital data is the baud rate, defined as the number of bits transmitted per second. Generally, transmission is accomplished in packets consisting of a start bit, a byte (8 bits) of information, and a stop bit. Using these facts, answer the following: CourseNana.COM

(a) How many minutes would it take to transmit a image 512 × 512 with 256 intensity levels using a 56K baud modem? CourseNana.COM

(b) What would the time be at 3000K baud, a representative medium speed of a phone DSL (Digital Subscriber Line) connection? CourseNana.COM

Problem 2 (5 points) CourseNana.COM

Consider the two image subsets, S1 and S2 , shown in the following figure. For V = {1}, determine whether these two subsets are (a) 4-adjacent, (b) 8-adjacent, or (c) m-adjacent. CourseNana.COM

Problem 3 (5 points) CourseNana.COM

Propose a set of intensity-slicing transformations capable of producing all the individual bit planes of an 8-bit monochrome image. (For example, a transformation function with the property T(r) = 0, for r in the range [0, 127], and for r in the range [128, 255] produces an image of the 8th bit plane in an 8-bit image.) CourseNana.COM

Problem 4 (5 points) CourseNana.COM

Explain why the discrete histogram equalization technique does not, in general, yield a flat histogram. CourseNana.COM

Problem 5 (5 points) CourseNana.COM

The images shown below are quite different, but their histograms are the same. Suppose that each image is blurred with a averaging mask.
(a) Would the histograms of the blurred images still be equal? Explain.
(b) If your answer is no, sketch the two histograms.
CourseNana.COM

Problem 6 (5 points) CourseNana.COM

  1. (a)  Suppose that you filter an image, f(x, y) , with a spatial filter mask, w(x, y) , using convolution, as defined as follows, CourseNana.COM

    where the mask is smaller than the image in both spatial directions. Show the important property that, if the coefficients of the mask sum to zero, then the sum of all the elements in the resulting convolution array (filtered image) will be zero also (you may ignore computational inaccuracies). Also, you may assume that the border of the image has been padded with the appropriate number of zeros. CourseNana.COM

  2. (b)  Would the result to (a) be the same if the filtering is implemented using correlation, as defined as follows? CourseNana.COM

Problem 7 (5 points) CourseNana.COM

  1. (a)  Isolated clusters of dark or light (with respect to the background) pixels whose area is less than one-half the area of a median filter are eliminated (forced to the median value of the neighbors) by the filter. Assume a filter of size n × n with n odd, and explain why this is so. CourseNana.COM

  2. (b)  Consider an image having various sets of pixel clusters. Assume that all points in a cluster are lighter or darker than the background (but not both simultaneously in the same cluster), and that the area of each cluster is less than or equal to n2/2. In terms of n, under what CourseNana.COM

condition would one or more of these clusters cease to be isolated in the sense described in part (a)? CourseNana.COM

Problem 8 (10 points) CourseNana.COM

The three images shown were blurred using square averaging masks of sizes n = 23,25, and 45, respectively. The vertical bars on the left lower part of (a) and (c) are blurred, but a clear separation exists between them. However, the bars have merged in image (b), in spite of the fact that the mask that produced this image is significantly smaller than the mask that produced image (c). Explain the reason for this. CourseNana.COM

Submission List: CourseNana.COM

All answers in the file your_school_id_name.pdf (e.g., 1190190xx_San_Zhang.pdf ). CourseNana.COM

Part II Programming Exercises Problem 1 Histogram Equalization and Matching (20 points) CourseNana.COM

Please use coding_input.jpgas the input and the coding_reference.jpgas the reference image. You can only use the following Python libraries: OpenCV (only for loading and writing images), numpy, math, and matplotlib. CourseNana.COM

Submission List: CourseNana.COM

  • Codes for part (a), (b), and (c) in the file hist.py. CourseNana.COM

  • Display the results for part (a), (b), and (c) in the file your_school_id_name.pdf. (e.g., CourseNana.COM

    1190190xx_San_Zhang.pdf ). CourseNana.COM

(a) Implement the function histShow(img). Display the histograms of the input image and the reference image. (Hint: Use numpy.histogram) CourseNana.COM

(b) Implement the function histEqual(img). Perform histogram equalization on the input image, and compare the histogram differences between the input image and output image. CourseNana.COM

(c) Implement the function histMatch(img, img_ref). Perform histogram matching on the RGB channels from the reference image to the input image, and display the output image. (Hint: The input image is a gray image.) CourseNana.COM

Problem 2 Spatial Filtering (35 points) CourseNana.COM

Please use sport_car.pngas the input. You can only use the following Python libraries: OpenCV (only for loading and writing images), numpy, math, and matplotlib. CourseNana.COM

Submission List: CourseNana.COM

  • Codes for the implementation in part (a) and (b) in the file noise.py. CourseNana.COM

  • Codes for the implementation in part (c) in the file median_filter.py. CourseNana.COM

  • Codes for the implementation in part (d) in the file gaussian_filter.py. CourseNana.COM

  • Codes for displaying results in part (b), (c), and (d) in the file main.py. CourseNana.COM

  • Display the results for part (a), (b), (c) and (d) in the your_school_id_name.pdf. (e.g., CourseNana.COM

    1190190xx_San_Zhang.pdf ).
    (a) Generate two different random matrices whose values are evenly distributed in the interval CourseNana.COM

    [0, 255], t1(x, y) and t2(x, y), t1(x, y) t2(x, y) . (Hint: Use numpy.random)
    (b) Denote the input image as
    f0 (x, y). Implement a function genNoise(img) to generate an CourseNana.COM

    image with salt-and-pepper noise f (x, y) based on the following function: CourseNana.COM

(c) Implement a median filter of size 3 × 3 medianFilter(img). Perform median filtering on the image with salt-and-pepper noise f (x, y) in (b). Compare the filtered result with the image that applies (Any filtering interfaces from the Python libraries, e.g., not allowed in implementation.) CourseNana.COM

(d) Implement a Gaussian filter of kernel size 3 × 3 gaussianFilter(img, sigma). Perform Gaussian filtering on the image with salt-and-pepper noise f (x, y) in (b) with the sigma of CourseNana.COM

cv2.medianBlur in OpenCV. CourseNana.COM

cv2.medianBlur in OpenCV, are CourseNana.COM

CourseNana.COM

0.5, 0.8, and 1.0. Compare the filtered result with the image that applies cv2.GaussianBlur and cv2.getGaussianKernel in OpenCV. (Hint: Implement the Gaussian kernel function gaussianKernel(sigma) before gaussianFilter(img, sigma). Any filtering interfaces from the Python libraries, e.g., cv2.GaussianBlur in OpenCV, are not allowed in implementation.)  CourseNana.COM

Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
CUHK代写,EIE4512代写,Digital Image Processing代写,Python代写,OpenCV代写,Histogram Equalization and Matching代写,Spatial Filtering代写,CUHK代编,EIE4512代编,Digital Image Processing代编,Python代编,OpenCV代编,Histogram Equalization and Matching代编,Spatial Filtering代编,CUHK代考,EIE4512代考,Digital Image Processing代考,Python代考,OpenCV代考,Histogram Equalization and Matching代考,Spatial Filtering代考,CUHKhelp,EIE4512help,Digital Image Processinghelp,Pythonhelp,OpenCVhelp,Histogram Equalization and Matchinghelp,Spatial Filteringhelp,CUHK作业代写,EIE4512作业代写,Digital Image Processing作业代写,Python作业代写,OpenCV作业代写,Histogram Equalization and Matching作业代写,Spatial Filtering作业代写,CUHK编程代写,EIE4512编程代写,Digital Image Processing编程代写,Python编程代写,OpenCV编程代写,Histogram Equalization and Matching编程代写,Spatial Filtering编程代写,CUHKprogramming help,EIE4512programming help,Digital Image Processingprogramming help,Pythonprogramming help,OpenCVprogramming help,Histogram Equalization and Matchingprogramming help,Spatial Filteringprogramming help,CUHKassignment help,EIE4512assignment help,Digital Image Processingassignment help,Pythonassignment help,OpenCVassignment help,Histogram Equalization and Matchingassignment help,Spatial Filteringassignment help,CUHKsolution,EIE4512solution,Digital Image Processingsolution,Pythonsolution,OpenCVsolution,Histogram Equalization and Matchingsolution,Spatial Filteringsolution,