Container number identification method and device, medium and program product

By constructing a container number image knowledge base and affine transformation positioning, and combining it with a deep learning model to extract feature vectors, the problems of high initialization cost and insufficient interpretability of deep learning methods in container number recognition are solved, and fast and accurate container number recognition is achieved.

CN120808351APending Publication Date: 2025-10-17BROAD VISION (XIAMEN) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510896361.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing deep learning methods in container number recognition have problems such as high initialization cost, dependence on large amounts of labeled data, and insufficient interpretability, making it difficult to quickly deploy and accurately identify container numbers in complex environments.

Method used

By building a container number image knowledge base, using a predetermined target detection model and text recognition algorithm, combined with the affine transformation matrix to locate the container number area, and extracting feature vectors through a pre-trained deep learning model to search for similar samples, rapid recognition of container numbers can be achieved.

Benefits of technology

It can achieve rapid deployment of container numbers with very few samples, reduce initialization costs, improve recognition accuracy, and achieve accurate recognition in complex environments through highly interpretable methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120808351A_ABST
    Figure CN120808351A_ABST
Patent Text Reader

Abstract

The invention provides a container number identification method and apparatus. The method comprises the steps of obtaining an image containing a container; using a predetermined target detection model to position a first area where the container is located in the image; extracting a first region from the image to generate a query image; searching in a pre-constructed container number image knowledge base to obtain K container image samples similar to the query image as reference samples, K being a predetermined number; wherein the container image samples and the positions of the second areas where the container numbers in the container image samples are located are stored in the container number image knowledge base in a pre-associated mode; and according to a sequence of the similarity from high to low, sequentially executing the steps of matching, identifying and checking on each reference sample in the K reference samples so as to obtain an identification result. By means of the technical scheme, rapid deployment can be achieved without large-scale data set labeling, the initialization cost is low, and the recognition accuracy is high.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of container number recognition, and in particular to a container number recognition method, device, medium and program product. BACKGROUND

[0002] The container number, such as the BIC (Bureau International des Containers) code, is an international standard for container identification, and its accurate identification is of great value to port management. However, in actual scenarios, various problems such as printing smudging, light obstruction, resolution adaptation, etc. lead to many challenges in recognizing container numbers in complex environments. Existing deep learning methods have high recognition accuracy, but lack interpretability, and rely on a large amount of labeled data and require a large amount of computing resources, which makes them require a large number of samples, have high initialization costs, and cannot be quickly deployed. SUMMARY

[0003] Embodiments of the present application provide a container number recognition method, device, medium and program product, which can be quickly deployed without large-scale labeled data sets, has low system initialization cost, and has high recognition accuracy.

[0004] To achieve the above-mentioned purpose, in one aspect, a container number recognition method is provided, comprising:

[0005] S1, obtaining an image containing a container;

[0006] S2, using a predetermined target detection model, locating a first region in which the container is located in the image;

[0007] S3, extracting the first region from the image to generate a query image;

[0008] S4, searching in a pre-constructed container number image knowledge base to obtain K container image samples similar to the query image as reference samples, K being a predetermined number; wherein the container image samples and the positions of the second regions in which the container numbers in the container image samples are located are pre-associated and stored in the container number image knowledge base;

[0009] S5, in order of similarity from high to low, sequentially performing the following steps on each of the K reference samples:

[0010] S51, determining a matching point pair set of the query image and the reference sample according to the relationship between the selected feature points of the query image and the selected feature points of the reference sample;

[0011] S52, obtaining an affine transformation matrix between the query image and the reference sample based on the set of matched point pairs;

[0012] S53, mapping a position of a second region in which a container number in the reference sample is located to the query image by the affine transformation matrix, to obtain a third region in which the container number is located in the query image;

[0013] S54, identifying text in the third region using a predetermined text recognition algorithm to obtain a candidate recognition result;

[0014] S55, verifying the candidate recognition result according to a predetermined verification rule, if the verification is passed, the recognition result is the final recognition result; if the verification is not passed, returning to execute the step S51 for the next reference sample according to the order.

