A tape scale extraction method, device and storage medium

CN122821580APending Publication Date: 2026-09-25HEFEI SUNGROW RENEWABLE ENERGY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611207976.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-10
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0004]本申请的主要目的在于提供一种卷尺刻度提取方法、设备及存储介质,旨在解决如何精确地提取卷尺测量图中的刻度数据,以提高施工验收效率的技术问题

Benefits of technology

[0015]本申请提供了一种卷尺刻度提取方法、设备及存储介质,所述卷尺刻度提取方法通过光学字符识别模型和目标检测模型分别对原始的卷尺测量图像中所有数字字符以及具有周期性结构特征和尺寸特征的至少一个十位数字字符进行识别,从而获得对应的第一观测信息和第二观测信息。由于目标检测模型能够获得比光学字符识别模型更稳定的检测结果,因此可以利用第一观测信息先对所有数字字符进行排序以获得第一序列,再利用第二观测信息将十位数字作为参考锚点,对第一序列的排序进行约束和修正,得到置信度高的第二序列;最终,利用第二序列在原图上的对应位置进行刻度数据标识,得到卷尺测量数据图像,以便于核验,可以提高施工验收的准确性和效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122821580A_ABST
    Figure CN122821580A_ABST
Patent Text Reader

Abstract

The application provides a tape scale extraction method and device and a storage medium, and relates to the technical field of construction acceptance. The method identifies all digital characters in the original tape measurement image and at least one ten-digit character with periodic structure characteristics and size characteristics through an optical character recognition model and a target detection model, respectively, to obtain corresponding first observation information and second observation information. Since the target detection model can obtain more stable detection results than the optical character recognition model, the first observation information can be used to sort all the digital characters to obtain a first sequence, and the second observation information can be used to take the ten digits as a reference anchor point to constrain and correct the sorting of the first sequence to obtain a second sequence with high confidence. Finally, the corresponding position of the second sequence on the original image is used for scale data identification to obtain a tape measurement data image, so that the accuracy and efficiency of construction acceptance can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of construction acceptance technology, and in particular to a method, equipment and storage medium for extracting tape measure graduations. Background Technology

[0002] In construction scenarios such as distributed photovoltaic power stations, measuring with a tape measure is a fundamental method for construction quality acceptance and quantity verification. Construction workers take images of the tape measure against the target object as standardized evidence of dimensional measurements, and verification personnel read the actual measurement value based on the tape measure numbers in the image. This process has long relied on manual verification. While this ensures accuracy, it becomes difficult to maintain high verification efficiency over long periods when there are many targets to verify, as visual fatigue can occur among the verification personnel.

[0003] While general optical character recognition (OCR) methods can replace manual verification in related technologies, this approach still struggles to achieve stable and reliable recognition results in scenarios involving automatic reading of numbers on measuring tapes. On one hand, the imaging quality of the digit area on the measuring tape is severely affected by factors such as ambient lighting, metallic reflections, shadows, tilted shooting, and perspective distortion. OCR models lack the ability to stably extract character features, easily leading to problems like misidentification, partial omissions, and spatial order confusion. On the other hand, the digits on measuring tapes exhibit highly repetitive (e.g., a cyclical arrangement of 0 to 9) and continuously increasing structural patterns. In areas with abrupt changes in the tens or hundreds digits, OCR models are unstable in handling two-character structures, easily resulting in missed digits, missing digits, or sequence misalignments. This leads to systematic biases in the measurement results, ultimately requiring manual verification. Summary of the Invention

[0004] The main purpose of this application is to provide a method, device and storage medium for extracting scale data from a measuring tape, which aims to solve the technical problem of how to accurately extract scale data from a measuring tape diagram in order to improve the efficiency of construction acceptance.

[0005] To achieve the above objective, this application provides a method for extracting the scale markings of a measuring tape, the steps of which include: The measurement image of the measuring tape is identified based on a preset optical character recognition model to determine the first set of observation information corresponding to each digit character in the measuring tape scale area. The measurement image of the measuring tape is also identified based on a preset target detection model to determine the second set of observation information corresponding to at least one target periodic character in the measuring tape scale area. The target periodic character includes ten digit characters. Based on the first set of observation information, the first sequence is determined by sorting the numbers according to their spatial positions. Based on the second observation information set, at least one of the target periodic characters is used as a reference anchor point in the first sequence to correct the first sequence and determine the corresponding second sequence. Based on the second sequence, the tape measure measurement image is labeled with scale data to obtain a tape measure measurement data image.

[0006] Optionally, the step of using at least one of the target periodic characters as reference anchors in the first sequence based on the second observation information set to correct the first sequence and determine the corresponding second sequence includes: Based on the second observation information set, a spatial mapping relationship between at least one of the target periodic characters and each digit character in the first sequence is determined, and based on the spatial mapping relationship, at least one of the target periodic characters is used as a corresponding reference anchor point. Based on all reference anchors, the numeric characters adjacent to each reference anchor in the first sequence are corrected to determine the corresponding second sequence.

[0007] Optionally, the steps of the tape measure graduation extraction method further include: Based on the scale marking rules of the measuring tape, the local continuity of each numeric character between each reference anchor point in the first sequence is checked in turn to obtain the continuity anomalies in the first sequence. Based on a preset set of high-frequency obfuscated numbers, all consecutive outliers in the first sequence are replaced with corresponding numeric characters to obtain the second sequence.

[0008] Optionally, the steps of the tape measure graduation extraction method further include: Based on each of the aforementioned reference anchor points, the first sequence is divided into several periodic groups; Detect missing numeric characters in each of the aforementioned periodic groups; The missing numeric characters in each of the aforementioned periodic groups are filled in to obtain the second sequence.

[0009] Optionally, the steps of the tape measure graduation extraction method further include: Based on the first set of observation information, determine the spatial position of each digital character on the measurement image of the measuring tape; Using the local orientation field algorithm, a continuous main axis flow field extending along the measurement direction of the measuring tape is constructed based on each of the aforementioned spatial positions; The step of marking the tape measure measurement image with scale data based on the second sequence to obtain the tape measure measurement data image includes: Based on the second sequence, the continuous main axis flow field in the tape measure measurement image is labeled with data to obtain the tape measure measurement data image.

[0010] Optionally, the step of constructing a continuous principal axis flow field extending along the measurement direction of the measuring tape based on each of the spatial locations using a local orientation field algorithm includes: Based on the spatial locations, determine the local neighborhoods between all adjacent digital characters, and combine the local direction field algorithm to calculate the local covariance matrix of each local neighborhood. Based on the local covariance matrices, the local feature directions of each local neighborhood are determined; The local feature directions are connected in series according to their adjacency relationship to determine the continuous main axis flow field.

