A method for fast positioning and correction of boarding passes

By combining local threshold segmentation and watershed algorithm with perspective transformation in the RGB color space, the problem of rapid positioning and correction of boarding passes under complex conditions is solved, improving the accuracy and robustness of character recognition, and is suitable for automatic recognition systems of airport boarding passes.

CN115588201BActive Publication Date: 2026-03-17MINJIANG UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-10
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing technologies struggle to quickly and accurately locate and correct boarding passes under complex conditions, resulting in low character recognition accuracy that fails to meet the needs of information systems.

Method used

The method employs local thresholding in the RGB color space combined with the watershed algorithm and perspective transformation. First, local thresholding is used to determine the approximate area of ​​the boarding pass. Then, edge detection and pixel value standardization are performed. The watershed algorithm is used to achieve precise positioning. Finally, perspective transformation is used to complete the segmentation and correction.

Benefits of technology

Under complex conditions such as uneven lighting, adhesion, and large-angle tilt, the system achieves rapid and accurate positioning and correction of boarding passes, improving the success rate and robustness of character recognition and meeting real-time monitoring requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115588201B_ABST
    Figure CN115588201B_ABST
Patent Text Reader

Abstract

The application relates to a method for quickly positioning and correcting boarding passes. Firstly, local threshold segmentation is performed on blue and red components in an RGB color space respectively, and then the threshold results are fused to determine the general area of the boarding pass; then, edge detection is performed on the blue component, and three-channel component pixel value standardization statistics are performed to obtain part of the edge and internal information of the boarding pass to perfect the target area; subsequently, a watershed algorithm is used to realize accurate positioning of the boarding pass; finally, perspective transformation is performed to complete segmentation and correction of the boarding pass. Experimental results show that the method has good timeliness and high success rate, and can meet the requirements of real-time monitoring in a real scene. Meanwhile, the boarding pass positioning and correction method has good robustness and is effective under the conditions of uneven illumination, partial adhesion and large-angle inclination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image recognition technology, specifically relating to a method for quickly locating and correcting boarding passes. Background Technology

[0002] Boarding passes are the primary boarding credentials provided by airports to passengers, recording important information such as passenger name, flight number, travel date, gate, and seat. This information needs to be entered into a database for future retrieval. Previously, this task required a significant amount of manpower, and manual data entry was not only costly and slow but also prone to errors, failing to meet the basic requirements of an information system.

[0003] With the development of computer vision technology, character recognition technology has become quite mature, and the previous manual input method is being replaced by automatic information recognition systems. Before performing character recognition on boarding pass information, locating and correcting the boarding pass helps improve the accuracy of character recognition and reduces the difficulty of subsequent steps. Therefore, boarding pass location and correction is an important step in boarding pass recognition systems. However, the algorithms for boarding pass location and correction have only been studied by a few scholars. Considering the similarity between boarding pass and license plate location and correction algorithms, boarding pass information recognition can refer to license plate recognition methods.

[0004] In the field of license plate recognition, Lu Huazhang et al. [1] proposed a method to locate license plates based on the mean square error of the vertical distance from the license plate characters to the straight line, which improved the accuracy of license plate location under different tilt degrees. Wang Nannan [2] used the texture features of the license plate and combined edge detection and morphological operation information to locate the license plate, which improved the effectiveness of license plate location. Reference [3] proposed a tilt correction algorithm based on Radon transform, which not only improved the effectiveness of license plate location but also greatly improved the speed by using the geometric and texture features of the license plate. Liu Wenfeng et al. [4] proposed a license plate location and correction method based on RGB color space for license plate images with complex backgrounds and different lighting conditions, which improved the overall performance of the license plate recognition system. Guo Dabao et al. [5] proposed a license plate location method that combines license plate texture features and color features, which overcame the problem of the license plate area becoming larger when only texture or shape features are used. In summary, the license plate location method is relatively mature. The algorithm is mainly based on the color, edge, texture and geometric features of the license plate for location.