[0015] Preferably, in the recognition method, the container number is a BIC code.

[0016] Preferably, in the recognition method, the position of the second region is represented by a bounding box.

[0017] Preferably, in the recognition method, the step S3 further comprises: extracting a feature vector of the query image using a predetermined deep learning model; in the step S4, the container image sample knowledge base further stores a feature vector of the container image sample in association with the container image sample, and the container image sample similar to the query image is determined based on the feature vector of the query image and the feature vector of the container image sample.

[0018] Preferably, in the recognition method, the step of constructing the container number image knowledge base comprises:

[0019] Obtaining a plurality of container picture samples covering a predetermined plurality of scenes;

[0020] For each of the plurality of container picture samples, using a predetermined object detection model to locate a fourth region in which a container in the sample is located;

[0021] For each container picture sample, extracting the fourth region to obtain a standardized container image sample;

[0022] For each standardized container image sample, a pre-trained deep learning model is used to extract a feature vector of the container image in the sample;

[0023] For each standardized container image sample, the position of a fifth region in which a container number in the container image in the sample is located is labeled, and the labeled position of the fifth region is converted into a relative position.

[0024] A similarity retrieval system is established using the selected vector database, in which the container image sample, the feature vector corresponding to the container image sample and the relative position of the fifth region in the container image sample are stored in association.

[0025] Preferably, in the recognition method, the predetermined multiple scenes include container image samples of different companies, container image samples of different angles and container image samples of different light conditions.

[0026] Preferably, in the recognition method, the predetermined verification rule is the ISO 6346 verification standard.

[0027] In another aspect, a container number recognition device is also provided, which includes a memory and a processor, the memory stores at least one program, and the at least one program is executed by the processor to implement the steps of the container number recognition method according to any one of the above.

[0028] In yet another aspect, a computer readable storage medium is also provided, which stores at least one program, and the at least one program is executed by a processor to implement the steps of the container number recognition method according to any one of the above.

[0029] In yet another aspect, a computer program product is also provided, which includes a computer program, and the computer program is executed by a processor to implement the steps of the container number recognition method according to any one of the above.

[0030] The above technical solutions have the following technical effects:

[0031] The technical solution of the embodiment of the application pre-constructs a container number image knowledge base, performs similar sample search on a query image based on the container number image knowledge base, finds a container image sample similar to the query image, maps the position of the region where the container number is located in the container image sample to the query image through affine transformation to locate the region of the container number in the query image, and then performs text recognition on the region of the container number to obtain the container number. Under the condition of very few samples, the position characteristics of container numbers such as BIC codes of various containers can be mastered, large-scale labeled data sets are not required for rapid deployment, and thus the initialization cost is greatly reduced.

[0032] Further, compared with the identification scheme based on the black box deep learning model, the identification scheme has higher explainability, each step of the decision process can be tracked and visualized; the identification scheme has higher applicability, the container number in the corresponding situation can be recognized by collecting container picture samples in the predetermined complex situation; and the number area mapping is performed through affine transformation, the geometric structure relationship is maintained through the affine transformation, the container number area can be positioned more robustly; thereby, more accurate, efficient and reliable technical support can be provided for the port container management. BRIEF DESCRIPTION OF DRAWINGS

[0033] Figure 1 a flowchart of a container number identification method according to an embodiment of the present application;

[0034] Figure 2 a flowchart of a container number identification method according to another embodiment of the present application;

[0035] Figure 3 a flowchart of a container number identification method according to an embodiment of the present application. DETAILED DESCRIPTION

[0036] To further illustrate the embodiments, the present application provides accompanying drawings. These drawings are part of the disclosure of the present application, mainly used to illustrate the embodiments, and can be used to explain the operating principle of the embodiments in conjunction with the related description of the specification. Those of ordinary skill in the art should understand other possible implementations and advantages of the present application by referring to these contents. The components in the drawings are not drawn to scale, and similar component symbols are generally used to represent similar components.

[0037] The present application will be further described in conjunction with the accompanying drawings and specific embodiments.

[0038] Embodiment one:

