Matlab

Moderators: None (Apply to moderate this forum)
Number of threads: 1494
Number of posts: 2174

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Polynomial fitting Posted by DHIKRA on 1 Nov 2012 at 6:11 PM
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
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,'.');


the image is attached there
Attachment: TT.bmp (7654 Bytes | downloaded 15 times)



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.