[0011] Optionally, the step of identifying the continuous principal axis flow field in the tape measure measurement image based on the second sequence to obtain the tape measure measurement data image includes: Calculate the one-dimensional spatial spacing sequence between adjacent digital characters in the second sequence, and determine the global scale curvature that characterizes the global perspective compression effect corresponding to the one-dimensional spatial spacing sequence based on the continuous principal axis flow field; Based on the global scale curvature, the relative spatial positions of all digital characters in the second sequence in the continuous main axis flow field are calculated; Based on the calculation results, all the numeric characters in the second sequence are sequentially filled into the corresponding relative spatial positions in the continuous main axis flow field to generate the tape measure scale reconstruction image.

[0012] Optionally, the step of calculating the one-dimensional spatial spacing sequence between adjacent digit characters in the second sequence, and determining the global-scale curvature characterizing the global perspective compression effect corresponding to the one-dimensional spatial spacing sequence based on the continuous principal axis flow field, includes: Based on the preset state propagation model and the reference anchor points of the second sequence edge, the numerical characters that cannot be displayed due to occlusion are calculated and the second sequence is completed; Based on each of the aforementioned reference anchor points and the spatial position of each digit character in the completed second sequence, the one-dimensional spatial spacing sequence is determined; Calculate the global second derivative of the one-dimensional spatial spacing sequence to determine the global scale curvature.

[0013] In addition, to achieve the above objectives, this application also provides a tape measure scale extraction device, which includes: a memory, a processor, and a tape measure scale extraction program stored in the memory and executable on the processor, wherein the tape measure scale extraction program is configured to implement the steps of the tape measure scale extraction method described above.

[0014] In addition, to achieve the above objectives, this application also provides a storage medium, which is a computer-readable storage medium, and stores a tape measure scale extraction program thereon. When the tape measure scale extraction program is executed by a processor, it implements the steps of the tape measure scale extraction method described above.

[0015] This application provides a method, device, and storage medium for extracting tape measure markings. The method uses an optical character recognition model and a target detection model to identify all numeric characters and at least one ten-digit character with periodic structural and dimensional features in the original tape measure measurement image, thereby obtaining corresponding first and second observation information. Since the target detection model can obtain more stable detection results than the optical character recognition model, the first observation information can be used to sort all numeric characters to obtain a first sequence. Then, the second observation information is used to constrain and correct the sorting of the first sequence using the ten-digit number as a reference anchor point, resulting in a second sequence with high confidence. Finally, the corresponding position of the second sequence on the original image is used to mark the scale data, obtaining a tape measure measurement data image for verification, which can improve the accuracy and efficiency of construction acceptance. Attached Figure Description

[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart illustrating the first embodiment of the tape measure graduation extraction method of this application; Figure 2 A flowchart illustrating the second embodiment of the tape measure graduation extraction method of this application; Figure 3 This is a schematic diagram of the first abnormal situation in the first sequence; Figure 4 This is a schematic diagram of the second abnormal situation in the first sequence; Figure 5 This is a diagram illustrating the third abnormal situation in the first sequence; Figure 6 A schematic diagram of a periodic hash topology; Figure 7 A flowchart illustrating the third embodiment of the tape measure graduation extraction method of this application; Figure 8 This is a schematic diagram of the structure of the first embodiment of the tape measure graduation extraction device of this application.

[0019] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0020] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0021] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0022] This application presents a method for extracting tape measure graduations according to a first embodiment. Please refer to [link / reference]. Figure 1 The tape measure graduation extraction method includes steps S10-S40: Step S10: Based on a preset optical character recognition model, the measuring tape image is identified to determine the first observation information set corresponding to each digit character in the measuring tape scale area. Based on a preset target detection model, the measuring tape image is identified to determine the second observation information set corresponding to at least one target periodic character in the measuring tape scale area. The target periodic character includes ten digit characters. It should be understood that, in this embodiment, the executing entity can be a computer device, a server, or other electronic device with image processing capabilities, such as the tape measure scale extraction device mentioned below.

[0023] It should be noted that the measuring tape image refers to the original image containing the measuring tape's scale area, obtained by construction workers at the acceptance site by taking a picture of the measuring tape against the target being measured. The pre-trained optical character recognition model is a pre-trained deep learning model used to detect and recognize character content from images. It can output the character content of each digit character, the location of the detection box, and the corresponding recognition confidence score. Similarly, the pre-trained object detection (DET) model is a pre-trained deep learning model used to locate and recognize specific target objects from images. It can also output the character content of each digit character, the location of the detection box, and the corresponding detection confidence score.

[0024] It should be understood that OCR models recognize characters character by character, while DET detects based on the entire instance, thus having a larger receptive field. In the scenario of recognizing characters on a measuring tape, a ten-digit character, such as "20," occupies the width of two digit characters in the image. Therefore, the OCR model might recognize it as two separate characters, "2" and "0," or it might miss recognition due to the large gap between the characters. In contrast, the DET model can detect "20" as a whole instance, thus remarkably consistently recognizing special digit characters like "10" and "20," which are spatially evenly spaced and structurally stable, occupying the width of two characters (while other markings occupy only the width of a single character, such as "0" and "1").

[0025] It is worth noting that, in this embodiment, the target periodic character refers to a ten-digit scale (i.e., a ten-digit character) that appears after each cycle of ten digits, such as "10" or "20" on the measuring tape. These scales have more significant structural features and larger visual size, and are more likely to form stable and high-confidence detection results compared to ordinary single-digit numbers.

[0026] It is easy to understand that the first observation information set includes the character content, detection box position coordinates, and recognition confidence of all digit characters recognized by the OCR model; while the second observation information set includes the content, detection box position coordinates, and detection confidence of all ten-digit characters detected by the DET model. In this embodiment, when a measurement image of a measuring tape taken by construction workers is obtained, the original image can be simultaneously sent to a preset optical character recognition model and a preset target detection model. The preset optical character recognition model detects the character content, detection box position coordinates, and recognition confidence of all digit characters to obtain the first observation information corresponding to each digit character. At the same time, the preset target detection model performs targeted detection on at least one target periodic character in the image to obtain the second observation information corresponding to at least one target periodic character ("10", "20", etc.).

[0027] Step S20: Based on the first observation information set, sort the numbers according to their spatial positions to determine the first sequence; It should be understood that the OCR model has not yet established a stable topological relationship between the character detection results output in the initial recognition stage, and each character node presents an independent discrete state. In this embodiment, since the numbers on the measuring tape are arranged continuously along the extension direction of the measuring tape, each digit character has a definite spatial position coordinate in the image. They can be sorted according to the projection position of each digit character detection box in the extension direction of the measuring tape, thus organizing the discrete character recognition results into an ordered sequence structure.

[0028] It should be noted that, in this embodiment, the first sequence refers to the initial number sequence formed by arranging all the digital characters recognized by OCR according to their spatial positions along the measurement direction of the measuring tape. This sequence retains the spatial order relationship of each character, but has not yet undergone structural verification and anomaly correction.

[0029] It is worth noting that when the measuring tape is bent, the direction of its extension may vary in different areas. In this case, the spatial order can be determined based on the path determined by connecting the center points of each character detection box.

