programmatically take screenshot, crop section, and run OCR tools. quick solutions? - windows

I will be writing code that takes a screenshot, crops to a small section of the screen (predefined area of screen), and then extracts the text from that cropped image (via OCR tools), and then saves the resulting text to a file. I was wondering if there is software (preferably for Windows) that can do this, or at least parts of it. I am already looking into tesseract as an OCR tool. Anyone know of software that can take the screenshot, and possibly crop a predefined region of the image.
Thanks,
-Jason

I use Greenshot, which is a very awesome tool for screenshots and according to the FAQ it supports OCR (using MODI = Microsoft Office Document Imaging) as well. However, I never got it working on my Windows machine and used Tesseract instead (for Linux, with some scripting experience, this method should be possible as well):
Download Tesseract here for Ubuntu/Debian/Windows and install it.
Download and install Greenshot
Create a new windows batch script called "Greenshot_Tesseract_OCR.bat" using a text editor like notepad or Notepad++ - and save it at a location of your choice, e.g. "C:\Users\MyUser\Scripts\Greenshot_Tesseract_OCR.bat" - with the following content (depending on the installation location of tesseract):
ECHO OFF
set arg1=%1
"C:\Program Files\Tesseract-OCR\tesseract.exe" "%arg1%" "%arg1%"
type "%arg1%.txt" | clip
Right-click the Greenshot icon in the toolbar and click "configure external command"
Add a new command with a name like "Tesseract OCR to Clipboard", select the batch script you just created as a command and as argument, use the default "{0}". Then click OK twice.
You should now be able to copy the text of a screenshot into your clipboard, with a shortcut ("Print" key in my case) and 1-2 mouse clicks (depending on your Greenshot settings)!

You can try the following open-source programs:
Greenshot for screenshots and VietOCR (a GUI frontend for Tesseract) for OCR on screenshots.

Related

macOS: How to access the Live Text OCR functionality from AppleScript/JXA?

As of macOS Monterey it is possible to select text in images in Preview.
Is this OCR functionality available from AppleScript and/or JXA (JavaScript for Automation)?
In Script Editor.app File > Open dictionary... I selected the Preview.app and looked at the API for Standard Suite and Text Suite but there doesn't seem to be anything related to OCR. (The Text Suite apparently has to do with drawing text on picture and not text extraction.)
I have also searched for text recognition actions in Automator.app but didn't see anything suitable.
There isn’t (yet?) a way to directly access OCR from AppleScript, but the workaround that I’m using is to use OwlOCR. This is an app that can capture text from the screen and output it to PDF, or plant text to the clipboard. Crucially for our purposes, it can also be controlled from the command line, and you can wrap those shell commands in an AppleScript “do shell script” command.

Is there a way I can edit or rewrite default Matlab Apps?

Is there a way I can edit or rewrite default Matlab Apps such as "Image Viewer?"
Matlab R2016b
The Image Viewer App is called from the command line as imtool. You can open this file in the Editor using edit like so:
edit imtool
or you can find its location with which and open it in whatever other editor you like:
>> which imtool
C:\Program Files\MATLAB\R2016b\toolbox\images\imuitools\imtool.m
If you really want to modify it, I suggest making a copy of your own and renaming it, leaving the built-in one unchanged and still available.
For other apps, if you go to the "APPS" tab and pull down the menu it will list all the built-in ones available:
Notice that hovering over an app will give a brief description with an associated function name in parentheses. For example, the Video Viewer App can be called with the function implay.

Microsoft Windows7 show thumbnails conflicting with open with a default program

I wrote a windows shell extension to show 3D files' thumbnail image, so user can search quickly. It works when users don't change default open program. However, if a user right click on a 3D file, then select open with to change default open program. It will block explorer to call my shell extension. Does anyone could help me with this?

how to check windows icon file for image quality

