Hi, How to tell Engine to delete white, blank spaces on scanned page? Or create image for objects located in center of scanned page?
asked 31 May '16, 14:48
There is “CropImage” Method of ImageDocument Object that finds the edges of a document on the image and then crops the image. For more detailed information see “Help → API Reference → Image-Related Objects → ImageDocument”.
Pay attention, that this method works more correct when all four edges of document can be found i.e. the document is completely surrounded by background. In other cases you can crop it manually with “Modify” Method of the ImageDocument Object. This method modifies ImageDocument according to transmitted ImageModification Object. You should add the region that should be clipped into ImageModification through “AddClipRegion” Method.
Hi, tell me what in what step of processing document, this should be done? I mean, it should be working like this?:
1. frDocument.AddImageFile('page', nil, nil );
If yes, how can i check what goes wrong if my image is not auto-crop?
Image cropping is useful when the image has already been loaded but hasn’t been processed. This code is technically correct (except missed brackets at the end of the second line) but it is doing quite a strange thing.
1) It adds an image, for instance ‘test.png’, to existing FRDocument object.
2) Then it crops the image inside of FRDocument object.
3) After that it processes the FRDocument object.
4) And finally it saves FRDocument object with a name of image (in our case ‘test.png’). But the file is saved in the internal format of FineReader Engine, which can’t be read by any image viewer.
As I mentioned before autocrop works better when all 4 edges of document can be clearly seen. If application doesn’t crop your image, try another image with perfectly shaped edges. If the latter image is processed correctly, then the issue is in borders of the first document. Otherwise most probably the cause is in Autocrop function application.