[0030] Step S30: Based on the second observation information set, at least one of the target periodic characters is used as reference anchors in the first sequence to correct the first sequence and determine the corresponding second sequence; It should be understood that OCR models are prone to problems such as missed digit recognition, missing digits, or sequence misalignment in tens-digit transition regions (such as the region where "10" changes to "1"). Relying solely on OCR recognition results cannot guarantee the accuracy of sequence structure. In contrast, the DET model is specifically designed for detecting tens-digit characters, which have more significant structural features and larger visual size, resulting in more stable and reliable detection results.

[0031] It should be noted that, in this embodiment, for a measuring tape, any numeric character can represent a precise scale. Therefore, while maintaining high accuracy in the DET model recognition results, target periodic characters (i.e., ten-digit numeric characters) with significant structural features and larger visual size can be used as benchmark reference nodes in the reconstruction process of the first sequence. Correspondingly, the second sequence refers to the high-confidence result obtained by correcting the data, sorting, and other attributes of the first sequence through reference anchors.

[0032] It is easy to understand that in this embodiment, the target periodic character (i.e., the ten-digit character) detected by DET can be used as a reference anchor point to constrain the periodic positioning and spatial structure recovery of the tape measure sequence, thereby obtaining a second sequence with high confidence.

[0033] In practical implementation, for example, if the DET model detects a target periodic character (i.e., a ten-digit number) as "20" in a certain region of an image, while the OCR model recognizes a corresponding number as "2" in the first sequence (which can be understood as the OCR missing "0"), then the DET detection result "20" is used as a reference anchor point for that position, and the corresponding character in the first sequence is corrected to "20". Then, based on this reference anchor point, the data before and after it are corrected, ultimately transforming the low-confidence first sequence into a high-confidence second sequence.

[0034] Step S40: Based on the second sequence, the tape measure measurement image is labeled with scale data to obtain a tape measure measurement data image.

[0035] It should be understood that data labeling refers to visually annotating the corrected tape measure scale sequence onto the tape measure measurement image, so that the tape measure scale measurement results can be intuitively presented in the image, facilitating manual reading and confirmation by auditors, or facilitating automatic reading and confirmation by computers. In this embodiment, the form of data labeling includes, but is not limited to, displaying scale value labels superimposed above or beside the tape measure scale area, displaying the value sequence in a list form at the edge of the image, or rendering the corrected scale values ​​at the corresponding scale line positions on the tape measure.

[0036] It should be noted that, in this embodiment, the measurement data image of the measuring tape is the final result image output after data identification processing. It retains the visual information of the original measuring tape image and superimposes the corrected scale value annotation information, which can be used as a standardized evidence for construction acceptance.

[0037] It is easy to understand that, in this embodiment, after obtaining a second sequence with high confidence, the first and second observation information can be used to associate each numerical character in the second sequence with its corresponding spatial position, and the scale value label can be superimposed on the tape measure image. After data identification processing, the computer device can output the tape measure measurement data image for subsequent automatic computer acceptance verification or manual verification.

[0038] This embodiment introduces the DET target detection model to specifically detect the tens digit characters in the measuring tape. The tens digit scale detection result is used as a key structural anchor point and jointly analyzed with the OCR recognition result. This can effectively suppress the cumulative error and periodic drift problem caused by local misidentification of OCR, significantly improve the stability and continuity of measuring tape digit recognition in complex construction environments, and reduce the risk of missing digits and sequence misalignment in the tens digit jump area.

[0039] This application provides a method for extracting the scale markings of a measuring tape. The method uses an optical character recognition model and a target detection model to identify all numeric characters and at least one ten-digit character with periodic structural and dimensional features in the original measuring tape image, thereby obtaining corresponding first and second observation information. Since the target detection model can obtain more stable detection results than the optical character recognition model, the first observation information can be used to sort all numeric characters to obtain a first sequence. Then, the second observation information, using the ten-digit number as a reference anchor point, constrains and corrects the sorting of the first sequence to obtain a second sequence with high confidence. Finally, the scale data is marked using the corresponding position of the second sequence on the original image to obtain the measuring tape measurement data image, which facilitates verification and improves the accuracy and efficiency of construction acceptance.

[0040] Based on the first embodiment of the tape measure scale extraction method of this application, in the second embodiment of the tape measure scale extraction method of this application, the content that is the same as or similar to the first embodiment of the tape measure scale extraction method described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 , Figure 3 , Figure 4 , Figure 5 as well as Figure 6 The step of using at least one of the target periodic characters as reference anchors in the first sequence based on the second observation information set to correct the first sequence and determine the corresponding second sequence includes: Step S31: Based on the second observation information set, determine the spatial mapping relationship between at least one of the target periodic characters and each digit character in the first sequence, and use at least one of the target periodic characters as the corresponding reference anchor point based on the spatial mapping relationship; It should be understood that, in this embodiment, the spatial mapping relationship refers to the spatial correspondence between the detection box position of the target periodic character (i.e., the ten-digit digit character) detected by the DET model and the detection box position of the digit character recognized by the OCR model.

[0041] It should be noted that, in this embodiment, since the OCR model and the DET model process the same measuring tape image, and the detection results of both are located in the same image coordinate system, the correspondence between the DET detection results and the OCR recognition results can be determined by calculating the degree of overlap between the detection boxes or the distance between the center points of the detection boxes.

[0042] It is easy to understand that in this embodiment, the target periodic character (ten-digit character) detected by each DET can be found first based on the second observation information set, and its spatial position can be confirmed. Then, the spatial position of each target periodic character is matched with the spatial position of each digit character in the first sequence based on the first observation information. If the detection box of the target periodic character is highly coincident with the detection box of a digit character recognized by OCR in spatial position, the target periodic character (ten-digit character) can be used as the reference anchor point corresponding to the OCR-recognized character, and the corresponding digit character in the first sequence can be replaced.

[0043] It is worth noting that in this embodiment, during the process of using the target periodic character (ten-digit digit) as a reference anchor point to replace the digit characters in the first sequence, the replacement does not necessarily change the content of the first sequence. For example, if a segment of the first sequence originally contains "8", "9", "10", and "1", and the DET detection result indicates that the target periodic character "10" corresponds to the third digit character in the corresponding segment of the first sequence, then after using it as a reference anchor point and completing the replacement, the segment will still contain "8", "9", "10", and "1".

[0044] Step S32: Based on all reference anchor points, correct the numeric characters adjacent to each reference anchor point in the first sequence to determine the corresponding second sequence.

[0045] It should be noted that in this embodiment, the reference anchor point serves as a key benchmark node in the tape measure's periodic structure, exhibiting high numerical accuracy and spatial positioning reliability. Using the reference anchor point as the core, characters located between or adjacent to anchor points in the first sequence can be verified and corrected to address the issue of errors easily occurring in the tens digit transition area of ​​the tape measure during OCR recognition.

