Processing taking too much time, memory exceeded issues occurs on documents with a lot of black dots or additional noises that can be considered as black dots.
This issue is caused by the fact that the engine tries to process each black dot separately.
You can use RemoveGarbage Method to clean the image before extraction.
As an argument, it will take the region in which the garbage will be removed and the second variable will be the area of black dots(in pixels) to consider it as garbage.
In addition to that, allow us to mention the perils of using this method.
The most important is the second variable by default it will be -1 which will allow the Engine to automatically calculate the garbage size, we can adjust it to the desired amount according to image quality and purposes. But be aware that specifying it too large may result in removing not only garbage but text as well. As presented on the screenshot below:
In case when sample image contains a zone with large noise (like in the screenshot) it will be much more effective to use OnCropImages Method to specify the processed region.