How to extract the face of a RG document from a scanned image

Asked

Viewed 546 times

2

Ola, Personal

I am developing a solution where I use Google Cloud Vision to analyze text in the image, this is already ready in my solution. I send the image and Google Vision returns the words found and their coordinates.

What I need is to extract the face (back part of the RG document) from the scanned image, did several tests with Opencv, Emgucv (C#) and tried using Tensorflow (Google) using neural network to try to create something that recognizes the face of the RG document, but all and kind of confusing in this part because there is little content related to Opencv, Emgucv and Tensorflow and the little content that exists are all in English or other languages.

Tensorflow uses to train Python (I don’t know if it’s worth it either) because there are a number of factors to use Tensorflow installation, configuration taking into account the time of my learning not knowing if this will work for my project.

Opencv I wanted to use it but still this obscure the way model is trained also and in python or C++ my knowledge in these languages is scarce but I am senior modestly speaking in C# but I do not know right in which way to go for it.

Today I send the image the way I get it to the Google Vision api and I reshoot the information from the OCR analysis summarizing I want to detect the RG inside the scanned image and I plot it to rotate it to let it horizontal and then yes send it to the Google Vision api.

Someone has some idea to do this "step before sending" that is average or some model of easy understanding of how to train image models through Opencv. I’ve been reading a lot and what theoretically I need and the neural network model Convolucional Neural Network, for Detect Object.

I did several examples of demarcating in the image using Opencv (Emgucv) but maybe due to the lack of knowledge of the framework I could not use and I have read several tutorials to leave the image and Grayscale and Threshold (threshold or binarizada)I have already used the Aforge library but still could not reach a stage or legal level of the project I need this step before sending for OCR analysis.

I ask for advice and examples if anyone has.

Hugs.

  • You have asked several questions in one. Better separate. What is your main goal? Take an RG image and select with a rectangle where the photo is?

1 answer

0

You can use Opencv with various techniques and filters, such as edge/Canny (photo film effect), then use the Boundary technique to define the document border, if the border is broken you will use the morphological dilation operation technique to thicken the border so as to approximate the encounters between lines and use the contour features to apply the geometric calculations and with the result park the image.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.