[0046] It is easy to understand that in this embodiment, since both the position and content of the reference anchor point have high confidence, based on the physical characteristics of the measuring tape, if a ten-digit character is used as the reference anchor point, then in the first sequence, the digit preceding the reference anchor point must be "9" and the digit following the reference anchor point must be "1". Therefore, based on the value and position of the reference anchor point, the digit characters adjacent to the reference anchor point in the first sequence can be corrected to obtain a second sequence with high confidence. In this way, the problem of inaccurate recognition of digit identifiers in OCR at digit jump regions can be solved.

[0047] Specifically, such as Figure 3 As shown, Figure 3 The horizontal axis represents the theoretical reading of the measuring tape. Figure 3The vertical axis represents the ruler reading corresponding to the OCR recognition result (the ruler reading for each reference anchor point can be all "10", or it can change accordingly with the cycle, such as "10" or "20"); if the reference anchor point is "10", then the order of the segments in the first sequence at that reference anchor point should be "9", "10", "1". At this time, if the numeric character after the reference anchor point in the segment of the first sequence is detected as "7", it can be directly corrected to "1", thus obtaining a high-confidence second sequence.

[0048] Furthermore, in this embodiment, the method for extracting the measurement scale further includes the following steps: Step S33: Based on the scale marking rules of the measuring tape, perform local continuity checks on each number character between each reference anchor point in the first sequence to obtain continuity anomalies in the first sequence. It should be understood that the marking rules for a measuring tape refer to the fact that the scale values ​​of the measuring tape increase monotonically along the tape's body, and that adjacent scales satisfy a fixed increment (usually 1 step). For example, in the centimeter-scale markings of a measuring tape, the numerical sequence such as "1", "2", ..., "10" is arranged consecutively.

[0049] It should be noted that, in this embodiment, the local continuity check refers to checking whether adjacent numbers satisfy the above-mentioned increasing rule within a local window (i.e., the cycle of the measuring tape). In any local window, if the numerical difference between a certain number character and its preceding and following adjacent characters does not conform to the increasing relationship of step size 1, then the number character is determined to be a continuity anomaly.

[0050] The determination method for the above local continuity test can be set as follows (taking the ten digits of the measuring tape as "10" as an example): ; It should be noted that, and For two adjacent numbers in the sequence, For the previous number, For the next number; Indicates "other situations". When When the output is 1, the current node of the sequence can be considered to satisfy the local continuity constraint; when When the output result is 0, it can be considered that the current node of the sequence does not satisfy the local continuity constraint.

[0051] It is worth noting that for the tens digit transition range, such as "9" to "10", the numerical value jumps from 9 to 10. The numerical difference is 1 and the number of digits changes, but it still falls under the normal tape measure marking rules. Such cases are not considered abnormal.

[0052] It is easy to understand that, in this embodiment, all characters in the first sequence located between any two adjacent reference anchor points can be traversed and checked. For the current numeric character to be checked, the values ​​of at least one character before and after it are extracted to form a local subsequence. The subsequence is then checked to see if it satisfies a monotonically increasing relationship with a step size of 1 (i.e., a local continuity constraint). If the value of a character does not conform to the increasing relationship with the values ​​of the characters before and after it, the character is marked as a continuity anomaly. In this manner, all characters in the first sequence are traversed continuously until all continuity anomalies are identified.

[0053] Specifically, such as Figure 4 As shown, Figure 4 The horizontal axis represents the theoretical reading of the measuring tape. Figure 4 The vertical axis represents the ruler reading corresponding to the OCR recognition result (the ruler reading corresponding to each reference anchor point can all be "10", or it can change with the cycle period, such as "10" or "20"); the local sequence in a certain segment of the first sequence is "4", "5", "9", "7", "8", where the character "9" is preceded by "5" and followed by "7", the difference between "9" and "5" is 4, and the difference between "9" and "7" is -2, neither of which conforms to the increasing rule of step size 1 (i.e. local continuity constraint), so "9" is judged as a continuity anomaly.

[0054] Step S34: Based on a preset set of high-frequency obfuscated numbers, replace all continuous abnormal points in the first sequence with corresponding numeric characters to obtain the second sequence.

[0055] It should be noted that, in this embodiment, the preset high-frequency confusion digit set refers to the set of digit pairs that are easily confused during the tape measure digit recognition process due to their similar character shapes. Typically, such as... Figure 4 As shown, since "6" and "9" are easily confused under rotation or perspective distortion, and "1" and "7" are similar in stroke shape and are also prone to misjudgment, the high-frequency confused number set includes, but is not limited to, {6, 9} and {1, 7}. The establishment of this set is based on prior experience in the tape measure number recognition scenario and can be expanded or adjusted according to the confusion statistics in actual application scenarios.

[0056] In one scenario, the preset high-frequency confusion number set can also be adjusted according to the actual font characteristics of the numbers on the measuring tape. For example, in some measuring tape fonts, "3" and "8" may be confused under low resolution conditions. In this case, {3, 8} can also be included in the preset high-frequency confusion number set.

[0057] It is easy to understand that in this embodiment, after detecting continuous anomalies, instead of randomly correcting the values ​​of each anomaly, the system attempts to replace the current anomaly character with a candidate obfuscated character from a set of high-frequency obfuscated digits, and then re-performs local continuity checks. If the replaced sequence segment satisfies the local continuity constraint, the replacement is confirmed to be valid, and the replaced sequence is determined as the final required second sequence. This significantly reduces the problem of decreased numerical reading accuracy caused by OCR's confusion in recognizing specific digit identifiers with similar morphological structures.

[0058] It is worth noting that in this embodiment, after finding all consecutive outliers, a trusted chain can be constructed between nodes that satisfy the local continuity constraint between any two consecutive outliers. Subsequently, nodes that, after replacement, allow the sequence fragment to satisfy the local continuity constraint can be attempted to be added to adjacent trusted chains until the remaining trusted chains cannot be merged further. Finally, the second sequence required at the final stage can be reconstructed based on these remaining trusted chains. The number of numeric characters retained in each trusted chain can be adjusted according to the actual scenario to reduce the probability of mismatches in different scenarios.

[0059] Furthermore, a graph neural network anomaly detection mechanism can be introduced to perform global consistency analysis on the OCR results. Specifically, a correlation graph can be constructed first using cosine similarity and Top-K strategies for the multidimensional features of each scale node, and the graph structure can be dynamically optimized using a Gumbel-Softmax sampling mechanism. Subsequently, an improved graph attention network is used to learn the structural correlation features between nodes. Then, the graph structure features are fused with the original temporal features and input into a deep prediction model to complete the sequence state prediction. Finally, the anomaly score of each node is calculated by comparing the error between the predicted value and the actual observed value. After obtaining the anomaly score, the system filters out anomaly nodes according to a preset threshold. For nodes with high anomaly scores that do not meet the local continuity constraint, a "deletion" operation is performed first rather than direct modification to avoid the uninterpretable miscorrection problem caused by the neural network probability prediction. By first removing obviously noisy nodes and then constructing the subsequent trusted chain and sequence completion, the interference of abnormal data on the overall tape measure structure restoration process can be effectively reduced.

