A method, device, electronic device and medium for measuring steel bar size
Automatically identifying the two sides of the steel bar through image processing technology, solving the problem of inaccurate manual measurement of steel bar size in the prior art, realizing automatic measurement of steel bar size, and improving the accuracy and efficiency of measurement.
Patent Information
- Application Number
- CN202310133277.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-18
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-02-18
AI Technical Summary
In the prior art, the measurement of steel bar size relies on manual measurement, which is large in workload and prone to errors, making it difficult to ensure the accuracy and efficiency of measurement.
The image processing method uses an image processing method to identify the two sides of the steel bar from the construction site image, determine the contour information of the steel bar, and automatically measure the size of the steel bar, including using the deep learning neural network classification model and the instance segmentation model, filter out approximately parallel steel bar line segments as the two sides of the steel bar, and calculate the length and diameter of the steel bar.
Automatic steel bar size measurement is realized, manual intervention is reduced, measurement accuracy and efficiency are improved, and the length, diameter and spacing information of steel bars can be accurately obtained.
Smart Images

Figure CN116067289B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of construction engineering technology, and in particular to a method, a measuring device, an electronic device, and a medium for measuring steel bar dimensions. Background Art
[0002] Reinforced concrete structures are widely used in modern construction projects. The size of the steel bars, such as their length, diameter, and spacing, directly affects the structural stability and bearing capacity of the building. Therefore, the size of the steel bars has become a key monitoring topic in construction project supervision.
[0003] However, in the prior art, the measurement of steel bar dimensions mainly relies on surveyors carrying calipers to the construction site to manually measure and record, which is a huge workload and prone to errors. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide a method, measuring device, electronic equipment and medium for measuring steel bar size, which can automatically identify the two sides of each steel bar from the construction site image, thereby obtaining the contour information of each steel bar to determine the steel bar size; in this way, the steel bar size can be measured automatically, reducing manual intervention and improving measurement accuracy and efficiency.
[0005] The present invention provides a method for measuring the size of a steel bar, the method comprising:
[0006] Acquire a target image of a target measurement area in a construction site;
[0007] Using an image processing method, determining a set of steel bar line segments in the target image;
[0008] Based on the relative position information between each steel bar line segment in the steel bar line segment set, every two steel bar line segments that are closest and approximately parallel are selected from the steel bar line segment set as two sides of a steel bar, thereby obtaining the contour information of each steel bar in the target image;
[0009] Based on the profile information of each steel bar, the size information of the steel bars in the target measurement area is determined.
[0010] Furthermore, the method of using an image processing method to determine a set of steel bar line segments in the target image includes:
[0011] Inputting the target image into a construction stage classification model to determine the construction stage indicated by the target image; wherein the construction stage includes a steel bar binding stage, a concrete pouring stage, a concrete curing stage, and a formwork laying stage;
[0012] When the construction stage is the steel bar binding stage, the target image is input into a steel bar contour extraction model to determine a steel bar contour map in the target image; wherein the steel bar contour map is represented as a mask image, and positions in the steel bar contour map with pixel values of a first value correspond to steel bar areas, and positions with pixel values of a second value correspond to gaps between steel bars;
[0013] Line segments whose length is greater than a preset number of pixels are screened out from the steel bar contour image to form the steel bar line segment set.
[0014] Furthermore, based on the relative position information between each steel bar line segment in the steel bar line segment set, every two steel bar line segments that are closest and approximately parallel are selected from the steel bar line segment set as two sides of a steel bar to obtain the contour information of each steel bar in the target image, including:
[0015] For any target steel bar segment in the steel bar segment set, a plurality of first steel bar segments are screened from the steel bar segment set according to a segment angle between the target steel bar segment and each other steel bar segment in the steel bar segment set and a preset angle threshold;
[0016] Selecting, from the plurality of first steel bar line segments, a first steel bar line segment that does not intersect with the target steel bar line segment within the range of the target image as a second steel bar line segment;
[0017] Projecting the target steel bar line segment onto each second steel bar line segment, and selecting the second steel bar line segment that overlaps with the corresponding second steel bar line segment as the third steel bar line segment;
[0018] Determine the distance between each endpoint of the target steel bar segment and each third steel bar segment, and determine the comparison order of each third steel bar segment according to the distance from smallest to largest;
[0019] Starting from the third steel bar line segment with the smallest distance, determining in sequence whether a quadrilateral area enclosed by two line segment endpoints of the third steel bar line segment and two line segment endpoints of the target steel bar line segment is located in the steel bar area in the steel bar contour diagram;
[0020] If so, the third steel bar segment and the target steel bar segment are determined as the two closest and approximately parallel steel bar segments, and are used as two sides of a steel bar;
[0021] If not, then determine, in accordance with the comparison order, whether the quadrilateral area enclosed by the two segment endpoints of the next third steel bar segment of the third steel bar segment with the smallest distance and each segment endpoint of the target steel bar segment is located in the steel bar area in the steel bar contour diagram, until a steel bar segment that is closest to and approximately parallel to the target steel bar segment is determined.
[0022] Furthermore, the contour information includes coordinates of four endpoints included in two sides of each steel bar in the target image; and determining the steel bar size information in the target measurement area based on the contour information of each steel bar includes:
[0023] For each steel bar, determining the length of the steel bar and the number of steel bars intersecting with the steel bar within the target image based on the contour information of the steel bar;
[0024] Based on the length of the steel bar and the number of the steel bars, an average steel bar spacing within the target image range is determined.
[0025] Furthermore, the determining of the steel bar size information in the target measurement area based on the profile information of each steel bar further includes:
[0026] Based on the contour information of each steel bar, determining the plane equation of the target plane of the steel bar in the target image and the line equations of the lines on which the two sides of the steel bar lie;
[0027] Based on the plane equation and the straight line equation, the steel bar diameter of the steel bar is determined.
[0028] Furthermore, after determining the steel bar size information in the target measurement area based on the profile information of each steel bar, the measurement method further includes:
[0029] Saving the steel bar size information to a database;
[0030] In response to a user's selection operation on the target image, determining a target steel bar whose pixel distance from the pixel point selected by the user is less than a preset distance;
[0031] The steel bar size information of the target steel bar is queried from the database, and the steel bar size information of the target steel bar is displayed.
[0032] Furthermore, based on the relative position information between each steel bar line segment in the steel bar line segment set, each two steel bar line segments that are approximately parallel are screened out from the steel bar line segment set as two sides of a steel bar, and after obtaining the contour information of each steel bar in the target image, the measurement method further includes:
[0033] Convert the coordinates of the four endpoints included in the two sides of each steel bar in the target image to three-dimensional space coordinates in the device coordinate system;
[0034] A steel bar model is drawn according to the three-dimensional spatial coordinates of each end point in the device coordinate system to obtain a building model of the target measurement area.
[0035] The embodiment of the present application further provides a device for measuring the size of steel bars, the device comprising:
[0036] An acquisition module, used to acquire a target image of a target measurement area in a construction site;
[0037] A first determining module is used to determine a set of steel bar line segments in the target image using an image processing method;
[0038] a screening module for screening out, based on relative position information between each steel bar line segment in the steel bar line segment set, each two steel bar line segments that are approximately parallel from the steel bar line segment set as two sides of a steel bar, thereby obtaining contour information of each steel bar in the target image;
[0039] The second determining module is used to determine the size information of the steel bars in the target measurement area based on the contour information of each steel bar.
[0040] An embodiment of the present application also provides an electronic device, comprising: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned method for measuring steel bar size are performed.
[0041] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the above-mentioned method for measuring the size of steel bars are executed.
[0042] The embodiment of the present application provides a method, device, electronic device and medium for measuring the size of steel bars, including: obtaining a target image of a target measurement area in a construction site; using an image processing method to determine a set of steel bar segments in the target image; based on the relative position information between each steel bar segment in the steel bar segment set, screening out the two closest and approximately parallel steel bar segments from the steel bar segment set as the two sides of a steel bar, and obtaining the contour information of each steel bar in the target image; based on the contour information of each steel bar, determining the steel bar size information in the target measurement area. In this way, the two sides of each steel bar can be automatically identified from the construction site image, thereby obtaining the contour information of each steel bar to determine the steel bar size; in this way, the steel bar size can be automatically measured, reducing manual intervention and improving measurement accuracy and efficiency.
[0043] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 A flow chart showing a method for measuring steel bar size provided in an embodiment of the present application is shown;
[0046] Figure 2 One of the structural schematic diagrams of a steel bar size measuring device provided in an embodiment of the present application is shown;
[0047] Figure 3 A second structural diagram of a device for measuring steel bar size provided in an embodiment of the present application is shown;
[0048] Figure 4 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application for which protection is claimed, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work falls within the scope of protection of the present application.
[0050] Based on this, the embodiments of the present application provide a method, a measuring device, an electronic device and a medium for measuring the size of steel bars to automatically measure the size of steel bars, reduce manual intervention, and improve measurement accuracy and efficiency.
[0051] See also Figure 1 , Figure 1 This is a flow chart of a method for measuring the size of steel bars provided in an embodiment of the present application. Figure 1 As shown in , the measurement method provided in the embodiment of the present application includes:
[0052] S101: Acquire a target image of a target measurement area in a construction site.
[0053] In this step, an image acquisition device, such as a camera or a video camera, may be used to capture a target image of the target measurement area at the construction site.
[0054] S102: Using an image processing method, determine a set of steel bar line segments in the target image.
[0055] In a possible implementation, step S102 may include:
[0056] S1021: Input the target image into a construction stage classification model to determine the construction stage indicated by the target image.
[0057] Here, the construction stage classification model can be a pre-trained classification model based on a deep learning neural network. By inputting the target image into the construction stage classification model, the construction stage with the highest confidence corresponding to the target image output by the construction stage classification model can be obtained. The construction stages include the rebar binding stage, the concrete pouring stage, the concrete curing stage, and the formwork installation stage.
[0058] S1022: When the construction stage is the steel bar binding stage, the target image is input into a steel bar contour extraction model to determine a steel bar contour map in the target image.
[0059] During the rebar binding stage, target measurement areas on the construction site, such as cast floor slabs, will be distributed with crisscrossing grid-like rebars to provide the necessary support for the floor slabs. Therefore, the size of the rebars will directly affect the building's construction quality.
[0060] Here, the steel bar contour extraction model can be a pre-trained instance segmentation model or semantic segmentation model based on a deep learning neural network, such as U2net; by inputting the target image into the steel bar contour extraction model, the steel bar contour extraction model can output a steel bar contour map including a set of contours of all steel bars in the target image.
[0061] The rebar contour image is represented as a mask image, where locations with pixel values of a first value correspond to rebar areas, and locations with pixel values of a second value correspond to spaces between rebars. For example, black locations in the rebar contour image correspond to rebar areas, and white locations correspond to spaces between rebars.
[0062] S1023. Filter out line segments whose lengths are greater than a preset number of pixels from the steel bar contour image to form the steel bar line segment set.
[0063] In this step, an image processing algorithm (e.g., Hough transform) can be used to filter out line segments with lengths greater than a preset number of pixels from the steel bar contour image to form a steel bar line segment set. The preset number of pixels can be set as needed, for example, 20 pixels.
[0064] S103. Based on the relative position information between each steel bar line segment in the steel bar line segment set, select every two steel bar line segments that are closest to each other and approximately parallel from the steel bar line segment set as two sides of a steel bar, and obtain the contour information of each steel bar in the target image.
[0065] Here, the rebar segment set includes multiple rebar segments. In this step, the corresponding relationship between the rebar segments can be determined based on the relative position information between the rebar segments, namely, which two rebar segments are the closest and approximately parallel segments that can form the two sides of a rebar, thereby obtaining the contour information of each rebar. The contour information includes the coordinates of the four endpoints of the two sides of each rebar in the target image.
[0066] Among them, the closest and approximately parallel line segments can be defined as follows: (1) the angle between line segment A and line segment B is less than the angle threshold. (2) Line segment A and line segment B do not intersect. (3) Line segment C, formed by projecting the two endpoints of line segment A onto the line where line segment B is located, overlaps with line segment B. (4) The maximum distance between the two endpoints of line segment A and the line where line segment B is located is less than the maximum distance between the two endpoints of line segment A and the line where any other line segment is located. (5) The quadrilateral area formed by the four endpoints of line segment A and line segment B is included in the steel bar area.
[0067] In a possible implementation, step S103 may include:
[0068] S1031. For any target steel bar segment in the steel bar segment set, select a plurality of first steel bar segments from the steel bar segment set based on a segment angle between the target steel bar segment and each other steel bar segment in the steel bar segment set and a preset angle threshold.
[0069] In this step, for any target steel bar segment A in the steel bar segment set, steel bar segments whose segment angles with the target steel bar segment A are less than a preset angle threshold can be selected from other steel bar segments included in the steel bar segment set, and these steel bar segments are used as the plurality of first steel bar segments. The preset angle threshold can be set as needed, for example, 5°.
[0070] S1032: Filter out, from the plurality of first steel bar line segments, a first steel bar line segment that does not intersect with the target steel bar line segment within the range of the target image as a second steel bar line segment.
[0071] Here, the two sides of a steel bar should not intersect within the image range, so a first steel bar line segment that does not intersect with the target steel bar line segment within the range of the target image can be further screened out from the multiple first steel bar line segments and used as the second steel bar line segment.
[0072] S1033: Project the target steel bar line segment onto each second steel bar line segment, and select the second steel bar line segment that overlaps with the corresponding second steel bar line segment as the third steel bar line segment.
[0073] Here, during the specific implementation, it was found that the angles between some steel bar line segments were smaller than the preset angle threshold, and they did not intersect within the target image range. However, these steel bar line segments were not two sides of the same steel bar, but belonged to different, approximately parallel steel bars. Such steel bars were staggered in space.
[0074] Therefore, in this step, the target steel bar line segment A can be projected onto each second steel bar line segment, and the resulting projected line segment can be determined to determine whether it overlaps with the corresponding projected second steel bar line segment. The overlapping second steel bar line segment is then used as the third steel bar line segment. This way, steel bar line segments of two steel bars that are approximately parallel but intersecting can be removed.
[0075] S1034. Determine the distance from each endpoint of the target steel bar segment to each third steel bar segment, and determine the comparison order of each third steel bar segment according to the distance from smallest to largest.
[0076] Here, the steel bar segments that constitute the two sides of the same steel bar should be closest in spatial distance. Therefore, the distance from each segment endpoint of the target steel bar segment A to each third steel bar segment can be determined, and the comparison order of each third steel bar segment can be determined in ascending order of the distances. That is, the third steel bar segment with the smallest distance should be most likely to constitute the two sides of the same steel bar with the target steel bar segment A.
[0077] S1035. Starting from the third steel bar segment with the smallest distance, determine in sequence whether a quadrilateral area enclosed by two segment endpoints of the third steel bar segment and two segment endpoints of the target steel bar segment is located in the steel bar area in the steel bar contour diagram.
[0078] Corresponding to the above example, whether the quadrilateral area is located in the steel bar area in the steel bar contour diagram can be understood as whether the quadrilateral area is black in the steel bar contour diagram; if it is black, it means that the quadrilateral area is located in the steel bar area in the steel bar contour diagram.
[0079] During implementation, we discovered that two adjacent rebars might be placed so that the distance between their adjacent edges is less than the diameter of a single rebar, potentially misidentifying them as two edges of a single rebar. Therefore, we can eliminate this problem by determining whether the quadrilateral enclosed by the line segment endpoints lies within the rebar area.
[0080] S1036: If yes, determine the third steel bar line segment and the target steel bar line segment as two steel bar line segments that are closest to each other and approximately parallel, and use them as two sides of a steel bar.
[0081] S1037. If not, determine, in accordance with the comparison order, whether a quadrilateral area enclosed by two segment endpoints of the next third steel bar segment of the third steel bar segment with the smallest distance and each segment endpoint of the target steel bar segment is located in the steel bar area in the steel bar contour diagram, until a steel bar segment that is closest to and approximately parallel to the target steel bar segment is determined.
[0082] In this way, the two edges belonging to the same steel bar in the steel bar segment set can be automatically matched according to the relative position information between the steel bar segments, thereby preparing for the subsequent calculation of the size information of each steel bar.
[0083] S104: Determine the size information of the steel bars in the target measurement area based on the profile information of each steel bar.
[0084] The contour information includes the coordinates of the four endpoints included in the two sides of each steel bar in the target image.
[0085] In a possible implementation, step S104 may include:
[0086] S1041. For each steel bar, determine the length of the steel bar and the number of steel bars intersecting with the steel bar within the target image based on the contour information of the steel bar.
[0087] In specific implementation, after determining the coordinates of the four endpoints of each steel bar in the target image, the coordinate system conversion can be performed based on the method in the prior art, that is, the pixel coordinates in the camera imaging coordinate system are converted to the three-dimensional space coordinates under the device coordinate system (world coordinate system), so as to calculate the length of each steel bar.
[0088] Furthermore, after determining the coordinates of each rebar's four endpoints in the target image, the number of other rebars intersecting any rebar within the target image can be determined using conventional methods. For example, a straight line equation can be obtained by fitting the rebar endpoints, and the number of rebars intersecting each rebar within the target image can be determined using simultaneous straight line equations.
[0089] S1042: Determine an average spacing between steel bars within the target image based on the length of the steel bar and the number of steel bars.
[0090] In this step, the length of the steel bar may be divided by the number of steel bars to obtain the average steel bar spacing within the target image range.
[0091] In another possible implementation, step S104 may further include:
[0092] S1043. Based on the contour information of each steel bar, determine the plane equation of the target plane of the steel bar in the target image and the line equations of the lines on which the two sides of the steel bar lie.
[0093] S1044. Determine the diameter of the steel bar based on the plane equation and the straight line equation.
[0094] In this step, the steel bar size information can be determined based on the steel bar contour information using methods in the prior art; for example, the three side lengths of the circumscribed triangle of the cross section of the steel bar can be calculated based on the straight line equation of the straight line on which the two sides of the steel bar are located; the diameter of the inscribed circle of the cross section of the steel bar is calculated based on the three side lengths, and the diameter of the inscribed circle is the diameter of the steel bar.
[0095] Furthermore, after determining the steel bar size information in the target measurement area based on the contour information of each steel bar in S104, the measurement method also includes: saving the steel bar size information to a database; in response to a user's selection operation on the target image, determining a target steel bar whose pixel distance from the pixel point selected by the user is less than a preset distance; querying the steel bar size information of the target steel bar from the database, and displaying the steel bar size information of the target steel bar.
[0096] In this way, by clicking on the steel bar position in the image, the user can use significant visual markers to automatically draw steel bar segments on the image and display the steel bar size information of the steel bar, so that the user can more intuitively understand the steel bar size information of the target measurement area.
[0097] Furthermore, in S103, based on the relative position information between each steel bar line segment in the steel bar line segment set, every two approximately parallel steel bar line segments are screened out from the steel bar line segment set as the two sides of a steel bar, and the contour information of each steel bar in the target image is obtained. The measurement method also includes: converting the coordinates of the four endpoints included in the two sides of each steel bar in the target image into three-dimensional space coordinates in the device coordinate system; drawing a steel bar model according to the three-dimensional space coordinates of each endpoint in the device coordinate system, and obtaining the building model of the target measurement area.
[0098] In a specific implementation, the camera's gimbal angle when capturing the target image can be obtained, and based on the gimbal angle, a rotation and translation matrix is determined to convert the camera's imaging coordinate system to the device coordinate system. The device coordinate system is a right-handed three-dimensional coordinate system with the gimbal's horizontal rotation axis pointing upward as the positive Z-axis, the gimbal's horizontal and vertical angles at 0 degrees, and the laser rangefinder's laser emission direction as the positive Y-axis. Subsequently, the coordinates of the four endpoints in the target image are converted to three-dimensional spatial coordinates in the device coordinate system based on the rotation and translation matrix. A rebar model is drawn based on the three-dimensional spatial coordinates, thereby obtaining a building model of the entire target measurement area, such as a BIM model.
[0099] Furthermore, after calculating the three-dimensional spatial coordinates of the four endpoints of the steel bar in the device coordinate system, the mapping relationship between the device coordinate system and other coordinate systems can be used to transform the device coordinate system coordinates of the four endpoints of the steel bar into other coordinate systems for subsequent calculations.
[0100] A method for measuring steel bar size provided in an embodiment of the present application includes: acquiring a target image of a target measurement area at a construction site; using an image processing method to determine a set of steel bar line segments in the target image; based on relative position information between each steel bar line segment in the steel bar line segment set, screening out from the steel bar line segment set every two steel bar line segments that are closest in distance and approximately parallel as two sides of a steel bar, thereby obtaining contour information of each steel bar in the target image; and determining the steel bar size information in the target measurement area based on the contour information of each steel bar.
[0101] In this way, the two sides of each steel bar can be automatically identified from the construction site image, thereby obtaining the contour information of each steel bar to determine the steel bar size; in this way, the steel bar size can be measured automatically, reducing manual intervention and improving measurement accuracy and efficiency.
[0102] See also Figure 2 、 Figure 3 , Figure 2 This is one of the structural schematic diagrams of a steel bar size measuring device provided in an embodiment of the present application. Figure 3 This is a second structural diagram of a device for measuring the size of steel bars provided in an embodiment of the present application. Figure 2 As shown in FIG, the measuring device 200 includes:
[0103] An acquisition module 210 is used to acquire a target image of a target measurement area in a construction site;
[0104] A first determining module 220 is configured to determine a set of steel bar line segments in the target image using an image processing method;
[0105] A screening module 230 is configured to screen out two approximately parallel steel bar segments from the steel bar segment set as two sides of a steel bar based on relative position information between each steel bar segment in the steel bar segment set, thereby obtaining contour information of each steel bar in the target image;
[0106] The second determining module 240 is configured to determine the size information of the steel bars in the target measurement area based on the profile information of each steel bar.
[0107] Furthermore, when the first determining module 220 is used to determine the set of steel bar line segments in the target image using an image processing method, the first determining module 220 is used to:
[0108] Inputting the target image into a construction stage classification model to determine the construction stage indicated by the target image; wherein the construction stage includes a steel bar binding stage, a concrete pouring stage, a concrete curing stage, and a formwork laying stage;
[0109] When the construction stage is the steel bar binding stage, the target image is input into a steel bar contour extraction model to determine a steel bar contour map in the target image; wherein the steel bar contour map is represented as a mask image, and positions in the steel bar contour map with pixel values of a first value correspond to steel bar areas, and positions with pixel values of a second value correspond to gaps between steel bars;
[0110] Line segments whose length is greater than a preset number of pixels are screened out from the steel bar contour image to form the steel bar line segment set.
[0111] Furthermore, when the screening module 230 is used to screen out two approximately parallel steel bar segments from the steel bar segment set as two sides of a steel bar based on the relative position information between each steel bar segment in the steel bar segment set to obtain the contour information of each steel bar in the target image, the screening module 230 is used to:
[0112] For any target steel bar segment in the steel bar segment set, a plurality of first steel bar segments are screened from the steel bar segment set according to a segment angle between the target steel bar segment and each other steel bar segment in the steel bar segment set and a preset angle threshold;
[0113] Selecting, from the plurality of first steel bar line segments, a first steel bar line segment that does not intersect with the target steel bar line segment within the range of the target image as a second steel bar line segment;
[0114] Projecting the target steel bar line segment onto each second steel bar line segment, and selecting the second steel bar line segment that overlaps with the corresponding second steel bar line segment as the third steel bar line segment;
[0115] Determine the distance between each endpoint of the target steel bar segment and each third steel bar segment, and determine the comparison order of each third steel bar segment according to the distance from smallest to largest;
[0116] Starting from the third steel bar line segment with the smallest distance, determining in sequence whether a quadrilateral area enclosed by two line segment endpoints of the third steel bar line segment and two line segment endpoints of the target steel bar line segment is located in the steel bar area in the steel bar contour diagram;
[0117] If so, the third steel bar segment and the target steel bar segment are determined as the two closest and approximately parallel steel bar segments, and are used as two sides of a steel bar;
[0118] If not, then determine, in accordance with the comparison order, whether the quadrilateral area enclosed by the two segment endpoints of the next third steel bar segment of the third steel bar segment with the smallest distance and each segment endpoint of the target steel bar segment is located in the steel bar area in the steel bar contour diagram, until a steel bar segment that is closest to and approximately parallel to the target steel bar segment is determined.
[0119] Furthermore, the contour information includes coordinates of four endpoints included in two sides of each steel bar in the target image; when the second determination module 240 is used to determine the steel bar size information in the target measurement area based on the contour information of each steel bar, the second determination module 240 is further used to:
[0120] For each steel bar, determining the length of the steel bar and the number of steel bars intersecting with the steel bar within the target image based on the contour information of the steel bar;
[0121] Based on the length of the steel bar and the number of the steel bars, an average steel bar spacing within the target image range is determined.
[0122] Furthermore, when the second determining module 240 is used to determine the steel bar size information in the target measurement area based on the profile information of each steel bar, the second determining module 240 is further used to:
[0123] Based on the contour information of each steel bar, determining the plane equation of the target plane of the steel bar in the target image and the line equations of the lines on which the two sides of the steel bar lie;
[0124] Based on the plane equation and the straight line equation, the steel bar diameter of the steel bar is determined.
[0125] Further, such as Figure 4 As shown, the measuring device 200 further includes a display module 250; the display module 250 is used to:
[0126] Saving the steel bar size information to a database;
[0127] In response to a user's selection operation on the target image, determining a target steel bar whose pixel distance from the pixel point selected by the user is less than a preset distance;
[0128] The steel bar size information of the target steel bar is queried from the database, and the steel bar size information of the target steel bar is displayed.
[0129] Further, such as Figure 4 As shown, the measuring device 200 further includes a building module 260; the building module 260 is used to:
[0130] Convert the coordinates of the four endpoints included in the two sides of each steel bar in the target image to three-dimensional space coordinates in the device coordinate system;
[0131] A steel bar model is drawn according to the three-dimensional spatial coordinates of each end point in the device coordinate system to obtain a building model of the target measurement area.
[0132] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown in FIG, the electronic device 400 includes a processor 410, a memory 420 and a bus 430.
[0133] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, the above-mentioned Figure 1 The steps of a method for measuring steel bar size in the method embodiment shown are specifically implemented in accordance with the method embodiment and will not be described in detail here.
[0134] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The steps of a method for measuring steel bar size in the method embodiment shown are specifically implemented in accordance with the method embodiment and will not be described in detail here.
[0135] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0136] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. There may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interface, indirect coupling or communication connection of devices or units, which may be electrical, mechanical or other forms.
[0137] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0138] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0139] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0140] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The scope of protection of the present application is not limited thereto. Although the present application has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-mentioned embodiments within the technical scope disclosed in the present application, or perform equivalent replacements for some of the technical features thereof. These modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for measuring steel bar size, characterized in that: The measuring method comprises: Acquire a target image of a target measurement area in a construction site; Using an image processing method, determining a set of steel bar line segments in the target image; Based on the relative position information between each steel bar line segment in the steel bar line segment set, every two steel bar line segments that are closest and approximately parallel are selected from the steel bar line segment set as two sides of a steel bar, thereby obtaining the contour information of each steel bar in the target image; Determining the steel bar size information in the target measurement area based on the profile information of each steel bar; The method of selecting, based on the relative position information between each steel bar line segment in the steel bar line segment set, each two steel bar line segments that are closest and approximately parallel to each other are used as two sides of a steel bar to obtain the contour information of each steel bar in the target image, includes: For any target steel bar segment in the steel bar segment set, a plurality of first steel bar segments are screened from the steel bar segment set according to a segment angle between the target steel bar segment and each other steel bar segment in the steel bar segment set and a preset angle threshold; Selecting, from the plurality of first steel bar line segments, a first steel bar line segment that does not intersect with the target steel bar line segment within the range of the target image as a second steel bar line segment; Projecting the target steel bar line segment onto each second steel bar line segment, and selecting the second steel bar line segment that overlaps with the corresponding second steel bar line segment as the third steel bar line segment; Determine the distance between each endpoint of the target steel bar segment and each third steel bar segment, and determine the comparison order of each third steel bar segment according to the distance from smallest to largest; Starting from the third steel bar line segment with the smallest distance, determining in sequence whether a quadrilateral area enclosed by two line segment endpoints of the third steel bar line segment and two line segment endpoints of the target steel bar line segment is located in the steel bar area in the steel bar contour image in the target image; If so, the third steel bar segment and the target steel bar segment are determined as the two closest and approximately parallel steel bar segments, and are used as two sides of a steel bar; If not, then determine, in accordance with the comparison order, whether the quadrilateral area enclosed by the two segment endpoints of the next third steel bar segment of the third steel bar segment with the smallest distance and each segment endpoint of the target steel bar segment is located in the steel bar area in the steel bar contour diagram, until a steel bar segment that is closest to and approximately parallel to the target steel bar segment is determined.
2. The measuring method according to claim 1, wherein The method of using an image processing method to determine a set of steel bar line segments in the target image includes: Inputting the target image into a construction stage classification model to determine the construction stage indicated by the target image; wherein the construction stage includes a steel bar binding stage, a concrete pouring stage, a concrete curing stage, and a formwork laying stage; When the construction stage is the steel bar binding stage, the target image is input into a steel bar contour extraction model to determine a steel bar contour map in the target image; wherein the steel bar contour map is represented as a mask image, and positions in the steel bar contour map with pixel values of a first value correspond to steel bar areas, and positions with pixel values of a second value correspond to gaps between steel bars; Line segments whose length is greater than a preset number of pixels are screened out from the steel bar contour image to form the steel bar line segment set.
3. The measuring method according to claim 1, wherein The contour information includes coordinates of four endpoints included in two sides of each steel bar in the target image; and determining the steel bar size information in the target measurement area based on the contour information of each steel bar includes: For each steel bar, determining the length of the steel bar and the number of steel bars intersecting with the steel bar within the target image based on the contour information of the steel bar; Based on the length of the steel bar and the number of the steel bars, an average steel bar spacing within the target image range is determined.
4. The measuring method according to claim 1, wherein The method of determining the steel bar size information in the target measurement area based on the profile information of each steel bar further includes: Based on the contour information of each steel bar, determining the plane equation of the target plane of the steel bar in the target image and the line equations of the lines on which the two sides of the steel bar lie; Based on the plane equation and the straight line equation, the steel bar diameter of the steel bar is determined.
5. The measuring method according to claim 1, wherein: After determining the steel bar size information in the target measurement area based on the profile information of each steel bar, the measurement method further includes: Saving the steel bar size information to a database; In response to a user's selection operation on the target image, determining a target steel bar whose pixel distance from the pixel point selected by the user is less than a preset distance; The steel bar size information of the target steel bar is queried from the database, and the steel bar size information of the target steel bar is displayed.
6. The measuring method according to claim 3, characterized in that After obtaining the contour information of each steel bar in the target image, the measurement method further includes: Convert the coordinates of the four endpoints included in the two sides of each steel bar in the target image to three-dimensional space coordinates in the device coordinate system; A steel bar model is drawn according to the three-dimensional spatial coordinates of each end point in the device coordinate system to obtain a building model of the target measurement area.
7. A device for measuring steel bar size, characterized in that: The measuring device comprises: An acquisition module, used to acquire a target image of a target measurement area in a construction site; A first determining module is used to determine a set of steel bar line segments in the target image using an image processing method; a screening module for screening out, based on relative position information between each steel bar line segment in the steel bar line segment set, each two steel bar line segments that are approximately parallel from the steel bar line segment set as two sides of a steel bar, thereby obtaining contour information of each steel bar in the target image; A second determining module is used to determine the steel bar size information in the target measurement area based on the profile information of each steel bar; When the screening module is used to screen out two approximately parallel steel bar segments from the steel bar segment set as two sides of a steel bar based on the relative position information between each steel bar segment in the steel bar segment set to obtain the contour information of each steel bar in the target image, the screening module is used to: For any target steel bar segment in the steel bar segment set, a plurality of first steel bar segments are screened from the steel bar segment set according to a segment angle between the target steel bar segment and each other steel bar segment in the steel bar segment set and a preset angle threshold; Selecting, from the plurality of first steel bar line segments, a first steel bar line segment that does not intersect with the target steel bar line segment within the range of the target image as a second steel bar line segment; Projecting the target steel bar line segment onto each second steel bar line segment, and selecting the second steel bar line segment that overlaps with the corresponding second steel bar line segment as the third steel bar line segment; Determine the distance between each endpoint of the target steel bar segment and each third steel bar segment, and determine the comparison order of each third steel bar segment according to the distance from smallest to largest; Starting from the third steel bar line segment with the smallest distance, determining in sequence whether a quadrilateral area enclosed by two line segment endpoints of the third steel bar line segment and two line segment endpoints of the target steel bar line segment is located in the steel bar area in the steel bar contour image in the target image; If so, the third steel bar segment and the target steel bar segment are determined as the two closest and approximately parallel steel bar segments, and are used as two sides of a steel bar; If not, then determine, in accordance with the comparison order, whether the quadrilateral area enclosed by the two segment endpoints of the next third steel bar segment of the third steel bar segment with the smallest distance and each segment endpoint of the target steel bar segment is located in the steel bar area in the steel bar contour diagram, until a steel bar segment that is closest to and approximately parallel to the target steel bar segment is determined.
8. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate via the bus. When the machine-readable instructions are run by the processor, the steps of the method for measuring the size of a steel bar as described in any one of claims 1 to 6 are executed.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for measuring the size of a steel bar as claimed in any one of claims 1 to 6 are executed.
Citation Information
Patent Citations
Cylinder frame buffer texture re-labeling geometric correction method based on software
CN101221658A
Physical-object measurement device and physical-object measurement method
CN108351201A