[0039] Figure 1 a flowchart of a container number identification method according to an embodiment of the present application. As Figure 1 , the container number identification method of this embodiment includes:

[0040] S1, obtaining an image containing a container; in one specific implementation, a video stream is collected in real time to obtain an image frame containing a container in the video stream;

[0041] S2, using a predetermined target detection model to locate a first region where the container is located in the image; in one specific implementation, the predetermined target detection model is a YOLO target detection model; in one specific implementation, the first region is represented by a bounding box;

[0042] S3, extract the first region from the image to generate a query image; the query image is an image of the container region in the image of the container, i.e., the query image is an image of the container itself focusing on the container; in one specific implementation, the first region is extracted by the way of matting to generate the query image;

[0043] S4, search in the pre-constructed container number image knowledge base to obtain K container image samples similar to the query image as reference samples, K being a predetermined number; wherein, the container image samples and the positions of the second regions in which the container numbers in the container image samples are pre-associated and stored in the container number image knowledge base; in one specific implementation, the positions of the second regions are represented by a bounding box such as a rectangular box; specifically, the position of the bounding box is represented by the coordinates of the selected points in the bounding box; for example, the position of the rectangular box is represented by the coordinates of the opposite vertices of the rectangular box;

[0044] S5, in order from high to low, sequentially execute the steps of matching, identifying and checking for each of the K reference samples, wherein the steps of matching, identifying and checking include:

[0045] S51, determine the matching point pair set of the query image and the reference sample according to the relationship between the selected feature points of the query image and the selected feature points of the reference sample;

[0046] S52, obtain the affine transformation matrix between the query image and the reference sample based on the matching point pair set;

[0047] S53, map the position of the second region in which the container number in the reference sample is located to the query image by the affine transformation matrix to obtain a third region in which the container number is located in the query image; preferably, the container number is a BIC code;

[0048] S54, identify the text in the third region using a predetermined text recognition algorithm to obtain a candidate recognition result;

[0049] S55, check the candidate recognition result according to a predetermined verification rule, if the check is passed, the recognition result is the final recognition result; if the check is not passed, return to execute step S51 for the next reference sample in order.

[0050] In one specific implementation, cosine similarity or Euclidean distance is used to measure similarity.

[0051] In one specific implementation, step S3 further comprises: extracting a feature vector of the query image using a predetermined deep learning model; and in step S4, the feature vector of the container image sample is also stored in association with the container image sample in the container number image knowledge base, and the container image sample similar to the query image is determined based on the feature vector of the query image and the feature vector of the container image sample.

[0052] In one specific implementation, the predetermined deep learning model is a pre-trained ResNet-50 deep learning model; and the extracted feature vector is a high-dimensional representation feature of the container image, such as a 2048-dimensional feature vector, which is used as a digital fingerprint of each container image; and these feature vectors can effectively capture the visual characteristics of the container, including color distribution, texture pattern, and structural information.

[0053] In one specific implementation, the step of constructing the container number image knowledge base comprises:

[0054] A plurality of container image samples covering a predetermined plurality of scenes are obtained; preferably, the predetermined plurality of scenes include container image samples of different companies, container image samples at different angles, and container image samples under different lighting conditions;

[0055] For each of the plurality of container image samples, a predetermined object detection model is used to locate the fourth region where the container is located in the sample;

[0056] For each container image sample, the fourth region is extracted to obtain a standardized container image sample;

[0057] For each standardized container image sample, a pre-trained deep learning model is used to extract a feature vector of the container image in the sample;

[0058] For each standardized container image sample, the position of the fifth region where the container number in the container image in the sample is located is labeled, and the labeled position of the fifth region is converted into a relative position;

[0059] A similarity retrieval system is established using the selected vector database, and in the similarity retrieval system, the container image sample, the feature vector corresponding to the container image sample, and the relative position of the fifth region in the container image sample are stored in association.

[0060] Embodiment Two:

[0061] Figure 2 A flowchart of a container number recognition method according to another embodiment of the present application. In this embodiment, the container number is a BIC code. As shown in FIG. 2, the method comprises the following steps: Figure 2The container number recognition method of the embodiment includes the following steps:

