Path: news.mathworks.com!not-for-mail
From: "zaheer ahmad" <ahmad.zaheer@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Angle between Pixels of an image
Date: Sat, 3 May 2008 16:08:02 +0000 (UTC)
Organization: IMS
Lines: 48
Message-ID: <fvi2l2$21r$1@fred.mathworks.com>
Reply-To: "zaheer ahmad" <ahmad.zaheer@yahoo.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1209830882 2107 172.30.248.38 (3 May 2008 16:08:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 3 May 2008 16:08:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 706613
Xref: news.mathworks.com comp.soft-sys.matlab:466428




I am working on Cursive ( Urdu/Arabic )Optical character
Recognition (OCR )System. i need to find out the flow of
pixels or angle between pixels (i.e. angle between pixel1
and pixel5)
is it possible using any existing filters in matlab. if yes
which filter and where to find help regarding the filter.
the image is of binary type.
Presently i am scanning the image for black pixels, storing
the pixels location then using ' atan2 ' find the angle.
the complete code is as below:

clear
clc
Img=im2bw(imread('SingleWord.bmp'));
imshow(Img);hold on; axis manual;
[Ymax, Xmax] = size(Img);

points=[22,22];
xx=0;yy=0;
for y=Ymax:-1:1
for x=Xmax:-1:1
   
    if Img(y,x)==0
         plot(x,y,'Color','r','LineWidth', 0.5,'Marker','.');
         xx=xx+1;
         yy=yy+1;
         
         points(xx,yy)=x;
         points(xx+1,yy)=y;
          
         break;
    end
end
end


for i=1:25
    for j=1:25
       
PA=atan2((points(i,j+1)-points(i+1,j+1)),((points(i,j+1)-points(i,j))))
    end
end

It gives me a list of angles as expected but with errors.
the code is given here for explaining my aim and  to make it
sure you follow me.
thanks in advance.