[0005] Unlike license plates, which have uniform fonts and shapes, boarding passes from different airlines vary in shape, color, and other features. Therefore, license plate recognition algorithms are not well-suited for locating and recognizing boarding passes. Summary of the Invention

[0006] The purpose of this invention is to provide a method for quickly locating and correcting boarding passes, which can achieve the task of quickly locating and correcting boarding passes under complex conditions.

[0007] To achieve the above objectives, the technical solution of this invention is: a method for rapidly locating and correcting boarding passes. First, local threshold segmentation is performed on the blue and red components in the RGB color space, and then the threshold results are fused to determine the general area of ​​the boarding pass. Then, edge detection is performed on the blue component, and the pixel values ​​of the three-channel components are standardized and statistically analyzed to obtain partial edge and internal information of the boarding pass to improve the target area. Next, the watershed algorithm is used to achieve precise positioning of the boarding pass. Finally, perspective transformation is used to complete the segmentation and correction of the boarding pass.

[0008] Compared to existing technologies, this invention offers the following advantages: The present invention provides a method for rapidly locating and correcting boarding passes. First, local thresholding is performed on the blue and red components in the RGB color space, and then the threshold results are fused to determine the approximate area of ​​the boarding pass. Next, edge detection is performed on the blue component, and the pixel values ​​of the three-channel components are standardized and statistically analyzed to obtain partial edge and internal information of the boarding pass to refine the target area. Then, a watershed algorithm is used to achieve precise positioning of the boarding pass. Finally, perspective transformation is used to complete the segmentation and correction of the boarding pass. Experimental results show that the method of this invention has good timeliness and a high success rate, meeting the requirements of real-time monitoring in real-world scenarios. Furthermore, the boarding pass positioning and correction method of this invention has good robustness and is effective under conditions of uneven lighting, partial adhesion, and large-angle tilt. Attached Figure Description

[0009] Figure 1 This is a flowchart of the method of the present invention.

[0010] Figure 2 This is an example of dual-channel binary image fusion.

[0011] Figure 3 This is an example of local threshold segmentation.

[0012] Figure 4 Example of completing a binary graph.

[0013] Figure 5 Examples for filtering.

[0014] Figure 6 This is the result of the watershed algorithm.

[0015] Figure 7 This is the result of partial segmentation correction. Detailed Implementation

[0016] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.

[0017] This invention provides a method for rapidly locating and correcting boarding passes. First, local thresholding is performed on the blue and red components in the RGB color space, and then the threshold results are fused to determine the general area of ​​the boarding pass. Next, edge detection is performed on the blue component, and the pixel values ​​of the three-channel components are standardized and statistically analyzed to obtain partial edge and internal information of the boarding pass to improve the target area. Then, the watershed algorithm is used to achieve precise positioning of the boarding pass. Finally, perspective transformation is used to complete the segmentation and correction of the boarding pass.

[0018] The following is a detailed implementation process of the present invention.

[0019] The execution flow of the method of the present invention is as follows: Figure 1 As shown, the specific implementation is as follows:

[0020] 1. Coarse positioning of boarding pass

[0021] 1.1 Image Preprocessing

[0022] First, the input image is scaled according to formula (1). The purpose of scaling is to reduce the amount of computation, speed up the operation, and retain most of the image information. Here, w0 and h0 are the width and height of the input image, respectively. i and h i These are the width and height of the image after scaling.

[0023] w i ,h i =w0*0.5,h0*0.5, (1)

[0024] The scaling ratio of 0.5 for the image width and height was determined by considering both computational complexity and visual performance. This scaling method ensures, to some extent, that the algorithms process images of similar size, improving the effectiveness and applicability of the parameters set within the algorithm. The boarding pass images shown below are all pre-processed images after scaling.

[0025] 1.2 Local Threshold Segmentation