[0062] (1) Image acquisition and preprocessing

[0063] (1.1) Real-time video stream acquisition: Obtain a high-definition real-time video stream from the port monitoring system, such as a 1080p or 4K resolution video stream, and record each image as I f ;

[0064] (1.2) Container detection trigger: When a container is detected entering a designated area, trigger a BIC detection event, and extract the current video frame I f ; This video frame I f contains the container;

[0065] (1.3) Container area positioning: Apply a YOLO target detection model to process I f , and output the container bounding box coordinates B cont :

[0066] B cont = {(x1, y1, x2, y2) | confidence > θ detect}

[0067] Where θ detect is the detection confidence threshold, preferably set to 0.6; (x1, y1) and (x2, y2) are the coordinates of the left bottom corner and the right top corner of the bounding box, respectively; and confidence represents the confidence level.

[0068] (1.4) Query image generation: Extract the container area based on the bounding box B cont , and generate a query image:

[0069] I q = I f [y1:y2, x1:x2]

[0070] (1.5) Feature vector extraction: Extract the high-dimensional feature representation of the query image through a pre-trained ResNet-50 network:

[0071]

[0072] Where f ResNet (·) represents the feature extraction function of the ResNet-50 model, and outputs a 2048-dimensional feature vector V q .

[0073] (2) Knowledge base retrieval and matching

[0074] (2.1) Vector knowledge base query: Use the extracted feature vector Vq Perform similarity search on a pre-built container BIC code image knowledge base containing N reference samples in:

[0075] The i-th reference sample is the i-th container image sample;

[0076] The feature vector corresponding to the i-th reference sample;

[0077] The manually annotated BIC code bounding box position corresponding to the i-th reference sample;

[0078] (2.2) Similarity calculation: Calculate the similarity between the query image’s feature vector, i.e., the query feature, and the feature vectors of all reference samples in the knowledge base, i.e., the reference feature. In specific implementations, cosine similarity or Euclidean distance can be used to measure similarity.

[0079] Cosine similarity:

[0080]

[0081] You can also use Euclidean distance, where smaller distances indicate greater similarity:

[0082]

[0083] Among them, V q The feature vector representing the reference image; represents the feature vector of the i-th query sample; ||·|| represents the norm operator;

[0084] (2.3) Top-K similar sample selection: Select the K reference samples with the highest similarity to the query image; preferably, K is a number between 5 and 10:

[0085]

[0086] Among them, TopK is the set of K reference samples with the highest similarity to the query image, where i1,i2,...,i K are the indexes of these K samples in the knowledge base;

[0087] Among them, the index set {i1,i2,...,i K}satisfy:

[0088]

[0089] And for any have

[0090] wherein, Sim (feature vector 1, feature vector 2) represents the similarity between the feature vector 1 and the feature vector 2; as represents the similarity between the feature vector V q and the feature vector ; other expression meanings are similar, and are not described here.

[0091] (3) BIC code accurate positioning cycle

[0092] For each candidate reference image, i.e. reference sample , the following steps are performed in the order from high to low similarity:

[0093] (3.1) Local feature extraction: local feature points are extracted from the query image I q and the current reference sample , respectively, and the local feature points to be extracted are pre-set:

[0094] The point set of the extracted feature points of the query image is P q , wherein: its corresponding descriptor , wherein m is the total number of feature points in P q ;

[0095] The point set of the extracted feature points of the reference sample, i.e. reference image, is P r , wherein, its corresponding descriptor , wherein m is the total number of feature points in P r ;

[0096] Preferably, n = m;

[0097] wherein each feature point is represented by a two-dimensional space coordinate, such as p = (x, y), x is the horizontal coordinate of the feature point, and y is the vertical coordinate of the feature point;

[0098] (3.2) Feature point matching: the corresponding relationship between the feature points of the query image and the reference sample is established:

[0099] For each point , find its best matching point , so that:

[0100]

[0101] wherein ||·||2 represents the 2-norm operator; specifically, is the 2-norm of ; , i.e. j is the k value that makes the minimum value;

