1. Homepage
  2. Programming
  3. [2022] UNSW - COMP9517 Computer Vision - Lab1 Image Processing

[2022] UNSW - COMP9517 Computer Vision - Lab1 Image Processing

Engage in a Conversation
COMP9517Computer Visionniversity of New South WalesUNSW

2022 T2 Lab 1 Specification

CourseNana.COM


CourseNana.COM


CourseNana.COM

 1. Contrast Stretching CourseNana.COM

Contrast is a measure of the range of intensity values in an image and is defined as the difference between the maximum pixel value and minimum pixel value. The full contrast of an 8-bit image is 255 (max) – 0 (min) = 255. Any value less than that means the image has lower contrast than possible. Contrast stretching attempts to improve the contrast of the image by stretching the range of intensity values using linear scaling. CourseNana.COM

Assume that ?? _is the original input image and ?? _is the output image. Let ?? _and ?? _be the minimum and maximum pixel values allowed (for an 8-bit image that means ??=0 and ??=255) and let ?? _and ?? _be the minimum and maximum pixel values found in ??. Then the contrast-stretched image ?? _is given by the function: CourseNana.COM

  CourseNana.COM

Question 1: Write an algorithm that performs contrast stretching as per Equation (1) above. Read the given gray-scale image Kitten.png and run your algorithm to see whether it indeed improves the image quality. The result should look like this CourseNana.COM

  CourseNana.COM

Also write an algorithm that finds the coordinates of the minimum pixel value and the coordinates of the maximum pixel value in an image. Do not use the built-in OpenCV functions for these tasks but write your own code. Run it on both the input image and the output image and print the values of these pixels to confirm whether your contrast stretching algorithm works correctly. CourseNana.COM

2. Intensity Histogram CourseNana.COM

The histogram of an image shows the counts of the intensity values. It gives only statistical information about the pixels and removes the location information. For a digital image with ?? _gray levels, from 0 to ??−1, the histogram is a discrete function ℎ(??)=???? _where ??∈[0,??−1] is the ??th gray level and ???? _is the number of pixels with that gray level. CourseNana.COM

  CourseNana.COM

Question 2: Write an algorithm that computes and plots the histogram of an image. Do not use the built-in OpenCV functions for computing the histogram but write your own code to perform this task. Then run your algorithm on Kitten.png and its contrast-stretched version from Question 1 and visually compare the histograms CourseNana.COM

  CourseNana.COM

3 Image Edges CourseNana.COM

Edges are an important source of semantic information in images. They occur in human visual perception at divisions between areas of different intensity, colour, or texture. A gray-scale image can be thought of as a 2D landscape with areas of different intensity living at different heights. A transition between areas of different intensity in an image ?? _means there must be a steep slope, which we formalise as the gradient (vector): CourseNana.COM


CourseNana.COM

As the image ?? _is discrete, we need to approximate the continuous derivatives ????/????and ????/????by finite differences. Simple examples of convolution kernels that perform finite differencing are the Sobel filters defined as follows CourseNana.COM

  CourseNana.COM

Question 3: Write an algorithm that computes the two Sobel images ????/????≈??∗???? _and ????/????≈??∗???? _from an input image. Use the given image CT.png to test your algorithm. Do not use the built-in OpenCV functions for computing the Sobel images but write your own code to perform this task. You may verify the output of your own algorithm by comparing with the output of built-in functions. CourseNana.COM

Notice that the calculations may produce negative output pixel values. Thus, make sure you use the right data types for the calculations and the output image. CourseNana.COM

After that, compute the gradient magnitude image CourseNana.COM

  CourseNana.COM

In other words, create a new output image having the same size as the input image and the Sobel images, and then for every pixel in the output image compute the value as the square root of the sum of the squared value of the Sobel image ????/????and the squared value of the Sobel image ????/????at that pixel position. CourseNana.COM

Here again, notice that the calculations may produce intermediate values outside the 8-bit range. Thus, make sure you use the right data types for the calculations. CourseNana.COM

The final result should look like this: CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
COMP9517代写,Computer Vision代写,niversity of New South Wales代写,UNSW代写,COMP9517代编,Computer Vision代编,niversity of New South Wales代编,UNSW代编,COMP9517代考,Computer Vision代考,niversity of New South Wales代考,UNSW代考,COMP9517help,Computer Visionhelp,niversity of New South Waleshelp,UNSWhelp,COMP9517作业代写,Computer Vision作业代写,niversity of New South Wales作业代写,UNSW作业代写,COMP9517编程代写,Computer Vision编程代写,niversity of New South Wales编程代写,UNSW编程代写,COMP9517programming help,Computer Visionprogramming help,niversity of New South Walesprogramming help,UNSWprogramming help,COMP9517assignment help,Computer Visionassignment help,niversity of New South Walesassignment help,UNSWassignment help,COMP9517solution,Computer Visionsolution,niversity of New South Walessolution,UNSWsolution,