[0026] Similar to traditional license plate localization algorithms that utilize the RGB color features of license plates, this method extracts more information for image thresholding by using channel combination or channel separation. Unlike common blue-background-white-letter license plates, boarding passes are mostly composed of a blue or red dot and a white background with black lettering. Therefore, utilizing this color feature, the preprocessed boarding pass is subjected to channel separation, and the R and B channels are used separately for Otsu's algorithm. [6] Binarization is performed to obtain binary images of the R and B channels of the boarding pass, and finally the binary images are fused together.

[0027] like Figure 2 As shown, the dual-channel binary image fusion method utilizes the color features of the boarding pass, and the extracted boarding pass area is more complete compared to the single-channel binary image. However, this method cannot obtain a complete boarding pass area under complex conditions such as uneven lighting and alternating light and dark. This is because the method of directly using the Otsu algorithm to binarize the entire image calculates the binarization threshold based on the consideration of global image information. Therefore, the effect is slightly worse for situations such as uneven lighting and shadows that may occur in real-world scenes. To solve the problem in this step, we will use the local Otsu algorithm on the R and B channels obtained by channel separation. The specific steps are to divide the image into blocks using formula (2), then use the Otsu algorithm to perform threshold segmentation on each block, and finally save the results.

[0028]

[0029] Where P represents the R and B channel components of the segmented image, and in this paper, the height and width of the segmented image are taken as 1 / 5 of the original image; T is the threshold determined by the classic thresholding algorithm Otsu on the corresponding channel component. ij It is the result of binarization followed by fusion, ultimately yielding the following: Figure 3 The result in (c).

[0030] 1.3 Binary Graph Completion

[0031] from Figure 3 As shown in (c), compared to thresholding the entire image directly, local thresholding effectively suppresses the loss of local information or the appearance of noisy regions caused by uneven illumination. However, some edge or internal information of the boarding pass is still lost. For the edge information of the boarding pass, the Canny edge detection algorithm is used on its B channel. [7] Obtain the edge information variable e of the boarding pass ij For the internal information of the boarding pass, firstly, the standard deviation function is used to calculate the standard deviation x of each pixel for the three channel components in the original image. ij As sample data, z-score standardization is performed using formula (3) to obtain sample data that conforms to the standard normal distribution.

[0032]

[0033] Where, x i It is x ij The mean, s i It is x ij standard deviation, z ij These are the standardized variable values. The binary graph variable e representing the boarding pass edge information is obtained. ij The sample data variable z after standardization of the three-channel components of the boarding passij Then, using formula (4) to... Figure 3 (c) is completed by binarizing the result.

[0034]

[0035] We set the value of parameter α to 2. This threshold can complete the internal information of the binary image of the boarding pass while avoiding noise areas caused by lighting.

[0036] like Figure 4 As shown in (c), we obtained more binary images of the boarding pass area, but the method also resulted in some additional noisy regions. A filtering strategy is needed to obtain boarding pass areas that meet the criteria, achieving coarse localization of the boarding pass. The filtering strategy steps are as follows:

[0037] Step 1: Find all outer contours in the binary image.

[0038] Step 2: Calculate the area value of each outer contour.

[0039] Step 3: Determine whether the area of ​​each outer contour conforms to the format (5). If it does not conform, it is the background area.

[0040]

[0041] Where K takes the value of 5000, I c This is the point set of the outer contour. `fill` performs a fill operation on the outer contour, setting the value of the entire contour area to 255. The reason for the value of `K` is that the main contour area of ​​the boarding pass has a large area, while the noise area has a small area. The purpose of this step is to ensure that the target area is better preserved in subsequent morphological operations.

[0042] 2. Precise boarding pass positioning

[0043] Watershed Algorithm [8] The watershed algorithm is a commonly used image region segmentation algorithm that prevents the segmented objects from being merged, making it suitable for situations where the boundaries of the objects to be segmented are connected. Before using the watershed algorithm, we need to determine the foreground and background regions of the image, then process the connected regions, and finally use the watershed algorithm to label each boarding pass.