[0102] Further apply Lowe's ratio test to screen high quality matched points:

[0103]

[0104] where j' is the second nearest neighbor, θ ratio is a pre-defined ratio threshold, whose value is less than 1 and greater than 0; preferably, θ ratio is in the range of 0.7 to 0.8;

[0105] Finally, obtain a set of matched point pairs M containing / pairs of matched points, preferably / is greater than or equal to 3:

[0106]

[0107] (3.3) Affine transformation matrix calculation: calculate the affine transformation matrix H between the query image and the current reference sample based on the matched point pairs in M, such that:

[0108] p q ≈ H - p r ; where p q refers to the feature points in M belonging to the query image, which includes the above to p r refers to the feature points in M belonging to the reference sample that are matched with p q , which includes the above to

[0109] Preferably, H is expressed as a 3x3 matrix:

[0110]

[0111] where the meanings of the elements in the affine matrix H between the two images are known to those skilled in the art. In a specific implementation, h 11 , h 12 ... to h 23 represent the x-axis direction scaling factor, the y-axis direction shear factor, the x-axis translation, the x-axis direction shear factor, the y-axis direction scaling factor, and the y-axis translation, respectively.

[0112] Solve H using the RANSAC algorithm to minimize the mapping error:

[0113]

[0114] where M inlier is the set of inliers selected by the RANSAC algorithm, excluding the influence of abnormal matched points.

[0115] (3.4) BIC box mapping transformation: mapping the position of the region where the BIC code in the reference sample is located to the query image through the transformation matrix H; in one specific implementation, the position of the region where the BIC code is located is represented by a bounding box such as a rectangular bounding box, and the position of the rectangular bounding box is the position of the rectangular bounding box; in one specific implementation, the position of the BIC code bounding box is represented by the coordinates of the left lower corner vertex and the right upper corner vertex of the bounding box, specifically as follows: i k is the index number of the reference sample:

[0116]

[0117] wherein, is the coordinate of the left lower corner vertex of the BIC code bounding box of the reference sample; is the coordinate of the right upper corner vertex of the BIC code bounding box of the reference sample; it is known to those skilled in the art that in other implementations, another pair of vertices on the diagonal or other points related to the position of the bounding box can be used to represent the position of the bounding box, which is not described here;

[0118] Correspondingly, the predicted BIC code bounding box in the query image is obtained as follows:

[0119]

[0120] wherein, the predicted BIC code bounding box in the query image is the position of the BIC code bounding box obtained after mapping the position of the BIC code bounding box in the reference sample to the query image; wherein, is the coordinate of the left lower corner vertex of the predicted BIC code bounding box; is the coordinate of the right upper corner vertex of the BIC code bounding box of the predicted BIC code bounding box;

[0121] (3.5) Extraction of BIC region image: extracting the image of the potential BIC region from the query image according to the position of the bounding box B q

[0122]

[0123] (4) Text recognition and verification

[0124] In one specific implementation, the OCR technology is used to recognize the text in the image to obtain the BIC code; specifically:

[0125] (4.1) OCR text recognition: recognizing the extracted BIC region image ​Input to the optimized OCR engine such as PaddleOCR for text recognition:

[0126]

[0127] where bicOcrResult represents the recognition result;

[0128] The OCR processing flow includes:

[0129] Text detection: locating the text line positions in the image;

[0130] Text direction classification: determining the orientation of the text and correcting it;

[0131] Text recognition: converting the text area into a character sequence;

[0132] (4.2) BIC format verification: performing ISO 6346 international standard specification verification on the recognition result: isValid = Verify ISO6346 (bicOcrResult)

[0133] ISO 6346 verification rules:

[0134] First 4 digits: owner code (3 uppercase letters + 1 uppercase letter or number)

[0135] Middle 6 digits: serial number (6 digits)

[0136] Last 1 digit: check digit (calculated based on the first 10 digits)

[0137] Check digit calculation formula:

[0138]

[0139] where d i is the numerical value of the ith character (letters A-Z correspond to 10-35 respectively)

[0140] (4.3) Verification result processing:

