I want to do text detection in image using java. I am using OpenIMAJ to do that using MSER algorithm (as the first stage), but it takes a lot of processing time and in most images the exception OutOfMemoryError is returned.
I tried to change the parameters, and also change the algorithm source code, but the problem still there.
When I did MSER algorithm using Matlab it was fast and no OutOfMemoryError.
This is my code:
MSERFeatureGenerator mser = new MSERFeatureGenerator(delta, maxArea, minArea, maxVariation, minDiversity, PixelsFeature.class);
List<Component> up_regions = mser.generateMSERs(flattenImg, MSERDirection.Up);
The error actually occurs when I call the following method:
List<MergeTreeBuilder> mergeTrees = mser.performWatershed(Transforms.calculateIntensityNTSC(img));
Example of image with no problem:
Example2 of image that make OutOfMemoryError:
please help.