[0044] First, according to formula (6), I in the previous step... ij Invert the binary image to obtain the background region I of the image. bg .

[0045]

[0046] Then, a matrix E of size (5,5) is constructed, with each element initially set to 1. For I... ij The binary image undergoes an erosion operation with 7 iterations to separate slightly adhered boarding passes while removing some small noise areas. However, some larger noise areas may still exist in the image, requiring a filtering strategy to obtain a definite foreground image. The filtering strategy is defined as follows:

[0047] Step 1: Locate all outer contours in the binary image.

[0048] Step 2: Find the smallest bounding rectangle for each outer contour.

[0049] Step 3: Calculate the area C of each contour. a The geometric properties of the corresponding minimum bounding rectangle include the width R. w High R h and area R a Step 4: Determine whether the above variables conform to formula (7). If they do not conform, they are background areas and should be removed.

[0050]

[0051] The parameters α, β, γ, and δ are set to 5000, 3, 3.4, and 0.75, respectively. The values ​​of β and γ are based on the characteristics of the boarding pass shape, while the values ​​of the other two parameters are chosen because the general area of ​​the boarding pass has been obtained, and the outline area and its proportion to the circumscribed rectangle will be relatively large.

[0052] like Figure 5 As shown in (b), the binary image obtained after the filtering strategy is the foreground image. Now we have obtained the foreground and background regions of the image, but there are still some regions that we are unsure about, namely the areas where boarding passes are connected or overlapped in the original image, i.e., the boundaries. We can roughly obtain these unknown boundaries using formula (8).

[0053]

[0054] Among them, background area I bg It is our opinion on I ij The binary image is obtained by inverting it. Therefore, we need to first process the foreground region I. fg After performing the inversion operation and subtracting the background area, we obtain the boundary binary image I of the boarding pass. u .

[0055] Next, foreground region I fg The boarding passes are labeled and classified using a connected component processing function, resulting in a label set M. ijBackground pixels are marked as 0, and non-background pixels are marked starting from 1. Before using the watershed algorithm, we also need to use formula (9) to define the unknown region I. u The corresponding marker M ij Set it to 0, which means it will be used as the background area.

[0056]

[0057] Finally, we will obtain the label M ij The watershed algorithm is used to accurately locate the boarding pass in the original image.

[0058] like Figure 6 As shown, for new labels obtained using the watershed algorithm, there is a problem with the resulting label region M. ij One target region will blend into the background region for marking. Therefore, we iterate through the labels that meet the conditions and create the corresponding mask image matrix I. m After segmenting and correcting the boarding pass through perspective transformation, it is removed from the coarse binary map of the boarding pass in the corresponding area using formula (10). For the final target, it is then removed from I... ij Segmentation and correction are performed on the binary image.

[0059]

[0060] 3. Boarding pass segmentation and correction

[0061] Perspective transformation [9] Perspective transformation projects an image onto a new viewpoint or plane. Its transformation formula is formula (11):

[0062]

[0063] The point to be moved is (x, y), and the target point is (X, Y, Z). The middle matrix of formula (11) is the perspective transformation rectangle. The scope of perspective transformation is a three-dimensional space, but the image is in two-dimensional space. Therefore, it needs to be divided by Z, (X', Y', Z') = (X÷Z, Y÷Z, Z÷Z), and (X', Y', Z') is the true target point we finally need to obtain. The true target point is calculated according to formula (12). The ultimate goal is to obtain the transformation matrix, removing a 33 There are still 8 unknowns to solve, so 8 equations are needed to solve them.

[0064]

