Question: Create a vector y of floating point values between 0-1. We will pretend that the vector y is a row from a 2D image. The
Create a vector y of floating point values between 0-1. We will pretend that the vector y is a row from a 2D image. The pixel values range from 0 to 1.0.
Define the vector as a 1D numpy array.
Calculate dy at each location n. Use a for-loop to do this.
Plot dy/dx and y against x in one figure.
Calculate the second derivative
Plot the second derivative on the same plot. Compare the first and second derivative plots. Look where their values change with respect to y.
Add the following code to your program at the end. This code converts one row of given intensities (y) into a 25X25 image, im, by broadcasting the row over the entire image. It also shows the resulting image in pseudo color to highlight the edges.
N=len(y)
im = np.zeros((N, N)).reshape((N, N))
im[:, 0:] = y
plt.figure()
plt.imshow(im, cmap='viridis')
plt.colorbar()
Use buit-infunctions, feature.canny() and filters.sobel(), to detect edges in image im. Examine the two images produced by canny and sobel filters.

HistogramAndEdge [Read-Onlyl - Word Sign in - Insert Design Layout References Mailings Review View Tell me what you want to do Share Find . Replace Select Editing File Home Cut Calibri (Body)A A Aa Blu. abEX, X, A... Eg Copy Paste E-. | 1Normal TNO Spac Heading 1 Heading 2 Title Subtitle Subtle Em.. Emphasis Format Painter Clipboard Font Paragraph Styles 2. Create a vector y of floating point values between 0-1. We will pretend that the vectory is a row from a 2D image. The pixel values range from 0 to 1.0. a. Define the vector as a 1D Dum array. pparray( [0,0,0,5,5,5,2,2,2,-3,4,5,6,7,6,5,4,3,2,1,1,-1,1,1, 1,4,4,4) Consider y to be a single row of pixel values from some image. b. Calculate dy -yon) at each location n. use a for-loop to do this. c. Plot gu/dx and y against x in one figure. d. Calculate the second derivati e. Plot the second derivative on the same plot. Compare the first and second dV_dy derivative plots. Look where their values change with respect to y. Add the following code to your program at the end. This code converts one row of given intensities (v) into a 25X25 image, im, by "broadcasting the row over the entire image. It also shows the resulting mage in pseudo color to highlight the edges t. i. N-leniv) iv. pltfigws0 g. Use buit-infuostisns, fsatur.caooni) and filters.sobel(), to detect edges in image im, Examine the two images produced by canny and sebel filters. Submit to jgynb files one for each problem including images. If you submit files, then include images in a separate pof file for both programs Page 1 ot 1 359 words 80%
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
