Thread Subject: Angle between Pixels of an image

Subject: Angle between Pixels of an image

From: zaheer ahmad

Date: 3 May, 2008 16:07:03

Message: 1 of 1


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.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
ocr zaheer ahmad 3 May, 2008 12:10:09
character recog... zaheer ahmad 3 May, 2008 12:10:09
angle zaheer ahmad 3 May, 2008 12:10:09
pixels zaheer ahmad 3 May, 2008 12:10:09
image pixels zaheer ahmad 3 May, 2008 12:10:08
angle between p... zaheer ahmad 3 May, 2008 12:10:08
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com