[0141] If isValid = True, i.e., the verification is passed, return the final BIC recognition result bicOcrResult;

[0142] If isValid = False, i.e., the verification is not passed, continue processing the next reference sample at the bottom of the TopK reference samples, i.e., perform steps (1) to (4) above for the next reference sample.

[0143] (5) Exception handling and continuous learning

[0144] (5.1) Recognition Failure Handling: If all K reference images fail to produce valid recognition results, trigger an exception handling procedure:

[0145]

[0146] (5.2) Data Preservation and Queue Management:

[0147] Query images that failed recognition are automatically saved and assigned a unique ID:

[0148]

[0149] timestamp, location, cameraID represent the timestamp, location, and camera identification corresponding to the image, respectively;

[0150] are added to the manual annotation queue:

[0151]

[0152] (5.3) Manual Feedback and Knowledge Base Update:

[0153] Experts manually annotate the accurate BIC code positions and corresponding BIC code text bicText manual ;

[0154] Extract the feature vectors of :

[0155] Update the knowledge base:

[0156]

[0157] (5.4) Continuous Optimization of System Performance:

[0158] Periodically re-evaluate the efficiency of the knowledge base, remove redundant or low-quality samples

[0159] Analyze recognition failure patterns and optimize algorithm parameters:

[0160] {θ detect , θ ratio , K} ← OptimizeParameters(FailureStatistics)

[0161] Form a closed-loop feedback mechanism to continuously improve the system's recognition performance as data accumulates

[0162] ​​Through the above-mentioned adaptive cycle process, the recognition method of the embodiment of the present invention can effectively cope with the challenges of container BIC code recognition in various complex scenarios and continuously improve itself over time.

[0163] In the recognition method of the embodiment of the present invention, an image knowledge base of container numbers, such as BIC codes, is pre-built. Figure 3 FIG. 1 is a schematic diagram of a BIC code image knowledge base construction process in one embodiment.

[0164] like Figure 3 ,The knowledge base construction process includes the following steps:

[0165] 1. Data collection and preprocessing:

[0166] Collect a sample of container images covering a variety of scenarios, ensuring that they include images from different companies, angles, and lighting conditions;

[0167] Use the YOLO object detection model to accurately locate the container area in the image;

[0168] Perform cutout processing on the positioning area to generate standardized container image samples;

[0169] 2. Feature extraction:

[0170] Use the pre-trained ResNet-50 deep learning model to extract high-dimensional representation features of container images;

[0171] Generate a 2048-dimensional feature vector as the digital fingerprint of each container image;

[0172] These features can effectively capture the visual characteristics of containers, including color distribution, texture patterns, and structural information;

[0173] 3. Manual annotation:

[0174] Professionals accurately mark the location of the BIC code on the container image; in one specific implementation, the location of the BIC code is marked using rectangular frame coordinates;

[0175] Standardize the annotation coordinates and convert them into relative position representation to adapt to images of different sizes;

[0176] These annotation information will provide accurate guidance for subsequent BIC code positioning;

[0177] 4. Index construction:

[0178] Use high-performance vector databases such as Milvus or FAISS to build an efficient similarity retrieval system;

[0179] For each reference sample, the image feature vector is associated with the corresponding BIC code position information and stored;

[0180] An index structure supporting fast nearest neighbor search is constructed to achieve millisecond-level retrieval response capability.

[0181] Embodiment three:

[0182] The application further provides a container number recognition device, comprising a memory and a processor, the memory storing at least one program, and the at least one program being executed by the processor to realize the steps of the container number recognition method according to any one of the above.

[0183] Further, as an executable solution, the device can be a computer unit, which can be a desktop computer, a notebook computer, a palm computer, a cloud server and the like computing device. The computer unit can include, but is not limited to, a processor and a memory. Those skilled in the art can understand that the above-mentioned component structure of the computer unit is merely an example of the computer unit, and does not constitute a limitation on the computer unit, and can include more or less components than the above, or combine certain components, or different components. For example, the computer unit can also include an input / output device, a network access device, a bus and the like, and the embodiments of the application do not limit this.

