Image recognition and distance measurement method and device

By using image recognition methods and the dots on the gauge length standard plate, the pixel change is calculated and converted into a distance change value, which solves the problems of expensive gauge length detection equipment and real-time detection, and realizes low-cost, full-range gauge length detection.

CN116223201BActive Publication Date: 2026-04-07CHINA MERCHANTS CHONGQING HIGHWAY ENG TESTING CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-16
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In the existing technology, gauge length detection equipment is expensive and can only be removed during the test, making it impossible to detect gauge length changes in real time. Moreover, its high cost makes it difficult to popularize in general laboratories.

Method used

An image recognition method is used to acquire multiple images of the sample to be tested, which are marked with punctuation. The pixel change between the punctuation points is calculated and combined with the dots on the gauge length standard plate to convert them into distance change values, thereby realizing full-range gauge length detection.

Benefits of technology

It enables low-cost detection of gauge length changes throughout the entire experiment, reduces equipment costs, is easy to operate, is suitable for ordinary equipment, and meets the needs of general laboratories.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116223201B_ABST
    Figure CN116223201B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of gauge length detection, and in particular to a detection method and device for image recognition gauge length. The pixel variation between the marks on the sample is obtained through the image of the sample, and then the distance variation between the marks is obtained according to the pixel variation. In this way, a contact extensometer is not needed, only a device capable of taking images of the sample is needed, the cost of the device is low, and the distance variation between the marks can be detected throughout the test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of gauge length detection technology, and specifically to a method and apparatus for detecting gauge length in image recognition. Background Technology

[0002] In the construction industry, gauge length is measured in various tests, including tensile tests on reinforcing steel, tensile tests on geotechnical materials, and tests on the elastic modulus of concrete. Currently, gauge length measurement includes contact and non-contact methods. Contact testing primarily uses contact extensometers, but these require installation during testing, and in most cases, the extensometer needs to be removed during the test, making it impossible to detect gauge length changes throughout the entire test. Non-contact testing typically uses specially customized gauge length measurement equipment, which is very expensive and can only be used for gauge length measurement, making it difficult for most laboratories to afford. Therefore, there is an urgent need for a cost-effective gauge length measurement method that can detect gauge length changes throughout the entire test. Summary of the Invention

[0003] To address the shortcomings of existing technologies, this invention proposes a method and apparatus for detecting gauge length in image recognition, which can reduce costs and detect changes in gauge length throughout the entire testing process.

[0004] In a first aspect, the present invention provides a method for detecting the gauge length of an image recognition system.

[0005] In a first possible implementation, an image recognition gauge detection method includes:

[0006] Acquire multiple images of the sample to be tested, with at least two punctuation marks of a first preset color on the sample;

[0007] The pixel variation between punctuation marks is obtained from multiple test sample images;

[0008] The distance change between punctuation marks is obtained based on the pixel change between them.

[0009] In the second possible method, which combines the first method, the direction of the line connecting the punctuation marks is consistent with the direction of the stretching of the sample to be tested. When the punctuation marks are calipers, the calipers are parallel to each other.

[0010] In the third possible method, in combination with the first possible method, a gauge standard plate is placed on the sample to be tested, and multiple equidistant dots of a second preset color are marked on the edge of the gauge standard plate.

[0011] In combination with the third feasible method, in the fourth feasible method, the edge line of the gauge standard plate with dots covers all the marks, and the line connecting the edge line and the marks is perpendicular. When the marks are marks, the edge line is perpendicular to the marks.

[0012] In the fifth possible method, which combines the third possible method, the punctuation mark, the sample to be tested, and the gauge standard plate are all different colors.

[0013] In conjunction with the first feasible method, the sixth feasible method involves obtaining the pixel variation between markers based on multiple test sample images, including:

[0014] Obtain the first RGB range of the markers in each sample image to be tested;

[0015] Iterate through all pixels in the test sample image and obtain the pixel coordinates of the punctuation in each test sample image according to the first RGB range of the punctuation.

[0016] The pixel distance between the markers in each test sample image is obtained based on the pixel coordinates of the markers in each test sample image.

[0017] The pixel change between punctuation marks is obtained by measuring the pixel distance between punctuation marks in multiple test sample images.

[0018] Combining the sixth feasible method, in the seventh feasible method, all pixels in the test sample image are traversed, and the pixel coordinates of the markers in each test sample image are obtained according to the first RGB range of the markers, including:

[0019] Iterate through all pixels in the sample image to be tested and obtain the first RGB value of each pixel;

[0020] The pixel corresponding to the first RGB value within the first RGB range is identified as the punctuation mark, and the pixel coordinates of the punctuation mark are obtained.