[0060] Furthermore, in this embodiment, the method for extracting the measurement scale further includes the following steps: Step S35: Based on each of the reference anchor points, the first sequence is divided into several periodic groups; Step S36: Detect missing numeric characters in each of the said periodic groups; It should be understood that, ideally, the reference anchor points corresponding to two adjacent tens digits should contain all nine numeric characters from "1" to "9". However, in reality, due to complex factors such as partial occlusion, blurring, and reflections affecting the image, the OCR model may fail to recognize complete numeric characters in certain areas, resulting in missing characters in the sequence, such as... Figure 5 As shown, only the seven digits "3", "4", "5", "6", "7", "8", and "9" are identified between the two reference anchor points. In this case, the digit characters need to be completed.

[0061] It should be noted that, in this embodiment, periodic grouping refers to dividing the first sequence into several independent segments using reference anchor points as boundaries. Each pair of adjacent reference anchor points contains a complete digital period. By grouping the characters between anchor points, the digital composition within each period can be more clearly identified, facilitating subsequent missing data detection and completion operations.

[0062] It is easy to understand that in this embodiment, the first sequence can be divided into several periodic groups based on each reference anchor point. For any complete periodic group, it is checked that it should contain all characters "1" to "9" from the starting number to the ending number. If the number of characters actually identified is less than the number of characters that should be in that interval, it is determined that there is a missing character. At this time, the identified character content can be compared with the character set from "1" to "9" one by one, and the missing numeric character in the periodic group can be found by elimination, and its position in the periodic group can be marked.

[0063] As a specific method, the inherent periodicity of numbers on a measuring tape is utilized to establish a periodic topological space. Periodic mapping is then performed within this topological space based on the numerical values. For recurring numerical nodes, their belonging to the next period can be automatically determined (using a reference anchor point as the period boundary), forming a periodic hash topological structure, such as... Figure 6 As shown, Figure 6 This demonstrates how the measurement of a reference anchor point changes with the cyclic period. After completing the cyclic mapping, missing positions can be automatically filled with virtual placeholders, uniformly represented as empty nodes in the topology space, providing a structural basis for subsequent global recovery. Based on the above cyclic hash topology, missing numeric characters within each cyclic group can be quickly identified.

[0064] Step S37: Complete the missing numeric characters in each of the periodic groups to obtain the second sequence.

[0065] It is easy to understand that in this embodiment, after finding the missing numeric character, it can be filled into the corresponding position in the periodic group, so that each numeric character in each periodic group has integrity and the order conforms to a continuous increasing rule, thereby realizing the reconstruction of the low-confidence first sequence into a high-confidence second sequence. The completion operation can utilize the numerical constraints of the preceding and following reference anchor points and the positional information of other characters in the same period to calculate the numerical value and spatial position of the missing character.

[0066] It is worth noting that in this embodiment, the steps S31 to S37 described above can also be performed sequentially to obtain a second sequence with high confidence.

[0067] First, based on the process provided in steps S31 to S32, reference anchor points can be established in the first sequence using the DET detection results. The digital characters at each reference anchor point and its adjacent positions can be corrected to provide a basis for subsequent correction and filling work. Subsequently, based on the process provided in steps S33 to S34, all continuous anomalies in the first sequence can be found, and these continuous anomalies can be replaced and corrected using a preset high-frequency confused number set to ensure that there is at least local continuity between the consecutively arranged digital characters in the first sequence. Finally, based on the process provided in steps S35 to S37, character missingness checks can be performed on the periodic groups between each reference anchor point of the first sequence, and the corresponding missing numeric characters in each periodic group can be filled in according to the check results.

[0068] After the above three steps of setting and correcting reference anchor points, replacing continuous outliers, and completing missing characters, the low-confidence first sequence can finally be reconstructed into a high-confidence second sequence.

[0069] Based on the first and / or second embodiments of the tape measure graduation extraction method of this application, in the third embodiment of the tape measure graduation extraction method of this application, the content that is the same as or similar to the first and second embodiments of the tape measure graduation extraction method described above can be referred to the above description and will not be repeated hereafter. Based on this, please refer to... Figure 7 The steps of the tape measure graduation extraction method further include: Step S401: Determine the spatial position of each digital character on the measuring tape image based on the first observation information set; It should be understood that the spatial position of each digit character refers to the position information of the detection box of each digit character identified by the OCR model in the image coordinate system, usually represented by the corner coordinates or center coordinates of the detection box. This spatial position is the basic data for subsequent construction of the main axis flow field of the measuring tape and for sequence reconstruction. The detection box position information of each digit character is already contained in the first observation information set and can be directly extracted from it.

[0070] Step S402: Using the local orientation field algorithm, a continuous main axis flow field extending along the measurement direction of the measuring tape is constructed based on each of the spatial positions; It should be understood that in the actual scenario of measuring with a tape measure, the tape measure in the measurement image may be bent, that is, the tape measure in the image extends along a curve rather than a straight line. Therefore, the single principal axis direction cannot be simply extracted using conventional linear methods.

[0071] It should be noted that, in this embodiment, the local orientation field algorithm is an algorithm used to estimate the local orientation of each point on the curve. Its basic idea is to calculate the local principal orientation of each target point based on the spatial distribution of other points in its neighborhood, thereby characterizing the tangent orientation of the curve at each position. Correspondingly, the continuous principal axis flow field refers to the vector field composed of the local orientation vectors at the positions of each digit character. This vector field extends continuously along the measurement direction of the measuring tape and is presented as a continuous curve in the figure, accurately reflecting the bending trend of the measuring tape in the image.

[0072] It is easy to understand that in this embodiment, the local orientation (i.e., the relative orientation between two adjacent nodes) can be estimated by analyzing the neighborhood of each measurement node (the detection box coordinate point of the digital character) based on the local orientation field algorithm, thereby enabling stable extraction of the main axis orientation of the measuring tape under complex conditions such as tape bending and perspective distortion.

[0073] The step of marking the tape measure measurement image with scale data based on the second sequence to obtain the tape measure measurement data image includes: Step S41: Based on the second sequence, the continuous main axis flow field in the tape measure measurement image is data-identified to obtain the tape measure measurement data image.

[0074] It should be understood that after obtaining the continuous main axis flow field, each digit character in the second sequence has a relatively accurate spatial positioning reference. That is, the projection position of each digit character in the second sequence along the main axis flow field of the measuring tape determines its marked position in the measuring tape measurement image.

[0075] It should be noted that in this embodiment, data labeling is based on a continuous main axis flow field, ensuring that the labeled scale values ​​match the actual spatial structure of the measuring tape. Even when the measuring tape is bent, the labeled scale values ​​can accurately correspond to the corresponding positions on the measuring tape. In this way, the final output measuring tape measurement data image can intuitively and accurately reflect the measurement values ​​at each scale position of the measuring tape.