[0184] Further, as an executable solution, the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The processor is the control center of the computer unit, and connects all parts of the computer unit through various interfaces and lines.

[0185] The memory can be used to store the computer program and / or modules, and the processor realizes various functions of the computer unit by running or executing the computer program and / or modules stored in the memory, and calling data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required by a function; the data storage area can store data created according to the use of the mobile phone and the like. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0186] Embodiment four:

[0187] The application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the steps of the method in the above embodiment of the application.

[0188] The modules / units integrated by the computer unit, if realized in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes of the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. The computer program can realize the steps of each method embodiment when being executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM) and software distribution medium, etc. It should be noted that the computer readable medium can include or exclude contents according to the requirements of legislation and patent practice in the jurisdiction.

[0189] Embodiment five:

[0190] The application further provides a computer program product, which includes a computer program, and the computer program is executed by a processor to realize the steps of the method as described above.

[0191] Although the present application has been particularly shown and described with respect to preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details can be made therein without departing from the spirit and scope of the application as defined in the appended claims.

Claims

1. A method for identifying a container number, characterized in that: include: S1, obtain an image containing a container; S2, using a predetermined target detection model to locate a first area where the container is located in the image; S3, extracting the first region from the image to generate a query image; S4, searching a pre-built container number image knowledge base to obtain K container image samples similar to the query image as reference samples, where K is a predetermined number; wherein the container number image knowledge base pre-associatively stores: the container image samples and the locations of the second regions where the container numbers are located in the container image samples; S5, in descending order of similarity, perform the following steps for each of the K reference samples: S51, determining a set of matching point pairs between the query image and the reference sample based on a relationship between the selected feature points of the query image and the selected feature points of the reference sample; S52, obtaining an affine transformation matrix between the query image and the reference sample based on the set of matching point pairs; S53, mapping the position of the second region where the container number in the reference sample is located to the query image using the affine transformation matrix to obtain a third region where the container number is located in the query image; S54, using a predetermined text recognition algorithm to recognize the text in the third area to obtain a candidate recognition result; S55, verifying the candidate recognition result according to a predetermined verification rule. If the candidate recognition result passes the verification, the recognition result is the final recognition result; if the candidate recognition result fails the verification, returning to execute step S51 for the next reference sample in the order.

2. The identification method according to claim 1, characterized in that The container number is the BIC code.

3. The identification method according to claim 1, characterized in that The location of the second area is represented by a bounding box.

4. The identification method according to claim 1, wherein: The step S3 further includes: extracting a feature vector of the query image using a predetermined deep learning model; in the step S4, the feature vector of the container image sample is also stored in association with the container image sample in the container number image knowledge base, and container image samples similar to the query image are determined based on the feature vector of the query image and the feature vector of the container image sample.

5. The identification method according to claim 4, characterized in that: The steps to build a container number image knowledge base include: Obtain multiple container image samples covering multiple predetermined scenes; For each of the plurality of container image samples, using a predetermined object detection model to locate a fourth area where the container in the sample is located; For each container image sample, extract its fourth region to obtain a standardized container image sample; For each standardized container image sample, a pre-trained deep learning model is used to extract the feature vector of the container image in the sample; For each standardized container image sample, marking the position of the fifth area where the container number is located in the container image in the sample, and converting the marked position of the fifth area into a relative position; A similarity retrieval system is established using the selected vector database, in which the container image sample, the feature vector corresponding to the container image sample, and the relative position of the fifth area in the container image sample are associated and stored.

6. The identification method according to claim 5, characterized in that The predetermined multiple scenes include: container image samples from different companies, container image samples from different angles, and container image samples under different lighting conditions.

7. The identification method according to claim 1, characterized in that: The predetermined verification rule is the ISO 6346 verification standard.

8. A container number identification device, characterized in that: The system comprises a memory and a processor, wherein the memory stores at least one program, and the at least one program is executed by the processor to implement the steps of the container number identification method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that The storage medium stores at least one program, and the at least one program is executed by a processor to implement the steps of the container number identification method according to any one of claims 1 to 7.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the container number recognition method according to any one of claims 1 to 7 are implemented.