[0021] In conjunction with the third feasible method, the eighth feasible method obtains the distance change value between punctuation marks based on the pixel change between punctuation marks, including:

[0022] Obtain the second RGB range of the dots in each sample image to be tested;

[0023] Traverse all pixels in the sample image to be tested, and obtain the pixel coordinates of the dots in the sample image to be tested based on the second RGB range of the dots.

[0024] The actual distance conversion relationship of pixels is obtained based on the pixel coordinates of the dots in each sample image to be tested;

[0025] Multiply the actual distance conversion relationship of the pixels by the pixel change between the punctuation marks to obtain the distance change value between the punctuation marks in the sample to be tested.

[0026] In conjunction with the eighth feasible method, the ninth feasible method obtains the actual distance transformation relationship of pixels based on the pixel coordinates of the dots in each test sample image, including:

[0027] The pixel distance between any two circles can be obtained based on the pixel coordinates of each circle.

[0028] Divide the actual distance between any two dots by the pixel distance between the two dots to obtain the actual distance conversion relationship of pixels in the sample image to be tested.

[0029] Secondly, the present invention provides an image recognition gauge detection device.

[0030] In the tenth possible implementation, an image recognition gauge length detection device includes:

[0031] The test sample image acquisition module is configured to acquire multiple images of the test sample, which are marked with at least two punctuation marks of a first preset color.

[0032] The pixel change acquisition module is configured to acquire the pixel change between punctuation marks based on multiple test sample images;

[0033] The distance change value acquisition module is configured to acquire the distance change value between punctuation points based on the pixel change between punctuation points.

[0034] As can be seen from the above technical solution, the beneficial technical effects of the present invention are as follows:

[0035] The method involves obtaining the pixel changes between punctuation marks on the test sample from an image of the sample, and then calculating the distance changes between the punctuation marks based on these pixel changes. This eliminates the need for a contact extensometer; only equipment capable of capturing images of the test sample is required. This results in low equipment costs and allows for the detection of distance changes between punctuation marks throughout the entire test. Attached Figure Description

[0036] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.

[0037] Figure 1 This is a schematic diagram of an image recognition gauge detection method provided in this embodiment;

[0038] Figure 2 This is a schematic diagram of a sample image to be tested provided in this embodiment;

[0039] Figure 3 This is a schematic diagram of the structure of an image recognition gauge length detection device provided in this embodiment;

[0040] Figure label:

[0041] 1-Sample to be tested, 2-Marking point, 3-Gazette standard plate, 4-Dot. Detailed Implementation

[0042] The embodiments of the technical solution of the present invention will now be described in detail with reference to the accompanying drawings. These embodiments are merely illustrative of the technical solution of the present invention and are therefore intended to limit the scope of protection of the present invention.

[0043] It should be noted that, unless otherwise stated, the technical or scientific terms used in this application should have the ordinary meaning understood by those skilled in the art to which this invention pertains. The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data used can be interchanged where appropriate for the embodiments of this disclosure described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. Unless otherwise stated, the term "a plurality of" means two or more. In this disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B means: A or B. The term "and / or" describes an association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B. The term "corresponding" can refer to an association or binding relationship; A corresponding to B means that there is an association or binding relationship between A and B.

[0044] Combination Figure 1 As shown, this embodiment provides a method for detecting the scale length of an image recognition system, including:

[0045] Step S01: Acquire multiple images of the sample to be tested, with at least two punctuation marks of a first preset color on the sample to be tested;

[0046] Step S02: Obtain the pixel change between punctuation marks based on multiple test sample images;

[0047] Step S03: Obtain the distance change value between punctuation marks based on the pixel change between punctuation marks.

[0048] Optionally, the punctuation marks on the sample to be tested are dots or lines of a first preset color.

[0049] Optionally, the direction of the line connecting the punctuation marks is consistent with the direction of stretching of the sample to be tested, and when the punctuation marks are calipers, the calipers are parallel to each other.

[0050] Optionally, obtaining the pixel change between punctuation marks based on multiple test sample images includes: using two punctuation marks as a standard plate, and obtaining the pixel change between punctuation marks based on the standard plate in the multiple test sample images.

[0051] In some embodiments, when the detection conditions are good, the gauge standard plate is removed, and two punctuation marks are used as the standard plate. The number of pixels between the two punctuation marks is detected, and then the distance of a single pixel is obtained based on the known actual distance between the two punctuation marks. The change in pixels between punctuation marks is obtained through the detection of the sequence images, thereby obtaining the change in distance between a single punctuation mark or two punctuation marks.

