Checking instrument image template identification method, device, equipment and medium
By matching the key features of the template image of the calibration tester and the affine transformation matrix, the problem of low recognition efficiency of complex layout templates is solved, and efficient and accurate template matching is achieved.
Patent Information
- Application Number
- CN202510241197.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-03
- Publication Date
- 2025-07-25
AI Technical Summary
The existing tester image model recognition technology is difficult to effectively process template recognition in complex layouts, resulting in low recognition efficiency and unreliableness, and cannot meet the practical application needs.
By calibrating the key features of the tester template image, the matching anchor points are determined and the global match is performed. If not unique, the affine transformation matrix is calculated for quadratic matching, and the final template matching result is obtained to improve the accuracy and efficiency of template recognition.
It improves the efficiency and accuracy of template recognition of complex tester, reduces misjudgment, enhances the reliability of identification, and solves the problem of template similarity and indistinguishability.
Smart Images

Figure CN120375403A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of inspection instrument layout matching, and specifically to a method, device, equipment and medium for image template recognition of inspection instruments. Background Art
[0002] In a complex scene containing table and image elements, the analysis and recognition of the layout structure become the key steps of text recognition. The complex layout matching technology aims to achieve accurate recognition and structured processing of these elements by analyzing and understanding the spatial layout of elements such as text, tables, and images contained in the document. This technology relies on advanced document analysis methods. However, there are various types of inspection instrument panels, and panel images include various tables and images, where the recognition of field values and field labels is difficult. Conventional OCR technology and table recognition technology have low recognition rates and it is difficult to accurately correspond field values and field labels, resulting in low efficiency and unreliability in the recognition of complex inspection instrument layout image models, and unable to meet the actual application requirements.
[0003] The patent "A Graphic Recognition Method, a Method and Device for Determining a Graphic Recognition Template", publication number: CN113869223A, publication date: December 31, 2021, discloses: obtaining a first image to be subjected to graphic recognition, including at least one object to be recognized; extracting the graphic element feature information included in any object to be recognized in the first image, and performing graphic recognition classification on all objects to be recognized according to the graphic element feature information of each object to be recognized and a preset graphic recognition template to obtain regular graphics and irregular graphics; by comparing the graphic element feature information of the object image with the graphic element feature information in the template one by one, graphic classification is realized, greatly improving the drawing efficiency of designers. However, this solution is to recognize the graphic element features of the image, thereby presetting a graphic template according to the graphic element features, and then comparing the graphic element features with the preset template. The accuracy of the preset template affects the accuracy and reliability of graphic recognition. Especially for complex layout panels containing various table forms and images, it is difficult to guarantee the recognition accuracy, and this solution has poor adaptability. Summary of the Invention
[0004] The object of the present application is to address the problem that the image model recognition technology of conventional inspection instruments has a poor recognition effect for complex layout templates; a method, device, equipment, and medium for template recognition of inspection instrument images are proposed. By calibrating the key feature information of the inspection instrument template image to determine the matching anchor points, the business inspection instrument image after text recognition is globally matched through the anchor points. If the global match is successful, the corresponding template panel of the business inspection instrument image is found. The anchor point matching reduces the matching range and thus improves the template matching efficiency; since the anchor point matching may have non-unique matching results, therefore, if the template is not unique after global matching, the affine transformation matrix is further calculated to transform the sub-table structure and then perform a secondary match with the business inspection instrument image to obtain the final template matching result, improving the recognition efficiency, template matching efficiency, accuracy, and reliability of complex inspection instrument templates, and overcoming the problem that the conventional inspection instrument image model recognition technology is difficult to handle the recognition and matching of complex layout templates.
[0005] To solve the above technical problems, according to the first aspect of the embodiments of the present application, a method for template recognition of inspection instrument images is provided, including the following steps: S1. Calibrate the key features of the inspection instrument template image, including at least the sub-table structure, field labels, and field value display frames corresponding to the field labels of the template image; S2. Determine the matching anchor points according to the field labels and the corresponding field value display frames; S3. Perform global matching according to the text recognition data of the business inspection instrument image and the matching anchor points. If not matching, retrieve a new inspection instrument template image and re-execute S1; if matching and the matching template is not unique, execute S4; S4. Based on the affine transformation matrix between the inspection instrument template image and the business inspection instrument image, transform the sub-table structure and then perform a secondary match with the business inspection instrument image to obtain the final template matching result.
[0006] In this solution, by calibrating the template image of the tester, the panel of testers from different manufacturers and types can be accurately located and identified, and the template features can be described more accurately, providing an accurate data basis for subsequent matching, which helps to improve the accuracy and reliability of recognition; by comparing the text recognition data of the business tester image with the matching anchor points of the tester template image, the matching range is narrowed, and the template that may match the business tester image can be quickly and accurately identified, improving the accuracy of matching, reducing the possibility of misjudgment, and thus enhancing the overall recognition efficiency; further, if there are multiple similar templates in the global matching, the coordinate affine transformation is performed on the business tester image, and the field value label of the calibration point field of the template image is directly matched in the business tester image, and then the sub-table is deeply compared on the basis of the preliminary screening of the global matching. The problem that it is difficult to distinguish similar template images is effectively solved through secondary matching, thereby improving the accuracy, reliability and efficiency of tester template recognition and matching.
[0007] Preferably, the S1 includes: Construct a calibration model for the tester panel image; Based on the calibration model of the tester panel image, keyword field labels and corresponding field value display frames are calibrated for the tester template image. Among them, the calibrated field value display frame includes the field content, the central position coordinate information, width information and height information of its surrounding rectangle frame; Based on the image style of the tester template image, the sub-table structure is calibrated, and the sub-table result includes the field label and its corresponding field value display frame.
[0008] Preferably, the constructing of the calibration model for the tester panel image includes: Obtain several tester template images of different types according to the business scenario, mark the field labels and the positions of their corresponding field value display frames of each tester template image, and use the marked images as training samples after coordinate and position normalization; Based on the automatic detection algorithm, use the training samples as input parameters for model training to obtain a calibration model for the tester panel image.
[0009] Preferably, the S2 includes: Retrieve at least four of the field labels located in the edge area of the tester template image as target anchor points; Combine the field content corresponding to each target anchor point and the central position coordinate information, width information and height information of its surrounding rectangle frame to obtain a target anchor point information set to obtain the matching anchor point.
[0010] Preferably, the S3 includes: Perform optical character recognition (OCR) on the image of the business inspection instrument to obtain character recognition data including the content of the character string and its position information; Globally match the content of the character string and its position information with the field content of the matching anchor points and their positions; If the number of matching anchor points found is less than the matching threshold or the image area where the anchor points are matched is less than the area threshold, the current inspection instrument template does not match, and a new inspection instrument template image is retrieved to re-execute the above S1; If the matching anchor points corresponding to the four edge regions of the inspection instrument template image are all matched, the business inspection instrument image matches the current inspection instrument template.
[0011] Preferably, the above S4 includes: Based on coordinate mapping, use the least squares method to calculate the affine coordinate transformation matrix from the inspection instrument template image to the business inspection instrument image; Based on the affine coordinate transformation matrix, transform the field labels of the sub-table structure into the business inspection instrument image, and match the positions of the field labels and their field value display boxes of the sub-table structure with the content of the character string and its position information in the business inspection instrument image. If all items can be matched, the sub-table structure is successfully matched, and the inspection instrument template of the sub-table structure is used as the panel of the business inspection instrument image.
[0012] Preferably, the step of calculating the affine coordinate transformation matrix from the inspection instrument template image to the business inspection instrument image based on coordinate mapping using the least squares method includes: Use the coordinate information of the inspection instrument template image and the business inspection instrument image as the coefficients of the transformation matrix to construct the transformation matrix and the coefficient vector; Based on the least squares method, solve the transformation matrix and the coefficient vector to obtain the affine coordinate transformation matrix.
[0013] In a second aspect, a device for recognizing an inspection instrument image template is provided, including: A calibration module for calibrating the key features of the inspection instrument template image, including at least the sub-table structure, field labels, and field value display boxes corresponding to the field labels of the template image; An acquisition module for determining matching anchor points according to the field labels and the corresponding field value display boxes; A matching module for globally matching according to the character recognition data of the business inspection instrument image and the matching anchor points. If there is no match, a new inspection instrument template image is retrieved to re-execute the anchor point matching program; if there is a match and the matching templates are not unique, secondary matching is performed based on the sub-table structure; A calculation module, configured to perform a secondary matching between the sub-table structure after transformation based on the affine transformation matrix of the tester template image and the business tester image and the business tester image, so as to obtain a final template matching result.
[0014] In a third aspect, a computer device is provided, including a memory and a processor. Computer-readable instructions are stored in the memory, and when the processor executes the computer-readable instructions, the steps of the tester image template recognition method are implemented.
[0015] In a fourth aspect, a computer-readable storage medium is provided. Computer-readable instructions are stored on the computer-readable storage medium, and when the computer-readable instructions are executed by a processor, the steps of the tester image template recognition method are implemented.
[0016] Advantages of the present application: 1. By calibrating the template information to record its position and size, the template features can be described more accurately, the panels of testers from different manufacturers and types can be accurately positioned and recognized, the selected anchor points are more accurate, which helps to enhance the accuracy and stability of matching; 2. By comparing the text strings at the corners of the business tester image with the content of the anchor point labels, it can be quickly determined whether the template matches, reducing misjudgment, improving the accuracy of matching, and avoiding incorrect matching caused by the similarity of other parts of the layout; 3. When the templates for global matching are not unique, by calculating the area of the sub-table in the input panel image through the matching transformation matrix and matching the calibrated field value labels within this area, the accuracy of recognition is further improved, effectively solving the problem of difficult distinction due to similar templates. Description of the Drawings
[0017] By reading the detailed description of the non-restrictive embodiments with reference to the following drawings, other features, objectives, and advantages of the present application will become more obvious. The drawings are only for the purpose of showing the preferred embodiments and are not considered as a limitation of the present application. Moreover, throughout the drawings, the same reference numerals are used to represent the same components.
[0018] Figure 1 It is a flowchart of a tester image template recognition method according to an embodiment of the present application.
[0019] Figure 2 For Figure 1 It is a flowchart of a specific implementation manner of step S1 in
[0020] Figure 3 For Figure 1 It is a flowchart of a specific implementation manner of steps S2 and S3 in
[0021] Figure 4 For Figure 1Flowchart of a specific implementation of step S4 in
[0022] Figure 5 Block diagram of an inspection instrument image template recognition device according to an embodiment of the present application.
[0023] Figure 6 Schematic structural diagram of a computer device according to an embodiment of the present application. Specific implementation mode
[0024] To make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific implementation mode described here is only a best embodiment of the present application, which is only used to explain the present application and does not limit the protection scope of the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.
[0025] Embodiment 1: As Figure 1 shown, an inspection instrument image template recognition method includes steps S1 - S4, where: S1. Calibrate the key features of the inspection instrument template image, including at least the sub - table structure, field labels, and field value display boxes corresponding to the field labels of the template image.
[0026] Specifically, S1 includes: Construct an inspection instrument panel image calibration model; Based on the inspection instrument panel image calibration model, calibrate the keyword field labels and the corresponding field value display boxes of the inspection instrument template image. Among them, the calibrated field value display boxes include the field content, the central position coordinates, width information, and height information of its surrounding rectangle frame; Based on the image style of the inspection instrument template image, calibrate the sub - table structure, and the sub - table result includes the field labels and their corresponding field value display boxes.
[0027] As an implementation mode, as Figure 2 shown, calibrate the inspection instrument image template in the order from left to right according to the horizontal position of the inspection instrument template image, including calibrating all field labels and the corresponding field value display boxes, recording their positions and sizes. Each field label includes the field content L, the central position coordinates (x, y) of its surrounding rectangle frame, width, and height (w, h), and the position, height, and width are recorded together as P(x, y, w, h).
[0028] Specifically, the construction of the inspection instrument panel image calibration model includes: Obtain several inspection instrument template images of different types according to the business scenario, label the field tags of each inspection instrument template image and the positions of their corresponding field value display boxes, and use the labeled images as training samples after normalizing the coordinates and positions; based on the automatic detection algorithm, use the training samples as input parameters for model training to obtain an inspection instrument panel image calibration model.
[0029] As an implementation, the YOLO algorithm is used as the automatic detection algorithm to construct the inspection instrument panel image calibration model. Specifically, it includes: Collect a large number of inspection instrument template images from different manufacturers and models, label each image, and determine the positions of the field tags and field value display boxes, which are represented by the center coordinates (x, y), width, and height (w, h) of the bounding rectangle. The position, height, and width are recorded together as P(x, y, w, h); Normalize the center coordinates and sizes to a set interval, such as the [0, 1] interval. Converting to the numerical interval suitable for input calculation by the YOLO algorithm helps improve the model calibration efficiency. Use the converted template images as the training set; Based on the YOLO algorithm, divide the inspection instrument template image into a grid of S×S. For each grid, predict B bounding boxes and the confidence C that each bounding box belongs to the target field tag, and output a tensor containing the bounding box coordinates and confidence to obtain the basic framework of the model; by using the training set as input parameters for model training, obtain the inspection instrument panel image calibration model.
[0030] Furthermore, according to the characteristics of the inspection instrument template image, the hyperparameters of the network, such as the convolutional kernel size, stride, number of layers, etc., can be adjusted to optimize the model performance; when applying the model to the calibration task of the inspection instrument template image, by inputting the template image to be calibrated, the model will output the predicted bounding box coordinates, confidence, and class probability. Then, filter out the effective bounding boxes according to the confidence threshold to obtain the calibration results of the field tags and field value display boxes, and complete the automatic calibration of the template image.
[0031] In this embodiment, the automatic detection algorithm can automatically learn the characteristics of the field tags and field value display boxes in the image. Training after image annotation enables the model to accurately identify the target under different conditions. Recording the position and size of the calibration template information can more accurately describe the template characteristics, precisely locate and identify the panels of different manufacturers and types of inspection instruments, making the selected anchor points more accurate, which helps enhance the accuracy and stability of the matching. By determining the sub-table area of the inspection instrument's image template in the image, each sub-table contains the corresponding field tags and their field value display boxes. These information are used to describe the position and size characteristics of the sub-table in the template image, providing sub-table level structural data support for subsequent panel matching to ensure that the characteristics of the sub-table can be accurately identified and compared during the matching process.
[0032] S2. Determine the matching anchor points according to the field labels and the corresponding field value display boxes.
[0033] Specifically, S2 includes: Retrieve at least four field labels located in the edge area of the template image of the tester as target anchor points; Combine the field content corresponding to each target anchor point and the central position coordinates, width information, and height information of its surrounding rectangle to obtain a set of target anchor point information, so as to obtain the matching anchor points.
[0034] As an implementation manner, as Figure 2 shown, select 4 to 8 field labels as close to the four corners as possible as matching anchor points, with 1 - 2 selected for each corner; that is, select 1 or 2 field labels from each of the four corners (upper left corner, upper right corner, lower left corner, and lower right corner) of the template image as matching anchor points.
[0035] In this embodiment, the positions of the four corners in the layout are unique and fixed, which can provide a stable reference framework for template matching; the field labels at the corners are less affected by the changes of internal elements in the layout and are more stable compared with the labels at other positions; by comparing the text strings at the corners of the tester image with the content of the anchor point labels, it can be quickly determined whether the template matches. If the anchor points at all four corners can be matched, it indicates to a great extent that the tester image and the template are globally matched. This matching method based on corner anchor points can reduce misjudgment, improve the accuracy of matching, and avoid incorrect matching caused by the similarity of other parts of the layout. In practical applications, some parts of the tester panel may be blocked, blurred, or there may be noise interference, while the labels at the corners are relatively easier to be completely retained; when these situations occur, the matching can still be carried out based on the corner anchor points to ensure the stability of the recognition process. Even if the information of other parts of the layout is missing or damaged, as long as the corner anchor points can be recognized, the matching operation can continue, and the entire matching process will not be interrupted due to local problems.
[0036] S3. Perform global matching according to the text recognition data of the tester image and the matching anchor points. If they do not match, retrieve a new template image of the tester and re - execute S1; if they match and the matching templates are not unique, then execute S4.
[0037] Specifically, S3 includes: Perform text recognition on the tester image through OCR to obtain text recognition data including text string content and its position information; Perform global matching on the text string content and its position information with the field content and its position of the matching anchor points; If the number of matching anchor points found is less than the matching threshold or the image area where the matching anchor points are found is less than the area threshold, the current inspector template does not match, and a new inspector template image is retrieved to re - execute the above - mentioned S1; If the matching anchor points corresponding to the four edge regions of the inspector template image all match, then the service inspector image matches the current inspector template.
[0038] As an implementation, as Figure 3 shown, first, perform OCR (Optical Character Recognition) on the service inspector image to recognize the text string, obtaining text recognition data including the content of the text string and its position information; perform global matching based on the recognized text string content, its position, and the matching anchor points. If the number of matching anchor points is less than 3 or the number of corners where anchor points are found is less than 3, then this template does not match, and the next template is taken to repeat the anchor point matching process. Subscript rearrangement is performed on the field labels and text strings of the successfully matched anchor points, and a set of text string pairs with consistent label content can be obtained, that is, the panel label content of the service inspector image is obtained. If the global matching result is not unique, further matching is performed through the sub - table to ensure correct matching to the panel to meet the actual scenario requirements.
[0039] In this embodiment, in the global matching stage, start comparing from the corner anchor points. If the number of matching anchor points is less than 3 or the number of corners where anchor points are found is less than 3, it can be quickly determined that this template does not match, and the next template is taken to repeat the matching, quickly excluding the unmatched templates and narrowing the matching range. Compared with the matching method of comprehensively comparing all elements on the layout, the amount of calculation and matching time are greatly reduced. When processing a large number of different inspector panel images, this fast screening mechanism based on corner anchor points can quickly screen out the templates that may match, narrow the matching range, improve the accuracy of matching, reduce the possibility of misjudgment, and significantly improve the overall recognition and matching efficiency of the inspector template.
[0040] S4. Based on the affine transformation matrix between the inspector template image and the service inspector image, transform the sub - table structure and then perform secondary matching with the service inspector image to obtain the final template matching result.
[0041] Specifically, the S4 includes: Calculate the affine coordinate transformation matrix from the inspector template image to the service inspector image using the least - squares method based on coordinate mapping; Based on the affine coordinate transformation matrix, transform the field labels of the sub-table structure into the image of the service inspection instrument, and match the positions of the field labels and their field value display boxes of the sub-table structure with the text string content and its position information in the image of the service inspection instrument. If all items can be matched, the sub-table structure is successfully matched, and the inspection instrument template of the sub-table structure is used as the panel of the image of the service inspection instrument.
[0042] Specifically, calculating the affine coordinate transformation matrix from the inspection instrument template image to the service inspection instrument image by using the least squares method based on coordinate mapping includes: Using the coordinate information of the inspection instrument template image and the service inspection instrument image as the transformation matrix coefficients to construct a transformation matrix and a coefficient vector; Solving the transformation matrix and the coefficient vector based on the least squares method to obtain the affine coordinate transformation matrix.
[0043] As an implementation manner, as Figure 4 shown, if the globally matched templates are not unique, perform a comparison of the field labels of the sub-tables until the matched templates are unique or it is confirmed that there are templates with exactly the same structure. The steps are as follows: Based on coordinate mapping Calculate the affine coordinate transformation matrix H from the template image A to the service inspection instrument image B, where is the coordinate of the template image A, and is the coordinate of the service inspection instrument image B; where H t is the transformation matrix, and A and b are the coefficient vectors respectively; Establish a matching relationship according to the transformation matrix and the coefficient vector as follows: AH t = b; Use the least squares method to transform the matching relationship to obtain: H t = (A T A) -1 A T b; Substitute the coordinate information of the inspection instrument template image and the service inspection instrument image into this formula to solve for the affine coordinate transformation matrix H.
[0044] Furthermore, the bounding rectangle R of the field labels of the sub-table structure of the inspection instrument template image i (x i ,yi , w i , h i ) It is transformed into the image of the service inspection instrument through the affine transformation H to obtain a coordinate transformation rectangle In the coordinate transformation rectangle Match the character string recognized in the image of the service inspection instrument. If all the field labels of the sub-table structure can be matched, it means that the sub-table structure matching is successful; otherwise, this inspection instrument template does not belong to the panel corresponding to this service inspection instrument image.
[0045] In this embodiment, when the globally matched templates are not unique, calculate the area of the sub-table in the input panel image through the matching transformation matrix, and match the calibrated field value labels within this area. If a match can be found, the sub-table matching is successful; if the templates matched by the current sub-table are not unique, continue to perform other sub-table matches until the matched templates are unique or it is confirmed that there are duplicate templates, which further improves the recognition accuracy and effectively solves the problem that it is difficult to distinguish similar templates.
[0046] Embodiment 2, as Figure 5 shown, this application provides an inspection instrument image template recognition device 500, which can be specifically applied to various electronic devices. It includes: a calibration module 501, an acquisition module 502, a matching module 503, and a calculation module 504, where:[[]] The calibration module 501 is used to calibrate the key features of the inspection instrument template image, including at least the sub-table structure, field labels, and field value display boxes corresponding to the field labels of the template image; The acquisition module 502 is used to determine matching anchor points according to the field labels and the corresponding field value display boxes; The matching module 503 is used to perform global matching according to the character recognition data of the service inspection instrument image and the matching anchor points. If there is no match, retrieve a new inspection instrument template image and re-execute the anchor point matching program; if there is a match and the matching templates are not unique, perform secondary matching based on the sub-table structure; The calculation module 504 is used to perform secondary matching with the service inspection instrument image after transforming the sub-table structure based on the affine transformation matrix between the inspection instrument template image and the service inspection instrument image, and obtain the final template matching result.
[0047] To solve the above technical problems, this application embodiment also provides a computer device, as Figure 6 shown, the computer device 6 includes a memory 61, a processor 62, and a network interface 63. Computer-readable instructions are stored in the memory, and the computer-readable instructions can be executed by at least one processor, so that the at least one processor executes the steps of the inspection instrument image template recognition method as described above.
[0048] It should be noted that only the computer device 6 with components 61-63 is shown in the figure, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Among them, those skilled in the art of the present technology can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0049] The computer device can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The computer device can interact with the user through a keyboard, a mouse, a remote control, a touchpad, or a voice control device.
[0050] The memory 61 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 61 can be an internal storage unit of the computer device 6, such as the hard disk or memory of the computer device 6. In other embodiments, the memory 61 can also be an external storage device of the computer device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 6. Of course, the memory 61 can also include both the internal storage unit and the external storage device of the computer device 6. In this embodiment, the memory 61 is generally used to store the operating system and various application software installed on the computer device 6, such as computer-readable instructions for the data query method based on the optimized statistical information histogram. In addition, the memory 61 can also be used to temporarily store various data that have been output or will be output.
[0051] In some embodiments, the processor 62 may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 62 is generally used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is used to run the computer-readable instructions stored in the memory 61 or process data, such as running the computer-readable instructions of the data query method based on the optimized statistical information histogram.
[0052] The network interface 63 may include a wireless network interface or a wired network interface, and this network interface 63 is generally used to establish a communication connection between the computer device 6 and other electronic devices.
[0053] A computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the inspection instrument image template recognition method are implemented.
[0054] The above specific embodiments are the preferred embodiments of the present application. The specific implementation scope of the present application is not limited thereby. The scope of the present application includes but is not limited to this specific implementation. All equivalent changes made according to the shape, structure, and method of the present application are within the protection scope of the present application.
Claims
1. An inspection instrument image template recognition method, characterized in that: It includes the following steps: S1. Calibrate the key features of the template image of the inspection instrument, including at least the sub-table structure, field labels, and field value display boxes corresponding to the field labels of the template image; S2. Determine the matching anchor points according to the field labels and the corresponding field value display boxes; S3. Perform global matching based on the character recognition data of the business inspection instrument image and the matching anchor points. If there is no match, retrieve a new template image of the inspection instrument and re-execute S1; if there is a match and the matching templates are not unique, execute S4; S4. Perform secondary matching between the transformed sub-table structure and the business inspection instrument image after transforming the sub-table structure based on the affine transformation matrix between the inspection instrument template image and the business inspection instrument image to obtain the final template matching result.
2. The method for recognizing an inspection instrument image template according to claim 1, characterized in that: The S1 includes: Construct an inspection instrument panel image calibration model; Based on the inspection instrument panel image calibration model, calibrate the keyword field labels and the corresponding field value display boxes of the inspection instrument template image. Among them, the calibrated field value display boxes include the field content, the central position coordinate information, width information, and height information of its surrounding rectangle frame; Calibrate the sub-table structure based on the image style of the inspection instrument template image. The sub-table result includes the field labels and the corresponding field value display boxes.
3. A method for identifying an inspection instrument image template according to claim 2, characterized in that: The construction of the inspection instrument panel image calibration model includes: Obtain several different types of inspection instrument template images according to the business scenario, mark the field labels and the positions of the corresponding field value display boxes of each inspection instrument template image, and use the marked images as training samples after coordinate and position normalization; Based on the automatic detection algorithm, use the training samples as input parameters for model training to obtain an inspection instrument panel image calibration model.
4. The image template recognition method of an inspection instrument according to claim 1, wherein: The S2 includes: Retrieve at least four field labels located in the edge area of the inspection instrument template image as target anchor points; Combine the field content corresponding to each target anchor point and the central position coordinate information, width information, and height information of its surrounding rectangle frame to obtain a target anchor point information set to obtain the matching anchor points.
5. A method for recognizing an inspection instrument image template according to claim 1, characterized in that: The S3 includes: Perform character recognition on the business inspection instrument image through OCR to obtain character recognition data including the character string content and its position information; Perform global matching between the character string content and its position information and the field content and its position of the matching anchor points; If the number of matching anchor points found is less than the matching threshold or the image area where the matching anchor points are found is less than the area threshold, the current inspection instrument template does not match. Retrieve a new template image of the inspection instrument and re-execute S1; If the matching anchor points corresponding to the four edge areas of the inspection instrument template image are all matched, the business inspection instrument image matches the current inspection instrument template.
6. The method for identifying an inspection instrument image template according to claim 5, characterized in that: The S4 includes: Calculate the affine coordinate transformation matrix from the inspection instrument template image to the business inspection instrument image by using the least squares method based on coordinate mapping; Based on the affine coordinate transformation matrix, transform the field labels of the sub-table structure into the business inspection instrument image, and match the positions of the field labels and their field value display boxes of the sub-table structure with the text string content and its position information of the business inspection instrument image. If all items can be matched, the sub-table structure is successfully matched, and the inspection instrument template of the sub-table structure is used as the panel of the business inspection instrument image.
7. A method for identifying an inspection instrument image template according to claim 6, characterized in that: The method for calculating the affine coordinate transformation matrix from the inspection instrument template image to the business inspection instrument image based on coordinate mapping using the least squares method includes: using the coordinate information of the inspection instrument template image and the business inspection instrument image as the transformation matrix coefficients to construct a transformation matrix and a coefficient vector; Solve the transformation matrix and the coefficient vector based on the least squares method to obtain the affine coordinate transformation matrix.
8. An inspection instrument image template recognition device, characterized in that: A method for recognizing an inspection instrument image template applicable to any one of claims 1-7 above includes: A calibration module for calibrating key features of the inspection instrument template image, including at least the sub-table structure, field labels, and field value display boxes corresponding to the field labels of the template image; An acquisition module for determining matching anchor points according to the field labels and the corresponding field value display boxes; A matching module for performing global matching according to the text recognition data of the business inspection instrument image and the matching anchor points. If not matched, retrieve a new inspection instrument template image and re-execute the anchor point matching program; if matched and the matching templates are not unique, perform secondary matching based on the sub-table structure; A calculation module for performing secondary matching between the transformed sub-table structure and the business inspection instrument image based on the affine transformation matrix between the inspection instrument template image and the business inspection instrument image to obtain the final template matching result.
9. A computer device, characterized in that, It includes a memory and a processor. Computer-readable instructions are stored in the memory, and when the processor executes the computer-readable instructions, the steps of the inspection instrument image template recognition method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that, Computer-readable instructions are stored on the computer-readable storage medium, and when the computer-readable instructions are executed by the processor, the steps of the inspection instrument image template recognition method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Pattern recognition method and pattern recognition template determination method and device
CN113869223A