[0065] In obtaining such Figure 6After obtaining the boarding pass mask image, we defined an element matrix E of size (5,5) with an initial value of 1. We then performed a dilation operation on the mask image, iterating 3 times, to extract a more complete boarding pass. Since our previous operation scaled the image, we first restored the image size to its initial value, i.e., magnified the image's x and y axes by a factor of 2. Then, we constructed a minimum bounding rectangle, taking its four corner points as source points. Using these four corner points, we calculated the length and width of the target rectangle. Let the top-left corner of the target point be (0,0). We then used the length and width of the target rectangle in the horizontal and vertical directions as the four points of the target rectangle as target points. After obtaining four sets of corresponding points, we calculated the perspective transformation matrix and then applied it to the original image to obtain the segmented and corrected boarding pass image.

[0066] To verify the effectiveness of the proposed method, this invention collected a dataset of 17 boarding pass images taken in real-world scenarios. Each image contains 1 to 8 boarding pass images, totaling 62 images including various boarding passes and tickets. These 17 images were all taken in real-world scenarios using a fixed camera or mobile phone, and include images with no tilt and horizontal tilt under complex conditions such as uneven lighting, large-angle tilt, and multiple tickets with edges stuck together.

[0067] The experiment was conducted on an AMD Ryzen 5800H 3.20GHz processor, 16GB RAM, and Windows 10 operating system. The PyCharm integrated development environment was used, and Python was used for programming, with the open-source library OpenCV assisting in the programming.

[0068] 1. Individual Experimental Analysis

[0069] In a dataset of 17 boarding pass images under different conditions and circumstances, totaling 62 boarding passes and tickets, the segmentation and correction experiments yielded the following results: 59 correctly segmented and corrected, 1 incorrectly segmented and corrected, and 2 not segmented and corrected. The segmentation and correction success rate was 95.16%, and the average segmentation and correction time per boarding pass or ticket was 0.049 seconds across multiple experiments. One incorrectly segmented image was due to eight target images occupying a large portion of the image area. This caused the watershed algorithm to segment even a background image that passed the image area proportion determination. The other two boarding passes failed to be completely segmented and corrected because of strong light interference in some areas, making other boarding passes within the same image relatively dark, thus making it difficult to obtain a complete binary image of the boarding pass region.

[0070] Partial segmentation correction results as follows Figure 7As shown in (b), the results of the first and fourth groups demonstrate that the algorithm presented in this paper can perform the segmentation and correction task well even under strong light interference or uneven lighting conditions. Other groups of images also verify the effectiveness of this algorithm in boarding pass distribution images with adhesion, angular tilt, and other conditions.

[0071] 2. Comparative Experimental Analysis

[0072] In the boarding pass character recognition test, a total of 16 images were used, including 3 unsegmented and uncorrected images and 13 corresponding segmented and corrected images. The test focused on 33 pieces of information on the boarding pass, such as name, flight number, date, and seat number, and 60 pieces of information on the receipt, such as name and baggage number. Tencent's character recognition tool was used for recognition. The experimental results are shown in Table 1.

[0073] Table 1 Comparison of Character Recognition Results

[0074]

[0075] In our testing, we found that for character recognition of uncorrected images, the greater the image tilt, the more difficult it is to locate characters, leading to recognition errors. For images with only a slight tilt, errors such as misidentifying the number 8 as the character B and the character R as the character A are common. Furthermore, for recognizing a continuous line of information, the tilted image can cause continuous information to be recognized as discrete information. Here, we only compared the character recognition performance with and without image correction. Directly performing character recognition on an entire unsegmented and uncorrected image results in even worse performance. Therefore, the method proposed in this paper helps improve the accuracy of subsequent character recognition.

[0076] References:

[0077] [1] Lu Huazhang, Wen Hao. License plate positioning and correction methods under different degrees of tilt [J]. Modern Industrial Economy and Information Technology, 2016(5):3.

[0078] [2] Wang Nannan. Research on license plate positioning and tilt correction method [J]. Industrial Control Computer, 2014(11):2.