[0052] Optionally, a gauge standard plate is placed on the sample to be tested, and multiple equidistant dots of a second preset color are marked on the edge of the gauge standard plate.

[0053] Optionally, the distance between any two dots is L0, the RGB value range of the dot color is RGB2, the number of dots is determined according to the detection accuracy, and generally no less than 3 dots, with the outermost point of the dots outside the end position of the test sample.

[0054] Optionally, the edge of the gauge length standard plate with dots covers all the marks, and the edge is perpendicular to the line connecting the marks. When the marks are markings, the edge is perpendicular to the markings.

[0055] In some embodiments, the lines connecting the dots on the side edge of the gauge length standard plate form a straight line, and the straight line formed by the dots is perpendicular to the line connecting all the marks. When the marks are calipers, the straight line formed by the dots is perpendicular to all the calipers. The side of the gauge length standard plate with the circular holes covers half of each mark, and the colors of the gauge length standard plate, the test sample, and the test environment are all different.

[0056] Optionally, the punctuation marks, the sample to be tested, and the gauge standard plate can be different colors.

[0057] In some embodiments, combined with Figure 2 As shown, two parallel punctuation marks 2 are marked on the sample 1 to be tested using a pen capable of drawing a first preset color. The direction of the line connecting the punctuation marks is consistent with the direction of stretching or compression of the sample. The sample with the punctuation marks is placed on the testing area or in the testing environment. A gauge standard plate 3 is placed over the punctuation marks on the sample, with the edge of the gauge standard plate marked with equidistant dots 4 perpendicular to the line connecting the punctuation marks. If the punctuation marks are lines, the edge of the gauge standard plate marked with equidistant dots 4 is perpendicular to the lines. The color of the punctuation marks on the sample or the dots on the gauge standard plate is different from the color of the testing environment. If the color of the punctuation marks or dots is the same as the color of the testing environment, a background plate of a different color from the punctuation marks and dots is placed on the back of the sample.

[0058] In some embodiments, after the sample to be tested and the gauge standard plate are placed in the detection environment as described above, a device with a camera is used to continuously photograph the sample to be tested and the gauge standard plate to obtain multiple images of the sample to be tested. Each image of the sample to be tested contains all the punctuation marks and at least three dots.

[0059] Alternatively, devices with cameras include mobile phones, cameras, or camcorders.

[0060] Optionally, obtaining the pixel change between punctuation marks based on multiple test sample images includes: obtaining the first RGB range of punctuation marks in each test sample image; traversing all pixels in the test sample image and obtaining the pixel coordinates of punctuation marks in each test sample image based on the first RGB range of punctuation marks; obtaining the pixel distance between punctuation marks in each test sample image based on the pixel coordinates of punctuation marks in each test sample image; and obtaining the pixel change between punctuation marks based on the pixel distance between punctuation marks in multiple test sample images.

[0061] In some embodiments, the sample image to be tested is imported into software on a computer or a mobile app. Clicking on a punctuation mark or a dot will provide the RGB value range RGB1 for the punctuation mark and the RGB value range RGB2 for the dot's color. Any color on an image can be recorded and represented by a set of RGB values, where RGB represents red (R), green (G), and blue (B), respectively. A set of red, green, and blue values ​​constitutes the smallest display unit of a color.

[0062] Optionally, traversing all pixels in the test sample image and obtaining the pixel coordinates of the punctuation in each test sample image according to the first RGB range of the punctuation includes: traversing all pixels in the test sample image and obtaining the first RGB value of each pixel; determining the pixel corresponding to the first RGB value within the first RGB range as the punctuation and obtaining the pixel coordinates of the punctuation.

[0063] Optionally, the pixel distance between punctuation points in each test sample image is obtained based on the pixel coordinates of the punctuation points in each test sample image, including obtaining the pixel distance between two punctuation points using a preset pixel distance formula.

[0064] Optionally, the preset pixel distance formula is:

[0065] △l= ;in, The pixel difference between the horizontal coordinates of the two punctuation marks. Δl is the pixel difference between the vertical coordinates of the two punctuation marks, and Δl is the pixel distance between the punctuation marks.

[0066] Optionally, the pixel change between punctuation marks is obtained based on the pixel distance between punctuation marks in multiple test sample images, including: determining the difference in pixel distance between punctuation marks in multiple test sample images as the pixel change between two punctuation marks.

