Java-based OPENCV for digital image Recognition (ii)-Basic flow

Source: Internet
Author: User

Java-based OPENCV for digital image Recognition (ii)-Basic flow

Before we do a project, we should have a general grasp, or a progress bar, to step by push us to complete the project, before we formally start, we first discuss the process.

The main thing I do is identify the numbers in the table, but that's not the point. The point is that through this we can extrapolate to achieve our own business.

Image recognition is mainly divided into two steps: Image preprocessing and image recognition. Both steps are important.

Image preprocessing:
1. Grayscale of image; Binary value
2, image noise reduction, remove interference line
3, image corrosion, expansion processing
4. Character segmentation
5. Normalization of characters

Image recognition:
1. Eigenvalue extraction
2. Training
3. Testing

Grayscale:

In the RGB model, if r=g=b, color represents a grayscale color, where the value of r=g=b is called a grayscale value; Therefore, grayscale images each pixel point only need one byte to hold the grayscale value (also called intensity value, luminance value), the grayscale range is 0-255. Generally, the weighted average method is used to find the gray value of the pixel.

The common weighting methods are as follows:
1:) Gray = B; Gray = G; Gray = R
2:) Gray = max ({B, G, R})
3:) Gray = (B + G + R)/3
4:) Gray = 0.072169 * B + 0.715160 * G + 0.212671 * R
5:) Gray = 0.11 * B + 0.59 * G + 0.3 * R

In these methods, the first is the component method, that is, a component of the RGB three component as the gray value of the point; the second method is the maximum value method, the maximum value of three component brightness in color image is used as the gray value of gray scale; The third method is to average three components in a color image to get a grayscale image. The latter two belong to the weighted average method, of which the fourth is a gray-scale algorithm adopted by the OPENCV Development Library, and the fifth is an algorithm for finding gray value from the human physiology point of view (the human eye is sensitive to green, the sensitivity of blue is the lowest)

Binary Value:

The two value of the image is to set the gray value of the pixel on the image to a bit 0 or 255 of the two poles, that is, the entire image shows a clear only black and white visual effects

Image noise Reduction:

is to deal with some of the interference factors;

The main noise reduction algorithm

Filter class: The image is processed by design filter. The feature is that speed is often faster, and many convolution filters can be accelerated by rapid Fourier changes

Sparse expression Classes: Natural images appear to be different from random noises/artificial structures because they find that they always have sparse expression under a certain horizontal pattern. The noise we want to eliminate is often not sparse. Based on this discriminant model, the sparse nature is used to constrain the natural image, and the tension pile effect is obtained in many inverse problems.

External Apriori: If you cannot find a pattern from a noisy image, we can also use other similar but noiseless images to summarize the intrinsic properties of the image. This class of methods utilizes an external image to create a priori condition, which is then used to constrain the image that needs to be predicted. The most representative is a mixed Gaussian model.

Low-rank Clustering: In addition to sparsity, low rank is also a common feature of natural images. Mathematically, the sparse representation of the data can be considered to be in the union of Low-dimensional subspaces, while the low-rank data is directly present in a low-dimensional subspace. This tighter limit can also make a good noise reduction effect.

Deep learning: This class can be attributed to an external priori subclass, if the key to solving the inverse problem is to find a good image constraint, then why don't we use a best constraint? The essence of the deep learning method is to learn a high complexity (multilayer network structure) picture constraint through a large amount of data, thus pushing the way to the limit of learning the external transcendental condition. A lot of this kind of work in the near future, is along this idea, has obtained the very inverse day effect.

Character segmentation: It is to divide the useful parts of the picture, the character segmentation has many methods, but not every method is omnipotent, we need to adjust according to our own business; The common projection method and the connected domain method

Projection method: is to analyze the number of black pixels on each dimension (assuming a two-valued image), and then set a threshold, according to this threshold to split the picture

Image corrosion, expansion treatment

Corrosion: A portion of the image is convolution with the specified core, and the minimum value of the nucleus is obtained and assigned to the specified area. Corrosion can be understood as the area of the highlighted area in the image shrinks.

Expansion: A portion of the image is convolution with the specified core, and the maximum value of the nucleus is obtained and assigned to the specified area. Expansion can be understood as the field of the highlighted area in the image expands.

Normalization of characters:

is to classify the characters in the segmented image into a standard template size; the ideal result of normalization is normalized to standard template size; tilt correction; stroke width normalized; glyph normalization.

Note:
This article refers to a lot of blogs, thanks, mainly follow a blog to achieve the https://blog.csdn.net/ysc6688/article/category/2913009 (also based on the OpenCV to do, but he is implemented in C + +) Thank

Java-based OPENCV for digital image Recognition (ii)-Basic flow

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.