Measurement length acquisition method and device based on image recognition, equipment and medium
Through an image recognition method, using an electronic tape measure to obtain and process the measurement video, and identify the scale on the tape, the friction loss, error and complex structure problems existing in the measurement process of the existing electronic tape measure are solved, achieving higher measurement accuracy and credibility.
Patent Information
- Application Number
- CN202411908086.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-18
AI Technical Summary
The existing electronic tape measure has problems such as friction loss, uncontrollable conversion errors and complex structural design during the measurement process, and users have doubts about the accuracy and credibility of the measurement data.
Using the measurement length acquisition method based on image recognition, the length measurement video is obtained through an electronic tape measure, and the length measurement image set is obtained by processing the video in frames. The edge detection algorithm and the improved MSER algorithm are used to identify the scale on the scale strip to calculate the measurement length.
It reduces physical contact friction, reduces uncontrollable errors, simplifies structural design, improves the accuracy and credibility of measurement results, and gives full play to the advantages of fast reading of electronic tape measure.
Smart Images

Figure CN119845158A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of length measurement, and in particular relates to a method, device, equipment and medium for obtaining measured length based on image recognition. Background Art
[0002] An electronic tape measure is a measuring tool that integrates high-tech elements. It can not only measure the length of an object like a traditional tape measure, but also has a variety of additional functions, such as data storage and remote transmission. These functions make electronic tape measures very practical in homes, industries, and professional fields. However, current electronic tape measures have many defects: for traditional electronic tape measures that convert the rotation of the core shaft into the stretched length of the tape after connecting a capacitive grid sensor to the core shaft, friction will occur between the two plates of the capacitive grid sensor during rotation, and there will be inevitable loss during the tape measurement process, which is a great test for the durability of the capacitive grid plate. In the process of converting the rotation into the measured length, there are uncontrollable conversion errors. At the same time, during the process of winding up the tape, there are more or less gaps in the tape in the core, which cannot be completely eliminated and will also lead to uncontrollable errors. For traditional electronic tape measures that convert the rotation of the core shaft into the stretched length of the tape, friction will occur between the two plates of the capacitive grid sensor during rotation, and there will be inevitable loss during the tape measurement process, which will greatly test the durability of the capacitive grid plate. In addition, in the process of converting the rotation into the measured length, there will be uncontrollable conversion errors. At the same time, in the process of winding up the tape, there will be more or less gaps in the tape in the core, which cannot be completely eliminated and will also lead to uncontrollable errors. Various encoders are connected to the tape measure to obtain the rotation amount of the ruler core rotating shaft, and then the rotation amount is converted into the stretched length of the ruler tape. In order to ensure the stability of the encoder, this type of tape measure often requires protective designs such as dust and water proofing on the product structure, which increases the difficulty of structural design and prolongs the product development cycle. For traditional electronic tape measures, there are trust issues in the process of user use. For example, in the furniture industry, when users measure the building dimensions to customize furniture, they have extremely high requirements for the accuracy and credibility of the data. They dare not fully trust electronic measurements and often observe the physical tape measure scale again after electronic measurements, which makes the advantage of fast reading of electronic tape measures lost. Summary of the invention
[0003] In order to solve the above problems existing in the prior art, the present invention provides a method, device, equipment and medium for obtaining measured length based on image recognition.
[0004] The purpose of the present invention can be achieved through the following technical solutions:
[0005] A method for obtaining a measured length based on image recognition, the implementation of which comprises the following steps:
[0006] Acquire a length measurement video through an electronic tape measure, and process the length measurement video frame by frame to obtain a length measurement image set, wherein the electronic tape measure includes a tape measure, a tape core box, a video acquisition end, a screen, and a control terminal, and the tape measure includes an absolute value scale tape measure and a comprehensive scale tape measure;
[0007] When the tape is the absolute value scale tape, the measured length is obtained by using the last frame length measurement image in the length measurement image set;
[0008] When the tape ruler is the integrated scale tape ruler, the measured length is obtained through the length measurement image set.
[0009] Preferably, obtaining the length measurement video by the electronic tape measure includes:
[0010] The retractable ruler tape is used to measure the length and the length measurement video is obtained by a video acquisition end fixed on the ruler core box and directly above the ruler tape. The video acquisition end is triggered by the displacement change of the ruler tape. When the ruler tape starts to move, it starts to collect the length measurement video, and when the ruler tape stops moving, it stops collecting the length measurement video.
[0011] Preferably, when the tape ruler is the absolute value scale tape ruler, obtaining the measured length through the last frame length measurement image in the length measurement image set comprises:
[0012] Calibrate the scale reading benchmark through edge detection algorithm;
[0013] Obtaining a first reading by improving the MSER algorithm, wherein the first reading is an integer part of the measured length;
[0014] obtaining a second reading by pixel distance ratio;
[0015] The first reading and the second reading are summed to obtain the measured length.
[0016] Preferably, the calibration of the scale reading reference by edge detection algorithm comprises:
[0017] Mark the upper edge of the tape inlet and outlet through edge detection algorithm;
[0018] The end face offset value is calculated by the Pythagorean theorem, and the end face offset value is the distance that the end face of the tape inlet and outlet is offset from the upper edge of the tape inlet and outlet, and the tape inlet and outlet end face is the end face of the inlet and outlet on the tape core box for the tape to enter and exit;
[0019] The end face offset value is used to calibrate the scale and read the reference.
[0020] Preferably, obtaining the first reading by improving the MSER algorithm comprises:
[0021] Capturing the reading value closest to the import and export end faces of the tape in the last frame length measurement diagram by using a target detection algorithm, that is, the first reading;
[0022] The first read is identified by the improved MSER algorithm.
[0023] The improved MSER algorithm is specifically as follows: decomposing the final frame length measurement graph under the RGB color channels to obtain an R color component graph, a G color component graph and a B color component graph;
[0024] Filter and denoise the R color component image, the G color component image, and the B color component image by using a median filtering method;
[0025] Get an edge detection operator, the edge detection operator includes an x-direction edge detection operator and a y-direction edge detection operator, and the expression of the x-direction edge detection operator is: The expression of the y-direction edge detection operator is:
[0026]
[0027] The x-direction gradient value and the y-direction gradient value are calculated by the edge detection operator, and the calculation formula is: Among them, G x is the gradient value in the x direction, G y is the gradient value in the y direction, B is a 3×3 window, and * is a convolution operation;
[0028] The gradient magnitude map is obtained based on the x-direction gradient value and the y-direction gradient value, and the expression is: Where G is the gradient amplitude map;
[0029] Performing edge enhancement on the R color component image, the G color component image, and the B color component image respectively through the gradient amplitude image to obtain a first edge enhanced image and a second edge enhanced image, wherein the first edge enhanced image includes a first edge enhanced image of R color, a first edge enhanced image of G color, and a first edge enhanced image of B color, and the second edge enhanced image includes a second edge enhanced image of R color, a second edge enhanced image of G color, and a second edge enhanced image of B color;
[0030] Through the MSER algorithm, the first edge enhanced image is detected within the threshold range of [0,255] to obtain MSER+, the second edge enhanced image is detected to obtain MSER-, the MSER+ and the MSER- are summed to obtain the MSER area, and the MSER areas of the three color components are unioned to obtain the first reading.
[0031] Preferably, obtaining the second reading by pixel distance ratio comprises:
[0032] Specifying that the scale line corresponding to the first reading is a main scale line, and the remaining scale lines are secondary scale lines, and obtaining the number of secondary scale lines between the main scale line and the inlet and outlet end faces of the tape;
[0033] Obtaining the pixel distance between the secondary scale line closest to the inlet and outlet end face of the tape and the inlet and outlet end face of the tape, and obtaining the pixel distance ratio by the ratio of the pixel distance to the pixel distance between two adjacent secondary scale lines;
[0034] The second reading is obtained according to the number of the secondary scale lines, the pixel distance between two adjacent secondary scale lines and the pixel distance ratio.
[0035] Preferably, when the tape ruler is the integrated scale tape ruler, obtaining the measured length through the length measurement image set comprises:
[0036] Calibrate the scale reading benchmark through edge detection algorithm;
[0037] Traversing the length measurement image set, extracting the absolute reading that appears last, and identifying the absolute reading through the target detection algorithm and the improved MSER algorithm, wherein the character color of the absolute reading is different from the background of the tape;
[0038] The target detection algorithm is used to capture the reading value closest to the inlet and outlet end faces of the tape in the last frame length measurement diagram. When the tape is retracted, the absolute reading is subtracted from the reading value at this time to obtain the first reading. When the tape is pulled out, the absolute reading is added to the reading value at this time to obtain the first reading.
[0039] Obtaining the number of secondary scale lines between the main scale line and the inlet and outlet end faces of the tape;
[0040] Obtaining the pixel distance between the secondary scale line closest to the inlet and outlet end face of the tape and the inlet and outlet end face of the tape, and obtaining the pixel distance ratio by the ratio of the pixel distance to the pixel distance between two adjacent secondary scale lines;
[0041] The second reading is obtained by the number of the secondary scale lines, the pixel distance between two adjacent secondary scale lines and the pixel distance ratio;
[0042] The first reading and the second reading are summed to obtain the measured length.
[0043] A measured length acquisition device based on image recognition, used to execute the measured length acquisition method described above, comprising a length measurement video acquisition module and a measured length calculation module;
[0044] The length measurement video acquisition module is used to acquire a length measurement video through an electronic tape measure, and to process the length measurement video by frame division to obtain a length measurement image set. The electronic tape measure includes a tape measure, a tape core box, a video acquisition terminal, a screen, and a control terminal. The tape measure includes an absolute value scale tape and a comprehensive scale tape.
[0045] The measured length calculation module is used to obtain the measured length through the last frame length measurement image in the length measurement image set when the tape is the absolute value scale tape; and to obtain the measured length through the length measurement image set when the tape is the comprehensive scale tape.
[0046] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for obtaining the measured length when executing the program.
[0047] A storage medium containing computer executable instructions, wherein the computer executable instructions are used to execute the above-mentioned measured length acquisition method when executed by a computer processor.
[0048] The beneficial effects of the present invention are:
[0049] (1) The video acquisition end fixed on the ruler core box and located directly above the ruler tape obtains the measured length, avoiding physical contact during the measurement process, reducing the loss caused by physical contact friction, and solving the uncontrollable error problem caused by installing the sensor on the ruler core rotating axis. The structure design is simple and the development cycle is short.
[0050] (2) The measured length is obtained through the length measurement video, which improves compatibility and has low requirements for the tape itself, thus solving the problem that the tape needs to be customized and the cost of small-batch production is too high;
[0051] (3) Through real-time length measurement video acquisition and recognition, the measurement results can be obtained while observing the tape, achieving synchronous comparison of the measurement results, improving the accuracy and reliability of the measurement results, and giving full play to the advantage of fast reading of electronic tape measures. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.
[0053] Figure 1 The present invention is a flowchart of the steps of a method for obtaining a measured length based on image recognition.
[0054] Figure 2 The figure is a schematic diagram of the structure of an electronic tape measure corresponding to a method for obtaining measured length based on image recognition according to the present invention. DETAILED DESCRIPTION
[0055] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.
[0056] The working principle and use process of the present invention:
[0057] See also Figure 1 , a method for obtaining measured length based on image recognition, comprising:
[0058] S1: Obtain a length measurement video through an electronic tape measure, and process the length measurement video by frame division to obtain a length measurement image set, wherein the electronic tape measure includes a tape measure, a tape core box, a video acquisition terminal, a screen, and a control terminal, wherein the tape measure includes an absolute value scale tape and a comprehensive scale tape, wherein the comprehensive scale tape is a tape measure combining an absolute value scale and a relative value scale;
[0059] S2: when the tape is the absolute value scale tape, obtaining the measured length through the last frame length measurement image in the length measurement image set;
[0060] S3: When the tape ruler is the integrated scale tape ruler, obtaining the measured length through the length measurement image set.
[0061] In this embodiment, obtaining the length measurement video by using an electronic tape measure can be implemented by the following steps:
[0062] The retractable ruler tape is used to measure the length and the length measurement video is obtained by a video acquisition end fixed on the ruler core box and located directly above the ruler tape. The video acquisition end is triggered by the displacement change of the ruler tape. When the ruler tape starts to move, it starts to collect the length measurement video, and when the ruler tape stops moving, it stops collecting the length measurement video, thereby improving compatibility and having low requirements on the ruler tape itself, thus solving the problem that the ruler tape needs to be customized and the cost of small batch production is too high.
[0063] In this embodiment, when the tape ruler is the absolute value scale tape ruler, the measured length is obtained by using the last frame length measurement image in the length measurement image set, which can be specifically implemented by the following steps:
[0064] S201: calibrating the scale reading reference by edge detection algorithm;
[0065] S202: obtaining a first reading by improving the MSER algorithm, where the first reading is an integer part of the measured length;
[0066] S203: Obtain a second reading through a pixel distance ratio;
[0067] S204: Sum the first reading and the second reading to obtain the measured length.
[0068] In this embodiment, the scale reading reference is calibrated by an edge detection algorithm, which can be implemented by the following steps:
[0069] S201-1: Mark the upper edge of the tape inlet and outlet by edge detection algorithm;
[0070] S201-2: Calculate the end face offset value by the Pythagorean theorem, wherein the end face offset value is the distance that the tape inlet and outlet end faces are offset from the tape inlet and outlet upper edges, and the tape inlet and outlet end faces are the end faces of the inlet and outlet on the tape core box for the tape to enter and exit;
[0071] S201-3: Calibrate the scale and read the reference by the end face offset value.
[0072] In this embodiment, the first reading is obtained by improving the MSER algorithm, which can be implemented by the following steps:
[0073] S202-1: capturing the reading value closest to the inlet and outlet end faces of the tape in the last frame length measurement graph by using a target detection algorithm, that is, the first reading;
[0074] S202-2: Identify the first reading by using the improved MSER algorithm.
[0075] The improved MSER algorithm is specifically as follows: decomposing the final frame length measurement graph under the RGB color channels to obtain an R color component graph, a G color component graph and a B color component graph;
[0076] The R color component image, the G color component image, and the B color component image are filtered and denoised by using a median filtering method, that is, the pixel values of the pixels within a certain range are compared, the median value is taken as the new pixel value of the central pixel in this area, and the pixel values of all pixels within the fixed range are arranged from small to large. If there are isolated noise points, such as salt and pepper noise, in this array from small to large, those isolated noise points will be distributed at both ends of the array, thereby achieving a denoising effect;
[0077] Get an edge detection operator, the edge detection operator includes an x-direction edge detection operator and a y-direction edge detection operator, and the expression of the x-direction edge detection operator is: The expression of the y-direction edge detection operator is:
[0078]
[0079] The x-direction gradient value and the y-direction gradient value are calculated by the edge detection operator, and the calculation formula is: Among them, G x is the gradient value in the x direction, G y is the gradient value in the y direction, B is a 3×3 window, and * is a convolution operation;
[0080] The gradient magnitude map is obtained based on the x-direction gradient value and the y-direction gradient value, and the expression is: Where G is the gradient amplitude map;
[0081] Performing edge enhancement on the R color component image, the G color component image, and the B color component image respectively through the gradient amplitude image to obtain a first edge enhanced image and a second edge enhanced image, wherein the first edge enhanced image includes a first edge enhanced image of R color, a first edge enhanced image of G color, and a first edge enhanced image of B color, and the second edge enhanced image includes a second edge enhanced image of R color, a second edge enhanced image of G color, and a second edge enhanced image of B color;
[0082] Through the MSER algorithm, the first edge enhanced image is detected within the threshold range of [0,255] to obtain MSER+, the second edge enhanced image is detected to obtain MSER-, the MSER+ and the MSER- are summed to obtain the MSER area, and the MSER areas of the three color components are unioned to obtain the first reading.
[0083] In this embodiment, obtaining the second reading by the pixel distance ratio can be specifically implemented by the following steps:
[0084] Specifying that the scale line corresponding to the first reading is a main scale line, and the remaining scale lines are secondary scale lines, and obtaining the number of secondary scale lines between the main scale line and the inlet and outlet end faces of the tape;
[0085] Obtaining the pixel distance between the secondary scale line closest to the inlet and outlet end face of the tape and the inlet and outlet end face of the tape, and obtaining the pixel distance ratio by the ratio of the pixel distance to the pixel distance between two adjacent secondary scale lines;
[0086] The second reading is obtained according to the number of the secondary scale lines, the pixel distance between two adjacent secondary scale lines and the pixel distance ratio.
[0087] In this embodiment, when the tape ruler is the integrated scale tape ruler, obtaining the measured length through the length measurement image set can be specifically implemented through the following steps:
[0088] S301: calibrating the scale reading reference by edge detection algorithm;
[0089] S302: traverse the length measurement image set, extract the absolute reading that appears last, and identify the absolute reading through the target detection algorithm and the improved MSER algorithm, wherein the character color of the absolute reading is different from the tape background;
[0090] S303: capturing the reading value closest to the inlet and outlet end faces of the tape in the last frame length measurement diagram by using a target detection algorithm; when the tape is retracted, the absolute reading minus the reading value at this time is the first reading; and when the tape is pulled out, the absolute reading plus the reading value at this time is the first reading;
[0091] S304: Obtain a second reading through a pixel distance ratio;
[0092] Obtaining the number of secondary scale lines between the main scale line and the inlet and outlet end faces of the tape;
[0093] Obtaining the pixel distance between the secondary scale line closest to the inlet and outlet end face of the tape and the inlet and outlet end face of the tape, and obtaining the pixel distance ratio by the ratio of the pixel distance to the pixel distance between two adjacent secondary scale lines;
[0094] The second reading is obtained by the number of the secondary scale lines, the pixel distance between two adjacent secondary scale lines and the pixel distance ratio;
[0095] S305: Sum the first reading and the second reading to obtain the measured length.
[0096] A device for obtaining measured length based on image recognition comprises a length measurement video obtaining module and a measured length calculating module.
[0097] The length measurement video acquisition module is used to acquire a length measurement video through an electronic tape measure, and to process the length measurement video by frame division to obtain a length measurement image set. The electronic tape measure includes a tape measure, a tape core box, a video acquisition terminal, a screen, and a control terminal. The tape measure includes an absolute value scale tape and a comprehensive scale tape. The comprehensive scale tape is a tape measure that combines an absolute value scale and a relative value scale.
[0098] The measured length calculation module is used to obtain the measured length through the last frame length measurement image in the length measurement image set when the tape is the absolute value scale tape; and to obtain the measured length through the length measurement image set when the tape is the comprehensive scale tape.
[0099] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.
[0100] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0101] The program code included on the computer readable medium can be transmitted with any appropriate medium, including but not limited to wireless, electric wire, optical cable, RF, etc., or any suitable combination of the above. The computer program code for performing the operation of the present invention can be written in one or more programming languages or their combinations, and the programming language includes object-oriented programming languages-such as Java, Smalltalk, C++, and also includes conventional procedural programming languages-such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0102] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. A method for obtaining measured length based on image recognition, characterized in that: The implementation of the measured length acquisition method comprises the following steps: Acquire a length measurement video through an electronic tape measure, and process the length measurement video frame by frame to obtain a length measurement image set, wherein the electronic tape measure includes a tape measure, a tape core box, a video acquisition end, a screen, and a control terminal, and the tape measure includes an absolute value scale tape measure and a comprehensive scale tape measure; When the tape is the absolute value scale tape, the measured length is obtained by using the last frame length measurement image in the length measurement image set; When the tape ruler is the integrated scale tape ruler, the measured length is obtained through the length measurement image set.
2. The method for obtaining the measured length according to claim 1, characterized in that: The length measurement video obtained by using an electronic tape measure includes: The retractable ruler tape is used to measure the length and the length measurement video is obtained by a video acquisition end fixed on the ruler core box and directly above the ruler tape. The video acquisition end is triggered by the displacement change of the ruler tape. When the ruler tape starts to move, it starts to collect the length measurement video, and when the ruler tape stops moving, it stops collecting the length measurement video.
3. The method for obtaining the measured length according to claim 1, characterized in that: When the tape is the absolute value scale tape, obtaining the measured length through the last frame length measurement image in the length measurement image set comprises: Calibrate the scale reading benchmark through edge detection algorithm; Obtaining a first reading by improving the MSER algorithm, wherein the first reading is an integer part of the measured length; obtaining a second reading by pixel distance ratio; The first reading and the second reading are summed to obtain the measured length.
4. The method for obtaining the measured length according to claim 3, characterized in that: The calibration reading reference by edge detection algorithm comprises: Mark the upper edge of the tape inlet and outlet through edge detection algorithm; The end face offset value is calculated by the Pythagorean theorem, and the end face offset value is the distance that the end face of the tape inlet and outlet is offset from the upper edge of the tape inlet and outlet, and the tape inlet and outlet end face is the end face of the inlet and outlet on the tape core box for the tape to enter and exit; The end face offset value is used to calibrate the scale and read the reference.
5. The method for obtaining the measured length according to claim 3, characterized in that: The obtaining of the first reading by improving the MSER algorithm comprises: Capturing the reading value closest to the import and export end faces of the tape in the last frame length measurement diagram by using a target detection algorithm, that is, the first reading; identifying the first read by the improved MSER algorithm; The improved MSER algorithm is specifically as follows: decomposing the final frame length measurement graph under the RGB color channels to obtain an R color component graph, a G color component graph and a B color component graph; Filter and denoise the R color component image, the G color component image, and the B color component image by using a median filtering method; Get an edge detection operator, the edge detection operator includes an x-direction edge detection operator and a y-direction edge detection operator, and the expression of the x-direction edge detection operator is: The expression of the y-direction edge detection operator is: The x-direction gradient value and the y-direction gradient value are calculated by the edge detection operator, and the calculation formula is: Among them, G x is the gradient value in the x direction, G y is the gradient value in the y direction, B is a 3×3 window, and * is a convolution operation; The gradient magnitude map is obtained based on the x-direction gradient value and the y-direction gradient value, and the expression is: Where G is the gradient amplitude map; Performing edge enhancement on the R color component image, the G color component image, and the B color component image respectively through the gradient amplitude image to obtain a first edge enhanced image and a second edge enhanced image, wherein the first edge enhanced image includes a first edge enhanced image of R color, a first edge enhanced image of G color, and a first edge enhanced image of B color, and the second edge enhanced image includes a second edge enhanced image of R color, a second edge enhanced image of G color, and a second edge enhanced image of B color; Through the MSER algorithm, the first edge enhanced image is detected within the threshold range of [0,255] to obtain MSER+, the second edge enhanced image is detected to obtain MSER-, the MSER+ and the MSER- are summed to obtain the MSER area, and the MSER areas of the three color components are unioned to obtain the first reading.
6. The method for obtaining the measured length according to claim 3, characterized in that: The obtaining of the second reading by using the pixel distance ratio comprises: Specify that the scale line corresponding to the first reading is the main scale line, and the remaining scale lines are the secondary scale lines, and obtain the number of the secondary scale lines between the main scale line and the inlet and outlet end faces of the tape; Obtaining the pixel distance between the secondary scale line closest to the inlet and outlet end face of the tape and the inlet and outlet end face of the tape, and obtaining the pixel distance ratio by the ratio of the pixel distance to the pixel distance between two adjacent secondary scale lines; The second reading is obtained according to the number of the secondary scale lines, the pixel distance between two adjacent secondary scale lines and the pixel distance ratio.
7. The method for obtaining the measured length according to claim 1, characterized in that: When the tape is the integrated scale tape, obtaining the measured length through the length measurement image set comprises: Calibrate the scale reading benchmark through edge detection algorithm; Traversing the length measurement image set, extracting the absolute reading that appears last, and identifying the absolute reading through the target detection algorithm and the improved MSER algorithm, wherein the character color of the absolute reading is different from the background of the tape; The target detection algorithm is used to capture the reading value closest to the inlet and outlet end faces of the tape in the last frame length measurement diagram. When the tape is retracted, the absolute reading is subtracted from the reading value at this time to obtain the first reading. When the tape is pulled out, the absolute reading is added to the reading value at this time to obtain the first reading. Obtaining the number of secondary scale lines between the main scale line and the inlet and outlet end faces of the tape; Obtaining the pixel distance between the secondary scale line closest to the inlet and outlet end face of the tape and the inlet and outlet end face of the tape, and obtaining the pixel distance ratio by the ratio of the pixel distance to the pixel distance between two adjacent secondary scale lines; The second reading is obtained by the number of the secondary scale lines, the pixel distance between two adjacent secondary scale lines and the pixel distance ratio; The first reading and the second reading are summed to obtain the measured length.
8. A device for obtaining measured length based on image recognition, characterized in that: The device is applied to the measured length acquisition method based on image recognition as described in any one of claims 1 to 7, comprising a length measurement video acquisition module and a measured length calculation module; The length measurement video acquisition module is used to acquire a length measurement video through an electronic tape measure, and to process the length measurement video by frame division to obtain a length measurement image set. The electronic tape measure includes a tape measure, a tape core box, a video acquisition terminal, a screen, and a control terminal. The tape measure includes an absolute value scale tape and a comprehensive scale tape. The measured length calculation module is used to obtain the measured length through the last frame length measurement image in the length measurement image set when the tape is the absolute value scale tape; and to obtain the measured length through the length measurement image set when the tape is the comprehensive scale tape.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the measured length acquisition method based on image recognition as described in any one of claims 1 to 7 is implemented.
10. A storage medium containing computer executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to execute the measured length acquisition method based on image recognition as described in any one of claims 1 to 7.
Citation Information
Cited By
Measurement device and method
CN121520983A