Box number identification method and device

文档序号:1253280 发布日期:2020-08-21 浏览:8次 中文

阅读说明:本技术 一种箱号识别方法和装置 (Box number identification method and device ) 是由 王宸 罗永祥 刘键涛 魏秋新 于 2020-04-10 设计创作,主要内容包括:一种箱号识别方法和装置,包括如下步骤:1)输入集装箱原始图片;2)使用图像语义分割模型进行箱面粗定位,分割出图像中的集装箱,进行图像预处理,得到箱型图像;3)采用CPTN模型对箱型图像进行文本检测;4)采用CRNN模型对文本检测的所有结果进行OCR识别;5)将识别结果按照箱号格式进行正则化,输出最终的箱号。(A box number identification method and device comprises the following steps: 1) inputting an original picture of the container; 2) roughly positioning the box surface by using an image semantic segmentation model, segmenting containers in the image, and preprocessing the image to obtain a box type image; 3) performing text detection on the box-type image by adopting a CPTN (continuous phase propagation) model; 4) performing OCR recognition on all results of the text detection by adopting a CRNN model; 5) and regularizing the identification result according to a box number format, and outputting a final box number.)

1. A box number identification method is characterized by comprising the following steps:

1) inputting an original picture of the container;

2) roughly positioning the box surface by using an image semantic segmentation model, segmenting containers in the image, and preprocessing the image to obtain a box type image;

3) performing text detection on the box-type image by adopting a CPTN (continuous phase propagation) model;

4) performing OCR recognition on all results of the text detection by adopting a CRNN model;

5) and regularizing the identification result according to a box number format, and outputting a final box number.

2. A bin number identification method according to claim 1, characterized in that: the image semantic segmentation model is TextionForest, and is based on a random forest classifier or a deep learning method.

3. A bin number identification method according to claim 1, characterized in that: and adopting an image semantic segmentation model based on a convolutional neural network.

4. A bin number identification method according to claim 1, characterized in that: the image preprocessing comprises an opening operation, a closing operation and a minimum external matrix to remove noise in the image.

5. A bin number identification method according to claim 1, characterized in that: in the step 3), the transmission transformation is further performed on the text detection result to adjust the angle.

6. A bin number identification method according to claim 1, characterized in that: the CRNN model in step 4) includes: a convolutional layer, a cyclic layer and a transcription layer, the convolutional layer extracting a feature sequence from an input image; the loop layer predicts the tag distribution for each frame and the transcription layer changes the prediction for each frame into the final tag sequence.

7. A box number identification apparatus, comprising:

the input module is used for inputting original pictures of the container;

the rough positioning module is used for roughly positioning the container surface by adopting an image semantic segmentation model, segmenting containers in the image and preprocessing the image to obtain a box-type image;

the text detection module is used for detecting the text of the box-type image by adopting a CPTN model;

the OCR recognition module is used for performing OCR recognition on all results of the text detection by adopting a CRNN model;

and the output module is used for regularizing the identification result according to the box number format and outputting the final box number.

Technical Field

The invention relates to the field of containers, in particular to a method and a device for identifying a container number.

Background

With the scientific and technological progress and the huge increase of the trade of countries in the world, the logistics transportation industry is developed rapidly year by year, wherein the global shipping volume is new and high year by year. The container is a main transportation and loading mode of sea transportation, and has a very important position in sea transportation. While the sea transportation is prosperous, the management of the containers needs a more modern means, and the aims of tracking a large number of containers, transferring goods, planning storage of cargo ships and the like are fulfilled.

The container number is the special identification code of each container, and automatically identifying the container number is the basis for carrying out various efficient management operations on the container, such as: affiliated companies, container tracking, cargo transfers, etc. However, since no unified standard is established for the automatic identification of the container number globally, the automatic identification of the container number is mainly realized by using an image processing technology at present. However, the wrong container can only be identified and recorded and the box number can only be checked by manual identification, which undoubtedly increases the labor cost and the circulation time.

At present, a box number recognition system cannot completely divide characters such as incomplete characters, adhesion characters and the like in a box number; meanwhile, the recognition accuracy rate of the segmented incomplete characters is low. The wrong container can only be recorded and checked through manual identification, which undoubtedly increases the labor cost and the circulation time. The existing box number identification technology adopts a single character for identification, and the identification speed is slow; and some images with box numbers have certain shooting angles, so that the identification accuracy is low.

Disclosure of Invention

The invention mainly aims to overcome the defects in the prior art and provides a box number identification method and device, which have higher identification accuracy and identification rate.

The invention adopts the following technical scheme:

a box number identification method is characterized by comprising the following steps:

1) inputting an original picture of the container;

2) roughly positioning the box surface by using an image semantic segmentation model, segmenting containers in the image, and preprocessing the image to obtain a box type image;

3) performing text detection on the box-type image by adopting a CPTN (continuous phase propagation) model;

4) performing OCR recognition on all results of the text detection by adopting a CRNN model;

5) and regularizing the identification result according to a box number format, and outputting a final box number.

Preferably, the image semantic segmentation model is textonfiest, and is based on a random forest classifier or a deep learning method.

Preferably, an image semantic segmentation model based on a convolutional neural network is adopted.

Preferably, the image preprocessing includes an open operation, a close operation and a minimum bounding matrix to remove noise in the image.

Preferably, in step 3), the method further includes performing transmission transformation on the text detection result to adjust the angle.