[0076] In practice, based on the first and second observation information, the projection positions of each numerical character in the second sequence onto the continuous main axis flow field can be determined, and the corresponding scale value labels can be superimposed and displayed on the corresponding positions of the tape measure image. For the curved areas of the tape measure, the scale value labels are arranged along the flow field curve direction, rather than simply along the horizontal or vertical direction, thus maintaining consistency with the actual spatial structure of the tape measure. In the final output tape measure measurement data image, each scale value is marked at its corresponding accurate position on the tape measure.

[0077] Furthermore, in this embodiment, the step of constructing a continuous principal axis flow field extending along the measurement direction of the measuring tape based on each of the spatial positions using a local orientation field algorithm includes: Step S4021: Determine the local neighborhood between all adjacent digital characters based on each of the spatial positions, and calculate the local covariance matrix of each local neighborhood in combination with the local orientation field algorithm. It should be understood that the local neighborhood between adjacent digit characters specifically refers to the spatial set formed by a group of digit character positions that are mutually adjacent along the main axis of the measuring tape. For each target character position... its local neighborhood It consists of multiple spatially adjacent character positions. For each local neighborhood, the aforementioned local orientation field algorithm is used to calculate the local covariance matrix. The eigenvectors of this matrix reflect the main spatial distribution direction of the point cloud within this neighborhood, and their expression is as follows: ; in, It refers to and The position of adjacent characters.

[0078] and The Gaussian weights are calculated using the following formula: ; in, It is the bandwidth parameter (scale parameter) of the Gaussian kernel, which is usually set according to the average spacing between the numbers on the measuring tape.

[0079] Step S4022: Based on each of the local covariance matrices, determine the local feature directions of each of the local neighborhoods; It should be understood that, since the measuring tape is a structure that extends along a one-dimensional direction, the point cloud distribution in its local neighborhood should exhibit obvious anisotropy, with the largest eigenvalue being significantly larger than other eigenvalues. Therefore, the estimation of the local principal direction has high stability.

[0080] It should be noted that the local feature direction refers to the main direction of the point cloud distribution within the local neighborhood, representing the local extension direction of the measuring tape at that location. In this embodiment, by performing eigenvalue decomposition on the local covariance matrix, the eigenvector corresponding to the largest eigenvalue is the local main direction, i.e., the tangent direction of the measuring tape at that location.

[0081] Step S4023: Connect the local feature directions in series according to their adjacency relationship to determine the continuous main axis flow field.

[0082] It should be noted that each local feature direction is estimated independently, and there may be inconsistencies in direction or local noise interference. In this embodiment, in order to construct a complete continuous main axis flow field, each local feature direction can be connected sequentially according to the adjacency relationship between characters (i.e., the extension order of the measuring tape), and the direction vectors are smoothed in a consistent manner so that the direction vectors of adjacent positions change continuously, ultimately forming a smooth flow field extending along the entire length of the measuring tape, i.e., the aforementioned continuous main axis flow field.

[0083] Further, in this embodiment, the step of data identification of the continuous principal axis flow field in the tape measure measurement image based on the second sequence to obtain the tape measure measurement data image includes: Step S411: Calculate the one-dimensional spatial spacing sequence between adjacent digital characters in the second sequence, and determine the global scale curvature that characterizes the global perspective compression effect corresponding to the one-dimensional spatial spacing sequence based on the continuous principal axis flow field. It should be understood that under ideal shooting conditions (the camera's optical axis is perpendicular to the measuring tape's plane), the actual physical distance between adjacent graduations on the measuring tape is equal, and the corresponding pixel spacing in the image should also be approximately constant. However, in actual construction and acceptance scenarios, the camera's optical axis often cannot be strictly perpendicular to the measuring tape's plane during shooting, resulting in a perspective projection effect in the measuring tape image. That is, areas closer to the camera occupy a larger scale in the image, while areas farther from the camera occupy a smaller scale, exhibiting a perspective compression phenomenon of "nearer areas appear larger and farther areas appear smaller." Therefore, before labeling each number character of the second sequence onto the continuous principal axis flow field in the image, it is also necessary to determine the positional spacing between these number characters.

[0084] It should be noted that, in this embodiment, the one-dimensional spatial spacing sequence refers to the sequence formed by arranging adjacent numerical characters in the second sequence along the flow field direction of the main axis of the measuring tape. The global scale curvature is a curvature parameter obtained after performing a second-order difference analysis on this spacing sequence, reflecting the overall trend of perspective compression effect across the entire measuring tape. When the global scale curvature is negative, it indicates that the spacing between adjacent graduations continuously decreases as the measuring tape extends further, indicating a significant perspective compression effect; when the global scale curvature is positive, it indicates that the spatial scale is expanding. The global scale curvature can quantitatively describe the degree of perspective distortion, providing a key parameter for the accurate reconstruction of subsequent graduation positions.

[0085] It is easy to understand that, in this embodiment, the projection positions of each adjacent digital character in the second sequence can be determined on a continuous principal axis flow field, and the arc distance between adjacent projection points can be calculated to form a one-dimensional spatial spacing sequence, where each element represents the interval between the current character and the next character. Then, a second-order difference operation is performed on the one-dimensional spatial spacing sequence to obtain a second-order derivative sequence reflecting the acceleration of the spacing change. Further averaging of the second-order derivative sequence and robust smoothing processing yields the global-scale curvature.

[0086] In practice, the rate of change of local spacing It can be represented as: ; in, It is the first The spacing between the first digit character and the next digit character.

[0087] Based on this, the following exists: ; in, Used to describe the acceleration of changes in scale spacing.

[0088] like A value less than 0 indicates that as the one-dimensional spatial spacing sequence propagates, the scale spacing continuously decreases, resulting in significant perspective compression; conversely, a value greater than 0 indicates spatial scale expansion.

[0089] Since OCR detection results may contain local false detections, jumps, and abnormal spacing, robust smoothing processing is subsequently performed using a robust smoothing compression function. as follows: ; in, It is the abnormal suppression coefficient.

[0090] Finally, the global scale curvature can be expressed as follows: ; in, The number of elements in the one-dimensional spatial spacing sequence.

[0091] Step S412: Based on the global scale curvature, calculate the relative spatial positions of all digital characters in the second sequence in the continuous main axis flow field; It is easy to understand that in this embodiment, given the global scale curvature, a dynamic scale propagation model that considers perspective compression can be established. Assuming that the adjacent spacing changes with a constant acceleration (i.e., global scale curvature), the precise spatial position of each digital character in the continuous main axis flow field can be calculated. The spatial position calculated in this way conforms to the physical laws of perspective projection.

