![Homework #8 Applied Programming, ENGR 10573 Spring 2018 Due Monday, Apr. 2 uploaded through TCU Online by 11:59 PM. Upload one script or function, named studentlastn ame-homework 8 ) n a single m- file that runs each problem. The homework problems should run sequentially showing I figure and or plots along with the proof that each problem works correctly. The single m-file that you turn in is the code that will be graded. Open a new figure for every problem (not every image/plot) by using the figure command. Use of subplot (m, n, k) will help. g ae s 1. Open the standard image, cameraman.tif with the imread(. Filter and display the image with a vertical Sobel edge filter using the command, v imfilter (I,hl). Filter and display the image with a horizontat Sobel edge filter with the command, H -infilter(, h2). Display both images atong with the addition of the two Tnages.V+ 2. Open the standard image, cameraman.tif with the imread function. Filter the image with an embossing filter and display the image with the same 256-element gray colormap 3. Again, open the standard image, cameraman.tif with the imread() function. Filter the image with a sharpening 0 10: 1 5 -1: 0 1 0] filter and an edge filer t0 -1 0 1 4 1; 0 1 01. Display the images with the same 256-element gray colormap and comment on the differences. 4. Using the images from Problem #3, plot the histogram using the [n, v] hist (x,nbins) command for the same value of nbins. Plot the histograms in different colors on the same graph and display the results. 5. Again, open the standard image, cameraman.tif and display the image. Use the imnoise () command to add salt & pepper noise (sometimes called shot noise) to the image and display the result. Try and remove the added noise with a 3x3 averaging filter using AVG imfilter (I,h) and a 3x3 median filter, MED medfilt2() and display both results. State which one works better on ot the absolute convergence test. This is requiréd when the nay contain negative terms but we cannot (or do not want to) rnating series test.](http://img.homeworklib.com/questions/fa070d10-d53c-11ea-95fd-0f0dd54523fb.png?x-oss-process=image/resize,w_560)
Please solve problem 4 and 5 using matlab and include the screenshot of the result , thank you
Please find the required MATLAB code along with necessary details in comments:
clear all
close all
clc
img=imread('cameraman.tif'); % load the original image
%% Question 4
nbins = 50;
% since the resulting image from question 3 is not available, so I
just
% used a filterd image (obtained using given sharpening filter) for
histogram
% plotting. You can replace the this filterd image with the image
obatined in
% question 3 to obatin the correct histogram plot.
filter_val=[0 -1 0; 1 5 -1; 0 -1 0]; % sharpening filter
filtered_img=imfilter(img,filter_val); % filtered image
[n,x] = hist(double(img),nbins); % histogram for original
image
bar(x,n,'r'); % use bar for same colour histogram for the image
hold on
[n,x] = hist(double(filtered_img),nbins); % histogram for filtered
image
bar(x,n,'b'); % use bar for same colour histogram for the image
% hold on
% edge_sharp_img=imfilter(img,filter_val); % edge filtered
image
% [n,x] = hist(double(edge_sharp_img),nbins); % histogram for edge
sharpened image
% bar(x,n,'g'); % use bar for same colour histogram for the
image
%% QUESTION 5
noisy_img = imnoise(img,'salt & pepper'); % add salt pepper noise to image
h = ones(3,3)/9; % define 3*3 averaging filter
avg_img = imfilter(noisy_img,h); % filter the image
median_img=medfilt2(noisy_img); % obtain median filter image
% display all the images
figure;
subplot(2,2,1)
imshow(img); % display original image
title('Original Image');
subplot(2,2,2)
imshow(noisy_img); % display noisy image
title('Image with salt and pepper noise');
subplot(2,2,3)
imshow(avg_img); % display averging filter image
title('Image with average filter');
subplot(2,2,4)
imshow(median_img); % display median filtered image
title('Image with median filter');
--------------------------------- SCREENSHOT OF CODE


------------------------------------------ SAMPLE OUTPUT


Please solve problem 4 and 5 using matlab and include the screenshot of the result ,...
Image processing Matlab problem. Could you please help me to write a Matlab code to read images, equalize contrasts, covert images to grayscale and binary, then display on same windows. Then perform SOBEL and CANNY edge detection on images. Final make MATLAB to count the number of circles in images (circles and red circles) And how can we distinguish circles by color? and how to count number of red, green and blue circles separately for example.
the picture above is the one you are supposed to use for the
MATlab code please help
Problems. Grayscale images are composed of a 2D matrix of light intensities from O (Black) to 255 (White). In this lab you will be using grayscale images and do 2D-array operations along with loops and iflelse branches. 1. We can regard 2D grayscale images as 2D arrays. Now load the provided image of scientists at the Solvay Conference in 1927 using the imread)...
Problem 3 In this problem you add some random noise to the sine function and then calculate the derivative. • First, generate a vector (the same length as x, above) which consists of random numbers in the range (-0.02) to (0.02). Use the MATLAB function rand. rand will return a random number between 0 and 1. For this problem, you actually need random numbers between +/- 0.02. How will you convert the random numbers you obtain from rand to be...
Matlab Matlab Matlab Matlab, Please solve this problem
Problem 4 : Runge's phenomenon For this proble, you wil interpolate the function h(x) = tanh(10x) in I [a, b, through n datapoints (xi, hx with equidistant nodes for several values of n, and observe the behavior of the interpolating polynomial as n increases. You should use the pair of functions polyfit and polyval In your prob40: (a) Interpolate the function tanh(10x) in [-1,1] using a uniform grid of n nodes, where...
could you please solve this problem using
Matlab
4. Using the Fourier series coefficients {ak} obtained, construct the following signal N(t)>akekwot k=-N where ak is the kth Fourier series coefficients of r(t). Therefore, N(t) is the so-called 2N-term approximation of original signal r(t). In one figure, plot âN(t) versus t, for N 10, 20, 30, 40. In the same plot, also plot original signal (t). Visually compare N(t) and r(t) in the figure and comment on your observations
consider the signal using matlab
Problem 2: Consider a signal: x[n] 3cos(n7/3) + 2sin(nt/4)+ cos(n7/5) Using Matlab, (1) Plot this signal in time domain. Can you identify the various frequencies in this signal? Use n 0:1:1000 (2) Plot this signal in frequency domain using the "fft" command. Identify the individual frequencies in the plot. (3) Calculate the frequencies of these signals. In the frequency plot, 1000 2
Please solve these using matlab
Problem 1 Given the transfer functions e S +5 (a) C(s) 20 S + 20 (b) Use the step function to determine the time constant and rise time for each system. Note: estimate these values from the plot and do not use the stepinfo function. Problem 2 Given the transfer function 100 G(S) = 22 +45 + 25 a. Use the plot resulting from the step function in MATLAB to determine the percent overshoot, settling...
please Dont solve problem 5 , solve problem 6 using vector
loop
Problem # 5. Referring to the linkage configuration and terminology shown in the Figure below, draw the linkage to scale and graphically find all possible solutions for 0 and 04 for the values in a and b. Determine the Grashof condition. Link 1 Link 2 Link 3 Link 4 6 2 7 9 30 20 10 10 10 50 AY Open F 84 X Crossed Problem #6: Repeat...
Please solve using MATLAB. Will rate
Problem 4; Applications of functions in numerical computations The probability of occurrence based on a normalized Gaussian distribution requires the evaluation of the following integral with the aid of the built-in function integral, plot the above function o the domain 0szs5. Plot on the same graph the above function by evaluating the integral using the RightRiemannSum function. Critical thinking: For this problem, it might be easier to use the plot function than the fplot...
please write code in MATLAB as well
5. (12 points) Create the following signal in Matlab: x[n] = u(n) - u[n-6] a. Mathematically compute yi[n] = x[n] * x[n] where * means convolution. Now use the conv command to perform the convolution. Graph x[n) and the resulting y(n), both over the interval Osns 20. How many non-zero terms does y(n) have? Does your computational result agree with the Matlab result? b. Repeat a. but this time with yz[n] = x[n]*h[n)...