Preferably, the CRNN model in step 4) includes: a convolutional layer, a cyclic layer and a transcription layer, the convolutional layer extracting a feature sequence from an input image; the loop layer predicts the tag distribution for each frame and the transcription layer changes the prediction for each frame into the final tag sequence.

A box number identification apparatus, comprising:

the input module is used for inputting original pictures of the container;

the rough positioning module is used for roughly positioning the container surface by adopting an image semantic segmentation model, segmenting containers in the image and preprocessing the image to obtain a box-type image;

the text detection module is used for detecting the text of the box-type image by adopting a CPTN model;

the OCR recognition module is used for performing OCR recognition on all results of the text detection by adopting a CRNN model;

and the output module is used for regularizing the identification result according to the box number format and outputting the final box number.

As can be seen from the above description of the present invention, compared with the prior art, the present invention has the following advantages:

1. the method and the device adopt CPTN + CRNN, and the method can realize end-to-end identification without character segmentation, and has higher identification speed and better identification effect.

2. The method and the device adopt the semantic segmentation model of the convolutional neural network structure, and the model has learning capacity and can adapt to multi-angle and multi-scene box surface positioning.

3. The method and the device effectively reduce the cost of manual checking and recording, reduce the container circulation time and accelerate the working efficiency of ports.

Drawings

FIG. 1 is a flow chart of the method of the present invention;

FIG. 2 is an input container raw picture of the present invention;

FIG. 3 is a diagram of an image semantic segmentation model based on a convolutional neural network;

FIG. 4 is an effect diagram of an image semantic segmentation model;

FIG. 5 is a cut-away box side image;

FIG. 6 is a schematic diagram of box-type text detection;

FIG. 7 is a schematic diagram of a box-shaped picture with an angle problem;

FIG. 8 is a schematic diagram of a transmission transformation;

FIG. 9 is a diagram of a CRNN model architecture;

FIG. 10 is a diagram illustrating an output result;

the invention is described in further detail below with reference to the figures and specific examples.

Detailed Description

The invention is further described below by means of specific embodiments.

A box number identification method comprises the following steps:

1) the container raw picture, see fig. 1, is input, which is not limited to a grey scale image, but may be a color picture.

2) And roughly positioning the container surface by using an image semantic segmentation model, segmenting the container in the image, and preprocessing the image to obtain a box type image, which is shown in the figure 5.

The image semantic segmentation model in this step is used for realizing classification at the pixel level, and may be realized by semantic segmentation methods such as TextonForest, random forest classifier or deep learning method, preferably, an image semantic segmentation model based on a convolutional neural network is used, and the network structure of the image semantic segmentation model is as shown in fig. 3, and the following steps are performed sequentially from left to right: the device comprises a convolution layer, a pooling layer, an upper sampling layer, a convolution layer, an upper sampling layer and a full connection layer. The effect after semantic segmentation is as in fig. 4.

The convolutional layer is an important component of a convolutional neural network, and features of input data can be extracted through convolution operation. The pooling layer, also called an upsampling layer, can compress signal characteristics, reduce network computation complexity, reduce the amount of computation of the next layer, and prevent overfitting. The full-connection layer can play a role in connection and connects the convolutional layer with the common neural network layer.

The image preprocessing comprises opening operation, closing operation and minimum external matrix to remove noise in the image and cut out a complete box surface.

3) The CPTN model is adopted to detect the texts of the box-shaped images, the model can detect the texts with variable-length sequences, and the CPTN model can detect the positions of characters on the box surface, which is shown in figure 6. The CPTN model is a trained CPTN model. The step is to put out each character in each line of the image to a frame by a target detection method, and then to combine the frames of all characters in each line to obtain a frame of a line of characters.

In addition, because there is a shooting angle problem in the container picture, for example, see fig. 7, the cut characters can be subjected to transmission transformation, and angle adjustment is realized, see fig. 8.

4) And performing OCR recognition on all results of the text detection by adopting a CRNN model, and identifying each character in each line of characters in the image by the method. CRNN is an end-to-end text recognition model that does not require character segmentation and can recognize sequences of arbitrary length.

Specifically, referring to fig. 9, the CRNN model includes, from top to bottom, a convolutional layer, a cyclic layer, and a transcription layer, the convolutional layer extracting a feature sequence from an input image; the loop layer predicts the label distribution of each frame, and the transcription layer changes the prediction of each frame into a final label sequence, namely the recognition result.

5) And regularizing the recognition result according to a box number format, preventing the overfitting of the model through regularization, and outputting the final box number. For example: the format of the box number is 4 letters +7 numbers (DRYU4128939), and all recognition results are normalized according to 4 letters +7 numbers, so that the box number can be output.

The invention also provides a box number identification device, which realizes the identification of the box number by adopting the method and comprises the following steps:

and the input module is used for inputting the original picture of the container.

And the rough positioning module is used for roughly positioning the box surface by adopting an image semantic segmentation model, segmenting the container in the image, and preprocessing the image to obtain a box type image.

And the text detection module is used for performing text detection on the box-type image by adopting a CPTN (continuous public transport network) model.

And the OCR recognition module is used for performing OCR recognition on all results of the text detection by adopting the CRNN model.

And the output module is used for regularizing the identification result according to the box number format and outputting the final box number.

The above description is only an embodiment of the present invention, but the design concept of the present invention is not limited thereto, and any insubstantial modifications made by using the design concept should fall within the scope of infringing the present invention.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种合格证识别装置及合格证识别方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!