[0067] In some embodiments, the pixel coordinates of a punctuation mark represent its position in the test sample image, the pixel difference between two punctuation marks represents their pixel distance, and the difference in pixel distances between punctuation marks in multiple test sample images represents the pixel change of the two punctuation marks. Multiplying the pixel change by the distance per unit pixel yields the deformation of the punctuation mark, and the distance per unit pixel represents the actual distance conversion relationship of the pixels. Thus, by obtaining the pixel distance between two punctuation marks from a single test sample image, obtaining the pixel deformation value of the punctuation mark from the difference in pixel distances across a series of test sample images, and multiplying the pixel deformation value of the punctuation mark by the distance per unit pixel to obtain the distance changed by the punctuation mark, the gauge length is obtained. This achieves gauge length detection with low computational cost and inexpensive detection equipment.

[0068] Optionally, obtaining the distance change value between punctuation marks based on the pixel change between punctuation marks includes: obtaining the second RGB range of the dots in each test sample image; traversing all pixels in the test sample image and obtaining the pixel coordinates of the dots in the test sample image based on the second RGB range of the dots; obtaining the actual distance conversion relationship of the pixels based on the pixel coordinates of the dots in each test sample image; and multiplying the actual distance conversion relationship of the pixels by the pixel change between punctuation marks to obtain the distance change value between punctuation marks in the test sample.

[0069] In some embodiments, the mobile phone or computer software detects each pixel in the sample image from top to bottom and from left to right, obtaining the second RGB value of each pixel. If the pixel corresponding to the second RGB value within the second RGB range (i.e., within RGB2) exceeds a first preset threshold, then the pixel is determined as the dot of the gauge standard plate, and the pixel coordinates (mx0, my0), (mx1, my1), ..., (mx...) of the dot on the gauge standard plate are recorded. x my x ... (mx) n my n ), where n is a positive integer and n is not less than 3.

[0070] Optionally, during gauge length detection, the area to be detected is enclosed in a box in the software or app, and all pixels within the enclosed area are traversed to obtain punctuation marks and dots, which greatly reduces the amount of detection required.

[0071] Optionally, the actual distance conversion relationship of pixels is obtained based on the pixel coordinates of the dots in each sample image to be tested, including: obtaining the pixel distance between any two dots based on the pixel coordinates of each dot; and dividing the actual distance between any two dots by the pixel distance between the two dots to obtain the actual distance conversion relationship of pixels in the sample image to be tested.

[0072] Optionally, the actual distance transformation relationship of pixels can be obtained using the following formula:

[0073] Lx`=L 0x / △lx=

[0074] Where Lx` represents the actual distance between any two pixels, i.e., the actual distance conversion relationship between pixels; L0x represents the actual distance between any two circles on the gauge plate; Δlx represents the pixel distance between any two circles; (mx) x my x () represents the pixel coordinates of the dot.

[0075] In some embodiments, when obtaining the pixel coordinates of the punctuation marks in the sample image to be tested, since the positions of the punctuation marks are between the dots of the gauge standard plate, the distance between the punctuation marks can be calculated by interpolation.

[0076] Optionally, two punctuation marks can be used as a standard template. The distance of a single pixel is obtained by detecting the number of pixel coordinates between the punctuation marks and the actual distance between them. The change in pixel values ​​between the punctuation marks is obtained by detecting the sequence of images, thus obtaining the change in the distance between the punctuation marks. In this way, punctuation distance detection can be performed without equidistant standard templates, making the process simpler and more convenient.

[0077] In some embodiments, on the hardware side, this solution only requires a device with a camera, such as a mobile phone lens, camera lens, or camcorder lens. The hardware technology is mature, reliable, and very inexpensive. On the software side, this solution only requires obtaining pixel values ​​and coordinates by clicking on the image. Existing technologies already have numerous mature and simple related software programs that can achieve this function, thus making this solution cost-effective. Furthermore, because a standard board is incorporated into the detection process, the requirements for the camera angle are low, and detection results can be achieved even in general motion modes. The lens can detect in non-stationary states, providing good operability.

[0078] Combination Figure 3As shown, an image recognition gauge detection device includes: a test sample image acquisition module 101, configured to acquire multiple images of the test sample, wherein the test sample is marked with at least two punctuation marks of a first preset color; a pixel change acquisition module 102, configured to acquire the pixel change between the punctuation marks based on the multiple test sample images; and a distance change value acquisition module 103, configured to acquire the distance change value between the punctuation marks based on the pixel change between the punctuation marks.

[0079] In some embodiments, compared with the prior art, this solution does not require specialized equipment; general equipment can obtain the necessary data, and the gauge length can be detected using specific software. Because it uses common equipment, the detection cost is reduced. Since it identifies relative parts in a sequence of images, the requirements for camera motion and angle are low, making it simple and convenient to operate.

[0080] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.

Claims

1. A method for detecting the gauge length in image recognition, characterized in that, include: Acquire multiple images of the sample to be tested, wherein the sample to be tested is marked with at least two punctuation marks of a first preset color; A gauge standard plate is placed on the sample to be tested, and multiple equidistant dots of a second preset color are marked on the edge of the gauge standard plate. The dotted edge of the gauge plate covers all the marks, and the edge is perpendicular to the line connecting the marks. When the marks are lines, the edge is perpendicular to the lines. The punctuation marks, the sample to be tested, and the gauge standard plate are all different colors; The pixel variation between punctuation marks is obtained from multiple test sample images; Obtaining the distance change value between punctuation marks based on the pixel change between them includes: Obtain the second RGB range of the dots in each sample image to be tested; Traverse all pixels in the sample image to be tested, and obtain the pixel coordinates of the dots in the sample image to be tested based on the second RGB range of the dots. The actual distance conversion relationship of pixels is obtained based on the pixel coordinates of the dots in each sample image to be tested; The actual distance conversion relationship of pixels can be obtained using the following formula: Lx`=L 0x / △lx= Where Lx` is the actual distance between any two pixels, L0x is the actual distance between any two circles on the gauge block, Δlx is the pixel distance between any two circles, (mx x my x () represents the pixel coordinates of the dot; The actual distance conversion relationship of the pixels is multiplied by the pixel change between the punctuation points to obtain the distance change value between the punctuation points in the sample to be tested.

2. The method according to claim 1, characterized in that, The direction of the line connecting the punctuation marks is consistent with the direction of expansion and contraction of the sample to be tested. When the punctuation marks are datum lines, the datum lines are parallel to each other.

3. The method according to claim 1, characterized in that, The pixel changes between punctuation marks are obtained from multiple test sample images, including: Obtain the first RGB range of the markers in each sample image to be tested; Traverse all pixels in the test sample image and obtain the pixel coordinates of the punctuation in each test sample image according to the first RGB range of the punctuation. The pixel distance between the markers in each test sample image is obtained based on the pixel coordinates of the markers in each test sample image. The pixel change between punctuation marks is obtained by measuring the pixel distance between punctuation marks in multiple test sample images.

4. The method according to claim 3, characterized in that, Traverse all pixels in the test sample image, and obtain the pixel coordinates of the markers in each test sample image according to the first RGB range of the markers, including: Traverse all pixels in the image to be tested and obtain the first RGB value of each pixel; The pixel corresponding to the first RGB value within the first RGB range is identified as the punctuation mark, and the pixel coordinates of the punctuation mark are obtained.

5. The method according to claim 1, characterized in that, The actual distance transformation relationship of pixels is obtained based on the pixel coordinates of the dots in each sample image to be tested, including: The pixel distance between any two circles can be obtained based on the pixel coordinates of each circle. Divide the actual distance between any two dots by the pixel distance between the two dots to obtain the actual distance conversion relationship of pixels in the sample image to be tested.

6. A device for detecting the gauge length of an image recognition system, characterized in that, include: The test sample image acquisition module is configured to acquire multiple images of the test sample, wherein the test sample is marked with at least two punctuation marks of a first preset color; A gauge standard plate is placed on the sample to be tested, and multiple equidistant dots of a second preset color are marked on the edge of the gauge standard plate. The dotted edge of the gauge plate covers all the marks, and the edge is perpendicular to the line connecting the marks. When the marks are lines, the edge is perpendicular to the lines. The punctuation marks, the sample to be tested, and the gauge standard plate are all different colors; The pixel change acquisition module is configured to acquire the pixel change between punctuation marks based on multiple test sample images; The distance change value acquisition module is configured to acquire the distance change value between the markers based on the pixel change between the markers, including: Obtain the second RGB range of the dots in each sample image to be tested; Traverse all pixels in the sample image to be tested, and obtain the pixel coordinates of the dots in the sample image to be tested based on the second RGB range of the dots. The actual distance conversion relationship of pixels is obtained based on the pixel coordinates of the dots in each sample image to be tested; The actual distance conversion relationship of pixels can be obtained using the following formula: Lx`=L 0x / △lx= Where Lx` is the actual distance between any two pixels, L0x is the actual distance between any two circles on the gauge block, Δlx is the pixel distance between any two circles, (mx x my x () represents the pixel coordinates of the dot; The actual distance conversion relationship of the pixels is multiplied by the pixel change between the punctuation points to obtain the distance change value between the punctuation points in the sample to be tested.

Citation Information

Patent Citations

  • Method for testing true stress and true strain of metal material

    CN107271279A

  • Method for measuring super-large deformation of plane

    CN114623795A