Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Polynomial fitting

19 views
Skip to first unread message

DHIKRA

unread,
Nov 2, 2012, 8:23:07 AM11/2/12
to
hello,
i have a problem with this code ,I'am looking for the équation of the polynomial that fits the curve on this image
I tried the fitting by figure window-tools-basic fiting but I didn't have any convincing result
could you please help me
[code]
clear;
clc;
I=imread('C:\Documents and Settings\Administrateur\Bureau\TT.bmp');

I=I(:,:,1)>160;
imshow(I)
I=bwmorph(~I,'thin','inf');
imshow(~I)
I = imresize(I, [199 199]);
imtool(I);

[N,N]=size(I);
iptsetpref('ImshowAxesVisible','on')
figure; imshow(I,[],'Xdata',[0:N-1],'Ydata',[0:N-1],'InitialMagnification','fit')
xlabel('x')
ylabel('y')
title('initial image');
colormap(gray), colorbar;
x=zeros(1,199*199);
inc=1;
y=x;
figure;
for l=1:199

for c=1:199

if (I(l,c)==1)
x(1,inc)=l;
y(1,inc)= c;
inc=inc+1;

end
end
end
imtool(x);
imtool(y);
hold on
plot(x,y,'.');
[/code]

dpb

unread,
Nov 2, 2012, 10:08:48 AM11/2/12
to
On 11/2/2012 7:23 AM, DHIKRA wrote:
> hello,
> i have a problem with this code ,I'am looking for the équation of the
> polynomial that fits the curve on this image I tried the fitting by
> figure window-tools-basic fiting but I didn't have any convincing result
> could you please help me [code]
> clear;
> clc;
> I=imread('C:\Documents and Settings\Administrateur\Bureau\TT.bmp');

Well, having no way to access your machine makes it a little hard to see
the figure... :)

...

But, in general, sometimes polynomials aren't much use in fitting if the
data isn't such that it is easily represented by such (at least not w/o
overfitting)...

--

DHIKRA

unread,
Nov 3, 2012, 6:38:08 AM11/3/12
to
dpb <no...@non.net> wrote in message <k70k5h$pr0$1...@speranza.aioe.org>...

DHIKRA

unread,
Nov 3, 2012, 6:41:08 AM11/3/12
to
dpb <no...@non.net> wrote in message <k70k5h$pr0$1...@speranza.aioe.org>...
> -- I can't load the image , I don't find a link to load my image on forum , can you help me
0 new messages