[0092] It is worth noting that, in the case of missing numeric characters as mentioned in step S36, if the missing node is... This indicates that you can search for missing nodes. The nearest trusted observation node (Observable, high-confidence digital characters) and their local scale states , in local scale state This represents the local scale interval for the current region. Then, the topological distance is defined. That is, missing nodes in a one-dimensional sequence. and trusted observation nodes The distance. Traditional methods typically use a fixed step size. However, this method cannot adapt to scale changes under perspective conditions. Therefore, this scheme further introduces a dynamic curvature propagation model to obtain the propagation step size: ; in, Represents the local scale curvature term. Indicates the index of a missing node; The indices representing trusted observation nodes; This represents a virtual number of iterations.

[0093] At this point, it is possible to start from the nearest trusted observation node. To missing nodes Position prediction is performed by projecting the measurement onto the main axis, and the predicted detection box for missing nodes is constructed by combining the global average box scale: ; in, Missing node The horizontal coordinates in the image; Missing node Vertical coordinates in the image; The average width of the detection boxes for all global numeric characters is used as the width of the predicted detection box; The average height of the detection boxes for all numeric characters globally is used as the height of the predicted detection box; and The mean can be calculated using the parameters provided by the first observation.

[0094] Step S413: Based on the calculation results, all the digital characters in the second sequence are sequentially filled into the corresponding relative spatial positions in the continuous main axis flow field to generate the tape measure scale reconstruction image.

[0095] It is easy to understand that, in this embodiment, based on the calculation results, each numeric character in the second sequence can be sequentially filled into its corresponding relative spatial position in the continuous main axis process, thereby generating a completely new image with data annotations, namely the aforementioned reconstructed tape measure image. In this reconstructed image, each scale mark along the entire length of the tape measure is accurately marked at its corresponding spatial position, including areas that were missing, misidentified, or corrected in the original OCR recognition results. Through the reconstructed tape measure image, both the computer and the reviewer can intuitively obtain the complete scale readings along the entire length of the tape measure.

[0096] It is worth noting that in the reconstructed image of the measuring tape scale, the data labels can be rendered in a different way than the original image (e.g., highlighted text, colored labels, etc.) in order to distinguish them from the existing texture content in the original image.

[0097] Further, in this embodiment, the step of calculating the one-dimensional spatial spacing sequence between adjacent digital characters in the second sequence, and determining the global-scale curvature characterizing the global perspective compression effect corresponding to the one-dimensional spatial spacing sequence based on the continuous principal axis flow field includes: Step S4111: Based on the preset state propagation model and the reference anchor points of the second sequence edge, calculate the digital characters that cannot be displayed due to occlusion and complete the second sequence; It should be understood that due to factors such as the design of the measuring tape's scale (the hook at the initial end of the tape measure obstructs the view), the limited shooting range, and the shooting scene (a fixed obstacle is placed in front of the object being measured), some numerical characters may not be recognized by the OCR model. In such cases, relying solely on the existing first or second observation results is insufficient to obtain a complete sequence of measuring tape scales; it is necessary to use a state propagation model to extrapolate or interpolate to fill in the missing characters.

[0098] It should be noted that the pre-defined state propagation model is a mathematical reasoning model based on the continuous increasing pattern of the numbers on the measuring tape and the dynamic scale change pattern. It can start from a known high-confidence anchor point and gradually deduce the scale value and its spatial position in the unknown area along the main axis of the measuring tape. The reference anchor point of the second sequence edge refers to the high-confidence ten-digit character located near the boundary of the second sequence. Its value is accurate and its location is reliable, so it can be used as the starting benchmark for propagation reasoning.

[0099] It is easy to understand that in this embodiment, the reference anchor point of the second sequence edge can be used as the basis for inference. The bidirectional propagation mechanism of the preset state propagation model is used, that is, forward propagation is used to extend the inference to the end of the measuring tape, and backward propagation is used to restore the inference to the starting area of ​​the measuring tape. Subsequently, the value of each missing digit character and its corresponding spatial position on the measuring tape will be calculated, so as to complete the digit characters that cannot be displayed due to occlusion.

[0100] Step S4112: Based on each of the reference anchor points and the spatial position of each digit character in the completed second sequence, determine the one-dimensional spatial spacing sequence; It should be noted that, in this embodiment, while calculating the digits that cannot be displayed due to occlusion using a preset state propagation model, the spatial positions of these completed digits on the continuous main axis flow field can also be calculated using the propagation inference mechanism of the model. At this point, each digit (including the completed characters) can be mapped to its corresponding position on the continuous main axis flow field, and then the arc distance between adjacent digits can be calculated to form a complete one-dimensional spatial spacing sequence. Thus, the obtained one-dimensional spatial spacing sequence can cover the entire measuring tape and comprehensively reflect the spatial variation law of the perspective compression effect.

[0101] In practice, when acquiring the second sequence, reference anchor points on both sides of the second sequence can be automatically selected as propagation seeds. : ; in, It refers to the current scale space position of the anchor point. It is a local scale spacing. It is the rate of change of scale.

[0102] Considering the perspective projection effect in actual shooting, the spacing of the measuring tape graduations is usually not a fixed value. Therefore, a dynamic state propagation model is established: ; The corresponding spatial location reasoning result is: ; in, This refers to the direction of the main axis of the measuring tape (i.e., the direction of propagation). This is the current propagation step size. This represents a virtual number of iterations.

[0103] Because a two-way propagation mechanism is used—positive propagation for extending the measuring tape's tail and negative propagation for recovering the measuring tape's starting area—the spatial location reasoning result can be expressed as: ; in, Indicates the direction of propagation.

[0104] Step S4113: Calculate the global second derivative of the one-dimensional spatial spacing sequence to determine the global scale curvature.

[0105] It is easy to understand that the global second derivative refers to the result obtained by performing a second-order difference operation on the one-dimensional spatial spacing sequence. In this embodiment, the first-order difference of the spacing sequence is first calculated to obtain the spacing change sequence, which reflects the difference between adjacent spacings, i.e., the "speed" of spacing change; then, the first-order difference of the spacing change sequence is calculated again to obtain the second derivative sequence, which reflects the difference between the spacing changes, i.e., the "acceleration" of spacing change. At this point, the average value of the obtained second derivative sequence is the global scale curvature, which characterizes the overall trend of perspective compression effect along the entire length of the measuring tape.

[0106] This application also provides a tape measure scale extraction device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the tape measure scale extraction method in the first embodiment described above.

[0107] The following is for reference. Figure 8 The diagram illustrates a structural schematic of a tape measure scale extraction device suitable for implementing embodiments of this application. The tape measure scale extraction device in this application may include, but is not limited to, fixed terminals such as vehicle-mounted terminals. Figure 8 The tape measure scale extraction device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0108] like Figure 8As shown, the tape measure scale extraction device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1002 or a program loaded from storage device 1003 into random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the tape measure scale extraction device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following devices can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. The communication device 1009 allows the tape measure graduation extraction device to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows a tape measure graduation extraction device with various devices, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented alternatively.