I have recently used an icon file received from our marketing team. The icon file when opened in resource editor (Visual Studio 2008) looks like this.
The same file when opened-and-saved in IcoFX appears correctly in resource editor.
My marketing team uses some tools (Picture2Icon ) in Mac and produces the icon file which appears to be corrupt or not fully correct. The same file saved by IcoFx seems to be correct. What is causing the ICOFX out to be correct?
The result is the exe shows bad icons. The exact case where the image is bad is not clear- It is reported in case where color quality is set to be 'medium' (windows XP). It is worse when executable is "selected" in windows explorer.
Here is one icon that shows problem: https://github.com/jayanmn/icontest/blob/master/icontest.ico
Full sample code to create exe is at https://github.com/jayanmn/icontest/
So question is given an ico file, how can I ensure that it works fine on WindowsXP, Windows Vista and Windows7?
I took a good look at your icontest.ico file provided from the GitHub website and discovered that the solution is an easy fix.
First, let me illustrate the problem as I see it on a Windows XP 32bit System using the freeware IrfanView software which is an excellent image viewer for this task.
Here is a composite shot I made illustrating the error for 5 of 6 layers as seen using IrfanView:
To fix the above icontest.ico file, one would think frames 1,2,3,4 and 6 are bad. But the opposite is true! It turns out that frame 5 is the culprit!.
Specifically, frame 5 has compression set on this frame which is causing the issue.
The actual fix that's required is to merely re-save the icontest.ico file without compressing that layer. For this task, the freeware GIMP application which is an excellent image editor is perfect for this task.
Just re-save the icon file with GIMP but remove the compression for the 5th layer as shown below:
The final result is a properly rendered icontestResaved.ico as seen in IrfanView (Tip: To view frames of an icon file in IrfanView, use the Red Arrows that's next to the frame number, i.e. 1/6):
The best way to ensure that the file works in different Windows Operating System's is to actually have a machine available, as the rendering engine is unique and emulators might not work as intended.
For the curious: Setting all layers to be compressed in GIMP resulted in a icon that was not viewable in Windows Explorer.
Tip: To view the reference images above at original size, right mouse-click and choose View Image.
Status Update: Consider installing Axialis IconWorkshop™ Lite Version 6.3.1.1 to handle all your icon development workflow needs. It's a free Visual Studio 2008 Plugin provided by Axialis themselves!

Tool for capturing screenshots in TFS2010 Web Access

I need a tool to capture and attach screenshots in TFS team web access. Instead of having some thrid party tool that captures and saves images on disk and then you have to attach that image to a bug like bugshooting. I want something integrated within TFS.
In VS11 it is possible to copy and paste your screen shots in the description field of the work item. You can check out the VS11 Beta version yourself.
There's nothing integrated in VS, but there are a couple of easy options:
use the standard Windows screenshot function. Alt-PrtScrn will capture the current window, and then you can paste into your work item's Attachments pane. It'll create a generic filename and attach as a PNG.
if you're using Win7, try the "Snipping tool" (just press Start and type "snip" to find it). That will capture a specified area and can then copy it to the clipboard or save to a file. If you copy & paste you still have the problem of generic filenames, though, so personally I still tend to save it myself.
As #Hofman said, you can do it with VS 11 beta, so you can use MS Paint or even SnagIt, for how to do it just see the following link:
http://mohamedradwan.wordpress.com/2012/02/29/new-enhancement-in-mtm-11-preview/
You may want to check the Capture Custom Control - you can use it to embed a "Capture" button in your work items. It automatically attaches the screenshot to your work item.
Check it out at http://witcustomcontrols.codeplex.com/wikipage?title=Screenshot%20controls&ProjectName=witcustomcontrols
there are a very powerful tool which comes with Windows Server 2008 (Actually I'm not sure if it comes with windows 8 or 7)
never-mine.., the tool called "Record Steps To Reproduce the Problems" , this tool built for Taking screenshots of doing any thing in your machine step by step... WOW
You just need to open the start panel and then write "record steps to reproduce a problem". starting record, and make you job that you want, then when you finish stop recording and save the zip file in your machine.
the zip file will expose a word document contains every single click that you make and every page you've open with some description.

Resources