Skip to content
Step by Step Internet 馃寪 Guides for learning to surf the Net

How to convert your notes and notes on paper to digital format with Google Vision? Step by step guide

Over time, it has become a very common activity digitize documents or writings who are previously in physical form. A clear example of this are the notes or notes that you have on paper.

Do you know how to digitize your documents or writings?. Really many people are unaware about the subject, but the good news is that there are tools such as Google vision that allow you to do it easily. In this way, you will have at hand all the information you need in digital format.

In this post we will talk to you in depth about How to convert your notes and notes on paper to digital format with Google Vision?, through a helpful step-by-step guide. In addition, we will explain what it is for.

What is Google Vision and what is this tool from the Internet giant for?

Google vision is a image recognition system ideal for all developers who want to automate content analysis of a large number of images. This tool has the ability to detect each of the elements present in the photographs, apart from knowing everything about all those that are in Google Photos.

The Google Cloud Vision API provides users with different machine learning models by which images are tagged and quickly classified into a large number of pre-defined categories. In consecuense, it can detect objects and faces, as well as read printed and handwritten text.

When it comes to converting notes and notes to digital format, working with Google Vision is an excellent idea because it allows you to extract the text present in images in order to digitize it, without having to do it manually. In this sense, you can use it to extract text from images and also to detect and extract handwriting from images. If you want to learn how to do it, you have to keep reading.

Learn step by step how to convert your notes and notes on paper to digital format with Google Vision

The procedure to convert your notes and notes on paper to digital format It is a bit long and may seem complicated at first. But once you are familiar with how it works, you can get the most out of this tool.

Let’s see below:

Sign up for Google Cloud

Sign up for Google Cloud

The first step to enjoy any Google service is be registered. In this case, you must create your Google Cloud account In the following link “https://cloud.google.com “ and, subsequently, enter “Get started for free.” The next step to take is sign in with your Google account, that is to say, in your Gmail account. Choose the country and accept the terms of service.

Then set up your account with customer information, which includes:

  • Account type (commercial or individual).
  • Name and direction.
  • Payment method (Credit or debit card).

When you enter Google cloud, you must select in the option “Create new project”. Once you do, it’s time to activate the Google Vision API for your project.

Enable the Google Vision API

Enable the Google Vision API

For enable the Google Vision API, click on the menu located in the upper left from the screen. There a list with the services it provides is displayed Google cloud. You must go down in said list until you find the Vision option. Likewise, we recommend that you follow the link: “https://console.cloud.google.com/apis/api/vision.googleapis.com/overview” to enable the API corresponding to Google Vision. Later, click on “Enable API”.

When you have done that, you must proceed with the authentication, the procedure to follow is:

  • Go to menu top left.
  • In IAM & Admin, click on “Service accounts”.
  • click in “Create service account”.
  • Fill in at least the required field of “Name of the service account”.

In the option of “Name of the service account” write the name you want for your project.

Create a key for credentials

Once the previous section is configured, it is time to create private key for credentials that are requested of you. To achieve this, you must go to the list of service accounts (go to IAM and Admin / Service Accounts). In there, create the key you want. Then you must download the key as JSON.

Now it’s time to set the environment variable GOOGLE_APPLICATION_CREDENTIALS in the file path JSON containing the key to your service account. Keep in mind that this variable only applies to the current shell session. This means that if you open a new session, you have to reconfigure the variable.

So, the way to do it is the following:

  • On Linux or macOS: replaces PATH by the path of the JSON file that has the service account key. For example (export GOOGLE_APPLICATION_CREDENTIALS = »/ home / user / Downloads / service-account-file.json»).
  • On Windows: you have to replace PATH by file path JSON containing the key to your service account. For example with PowerShell ($ env: GOOGLE_APPLICATION_CREDENTIALS = »C: Users username Downloads my-key.json»).

Google Cloud SDK Installation

Google Cloud SDK Installation

He Google Cloud SDK is nothing more than a set of tools you can use to manage the resources hosted on Google Cloud and applications. All of this includes the command line tools from gcloud, gsutil and bq. It should be noted that the gcloud command line tool is downloaded along with the SDK of Cloud.

The installation instructions depend on the computer from which you are entering:

  • Download the Cloud SDK Installer. Similarly, you can open a terminal PowerShell and run the following commands:
  • (New-Object Net.WebClient) .DownloadFile (“https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe”, “$ env: Temp GoogleCloudSDKInstaller.exe”)
    & $ env: Temp GoogleCloudSDKInstaller.exe
  • Launch the installer and follow all the instructions. One thing you should know is that the Cloud SDK requires Python.
  • The versions that are compatible are: 3.5 to 3.7, and 2.7.9 or later.
  • Then all the dependencies that are necessary will be installed, including the version of Python correspondent. While it is true that currently the SDK of Cloud uses Python 3 By default, you can uncheck the option “Install the Python package” to use an existing installation.
  • When the installation is complete, it is time to accept the options for Launch the Cloud Shell SDK and of Run gcloud init. Then the installer will launch a window from the window and run the command “gcloud init”.
  • Finally, the default installation does not include App Engine extensions necessary to be able to implement an app with the gcloud commands. These components can be installed with the component manager of the SDK of Cloud.

Write the actual code

Write the actual code

  • The next step is write real code. But, before doing so, you have to install Node.js “Https://nodejs.org/en/download”.
  • Then you must create a folder:
  • mkdir googlevision
    cd googlevision /
    npm init –yes
  • Import the Google Vision library: npm install @ google-cloud / vision.
  • Create the Node application entry point: tap googlevision.js.
  • In the same folder, add the photo containing the text you want.
  • If you want to make sure you are on the right track, try get the plain text of your image by adding the following code in googlevision.js:
  • const vision = require (‘@google -cloud / vision’);
    asynchronous function app () {
    constant client = new vision.ImageAnnotatorClient ();
    const fileName = ‘pic2.jpg’;
    const [resultado] = await client.documentTextDetection (filename);
    const fullTextAnnotation = result.fullTextAnnotation;
    console.log (`Result: $ {fullTextAnnotation.text}`);
    }
    application ();
  • When running it, you should get the following: googlevision.js node.
  • Now you can start generating the HTML. To achieve this, you must create a helper function (convertToHtml). You have to replace the console.log line in your application method with this: convertToHtml (fullTextAnnotation.text) ;.
  • Below app (), create the method:
  • function convertToHtml (text) {
    }

Finally, it is necessary that you take into consideration that, before generating the HTML, you must clean up the code generated by the Google Vision API. Once you have done that, you will have a clean digitized text. Without a doubt, the use of a OCR library (optical character recognition) Together with the creativity of the person, it can give amazing results. Go ahead and try and convert your notes and notes to digital format!.