[0079] [3] Ge Haijiang, Fang Jiangjiang, Zhang Xiang. Research on license plate localization and tilt correction algorithm in license plate recognition system [J]. Journal of Hangzhou Dianzi University (Natural Science Edition), 2007(2):4.

[0080] [4] Liu Wenfeng, Wu Xueyi, Liu Changfu. License plate localization and correction algorithm based on RGB color space [J]. Journal of Wuhan University (Information Science Edition), 2006, 31(9):785-787.

[0081] [5] Guo Dabao, Chen Limin, Lu Chaoyang, et al. License plate localization method based on license plate background color recognition [J]. Computer Engineering and Design, 2003, 24(5):5.

[0082] [6]Otsu N.AThreshold Selection Method from Gray-Level Histograms[J].IEEE Transactions on Systems Man&Cybernetics,2007,9(1):62-66.

[0083] [7]Canny, John. Collision Detection for Moving Polyhedra[J]. IEEETransactions on Pattern Analysis&Machine Intelligence 1986,8(2):200.

[0084] [8]Meyer, Fernand.Color image segmentation[C].1992 international conference on image processing and its applications,1992.

[0085] [9] Niu Yan. Research on perspective transformation [J]. Journal of Computer-Aided Design & Graphics, 2001, 13(6):3.

[0086] The above are preferred embodiments of the present invention. Any changes made to the technical solution of the present invention that do not exceed the scope of the technical solution of the present invention shall fall within the protection scope of the present invention.

Claims

1. A method for quickly positioning and correcting a boarding pass, characterized in that, First, the blue component and the red component in the RGB color space are respectively subjected to local threshold segmentation and then the threshold results are fused to determine the general area of the boarding pass; the specific implementation is as follows: Image preprocessing: First, the read-in picture is scaled according to the following formula, where and are the width and height of the input image, respectively, and are the width and height of the scaled image, respectively. Local threshold segmentation: The color features of the boarding pass are used to separate the preprocessed boarding pass into channels, and the R and B channels obtained by channel separation are subjected to local Otsu algorithm; the specific steps are as follows: the image is blocked, and then Otsu algorithm is used to perform threshold segmentation through the following formula: wherein, are the R, B channel components of the segmented image, and the height and width of the segmented image are taken as 1 / 5 of the original image; is the threshold value determined by the Otsu algorithm on the corresponding channel component, is the result of the binaryzation of the corresponding channel, and finally the binary images of the R channel and the B channel of the boarding pass are obtained, and the binary images are fused. Then, the blue component is subjected to edge detection, and the three-channel component pixel value is standardized and counted to obtain part of the edge and internal information of the boarding pass to perfect the target area; the specific implementation is as follows: For the edge information of the boarding pass, the Canny edge detection algorithm is used on the B channel to obtain the edge information variable of the boarding pass For the internal information of the boarding pass, first, the standard deviation function is used on the original image to calculate the standard deviation value of each pixel point for three channel components as sample data, and the sample data conforming to the standard normal distribution is obtained through the following formula: wherein is the mean of is the standard deviation of is the normalized variable value; after getting the boarding pass edge information binary graph variable with the boarding pass three-channel component normalized sample data variable After that, the binary graphs of the R channel and the B channel of the boarding pass are completed by the following formula: The value of parameter is set to 2, which avoids noise area caused by light while complementing the internal information of the boarding pass binary image. Since the binary graph completion process of the R channel and the B channel of the boarding pass introduces an additional noise area, a screening strategy needs to be developed to obtain the boarding pass area that meets the conditions and realize the coarse positioning of the boarding pass; the screening strategy steps are as follows: Step 1, find all the outer contours in the binary image; Step 2, calculate the area value area of each outer contour; Step 3, judge whether the area area of each outer contour meets the following formula, if not, it is a background area: where K takes the value of 5000, is a set of points of the outer contour, a filling operation is performed for the outer contour, i.e. the values of the entire contour area are set to 255; Next, the watershed algorithm is used to realize the accurate positioning of the boarding pass; Finally, the segmentation and correction of the boarding pass are completed through perspective transformation.

