Interpolation of angular data spline or linear?

I have a binary image. in which i have different data points on different locations. I want to apply interpolation techniques between those points. can anyone help me how i can apply interpolation on angular data points . input image is attached.
3.jpg
The out put is something like the below image
out.JPG

4 件のコメント

John D'Errico
John D'Errico 2019 年 1 月 1 日
What is different form this question to the last one you asked with the same goals? Except of course that you must not have gotten an answer that you liked on the last one?
Alina tom
Alina tom 2019 年 1 月 1 日
Sir, i realized that i was not able to clearly define my problem last time that is why i have posted it again . I am extreamly sorry for posting it again but i think that asking question is always better for learning purposes . even i have asked the basic question or even stupid question but if i din't ask again and again how i can learn things.hope you don't mind it
John D'Errico
John D'Errico 2019 年 1 月 1 日
Then why not just clarify your last question? Your approach is to just keep asking the same question until you hope someone gives you an answer.
Alina tom
Alina tom 2019 年 1 月 1 日
Sir, I am extremely sorry for my mistake, you are absolutely right i just have to clarify the last posted question. Actually i was not able to apply interpolation as i want and it stucks my mind and i posted it again. I am extreamly sorry again

サインインしてコメントする。

 採用された回答

Akira Agata
Akira Agata 2019 年 1 月 2 日

1 投票

One possible solution would be looks like this. In addition, if you feel @Image Analyst's answer for your previous question useful, I (...and Image Analyst-san) would be happy if you could accept it.
% Load the image
I = imread('3.jpg');
% Binarize and apply ultimate erosion
BW = imbinarize(rgb2gray(I));
BW = imclearborder(BW);
BW = bwulterode(BW);
% Find (x,y) coordinates
[row,col] = find(BW);
% Arrange the coordinates to circular order
theta = atan2(row-mean(row),col-mean(col));
data = table(row,col,theta);
data = sortrows(data,'theta');
data = [data;data(1,:)];
data.theta(end) = data.theta(end)+2*pi;
% Apply spline interpolation
n = 1:height(data);
pp = spline(n,[data.col';data.row']);
xy = ppval(pp,linspace(1,height(data)));
% Visualize the result
figure
imshow(I)
hold on
scatter(col,row,'rx')
plot(xy(1,:),xy(2,:),'r-')
spline.png

1 件のコメント

Alina tom
Alina tom 2019 年 1 月 2 日
Thank you so much Sir for your solution.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by