Bank card number recognition: C # version and iOS version

Source: Internet
Author: User
Tags scale image

(i) image Acquisition

first we need to get the image to be identified. This work can be achieved through digital cameras,DV machines, industrial cameras, computer digital cameras, mobile phone cameras and other equipment to collect, and to obtain the image information we want to analyze.

(b) layout Analysis

after obtaining the image information, the whole layout of the image should be analyzed. This step is inefficient if you use a generic algorithm for analysis. In general, it is necessary to make special analysis and setting for different recognition objects in order to obtain good analysis results.

Key word????

Tilt image correction??

Http://www.doc88.com/p-34555054276.html

(iii) grayscale of images

the images obtained from the acquisition equipment are usually color images, in order to simplify the analyzed image data and do not lose the key information, the image should be grayscale processed.

Typically, a computer image is made up of one pixel point (except vector), with each pixel RGB model to mark its color. in the RGB model, if r=g=b , the color is represented as a grayscale color, where The value of r=g=b is called a grayscale value, so Grayscale images each pixel needs only one byte to hold the grayscale value (also known as intensity value, luminance value), and the grayscale range is 0-255.

In general there are four ways to grayscale a color image:

  1, the component method. The brightness of three components in color image is used as the gray value of three gray image, and a grayscale image can be selected according to the application.

The calculation formula is:F1 (i,j) =r (i,j) f2 (i,j) =g (I,j) F3 (i,j) =b (i,j) where FK (I,j) (k=1,2,3 ) is the converted grayscale image in ( i,j) at the grayscale value.

  2, the maximum value method. The maximum value of the three-component luminance in a color image is used as the grayscale value of the grayscale graph.  

The calculation formula is:F (i,j) =max (R (i,j), G (I,j), B (I,J))

  3, the average method. The three-component luminance in color image is averaged to get a gray value.  

The calculation formula is:f (i,j) = (R (i,j) +g (i,j) +b (I,J))/3

  4, weighted average method: According to the importance and other indicators, three components with different weights weighted average. Because the human eye is sensitive to the green, the sensitivity of the blue is the lowest, therefore, the weighted average of the RGB Three components can get a more reasonable gray-scale image:f (i,j) =0.30r (i,j) +0.59g (i,j) + 0.11B (i,j)).

in the recognition process, the weighted average method of the method 4 is used to grayscale the color image.

(iv) Image Binary

Grayscale is the first step in compressing image data, and then the grayscale image is processed in binary format. The method is to calculate the gray image of the brightness level first, obtain an appropriate threshold, and then process the grayscale image, and all pixels with a gray scale greater than or equal to the threshold value are judged to belong to a particular object, whose gray value is 255 , otherwise these pixels are excluded from the object area, and the grayscale value is 0 , representing the background or exception of the object area.
After this step, the grayscale image is further compressed into a two-valued image, with each pixel not black or white and no other color. As long as the threshold is selected properly, the binary image can still reflect the whole and local features of the image, which is advantageous to the further processing of the image, makes the image simple, and the data volume is reduced, which can highlight the contour of the object of interest.

Above website:http://dongtingyueh.blog.163.com/blog/static/4619453201292984842752/

Above website:http://blog.chinaunix.net/uid-20074343-id-1736180.html

Code reference website:http://blog.csdn.net/baidu_31981559/article/details/51462426

Http://www.bubuko.com/infodetail-318130.html

(v) Tile cutting

The color image is compressed into black-and-white two-color image after the gray and binary values of the front. At this point, a key operation will be performed, that is, tile cutting.

At this point, all the characters of the upper and lower left and right four boundaries are all obtained, then the four boundary lines surrounding the image area is the small tile we want to cut.

Code Reference: Http://bbs.csdn.net/topics/392009365?list=lz

EMGUCV Getting Started Guide - Chinese Translation version :

Http://wenku.baidu.com/view/d4217a62af1ffc4ffe47ac27.html

(vi) Character recognition

The final result can be obtained by sending each small tile sequentially into this segment for character recognition.

The character recognition operation in this segment consists of two steps.

one is normalization. The goal of normalization is to convert all small tiles to images of the same size. As I said earlier, the character widths are just approximate and not necessarily identical. It can be obvious to see that the number "1" is narrowerthan the number "0" or "8", so in order to be able to use the template for uniform matching, You need to convert each character metalized block to the same size.

The second is the template matching. Since the template matching technique is used to achieve the matching of images and characters, there must be a template first. Each character is a template.

by extracting eigenvalues, there are many algorithms for recognition, including classifier algorithm, template matching algorithm, probability statistic based Bayes classifier algorithm, clustering algorithm and so on.

EMGUCV Reference documents:

Http://wenku.baidu.com/link?url=57aywD0Q6WTnl7XKbIHuEwWENnSuPS32QO8X0a0gHpOOzdnNt_ K0mk2cucvaehvsq0xj69mpae0i6uxwozeqaemaaqswxhp4w-ly_xjw4sm

TESSERACT-OCR Realization of image recognition function :

Http://www.52itstyle.com/thread-4803-1-1.html

Code section:  

C # version: Link: http://pan.baidu.com/s/1dE1CfXB Password: DLQF

iOS version: Link: http://pan.baidu.com/s/1slNiAOt Password: DVJH

Bank card number recognition: C # version and iOS version

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.