2. A method of quickly positioning and correcting a boarding pass according to claim 1, wherein, The specific implementation of using the watershed algorithm to realize the accurate positioning of the boarding pass is as follows: The binary image is inverted according to the following formula to obtain the background region of the image :​ Construct a size of The matrix elements E are all initialized to 1; The binary image undergoes an erosion operation with 7 iterations to separate slightly adhered boarding passes while removing some small noise areas. However, some larger noise areas may still exist in the image, requiring a filtering strategy to obtain a definite foreground image. The filtering strategy is defined as follows: Step 1, find all the outer contours in the binary image; Step 2, find the minimum circumscribed rectangle of each outer contour; Step 3, calculating the area of each contour and the geometric properties of the corresponding minimum bounding rectangle include width , height , and area ; Step 4, judge whether the above variables meet the following formula, if not, it is a background area, which is removed; wherein the parameters , , , are set to 5000, 3, 3.4 and 0.75, respectively; The binary graph obtained through the screening strategy is the foreground image; The boundary of the unknown area that is connected or overlapped between the boarding passes in the original image is obtained through the following formula, Wherein, the background region is the inverse of the binary image; so it is necessary to first perform an inverse operation on the foreground region and then subtract the background region to obtain the boarding pass boundary binary image ; Then the foreground region The boarding pass is labeled and classified using a connected domain processing function to obtain a label set ; the background pixel points are marked as 0, and the non-background pixel points are marked from 1 The unknown region is set to 0, i.e. treated as a background region, by the following formula The corresponding label is set to 0, i.e. treated as a background region, by the following formula The obtained mark And the original image using the watershed algorithm to achieve the precise positioning of the boarding pass.

3. A method of quickly positioning and correcting a boarding pass according to claim 2, wherein, One problem with using the watershed algorithm to obtain new labels is the resulting label region. One target region will be blended into the background region and thus marked. Therefore, the markers that meet the conditions are traversed to create the corresponding mask image matrix. After segmenting and correcting the boarding pass using perspective transformation, it is removed from the corresponding area of ​​the coarse binary map of the boarding pass using the following formula; for the final target, it is then... Segmentation and correction in binary images: 。 4. A method of quickly positioning and correcting a boarding pass according to claim 3, wherein, The specific implementation of completing the segmentation and correction of the boarding pass through perspective transformation is as follows: Perspective transformation is to project the picture to a new view or plane, and its transformation formula is as follows: The point to be moved is , the target point is , the intermediate matrix in the above formula is a perspective transformation rectangle; the scope of the perspective transformation is a three-dimensional space, but the image is in a two-dimensional space; therefore, Z needs to be divided, , is the real target point that needs to be finally obtained; The real target point is calculated by the following equation, and the final goal is to obtain the transformation matrix, excluding There are still 8 unknowns to be solved, so 8 equations are needed to solve them: After getting the boarding pass mask image, define an element matrix E with size of and initial value of 1, and perform dilation operation on the mask image with 3 iterations to extract a more complete boarding pass. First, restore the size of the picture to the initial value, i.e. enlarge the x-axis and y-axis of the picture by 2 times, then perform the minimum bounding rectangle, and take the 4 corner points as the source points. Then calculate the length and width of the target rectangle using the 4 corner points, set the top-left corner point of the target point as (0, 0), and use the length and width in the horizontal and vertical directions to get the 4 points of the target rectangle as the target points. After getting the 4 corresponding points, calculate the perspective transformation matrix, and then perform perspective transformation on the original image using the perspective transformation matrix to obtain the segmented and corrected boarding pass image.

Citation Information

Patent Citations

  • A blue license plate segmentation and correction method

    CN109886896A