T O P I C R E V I E W |
izaque |
Posted - Jul 18 2012 : 05:13:18 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)? |
2 L A T E S T R E P L I E S (Newest First) |
izaque |
Posted - Jul 19 2012 : 14:01:49 Thank you very much! It worked wonderfully! |
fab |
Posted - Jul 18 2012 : 14:11:15 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); |
|
|