MATLAB QUESTION
Implement Least squares fitting for linear line detection in MATLAB. Using Any input image, After detection you need to plot output line on the input image used (you can use MATLAB functions for this purpose)
Hint: find an appropriate input image and apply edge detection first. Then use MATLAB edge detector function and Implement Sobel edge detector.
Write a report about it (written codes need to be included as a text as well).
Solution:
A series of numbers are taken in 1D matrix x and corresponding functions in matrix y. They are plotted .Then the least square fitting method are used to find a approximate plot for the series based on the values of x,y matrices .The fitted curve is plotted which approximately follows the x,y matrix values.
%%------------------ MATLAB CODE ----------------------%%
%least square regression
x=[2 5 6 8 9 13 15];
y=[7 8 10 11 12 14 15];
plot(x,y,'k*')
xlabel('x');ylabel('y')
title('data points')
grid on
hold on
%% p=polyfit(X_R,Y_R,1)
Y_R=y';
X_R=x';
H=[];
%N=5 is used for best fit
N=5;
for idx=0:N
H=[H,X_R.^idx];
end
Astar=inv(H' *H)*H'*Y_R;
Ytilde=H*Astar;
R=sum((Y_R-Ytilde).^2);
plot(X_R,Ytilde,'r-','LineWidth',2)
%%------------------------ END
-------------------------------%%
plot:
N.B: Please copy the code and save it in a mfile and simulate using MATLAB tool to have the best result.
MATLAB QUESTION Implement Least squares fitting for linear line detection in MATLAB. Using Any input image,...
MATLAB THEORY QUESTION Write a detailed report about Edge detection, then sobel edge detector in Least squares fitting for linear line detection, explaining the MATLAB Functions to used.
1. What is Least squares fitting for linear line detection? 2. What is Edge Detection in Least squares fitting for linear line detection? 3. What is Sobel Edge Detection in Least squares fitting for linear line detection?
Hello, I need help with the following question in MATLAB for digital image processing, thank you for your help in advance Convolution operations using mask are commonly applied in image enhancement. Even edge detection is based on convolution with a specially designed mask. The assignment here is to write your own function for convolution and test it in edge detection. 1. Write a function in Matlab as follows: function Img2 Convolution(Img, mask); %Input: Img is the original image data matrix,...
Write a function in Matlab (or Java) as follows: function Img2=Convolution(Img, mask); %Input: Img is the original image data matrix, mask is square matrix, could be 2x2, 3 x 3 or size %Output: Img2 is the result image Test the function. Read an image file, apply the edge detection filters (i.e., masks) to see whether it works well. Try at least 3 filters: Sobel, Robert, Prewitt.
in MATLAB Curve fitting Given the following data, find the best linear functional relationship and cubic functional relationship using “polyfit,” “polyval,” and “plot” built-in functions. Plot all three fits that you got from Matlab. A rough plot by hand is allowable. You do not need to provide any codes. x = [-3, -2, 0, 1, 3, 4, 6, 7, 8, 9]; y = [5, 7, 8, 10, 6, 2, -4, -6, -2, 1];
Given the data points (xi , yi), with xi 0 1.2 2.3 3.5 4 yi 3.5 1.3 -0.7 0.5 2.7 find and plot (using MATLAB) the least-squares basis functions and the resulting least-squares fitting functions together with the given data points for the case of a) a linear monomial basis p(x)= {1 x}T . b) a quadratic monomial basis p(x)= {1 x x2}T . c) a trigonometric basis p(x)= {1 cosx sinx}T Moreover, determine the coefficients a by the Moore-Penrose...
c++ solve each task please O https//maryash.github.io/135/labs/lab 08 html Since the program should work for all input images that fit into the array, don't Thard-code" the cat picture dimensions into the program, use variables w and h instead Task D. One-pixethick frame Program frame.cpp Same as the previous task, but it should be a frame exactly one pixel thick Example: Task E. Scale 200% Program scale.cpp Scale the original picture to 200% of its size. It can be done by...
Using Matlab, only need part b to be done thank you. 1. Below you will find a table with hours of life of a cupper plate used in an industrial process. They are 45 data samples (they are just an array, but in this document, they are presented in three columns to save space) 63 59 75 78 70 64 75 93 90 70 98 92 85 90 83 95 89 92 92 90 82 81 89 80 79 46...
C ++ Implement cat command The purpose of this assignment is to provide practice using the system calls we discussed for working with files on a UNIX system. You will be writing a basic implementation of the cat command using C++. Description As you should recall, the cat command takes a list of files as command line arguments. It then opens each file in turn, writing each file’s entire contents to standard output in the order they were supplied. You...
//I NEED THE PROGRAM IN C LANGUAGE!// QUESTION: I need you to write a program which manipulates text from an input file using the string library. Your program will accept command line arguments for the input and output file names as well as a list of blacklisted words. There are two major features in this programming: 1. Given an input file with text and a list of words, find and replace every use of these blacklisted words with the string...