Scale length calculation method, device, computer equipment and storage medium
Through the target recognition algorithm and camera magnification calculation, the problem of inaccurate scale recognition in metallographic analysis is solved, the precise calculation of the length of the comparison scale is achieved, and the accuracy and consistency of the analysis results are improved.
Patent Information
- Application Number
- CN202110211926.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-25
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-02-25
AI Technical Summary
In the field of metallographic analysis, traditional scale identification has inaccuracies. This is mainly due to differences in photographing conditions, equipment and technician habits, which makes it difficult to unify the addition of scales, affecting the accuracy of analysis results.
The image to be measured is obtained through the target recognition algorithm, the scale bar area is identified and segmented, the image pixel length is calculated, and the length of the scale bar is calculated based on the camera magnification to improve the recognition accuracy.
It achieves accurate identification of the length of the comparison scale, improves the accuracy and consistency of metallographic analysis results, and reduces the reliance on manual measurement.
Smart Images

Figure CN112950568B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for calculating the length of a scale, a computer device and a storage medium. Background Art
[0002] Metallographic analysis is one of the important means of metal material testing and research. It uses the principle of quantitative metallography to determine the three-dimensional spatial morphology of the alloy structure by measuring and calculating the metallographic microstructure of the two-dimensional metallographic sample surface or film, thereby establishing a quantitative relationship between the alloy composition, structure and performance. At present, in the field of metallographic analysis, the scale is an extremely important calculation basis, which has a direct impact on the analysis results. For the collected metallographic images, the addition of the scale mainly depends on manual input. At the same time, the rating of the metallographic images requires measuring the length of the scale. At present, the identification of the scale mainly relies on manual measurement.
[0003] However, due to the inconsistency of photographing conditions and equipment, as well as the different habits of technicians, the scales of different metallographic images vary, such as font, color, position, size, etc., and it is difficult to achieve standardization. Therefore, traditional scale recognition has the problem of inaccuracy. Summary of the invention
[0004] Based on this, in order to solve the above technical problems, a scale length calculation method, device, computer equipment and storage medium are provided, which can improve the recognition accuracy of the scale.
[0005] A method for calculating scale length, the method comprising:
[0006] Acquire an image to be measured, wherein the image to be measured includes a scale;
[0007] Identify and segment the scale area in the image to be tested by using a target recognition algorithm;
[0008] Calculate the image pixel length corresponding to the scale according to the scale area, and identify the length data in the scale area;
[0009] The length of the scale is calculated according to the image pixel length and the length data.
[0010] In one embodiment, the scale area includes a scale line segment area and a scale length data area.
[0011] In one embodiment, the step of calculating the image pixel length corresponding to the scale according to the scale area includes:
[0012] extracting the scale line segment area in the scale area;
[0013] Detecting scale line segments in the scale line segment area based on an edge detection algorithm;
[0014] The image pixel length corresponding to the scale line segment is obtained through a skeleton extraction algorithm.
[0015] In one embodiment, the method further comprises:
[0016] extracting the scale length data area in the scale area;
[0017] Identify the length data in the scale length data area by the target recognition algorithm;
[0018] The camera magnification is calculated based on the length data.
[0019] In one embodiment, the calculating the length of the scale according to the image pixel length and the length data comprises:
[0020] Calculating a target length corresponding to a pixel length of the image according to the camera magnification;
[0021] The length of the scale is calculated using the target length and the length data.
[0022] In one embodiment, the method further comprises:
[0023] Acquire a training sample image, and input the training sample image into an initial target recognition algorithm;
[0024] Performing labeling training on the training sample images by using the initial target recognition algorithm to obtain training results;
[0025] The parameters of the initial target recognition algorithm are adjusted according to the training results to obtain the target recognition algorithm.
[0026] In one embodiment, the method further comprises:
[0027] A sample image is collected and preprocessed to obtain the training sample image.
[0028] A scale length calculation device, the device comprising:
[0029] An image acquisition module, used for acquiring an image to be tested, wherein the image to be tested includes a scale;
[0030] A region segmentation module, used to identify and segment the scale region in the image to be measured by using a target recognition algorithm;
[0031] A data identification module, used to calculate the image pixel length corresponding to the scale according to the scale area, and identify the length data in the scale area;
[0032] The length calculation module is used to calculate the length of the scale according to the image pixel length and the length data.
[0033] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0034] Acquire an image to be measured, wherein the image to be measured includes a scale;
[0035] Identify and segment the scale area in the image to be tested by using a target recognition algorithm;
[0036] Calculate the image pixel length corresponding to the scale according to the scale area, and identify the length data in the scale area;
[0037] The length of the scale is calculated according to the image pixel length and the length data.
[0038] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0039] Acquire an image to be measured, wherein the image to be measured includes a scale;
[0040] Identify and segment the scale area in the image to be tested by using a target recognition algorithm;
[0041] Calculate the image pixel length corresponding to the scale according to the scale area, and identify the length data in the scale area;
[0042] The length of the scale is calculated according to the image pixel length and the length data.
[0043] The scale length calculation method, device, computer equipment and storage medium described above obtain an image to be tested, wherein the image to be tested contains a scale; identify and segment the scale area in the image to be tested by a target recognition algorithm; calculate the image pixel length corresponding to the scale according to the scale area, and identify the length data in the scale area; and calculate the length of the scale according to the image pixel length and the length data. By segmenting the scale area, calculating the image pixel length, identifying the length data, and then calculating the length of the scale, the accuracy of scale recognition is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1A diagram showing an application environment of a method for calculating scale length in an embodiment;
[0045] Figure 2 Schematic diagram of a process of calculating the length of a scale bar in one embodiment;
[0046] Figure 3 is a structural block diagram of a scale length calculation device in one embodiment;
[0047] Figure 4 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0049] The scale length calculation method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Figure 1 As shown, the application environment includes a computer device 110. The computer device 110 can obtain an image to be tested, which includes a scale; the computer device 110 can identify and segment the scale area in the image to be tested through a target recognition algorithm; the computer device 110 can calculate the image pixel length corresponding to the scale according to the scale area, and identify the length data in the scale area; the computer device 110 can calculate the length of the scale according to the image pixel length and the length data. The computer device 110 can be, but is not limited to, various personal computers, laptops, robots, tablet computers, etc.
[0050] In one embodiment, Figure 2 As shown, a method for calculating the scale length is provided, comprising the following steps:
[0051] Step 202: Acquire an image to be tested, wherein the image to be tested includes a scale.
[0052] The image to be tested may be an image collected by a camera and needs to be subjected to metallographic structure analysis. The image to be tested may include a scale. In the field of metallographic structure analysis, the scale is an extremely important calculation basis and has a direct impact on the analysis results.
[0053] Step 204: Identify and segment the scale area in the image to be tested using a target recognition algorithm.
[0054] The scale area can be used to indicate the area containing the scale in the image to be tested. The target recognition algorithm can be a trained one, which is used to recognize the scale in the image to be tested and segment the scale area in the image to be tested.
[0055] Step 206, calculating the image pixel length corresponding to the scale according to the scale area, and identifying the length data in the scale area.
[0056] Pixels are small squares in an image. These small squares have a clear position and assigned color values. The color and position of the small squares determine the appearance of the image. After the computer device divides the scale area through the target recognition algorithm, it can further calculate the image pixel length corresponding to the scale area based on the scale area.
[0057] The length data may be data marked in the scale area, and the computer device may recognize the length data in the scale area.
[0058] Step 208, calculating the length of the scale according to the image pixel length and the length data.
[0059] The computer equipment can calculate the actual length of the scale based on the image pixel length and length data.
[0060] In this embodiment, an image to be tested is obtained, wherein the image to be tested includes a scale; a scale area in the image to be tested is identified and segmented by a target recognition algorithm; the image pixel length corresponding to the scale is calculated according to the scale area, and the length data in the scale area is identified; and the length of the scale is calculated according to the image pixel length and the length data. By segmenting the scale area, calculating the image pixel length, identifying the length data, and then calculating the length of the scale, the accuracy of scale recognition is improved.
[0061] In one embodiment, the scale area includes a scale line segment area and a scale length data area, wherein the scale line segment area can be used to represent an area containing scale line segments; and the scale length data area can be used to represent an area containing scale length data.
[0062] In one embodiment, a scale length calculation method provided may also include a process of calculating the image pixel length corresponding to the scale, and the specific process includes: extracting a scale line segment area in the scale area; detecting scale line segments in the scale line segment area based on an edge detection algorithm; and obtaining the image pixel length corresponding to the scale line segment through a skeleton extraction algorithm.
[0063] Among them, the edge detection algorithm can be used to detect the scale line segment in the scale line segment area. The skeleton extraction algorithm can be used to extract the skeleton of the image during the image processing process.
[0064] The computer device can extract the scale line segment area in the scale area through the target recognition algorithm, and then detect the scale line segment based on the edge detection algorithm, extract the scale line segment through the skeleton extraction algorithm, and then calculate the image pixel length corresponding to the scale line segment.
[0065] In one embodiment, a scale length calculation method provided may also include a process of calculating the camera magnification, and the specific process includes: extracting a scale length data area in the scale area; identifying length data in the scale length data area through a target recognition algorithm; and calculating the camera magnification based on the length data.
[0066] The length data may be a data value marked in the scale length data area. The computer device may extract the scale length data area in the scale area through a target recognition algorithm, further recognize the length data in the scale length data area, and calculate the camera magnification based on the length data.
[0067] In one embodiment, a scale length calculation method provided may further include a process of calculating the length of the scale, and the specific process includes: calculating a target length corresponding to an image pixel length according to a camera magnification; and calculating the length of the scale according to the target length and length data.
[0068] The length of the scale may be the actual length corresponding to the unit pixel of the image to be measured, that is, the actual length corresponding to the pixel range of the scale line segment / the pixel length of the scale line segment.
[0069] In one embodiment, a provided scale length calculation method may also include a process of training a target recognition algorithm, the specific process including: obtaining a training sample image, and inputting the training sample image into an initial target recognition algorithm; marking and training the training sample image through the initial target recognition algorithm to obtain a training result; and adjusting the parameters of the initial target recognition algorithm according to the training result to obtain a target recognition algorithm.
[0070] The training sample image can be a pre-collected image. The computer device can obtain the training sample image and input the training sample image into the training platform, and use the initial target recognition algorithm to respectively identify the numerical part and the line segment part of the scale and perform segmentation; the computer device can mark the segmented numerical part through the initial target recognition algorithm for training, and obtain the numerical result represented by the image through training; the computer device can input the magnification corresponding to the image into the numerical result obtained by training, so that the numerical value corresponds to the magnification, thereby obtaining the training result; the computer device can adjust the parameters of the initial target algorithm according to the training result, thereby obtaining the target recognition algorithm.
[0071] In this embodiment, the computer device can synthesize and retain the numerical results obtained by training and the magnification factor corresponding to the image input into the numerical results obtained by training; the computer device can train the segmented line segment parts through edge detection and skeleton extraction algorithms to extract the contours of the line segments; the computer device can calculate the pixel length of the extracted line segment contours; the computer device can synthesize the pixel length, the numerical results and the numerical results obtained by inputting the magnification factor corresponding to the image into the numerical results obtained by training, so as to obtain the numerical value represented by the corresponding line segment length, and thus obtain the actual length represented by the ruler.
[0072] In one embodiment, a scale length calculation method provided may further include a process of obtaining a training sample image, and the specific process includes: acquiring a sample image, and preprocessing the sample image to obtain a training sample image.
[0073] In one embodiment, a scale length calculation method provided may further include a process of collecting data and training a model, and the specific process includes:
[0074] 1. Data collection: Before training the AI platform, a sample set with a large enough volume needs to be prepared. The sample set refers to metallographic images with scales. The sources of metallographic images mainly include sample photos, historical test data images, and customer image collection, etc.;
[0075] 2. Sample set preprocessing: classify the metallographic images according to the color, shape, value, etc. of the scale, and then annotate the classified images; divide the data set into training set and test set according to a certain ratio, and use a part of the test set to verify the training results;
[0076] 3. Model training and establishment: Input the prepared training set into the AI training platform, which will strengthen the sample set of the data, extract the image features, and perform self-verification on the fitting algorithm. At the same time, the training will be repeated. When the confidence reaches the convergence state or the number of trainings reaches the set number, the training will stop and the model will be generated.
[0077] 4. Model verification: Input the test set into the model for verification, or deploy it in the production environment for verification. When the accuracy meets the requirements, the model is established. When the accuracy does not meet the requirements, re-preprocess the data or increase the sample size, and repeat the above steps for re-training.
[0078] It should be understood that, although the various steps in the above-mentioned flow chart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above-mentioned flow chart may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0079] In one embodiment, Figure 3 As shown, a scale length calculation device is provided, comprising: an image acquisition module 310, a region segmentation module 320, a data identification module 330 and a length calculation module 340, wherein:
[0080] An image acquisition module 310 is used to acquire an image to be measured, wherein the image to be measured includes a scale;
[0081] The region segmentation module 320 is used to identify and segment the scale region in the image to be tested by using a target recognition algorithm;
[0082] A data identification module 330, for calculating the image pixel length corresponding to the scale according to the scale area, and identifying the length data in the scale area;
[0083] The length calculation module 340 is used to calculate the length of the scale according to the image pixel length and the length data.
[0084] In one embodiment, the scale area includes a scale line segment area and a scale length data area.
[0085] In one embodiment, the data identification module 330 is further used to extract the scale line segment area in the scale area; detect the scale line segment in the scale line segment area based on the edge detection algorithm; and obtain the image pixel length corresponding to the scale line segment through the skeleton extraction algorithm.
[0086] In one embodiment, the data identification module 330 is further used to extract a scale length data region in the scale region; identify length data in the scale length data region by using a target identification algorithm; and calculate the camera magnification factor according to the length data.
[0087] In one embodiment, the data identification module 330 is further used to calculate the target length corresponding to the image pixel length according to the camera magnification; and calculate the length of the scale by the target length and the length data.
[0088] In one embodiment, a scale length calculation device provided may also include a model training module, which is used to obtain training sample images and input the training sample images into an initial target recognition algorithm; the training sample images are labeled and trained by the initial target recognition algorithm to obtain training results; and the parameters of the initial target recognition algorithm are adjusted according to the training results to obtain a target recognition algorithm.
[0089] In one embodiment, the model training module is further used to collect sample images and preprocess the sample images to obtain training sample images.
[0090] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for calculating the length of a scale is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0091] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0092] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0093] Acquire an image to be tested, wherein the image to be tested includes a scale;
[0094] Identify and segment the scale area in the image to be tested through the target recognition algorithm;
[0095] Calculating the image pixel length corresponding to the scale according to the scale area, and identifying the length data in the scale area;
[0096] Calculate the length of the scale bar based on the image pixel length and length data.
[0097] In one embodiment, when the processor executes the computer program, the following steps are further implemented: the scale area includes a scale line segment area and a scale length data area.
[0098] In one embodiment, when the processor executes the computer program, the following steps are also implemented: extracting the scale line segment area in the scale area; detecting the scale line segments in the scale line segment area based on an edge detection algorithm; and obtaining the image pixel length corresponding to the scale line segments through a skeleton extraction algorithm.
[0099] In one embodiment, when the processor executes the computer program, the following steps are also implemented: extracting a scale length data area in the scale area; identifying length data in the scale length data area by a target recognition algorithm; and calculating the camera magnification based on the length data.
[0100] In one embodiment, when the processor executes the computer program, the following steps are also implemented: calculating the target length corresponding to the image pixel length according to the camera magnification; and calculating the length of the scale by the target length and the length data.
[0101] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining training sample images and inputting the training sample images into an initial target recognition algorithm; labeling and training the training sample images through the initial target recognition algorithm to obtain training results; and adjusting the parameters of the initial target recognition algorithm according to the training results to obtain a target recognition algorithm.
[0102] In one embodiment, when the processor executes the computer program, the processor further implements the following steps: acquiring sample images, and preprocessing the sample images to obtain training sample images.
[0103] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0104] Acquire an image to be tested, wherein the image to be tested includes a scale;
[0105] Identify and segment the scale area in the image to be tested through the target recognition algorithm;
[0106] Calculating the image pixel length corresponding to the scale according to the scale area, and identifying the length data in the scale area;
[0107] Calculate the length of the scale bar based on the image pixel length and length data.
[0108] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: the scale area includes a scale line segment area and a scale length data area.
[0109] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: extracting the scale line segment area in the scale area; detecting the scale line segments in the scale line segment area based on the edge detection algorithm; and obtaining the image pixel length corresponding to the scale line segments through the skeleton extraction algorithm.
[0110] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: extracting a scale length data area in the scale area; identifying length data in the scale length data area by a target recognition algorithm; and calculating the camera magnification based on the length data.
[0111] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: calculating the target length corresponding to the image pixel length according to the camera magnification; calculating the length of the scale by the target length and the length data.
[0112] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining training sample images and inputting the training sample images into an initial target recognition algorithm; labeling and training the training sample images through the initial target recognition algorithm to obtain training results; and adjusting the parameters of the initial target recognition algorithm according to the training results to obtain a target recognition algorithm.
[0113] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: acquiring sample images, and preprocessing the sample images to obtain training sample images.
[0114] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0115] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0116] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for calculating scale length, characterized in that: The method comprises: Acquire an image to be tested, wherein the image to be tested includes a scale; acquire a training sample image, and input the training sample image into an initial target recognition algorithm; use the initial target recognition algorithm to respectively identify the length data area and the line segment area of the scale, and segment them; perform labeling training on the segmented length data area through the initial target recognition algorithm, and obtain the numerical result represented by the image through training; input the magnification corresponding to the image into the numerical result obtained by training, so that the numerical value corresponds to the magnification, thereby obtaining the training result; adjust the parameters of the initial target recognition algorithm according to the training result, and obtain the target recognition algorithm; Identify and segment the scale area in the image to be tested by a target recognition algorithm; the scale area includes a scale line segment area and a scale length data area; Calculating the image pixel length corresponding to the scale according to the scale area, including: extracting the scale line segment area in the scale area; detecting the scale line segments in the scale line segment area based on an edge detection algorithm; obtaining the image pixel length corresponding to the scale line segments by a skeleton extraction algorithm; identifying the length data in the scale area; extracting the scale length data area in the scale area; identifying the length data in the scale length data area by the target recognition algorithm; and calculating the camera magnification according to the length data; Calculating the length of the scale according to the image pixel length and the length data includes: calculating a target length corresponding to the image pixel length according to the camera magnification; and calculating the length of the scale according to the target length and the length data.
2. The method according to claim 1, characterized in that The method further comprises: A sample image is collected and preprocessed to obtain the training sample image.
3. A scale length calculation device, characterized in that: The device comprises: An image acquisition module is used to acquire an image to be tested, wherein the image to be tested includes a scale; acquire a training sample image, and input the training sample image into an initial target recognition algorithm; use the initial target recognition algorithm to respectively identify the length data area and the line segment area of the scale, and perform segmentation; perform labeling training on the segmented length data area through the initial target recognition algorithm, and obtain the numerical result represented by the image through training; input the magnification corresponding to the image into the numerical result obtained by training, so that the numerical value corresponds to the magnification, thereby obtaining the training result; adjust the parameters of the initial target recognition algorithm according to the training result, and obtain the target recognition algorithm; A region segmentation module, used to identify and segment the scale area in the image to be measured through a target recognition algorithm; the scale area includes a scale line segment area and a scale length data area; A data recognition module, used for calculating the image pixel length corresponding to the scale according to the scale area, comprising: extracting the scale line segment area in the scale area; detecting the scale line segments in the scale line segment area based on an edge detection algorithm; obtaining the image pixel length corresponding to the scale line segments by a skeleton extraction algorithm; identifying the length data in the scale area; extracting the scale length data area in the scale area; identifying the length data in the scale length data area by the target recognition algorithm; and calculating the camera magnification according to the length data; The length calculation module is used to calculate the length of the scale according to the image pixel length and the length data, including: calculating the target length corresponding to the image pixel length according to the camera magnification; calculating the length of the scale according to the target length and the length data.
4. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to claim 1 or 2 are implemented.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to claim 1 or 2 are implemented.