[0109] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0110] The tape measure scale extraction device provided in this application, employing the tape measure scale extraction method described in the above embodiments, can solve the technical problem of how to accurately extract scale data from tape measure drawings, thereby improving construction acceptance efficiency. Compared with the prior art, the beneficial effects of the tape measure scale extraction device provided in this application are the same as those of the tape measure scale extraction method provided in the above embodiments, and other technical features of this tape measure scale extraction device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0111] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0112] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0113] This application also provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the tape measure scale extraction method in the above embodiments.

[0114] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor devices, apparatuses, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution apparatus, device, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.

[0115] The aforementioned computer-readable storage medium may be included in the tape measure scale extraction device; or it may exist independently and not assembled into the tape measure scale extraction device.

[0116] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by the tape measure scale extraction device, the tape measure scale extraction device: identifies the tape measure measurement image based on a preset optical character recognition model to determine a first observation information set corresponding to each digit character in the tape measure measurement scale area; and identifies the tape measure measurement image based on a preset target detection model to determine a second observation information set corresponding to at least one target periodic character in the tape measure measurement scale area, wherein the target periodic character includes ten digit characters; based on the first observation information set, sorts the digit characters according to their spatial positions to determine a first sequence; based on the second observation information set, uses at least one of the target periodic characters as a reference anchor point in the first sequence to correct the first sequence and determine a corresponding second sequence; and based on the second sequence, performs scale data identification on the tape measure measurement image to obtain a tape measure measurement data image.

[0117] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0118] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using dedicated hardware-based apparatus to perform the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0119] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0120] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described tape measure scale extraction method. This solves the technical problem of how to accurately extract scale data from a tape measure measurement diagram to improve construction acceptance efficiency. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the tape measure scale extraction method provided in the above embodiments, and will not be repeated here.

[0121] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent scope of this application.

Claims

1. A method for extracting the graduations of a measuring tape, characterized in that, The steps of the tape measure graduation extraction method include: The measurement image of the measuring tape is identified based on a preset optical character recognition model to determine the first set of observation information corresponding to each digit character in the measuring tape scale area. The measurement image of the measuring tape is also identified based on a preset target detection model to determine the second set of observation information corresponding to at least one target periodic character in the measuring tape scale area. The target periodic character includes ten digit characters. Based on the first set of observation information, the first sequence is determined by sorting the numbers according to their spatial positions. Based on the second observation information set, at least one of the target periodic characters is used as a reference anchor point in the first sequence to correct the first sequence and determine the corresponding second sequence. Based on the second sequence, the tape measure measurement image is labeled with scale data to obtain a tape measure measurement data image.

2. The method for extracting tape measure graduations as described in claim 1, characterized in that, The step of using at least one of the target periodic characters as reference anchors in the first sequence based on the second observation information set, correcting the first sequence, and determining the corresponding second sequence includes: Based on the second observation information set, a spatial mapping relationship between at least one of the target periodic characters and each digit character in the first sequence is determined, and based on the spatial mapping relationship, at least one of the target periodic characters is used as a corresponding reference anchor point. Based on all reference anchors, the numeric characters adjacent to each reference anchor in the first sequence are corrected to determine the corresponding second sequence.

3. The method for extracting tape measure graduations as described in claim 2, characterized in that, The steps of the tape measure graduation extraction method further include: Based on the scale marking rules of the measuring tape, the local continuity of each numeric character between each reference anchor point in the first sequence is checked in turn to obtain the continuity anomalies in the first sequence. Based on a preset set of high-frequency obfuscated numbers, all consecutive outliers in the first sequence are replaced with corresponding numeric characters to obtain the second sequence.

4. The method for extracting tape measure graduations as described in claim 2, characterized in that, The steps of the tape measure graduation extraction method further include: Based on each of the aforementioned reference anchor points, the first sequence is divided into several periodic groups; Detect missing numeric characters in each of the aforementioned periodic groups; The missing numeric characters in each of the aforementioned periodic groups are filled in to obtain the second sequence.

5. The method for extracting tape measure graduations as described in claim 1, characterized in that, The steps of the tape measure graduation extraction method further include: Based on the first set of observation information, determine the spatial position of each digital character on the measurement image of the measuring tape; Using the local orientation field algorithm, a continuous main axis flow field extending along the measurement direction of the measuring tape is constructed based on each of the aforementioned spatial positions; The step of marking the tape measure measurement image with scale data based on the second sequence to obtain the tape measure measurement data image includes: Based on the second sequence, the continuous main axis flow field in the tape measure measurement image is labeled with data to obtain the tape measure measurement data image.

6. The method for extracting tape measure graduations as described in claim 5, characterized in that, The step of constructing a continuous main axis flow field extending along the measurement direction of the measuring tape based on each of the spatial locations using the local orientation field algorithm includes: Based on the spatial locations, determine the local neighborhoods between all adjacent digital characters, and combine the local direction field algorithm to calculate the local covariance matrix of each local neighborhood. Based on the local covariance matrices, the local feature directions of each local neighborhood are determined; The local feature directions are connected in series according to their adjacency relationship to determine the continuous main axis flow field.

7. The method for extracting tape measure graduations as described in claim 5, characterized in that, The step of identifying the continuous principal axis flow field in the tape measure measurement image based on the second sequence to obtain the tape measure measurement data image includes: Calculate the one-dimensional spatial spacing sequence between adjacent digital characters in the second sequence, and determine the global scale curvature that characterizes the global perspective compression effect corresponding to the one-dimensional spatial spacing sequence based on the continuous principal axis flow field; Based on the global scale curvature, the relative spatial positions of all digital characters in the second sequence in the continuous main axis flow field are calculated; Based on the calculation results, all the numeric characters in the second sequence are sequentially filled into the corresponding relative spatial positions in the continuous main axis flow field to generate the tape measure scale reconstruction image.

8. The method for extracting tape measure graduations as described in claim 7, characterized in that, The step of calculating the one-dimensional spatial spacing sequence between adjacent digit characters in the second sequence, and determining the global scale curvature characterizing the global perspective compression effect corresponding to the one-dimensional spatial spacing sequence based on the continuous principal axis flow field includes: Based on the preset state propagation model and the reference anchor points of the second sequence edge, the numerical characters that cannot be displayed due to occlusion are calculated and the second sequence is completed; Based on each of the aforementioned reference anchor points and the spatial position of each digit character in the completed second sequence, the one-dimensional spatial spacing sequence is determined; Calculate the global second derivative of the one-dimensional spatial spacing sequence to determine the global scale curvature.

9. A measuring tape graduation extraction device, characterized in that, The measuring tape scale extraction device includes: a memory, a processor, and a measuring tape scale extraction program stored in the memory and executable on the processor, the measuring tape scale extraction program being configured to implement the steps of the measuring tape scale extraction method as described in any one of claims 1 to 7.

10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and the computer-readable storage medium stores a tape measure scale extraction program, which, when executed by a processor, implements the steps of the tape measure scale extraction method as described in any one of claims 1 to 7.