Using tesseract plugin in ionic 3 project to get text from image - tesseract

I am getting wrong output, code run perfectly but don't know where is the problem

I believe the issue you are faced with is not related to only one point.
There could be problem with cropping: the characters appearing near to the borders may affect on the result.
There is a black line above the text which can also make troubles.
Also the blinking part of the text could become a trouble after preprocessing.
Here is a helpful link I would recommend to read for improving the OCR quality.
For example if your cases are always a single line text, then you can use -psm 7 to help Tesseract.

Related

Proper Scaling and Zooming into Window in QGIS

My attribute tables and icons are tiny in QGIS.
I believe this may be because I have a new high-res monitor.
Check out my screenshots - everything is super tiny. And in the attribute table, the row heights are not right.
Also - How do I zoom into the attribute table?? Normally this is ctrl-mouse wheel or ctrl+/-
Can't seem to find an answer to my question anywhere.
The answer is given by #Stu Smith here, with some clarifications that we worked out.
The detailed directions are here, written well for layman's, with step by step instructions and a nice video.
What's great is you can do this for any program you're having a problem with.
It's super easy, a 2-step 5 minute process. You have to add a file in the registry, and then in the Program Files folder, add another file.
Couple notes:
*For qgis specifically: where the following file is: qgis-bin.exe rename the file to add to the folder to qgis-bin.exe.manifest.
*When I chose decimal and reopen it, it shows that it's back to hexadecimal. This doesn't matter at all. An explanation is on the bottom here.
*The resolution will be lower, and things will look that way. In this case, not really a big deal, should affect your results, but not sure with programs where resolution matters, like Photoshop. Anyone give their experience or knowledge with that in the comments.

SKLabelNode creates black line and not showing text on iPhone4

I am loading different texts into a SKLabeNode it works fine on iPhone5, simulator, etc... but on iPhone4 I sometimes just get a black line, instead of the text.
It is weird that always the same texts are generating the failure, but I cannot figure out what is happening.
The code is:
ButtonText=#"";
ButtonLabel=[SKLabelNode labelNodeWithFontNamed:#"Marker Felt"];
ButtonLabel.fontSize=46;
ButtonLabel.text=ButtonText;
ButtonLabel.position=CGPointMake(0, 0);
ButtonLabel.verticalAlignmentMode=SKLabelVerticalAlignmentModeCenter;
ButtonLabel.horizontalAlignmentMode=SKLabelHorizontalAlignmentModeCenter;
ButtonLabel.colorBlendFactor=1.0f;
When I am changing the text, simply using the
ButtonLabel.text=NewString;
What can be the issue?
I have filed a bug report on this bug to Apple. After few weeks they replied and requested to check the issue with the updated IOS. It worked better and accepted longer texts. Later they fully solved the problem.

How can I use tesseract from command line to read inside an opened window?

I'm trying to use tesseract from command line to run OCR on the content of an opened window. In particular I'm willing to read the text typed into a current opened Notepad window.
I've read the documentation and the wiki here: http://code.google.com/p/tesseract-ocr/w/list
but I didn't find anything that helped me in this project, further more I've also searched here for similar questions ( there are many about OCR) but nothing seems to work/ be applicable in my case.
Is it feasible?
I'm mainly a PHP coder (coding just for fun) and have no experience in non-web languages.
Thanks in advance.
Tesseract is designed to take a TIFF image as input and know nothing about the Windows or screen Device Contexts. So you would need to add code to locate the windows handle for the Notepad window , perform a screen capture and clip the window based on the current window size reported by Windows and save the resulting image to a file. This image will most likely be black and white which will make it easier to OCR as I suspect Tesseract 2.0 only works with B/W Images. The next problem will be Tesseract gving poor results due to the low DPI (resolution) of the source image.
To evaluate the suitability of your approach I would perform some manual tests by opening Notepad, taking screenshots, opening the screenshots in MSPaint, clipping the text you want to OCR, save the clipped image to a TIFF or BMP and send this file to Tesseract. This could save you a lot of time and effort if the results are not as good as you need or expect.

IOS print pdf with minimal margins

This must be quite simple but I can't seem to figure this out.
I've managed to implement the code for printing an PDF from my App. Problem is, the PDF has quite some whitespace around it and with the default margins... it's just not how I would like the page to come out of the printer.
So, I'm trying to reduce the margins to minimum. How would I go about this? Do I need to use a custom UIPrintFormatter, UIPrintPageRenderer or UIPrintPaper. In which method from UIPrintInteractionControllerDelegate would I need to change things?
I know it can be done because when I print the PDF from Apple's iBook App, margines are significant less.
Thanks.
I did not quite solve the problem but I'm satisfied with the result now.
Actually I did not change anything, the reason why I asked this questing was because in the AirPrint simulator, my PDF printed with an excessive amount of white space / margin. But printing the PDF on an actual device did not have this problem.
So, if you run into this problem in the AirPrint simulator, try it on a real device/printer, changes are that everything prints fine.

Problem displaying font texture (SDL Xcode 4 project)

The below project of mine works fine with OpenGL on Windows and the Mac but will not work on the iPhone simulator or physical device.
The below link is to an Xcode 4 project containing the usual SDL examples plus an extra one called Rectangles2. I can't get my font characters to appear on the screen - I just keep getting a white rectangle.
Can somebody please have a look and tell me what is wrong with my project?
Please don't be critical of how its coded - I would just like to know what I'm missing to make it work.
Xcode Project
Thanks
I've just been told the problem was my parameter to the glTexImage2D function. The code I borrowed uses some literal values 3 and 4 whatever they are. Anyway, changing these to GL_RGBA has solved my problem.. so I'll have to go and read up on what this function actually does and how it works etc.