.Write a simple edge detector based on the Canny edge detector: 1. Image Smoothing (5 points)...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
.Write a simple edge detector based on the Canny edge detector: 1. Image Smoothing (5 points) Write/use a Matlab, function that will smooth an image with a Gaussian filter. The function should take as input an image and a value for sigma that will be used to smooth the image. You may use the function special to create the Gaussian filter and the function infilter to perform correlation with it. You should be sure that the width of your filter is at least two * sigma + 1, to fully capture the Gaussian. For example, if sigma is 2, you might use a filter that has a size of 5x5 (2*2+1). For sigma = 4, you might use a filter size of 9x9 (2*4+1). 2. Gradient Image (5 points) Next, write/use a function that will compute the gradient of an image. Your function should take an image as input and return two images. Each image will be the size of the original image. One will contain the x component of the image gradient for each pixel, the other will contain the y component of the gradient. Hint: you will need to do padding of your original image in order to keep the same size. 3. Magnitude and direction of the gradient (5 points) Next, write a function to compute the magnitude and direction (as described by the two components of the gradient, not the angle) of the gradient. This function should take as input the two images produced by the previous function, which contain the x and y components of the gradient. It should return three images, which contain the magnitude of the gradient at each pixel, and the x and y components of the gradient direction. 4. Edge Pixels (5 points) Finally, combine these functions together to create a function that will find positions in the image in which the gradient is a local maxima, and "reasonably" large. This function will take three inputs: an image, sigma, and t. We will only detect edges at pixels in which the magnitude of the gradient is greater than this threshold t. The output of this function will be a binary matrix. For every pixel, there will be a I if there is an edge at that pixel, and a zero if there is no edge. CSC482 (5 points): Add hysteresis to your edge detector. It should take two thresholds as input, along with the image and sigma. A pixel is an edge if the gradient magnitude is greater than the first threshold, but also if the gradient magnitude is bigger than the second threshold and it has a neighbor that is an edge (note that this is a recursive definition). Hint: It will be a good idea to turn your image into a matrix of floating point numbers using the double function. If not, you will get into trouble, because images are constrained to be non-negative integers below 255. If, for example, the gradient is sometimes negative, it cannot be stored in an unsigned integer image. Run your code on an image from a particular domain (best if you use grayscale or convert to color to grayscale) and save the results of parts # 1, 2, 3, 4 for the chosen image. For each point, explain the output images and what values for the parameter you chose in order to get the corresponding output. For example, for part #1 explain what value you chose for sigma and why. Also show different results by varying the values of the parameters. CSC482 (5 points): Use a color image and don't convert to grayscale. You still need to ultimately output a binary image with edge locations marked. To answer this question, you will need to decide what a color edge is. You do not need to find the "right" answer (there isn't one). You may convert to any color space you like, but you must consider all channels. (E.g., conversing to HSV and only using V does not satisfy the requirements of this part of the assignment.) .Write a simple edge detector based on the Canny edge detector: 1. Image Smoothing (5 points) Write/use a Matlab, function that will smooth an image with a Gaussian filter. The function should take as input an image and a value for sigma that will be used to smooth the image. You may use the function special to create the Gaussian filter and the function infilter to perform correlation with it. You should be sure that the width of your filter is at least two * sigma + 1, to fully capture the Gaussian. For example, if sigma is 2, you might use a filter that has a size of 5x5 (2*2+1). For sigma = 4, you might use a filter size of 9x9 (2*4+1). 2. Gradient Image (5 points) Next, write/use a function that will compute the gradient of an image. Your function should take an image as input and return two images. Each image will be the size of the original image. One will contain the x component of the image gradient for each pixel, the other will contain the y component of the gradient. Hint: you will need to do padding of your original image in order to keep the same size. 3. Magnitude and direction of the gradient (5 points) Next, write a function to compute the magnitude and direction (as described by the two components of the gradient, not the angle) of the gradient. This function should take as input the two images produced by the previous function, which contain the x and y components of the gradient. It should return three images, which contain the magnitude of the gradient at each pixel, and the x and y components of the gradient direction. 4. Edge Pixels (5 points) Finally, combine these functions together to create a function that will find positions in the image in which the gradient is a local maxima, and "reasonably" large. This function will take three inputs: an image, sigma, and t. We will only detect edges at pixels in which the magnitude of the gradient is greater than this threshold t. The output of this function will be a binary matrix. For every pixel, there will be a I if there is an edge at that pixel, and a zero if there is no edge. CSC482 (5 points): Add hysteresis to your edge detector. It should take two thresholds as input, along with the image and sigma. A pixel is an edge if the gradient magnitude is greater than the first threshold, but also if the gradient magnitude is bigger than the second threshold and it has a neighbor that is an edge (note that this is a recursive definition). Hint: It will be a good idea to turn your image into a matrix of floating point numbers using the double function. If not, you will get into trouble, because images are constrained to be non-negative integers below 255. If, for example, the gradient is sometimes negative, it cannot be stored in an unsigned integer image. Run your code on an image from a particular domain (best if you use grayscale or convert to color to grayscale) and save the results of parts # 1, 2, 3, 4 for the chosen image. For each point, explain the output images and what values for the parameter you chose in order to get the corresponding output. For example, for part #1 explain what value you chose for sigma and why. Also show different results by varying the values of the parameters. CSC482 (5 points): Use a color image and don't convert to grayscale. You still need to ultimately output a binary image with edge locations marked. To answer this question, you will need to decide what a color edge is. You do not need to find the "right" answer (there isn't one). You may convert to any color space you like, but you must consider all channels. (E.g., conversing to HSV and only using V does not satisfy the requirements of this part of the assignment.)
Expert Answer:
Related Book For
Posted Date:
Students also viewed these databases questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Case 10: You Decide How Much Meals Are Worth, Restaurants Tell Customers 283 Mr. Coutts, 36, a carpenter from west London, said, "If you can order a glass of Coke or champagne and still give a...
-
Crosby is known for his advocacy of zero-defects management and prevention; Crosby's Quality Vaccine consists of which three ingredients? Group of answer choices A. Determination, Education, and...
-
JJS Corporation purchased a building on January 1, 2011, for a total of $12,000,000. The building has been depreciated using the straight-line method with a 20-year useful life and no residual value....
-
Given the following algorithm which implement using a Queue ADT. Algorithm Start Q1 CreateQueue; Q2 = CreateQueue; while (true) read number; Q1.enqueue(number); Q2.enqueue(number); while (Q1 is not...
-
Identify and discuss the characteristics that make accounting information useful.
-
Multiple Choice Questions Select the best answer for each of the following and explain the reason for your selection. a. Which of the following procedures is least likely to be completed before the...
-
es Baird Manufacturing Company makes tents that it sells directly to camping enthusiasts through a mail-order marketing program. The company pays a quality control expert $88,450 per year to inspect...
-
Obtain v(t) and i(t) for t > 0 in the circuit in Fig. 16.54 . 5 H ll i(t) 24 V (+ 10u(t) v(t) 200 mF
-
Translate the following ER diagram into CREATE TABLE statements. We don't care what data types you use. storage cores memory index Machine accid Instance MAC capacity runs in Account part of provider...
-
An art dealer advises that, for the best display of a painting, the area of the frame should be (1/5) the area of the painting. Determine the best width of the frame for a painting 20 cm by 20 cm, if...
-
1. Express the following equation in vertex form: y = coordinates of the vertex point. (4 points) 3x 12x + 22 and state the S
-
The revenue (in dollars) from the sale of x car seats for infants is given by the following function. R(x) 28x-0.010x2 0x2800 (A) Find the average change in revenue if production is changed from...
-
Criminal Charges Assignment Imagine that you are working as a paralegal in the Johnson County Attorney's Office. One of your responsibilities is the review of arrest reports and narratives to...
-
Suppose there are four sellers and four buyers in a market. Each seller sell one unit of output. The opportunity costs of producing one unit are given by $7, $5, $3, and $1 for seller 1,2,3,and 4...
-
The following graph illustrates the four parts of a trip a family took from home. Use the graph to answer the questions. (Select all that apply.) d (miles) 14+ 13 12 210 11 10 INWA) CO 9 8 7 6 5 4 3...
-
A random sample of 10 houses heated with natural gas in a particular area, is selected, and the amount of gas (in therms) used during the month of January is determined for each house. The resulting...
-
Derive an equation for the time necessary to completely burn a 100 m carbon particle as a function of D 0 . Also calculate the burning rate constant. Use the KS values of the parameter values, for...
-
The rule of thumb that the rate of reaction doubles for a 10C increase in temperature occurs only at a specific temperature for a given activation energy. Develop a relationship between the...
-
View the CSB video to list two things in which dust explosions are different from those involving flammable liquids.
-
Consider an economy in long-run equilibrium with an inflation rate, \(\pi\), of \(12 \%(0.12)\) per year and a natural unemployment rate, \(u_{n}\), of \(4 \%(0.04)\). The expectations-augmented...
-
In a certain economy, the expectations-augmented Phillips curve is a. Graph the Phillips curve of this economy for an expected inflation rate of 0.075 . If the Fed chooses to keep the actual...
-
How do expropriation and confiscation differ?
Study smarter with the SolutionInn App