Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

zones out of order
Started by grhind at 08-08-2008 16:29. Topic has 3 replies.

Print Search « Previous Thread Next Thread »
  08-08-2008, 16:29
grhind is not online. Last active: 10/6/2008 3:09:45 PM grhind

Top 50 Posts
Joined on 07-03-2008
Posts 46
zones out of order
Reply Quote
i'm using v15 and basing my code on example VBOcrDemo... when i add a zone to my raster image and then re-recognize and then save results as rtf
ie
resOptions.Format = RasterDocumentFormatType.Rtf

resOptions.FormatLevel = RasterDocumentFormatLevel.Full

rdeRasterDocumentEng.SaveResultOptions = resOptions

the zones i add manually (after the i've allowed it to find zones on its own) the text in those zones get added to the end of the document instead of the position they are on the page/image itself... what should i be looking for to fix this?
   Report 
  08-08-2008, 17:19
GregR is not online. Last active: 1/2/2009 9:03:27 AM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,816
Re: zones out of order
Reply Quote
This is normal behavior.  The FindZones method will initially have them "in order" because it searches for zones from top left to bottom right.  Zones are simply ordered in the order that they are added to the engine.

If you want to ensure that they are in a specific order, you will have to create a temporary copy of all your zones, remove the zones from the engine, and then add them back into the engine in the order you prefer.

Greg Ross
LEADTOOLS Technical Support
   Report 
  08-11-2008, 8:08
grhind is not online. Last active: 10/6/2008 3:09:45 PM grhind

Top 50 Posts
Joined on 07-03-2008
Posts 46
Re: zones out of order
Reply Quote
that being said then is there an easy way for me to search for zones from top left to bottom right and put them in that order?
   Report 
  08-11-2008, 9:47
GregR is not online. Last active: 1/2/2009 9:03:27 AM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,816
Re: zones out of order
Reply Quote
Unfortunately there is not.  You will have to loop through each zone and check its Rectangle and figure out their "correct" order that way.  I would suggest taking a look at different kinds of sorting algorithms and see what option might work best for you.  The link below is for general information, but I'd be surprised if you couldn't find code examples of these algorithms.

http://en.wikipedia.org/wiki/Sorting_algorithm

Greg Ross
LEADTOOLS Technical Support
   Report 
Post
LEAD Support Fo... » Developer » OCR » zones out of order

Powered by Community Server, by Telligent Systems