I am using tesseract open source engine for OCR to read text from image.
But I didn't get 100% result for a single time. Please give your suggestions about quality improvement for OCR using tesseract.
Thanks
here is how to get best result from tesseract
Please make sure that you have done preprocessing on image. OVR will produce best results for the images which have following properties:
fix DPI (if needed) 300 DPI is minimum
fix text size (e.g. 12 pt should be ok)
try to fix text lines (deskew and dewarp text)
try to fix illumination of image (e.g. no dark part of image
binarize and de-noise image
https://groups.google.com/forum/?fromgroups=#!topic/tesseract-ocr/g5aE_OvgyTU
Related
I am trying to convert a high resolution image (30in width x 60in height) to a pdf file in MATLAB. I tried print, exportgraphics, and couple scripts online but I keep getting low quality output. I also tried setting the resolution to 300dpi but it didnt work. Please if you have any suggestions, share with me and I will test. Many thanks!
Image file used (renamed to map.png): https://upload.wikimedia.org/wikipedia/commons/thumb/d/de/Political_map_of_the_World_%28January_2015%29.svg/9444px-Political_map_of_the_World_%28January_2015%29.svg.png
MATLAB commands used:
world=imread('map.png');
imshow(world)
exportgraphics(gcf,'world.pdf','ContentType','vector','Resolution',300)
#Texts in picture is blurry
print -dpdf 'world.pdf'
#Texts in picture is still blurry
exportfig(gcf, 'world.pdf', 'format','pdf','Resolution', 300,'Renderer', 'painters');
#this is a script from the MATLAB file exchange. Texts still blurry
I managed to do it by importing pdfbox (java) and importing the image as a bufferedimage then creating a document with pdmodel.PDDocument then adding a page with a custom size using the bufferedimage.getWidth and same for length then I streamed the bufferedimage to the page and saved the document to a pdf file. The code is on my work PC if anyone is interested I will copy it here.
I have a PDF of building schematics. I would like to load it into MATLAB, and visualize the image via a GUI, so I can measure distances and such for some calculations.
I have no idea if this is even possible?
Furthermore, the PDF has an embedded scale (i.e. 1 cm = 1 meter). If I can extract this as well, that would be awesome.
I found extractFileText which can be used to extract text, but not much else.
I found the easiest way to do this was to convert the pdf to a image, for example using imagemagick. See this question
If you add an example of the image someone might be able to suggest some ideas for extracting the scale information using image processing.
I am doing brain tumor segmentation with the BTATS2013. I have gotten the test result with the testing dataset of BRATS 2013 which don't have ground truth, so I can't get the Dice, PPV, Sensitivity directly. I want to use the online platform to evaluate the segmentations, it requires the filetype of input is .mha, but the filetype of segmentations that I get is .png. I don't know how to convert the .png to .mha. Is there anyone can help me to solve the problem, or can you give me some advice of getting the indicators of segmentation? Thanks.
Load your data in 3DSlicer,
You can load Png files there.
Then store it in mha format:
So I have this png image here
and when I try to read it with tesseract on the command line, I get some random character
❯ tesseract Selection_002.png stdout --psm 7
Warning. Invalid resolution 0 dpi. Using 70 instead.
ale PR Me)
I'm running tesseract version 4.0.0-beta.1-370-g8b64 on ubuntu.
I would have guessed that this image would be easy to read for tesseract?
I've gone through trying to resize the image and "cleaning" it up but there's no much noise to clean on that. What Am I doing wrong?
Please try inverting the image color. (Black text on white).
I tried with your image as well as inverting the color. Both gave successful results.
I'm trying to convert simple image with numbers to text using https://github.com/tesseract-ocr/tesseract. I compiled latest version from github with Leptonica and other libs required for image process.
My image looks like this:
I'm trying to convert it like this: /usr/local/bin/tesseract '/home/var/img2text/phone.png' out but instead of numbers something like 3m mam. what could be the problem?
The image is small and the quality of it is a little low, try the following:
1- Change its DPI to 300
2- Resize the image 2x and apply Resample interpolation.
3- Make sure it is a B/W image.
Here are some useful links:
https://code.google.com/p/tesseract-ocr/wiki/ImproveQuality
image processing to improve tesseract OCR accuracy