ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Margin
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

izaque

Brazil
95 Posts

Posted - Jul 18 2012 :  05:13:18  Show Profile  Reply
Good morning!
Is there any way to detect where the characters start of a text in an image? The functionality of SkewDetection is to analyze and correct the angle. Would have similar functionality to get the margins before the text (Left, Right, Top, Bottom)?

fab

1310 Posts

Posted - Jul 18 2012 :  14:11:15  Show Profile  Reply
You should try AutoCrop method. It returns the text bounding rectangle (it doesn't crop the image if you set DoCrop optional parameter = false). Example:

var rect:TRect;
..
rect := ImageEnView.Proc.AutoCrop(10, clWhite, false);

Now you have top, left, right and bottom coordinates of what is not considered background.
Please take in mind the limitations of this method (ie noise could confuse the algorithm).
To remove isolated pixels you could try:

rect := ImageEnView.Proc.AutoCrop(10, clWhite, false);
ImageEnView1.Proc.RemoveIsolatedPixels(0, 4);
Go to Top of Page

izaque

Brazil
95 Posts

Posted - Jul 19 2012 :  14:01:49  Show Profile  Reply
Thank you very much!
It worked wonderfully!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: