You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
newton divided difference interpolation
2 views (last 30 days)
Show older comments
i have dicom image and converted into jpg now i want to apply newton divided difference interpolation. please anyone suggest the answer.
13 Comments
image-pro
on 12 Apr 2022
Edited: image-pro
on 12 Apr 2022
i have read an image using imread and apply segmentation method for detection of disease, now i want to use newton divided difference interpolation method on segmented image to find the tumor region. using newton divided interpolation to estimate value i have to specify X and Y coordinates to estimate missing value of Y. Now, my question is that how i can use image pixel values in place of X And Y coordinates. i have to pick image pixel value in place of x and y coordinates and calculate missing value using newton divided difference interpolation method.
This is my code. plz solve my problem. Thanks in advance.
%READ AN INPUT IMAGE
IMG=imread('C:\Users\DELL\OneDrive\Documents\MRI-images\Folder1\image-1.jpg');
%IMG = ind2rgb(IMG.X, IMG.map);
X=1:256;
Y=1:256;
[Dx, Dy] = meshgrid(X, Y);
x=Dx;
y=Dy;
size=length(x);
d=zeros(size,size);
xlength=length(x);
DDlim=length(x)-1;
D=zeros(xlength,xlength);
D(:,:,1)=y;
for i=1:DDlim
for j=1:i
D(i+1,j+1)=(D(i+1,j)-D(i,j))/(x(i+1)-x(i-j+1));
end
end
a=diag(D)
Rik
on 12 Apr 2022
A flag is meant to attract the attention of a site admin. Not to label a comment.
Also, you have read either page I linked to, as evident from the lack of formatting in your comment. Since you didn't bother reading my advice, why should I bother reading your comment to try to help you?
Sam Chak
on 12 Apr 2022
Click IMAGE buttion to insert your image. We cannot access the sample image in your OneDrive.
C:\Users\DELL\OneDrive\Documents\MRI-images\Folder1\image-1.jpg
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/961655/image.png)
Click SIGMA button to insert formula of the Newton's divided differences interpolation polynomial. Not everyone knows the math.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/961660/image.png)
Click the CODE button to insert your attempted MATLAB code in the proper format.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/961665/image.png)
image-pro
on 12 Apr 2022
Edited: image-pro
on 12 Apr 2022
%READ AN INPUT IMAGE
IMG=imread('C:\Users\DELL\OneDrive\Documents\MRI-images\Folder1\image-1.jpg');
%IMG = ind2rgb(IMG.X, IMG.map);
X=1:256;
Y=1:256;
[Dx, Dy] = meshgrid(X, Y);
x=Dx;
y=Dy;
size=length(x);
d=zeros(size,size);
xlength=length(x);
DDlim=length(x)-1;
D=zeros(xlength,xlength);
D(:,:,1)=y;
for i=1:DDlim
for j=1:i
D(i+1,j+1)=(D(i+1,j)-D(i,j))/(x(i+1)-x(i-j+1));
end
end
a=diag(D);
expr = poly2sym(a) ;% This create polynomial from the coefficient matrix
fpe = fplot(expr);
title(fpe.DisplayName)
hold on
plot(x,y,'*')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/961670/image.png)
I have to apply below formula on above image. The below given formula is of newton divided difference interpolation.
Suppose f(x0), f(x1), f(x2)………f(xn) be the (n+1) values of the function y=f(x) corresponding to the arguments x=x0, x1, x2…xn, where interval differences are not same
Then the first divided difference is given by
The second divided difference is given by
and so on…
Divided differences are symmetric with respect to the arguments i.e independent of the order of arguments.
so,
f[x0, x1]=f[x1, x0]
f[x0, x1, x2]=f[x2, x1, x0]=f[x1, x2, x0]
By using first divided difference, second divided difference as so on .
Sam Chak
on 12 Apr 2022
Edited: Sam Chak
on 12 Apr 2022
Edit and Move the image, code, and formula from the COMMENT to your original QUESTION above will increase the chances of all MATLAB experts to directly view the problem and attract their interest.
Jan
on 5 May 2022
Edited: Jan
on 5 May 2022
Please, @image-pro, provide the names of the author or even better the DOI: https://doi.org/10.1109/ICIP.2010.5652041 . Do not let the readers search your paper.
Answers (0)
See Also
Categories
Find more on Geometric Transformation and Image Registration in Help Center and File Exchange
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)