Engineering amount determination method and device and computer program product

By identifying the building images and calculating the attributes of reference components, the problems of low measurement and calculation efficiency and large errors in exterior wall decoration renovation are solved, and efficient and accurate engineering volume calculation is achieved.

CN119810639APending Publication Date: 2025-04-11GLODON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411812212.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

During the decoration and renovation of exterior walls, it is difficult for the prior art to quickly and accurately measure and calculate the area, window size and number of buildings, resulting in large measurement errors and high time costs.

Method used

By obtaining building images, identifying components, selecting reference components and generating their engineering quantity attributes, calculating the engineering quantity attributes of other components based on the properties of reference components, and performing data processing to calculate the engineering quantity of each building component.

Benefits of technology

It improves the automation and accuracy of engineering quantity calculation, reduces human error, saves time and labor costs, and improves work efficiency and accuracy of engineering quantity calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810639A_ABST
    Figure CN119810639A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses an engineering quantity determination method and device and a computer program product. The method comprises the following steps: acquiring a building image to be processed; component identification is carried out on the building image, and all building components in the building image are determined; selecting a reference component from the building components, and generating a first engineering quantity attribute of the reference component; determining second engineering quantity attributes of other building components based on the first engineering quantity attribute of the reference component; and performing data processing according to the first engineering quantity attribute and the second engineering quantity attribute to obtain the engineering quantity of each building component. By implementing the technical scheme of the invention, the project amount of the building component can be automatically identified and calculated based on the building image, and the efficiency and accuracy of project amount calculation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method and device for determining engineering quantities, and a computer program product. Background Art

[0002] At present, manual and software calculations are the common working methods of engineering cost personnel. In the early exploration process of exterior wall decoration for renovation, it is often impossible to quickly measure the area, window size and number of exterior walls through tools such as CAD. The commonly used technical solution is to use a tape measure or laser rangefinder for actual measurement, and then calculate manually, or draw CAD drawings and then calculate through modeling software. This method is prone to measurement errors, inaccurate calculations, and high time and labor costs. Summary of the invention

[0003] In view of this, the present invention provides a method, device and computer program product for determining engineering quantities to solve the problems of low measurement and calculation efficiency, large errors and high labor costs during exterior wall decoration and renovation.

[0004] In a first aspect, the present invention provides a method for determining engineering quantities, comprising: acquiring a building image to be processed; performing component recognition on the building image to determine all building components in the building image; selecting a reference component from the building components to generate a first engineering quantity attribute of the reference component; determining a second engineering quantity attribute of the remaining building components based on the first engineering quantity attribute of the reference component; performing data processing according to the first engineering quantity attribute and the second engineering quantity attribute to obtain the engineering quantity of each building component.

[0005] The method for determining the engineering quantity provided by the embodiment of the present invention can effectively improve the automation and accuracy of engineering quantity calculation by identifying components in the building image and selecting the reference components. The engineering quantity attributes of the remaining components are inferred by the attributes of the reference components, which simplifies the traditional manual measurement and calculation process, reduces human errors, and improves work efficiency. In addition, the data processing method can quickly obtain the engineering quantity of each building component, saving time and labor costs, and improving the accuracy and reliability of engineering quantity calculation.

[0006] In an optional embodiment, before performing component recognition on a building image and determining all building components in the building image, the method further includes: performing image enhancement on the building image to obtain an enhanced image; identifying a first straight line in the enhanced image, and obtaining multiple corner points corresponding to the enhanced image based on the first straight line; and correcting the building image based on the multiple corner points to obtain a corrected building image.

[0007] The method for determining the quantity of work provided by the embodiment of the present invention significantly improves the image quality and accuracy by performing image enhancement and correction on the building image before component recognition. Image enhancement can highlight the key features in the image, thereby more effectively performing component recognition. By identifying and correcting the corner points in the image, the error caused by image distortion or shooting angle problems is reduced, thereby ensuring the accuracy of subsequent component recognition and quantity calculation.

[0008] In an optional embodiment, multiple corner points corresponding to the enhanced image are obtained based on the first straight line, including: dividing the enhanced image into regions according to the position information of the first straight line to obtain multiple image regions; determining the slope corresponding to the second straight line in each image region based on the position information of the second straight line in each image region; determining the target direction of the second straight line in each image region based on the average value of the slopes; and extending the second straight line according to the target direction to obtain multiple corner points.

[0009] The method for determining the engineering quantity provided by the embodiment of the present invention can more accurately identify key features in the image by dividing the enhanced image into regions based on the information of the first straight line and further using the position information of the second straight line in each image region to determine the slope and the target direction. The accuracy of corner point recognition can be improved by calculating the average value of the slope and extending the second straight line in the target direction.

[0010] In an optional implementation, correcting the building image based on multiple corner points to obtain a corrected building image includes: determining perspective transformation parameters based on the multiple corner points; and correcting the building image according to the perspective transformation parameters to obtain a corrected building image.

[0011] The method for determining the quantity of work provided by the embodiment of the present invention can accurately perform geometric correction on the building image by determining the perspective transformation parameters based on multiple corner points, thereby eliminating the deviation in the image caused by the shooting angle or perspective distortion. The accurate calculation of the perspective transformation parameters ensures the true proportion and geometric shape of the building image, and improves the accuracy and usability of the image. The corrected building image provides a clearer and more standardized image basis for subsequent component identification, engineering quantity calculation, etc., thereby improving the accuracy and efficiency of the entire engineering quantity determination process.

[0012] In an optional implementation, component recognition is performed on a building image to determine all building components in the building image, including: inputting the building image into a pre-trained target detection model, and obtaining each bounding box information in the building image through the target detection model; if there are redundant bounding boxes in the bounding box information, the redundant bounding boxes are deleted to obtain each target box; and all building components in the building image are determined based on each target box.

[0013] The method for determining the quantity of work provided by the embodiment of the present invention can automatically identify the building components in the image and quickly extract the bounding box information by inputting the building image into the pre-trained target detection model. By deleting the redundant bounding boxes, the recognition results are further optimized to ensure that the bounding box of each component is accurate and non-repetitive, thereby improving the accuracy and efficiency of recognition. Therefore, the method utilizes the pre-trained target detection model, avoids manual intervention, reduces human errors, and can significantly improve the processing speed in large-scale building image processing tasks.

[0014] In an optional implementation, it is determined whether a component image in the building image is blocked; if it is determined that the component image is blocked, the component image is repaired based on a preset repair rule.

[0015] The method for determining the engineering quantity provided by the embodiment of the present invention can intelligently identify and process the occlusion problem in the image by judging whether the component image in the building image is occluded, thereby ensuring the integrity and accuracy of each building component analysis. When it is determined that the component image is occluded, the preset patching rules are used to patch it, effectively fill the occluded part, and restore the complete appearance of the component, which not only improves the accuracy of image analysis, but also avoids component recognition errors caused by occlusion, and enhances the robustness of the system.

[0016] In an optional embodiment, a reference component is selected from building components to generate a first engineering quantity attribute of the reference component, including: determining a reference component corresponding to the building component in response to a reference selection operation generated for the building component; and determining a first engineering quantity attribute corresponding to the reference component in response to an attribute editing operation for the reference component.

[0017] The method for determining the quantity of work provided by the embodiment of the present invention can effectively standardize the quantity calculation process of building components by selecting a reference component and generating its first quantity attribute. The selection of the reference component provides a reliable reference point for the entire building analysis, so that subsequent component analysis and quantity calculation can be performed based on a unified standard, avoiding errors caused by component diversity or different calculation methods. By responding to the attribute editing operation of the reference component, the system can dynamically adjust and update the quantity attributes of the reference component to ensure the real-time and accuracy of the calculation results.

[0018] In an optional embodiment, second quantity attributes of remaining building components are determined based on first quantity attributes of the reference component, including: obtaining pixel attributes of the reference component in the building image; determining parameter conversion coefficients based on the pixel attributes and the first quantity attributes; and determining second quantity attributes of remaining building components according to the parameter conversion coefficients.

[0019] The method for determining the engineering quantity provided by the embodiment of the present invention intelligently calculates the second engineering quantity attribute of the remaining building components through the first engineering quantity attribute of the reference component combined with its pixel attribute in the building image, thereby ensuring the consistency and accuracy of the engineering quantity calculation. By obtaining the pixel attribute of the reference component and determining the parameter conversion coefficient based on the relationship between the attribute and the first engineering quantity attribute, the system can automatically generalize the measurement results of the reference component to other components, thereby avoiding the duplication of work and errors that may be caused by calculating each component separately, and greatly improving the efficiency and accuracy of the engineering quantity calculation.

[0020] In an optional implementation, the engineering quantity index of the building components is obtained; and a bill of quantities corresponding to the building image is generated according to the engineering quantity index and the engineering quantity corresponding to each building component.

[0021] The method for determining the quantity of work provided by the embodiment of the present invention can greatly improve the automation and accuracy of the quantity calculation by obtaining the quantity index of the building components and automatically generating the quantity list corresponding to the building image in combination with the actual quantity of each building component. By using the direct relationship between the quantity index and the quantity of the component, the system can efficiently generate a detailed list, avoiding manual calculation and input errors, and improving work efficiency and accuracy.

[0022] In a second aspect, the present invention provides a device for determining engineering quantity, comprising: a first acquisition module, used to acquire a building image to be processed; a first recognition module, used to perform component recognition on the building image, and determine all building components in the building image; a selection module, used to select a reference component from the building components, and generate a first engineering quantity attribute of the reference component; a determination module, used to determine a second engineering quantity attribute of the remaining building components based on the first engineering quantity attribute of the reference component; and a processing module, used to perform data processing according to the first engineering quantity attribute and the second engineering quantity attribute to obtain the engineering quantity of each building component.

[0023] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the engineering quantity determination method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0024] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for determining engineering quantities of the first aspect or any corresponding embodiment thereof.

[0025] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method for determining engineering quantities according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0027] Figure 1 is a flow chart of a method for determining engineering quantities according to an embodiment of the present invention;

[0028] Figure 2 is a flow chart of another method for determining engineering quantity according to an embodiment of the present invention;

[0029] Figure 3 is a flow chart of another method for determining engineering quantity according to an embodiment of the present invention;

[0030] Figure 4 is a schematic diagram of a target frame according to an embodiment of the present invention;

[0031] Figure 5 is a schematic diagram of constructing a patch according to an embodiment of the present invention;

[0032] Figure 6 is a flow chart of another method for determining engineering quantity according to an embodiment of the present invention;

[0033] Figure 7 is a schematic diagram of the engineering quantities of various building components according to an embodiment of the present invention;

[0034] Figure 8 is a schematic diagram of a bill of quantities according to an embodiment of the present invention;

[0035] Fig. 9 is a structural block diagram of a device for determining engineering quantity according to an embodiment of the present invention;

[0036] Fig.10 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0038] At present, manual and software calculations are the common working methods used by construction cost personnel in construction projects, especially in the preliminary exploration stage of projects such as exterior wall decoration and renovation. Traditional measurements of exterior wall area, window size and quantity usually rely on manual operations, such as using a tape measure or laser rangefinder for actual measurement. Although this method is intuitive, it is easily affected by human factors, resulting in measurement errors and inaccurate results. Especially in large-scale projects, errors are easily accumulated, affecting subsequent engineering quantity calculations and cost estimates.

[0039] In order to improve accuracy and efficiency, some engineers may choose to use drawing tools such as CAD for modeling, and then use professional modeling software for calculation. This method is relatively standardized, but there are still several problems: first, the process of making CAD drawings is complicated and time-consuming, requiring certain professional skills and experience; second, the process of modeling and calculation after the drawings are completed is long, which is prone to information lag or errors; in addition, in the case of complex forms such as building facades, it is difficult to accurately restore the actual form of building components when using traditional software for calculation, resulting in the inability to quickly and effectively obtain accurate engineering quantities.

[0040] In view of this, the technical solution of the present invention obtains a building image and performs component recognition to identify all building components in the image. A reference component is selected and its engineering quantity attributes are generated. Based on the engineering quantity attributes of the reference component, the engineering quantity attributes of other components are calculated. By processing these engineering quantity attributes, the engineering quantity of each building component is calculated, thereby improving the efficiency and accuracy of engineering quantity calculation and reducing manual intervention.

[0041] According to an embodiment of the present invention, an embodiment of a method for determining engineering quantities is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0042] In this embodiment, a method for determining engineering quantities is provided, which can be used for computer equipment, such as desktop computers, laptop computers, etc. Figure 1 is a flow chart of a method for determining engineering quantities according to an embodiment of the present invention. Figure 1As shown, the process includes the following steps:

[0043] Step S101, obtaining a building image to be processed.

[0044] The building image refers to the image of the building's exterior wall. Specifically, the building's exterior wall can be photographed using a camera or a drone to obtain a high-definition image of the building's exterior wall. Alternatively, the image of the building's exterior wall can be directly downloaded from an online platform. Of course, other methods can also be used to obtain the building image to be processed, and the specific method is not limited.

[0045] Step S102: perform component recognition on the building image to determine all building components in the building image.

[0046] Building components refer to the various components or structural units in the exterior walls of buildings, such as walls, windows, doors, etc. Specifically, computer vision technology and image processing algorithms can be used to analyze and classify different elements in building images, thereby identifying the location and type of each building component in the exterior walls of buildings.

[0047] Step S103: Select a reference component from the building components and generate a first engineering quantity attribute of the reference component.

[0048] A reference component is a specific component selected from all building components for reference, and the quantity attributes of other components will be calculated based on it. The first quantity attribute refers to certain key quantity characteristics of the reference component, such as area, length, etc. Specifically, the reference component can be selected based on the importance, representativeness or ease of calculation of the building component, for example, the most common or easiest to quantify component is selected as the reference. By determining the size, shape or other characteristics of the reference component, its first quantity attribute is generated.

[0049] Step S104: determining the second engineering quantity attributes of the remaining building components based on the first engineering quantity attributes of the reference component.

[0050] The second engineering quantity attribute refers to the engineering quantity characteristics of other building components besides the reference component, such as area, length, etc. Specifically, the second engineering quantity attributes of the remaining building components are determined based on the first engineering quantity attribute of the reference component, and are calculated through the geometric relationship, proportion or architectural design rules between the building components. For example, if the first engineering quantity attribute (such as area, length, etc.) of the reference component is known, the engineering quantity attributes of other building components can be calculated using certain algorithms and formulas based on the layout of the building, structural characteristics or similarities between components.

[0051] Step S105, performing data processing according to the first engineering quantity attribute and the second engineering quantity attribute to obtain the engineering quantity of each building component.

[0052] The engineering quantity refers to the engineering properties of each building component, such as the number, size, area, etc. Specifically, the engineering quantity of each building component is finally calculated by combining and calculating the first engineering quantity attribute (the attribute of the reference component) and the second engineering quantity attribute (the attribute of other building components).

[0053] The method for determining the engineering quantity provided by the embodiment of the present invention can effectively improve the automation and accuracy of engineering quantity calculation by identifying components in the building image and selecting the reference components. The engineering quantity attributes of the remaining components are inferred by the attributes of the reference components, which simplifies the traditional manual measurement and calculation process, reduces human errors, and improves work efficiency. In addition, the data processing method can quickly obtain the engineering quantity of each building component, saving time and labor costs, and improving the accuracy and reliability of engineering quantity calculation.

[0054] In this embodiment, a method for determining engineering quantities is provided, which can be used for computer equipment, such as desktop computers, laptop computers, etc. Figure 2 is a flow chart of a method for determining engineering quantities according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0055] Step S201, obtain the building image to be processed. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0056] Step S202: performing image enhancement on the building image to obtain an enhanced image.

[0057] Enhanced images refer to images obtained by optimizing the original building images through image processing technology. The purpose of image enhancement is to improve the clarity of key details in the building image, so that subsequent image recognition, component analysis and engineering quantity calculation are more accurate. Specifically, the contrast-limited adaptive histogram equalization algorithm (CLAHE) can be used to pre-process the building image to enhance the local contrast of the image. In addition, the combination of the adaptive thresholding algorithm and the morphological opening operation can further enhance the edges of the image and refine the image contour.

[0058] Step S203: identifying a first straight line in the enhanced image, and obtaining a plurality of corner points corresponding to the enhanced image based on the first straight line.

[0059] The first straight line refers to a straight line feature that can be clearly identified after image processing in the enhanced building image, such as the edge of a building component or other significant structural lines. Specifically, these straight lines can be identified through edge detection or straight line detection algorithms (such as Hough transform algorithm).

[0060] The multiple corner points refer to multiple perspective correction points of the building image, and can also be understood as the intersection points of the upper, lower, left, and right boundary lines of the building image. Specifically, the multiple perspective correction points of the building image are inferred based on the position and direction of the first straight line using geometric relationships.

[0061] In some optional implementations, the above step S203 includes:

[0062] Step a1, identifying the first straight line in the enhanced image. Please refer to the above explanation for details, which will not be repeated here.

[0063] Step a2, dividing the enhanced image into regions according to the position information of the first straight line to obtain a plurality of image regions.

[0064] The first straight line is a horizontal or vertical boundary line of a building component, and the image can be divided into regions according to the position and direction of the first straight line. Specifically, the image can be divided into four regions of top, bottom, left, and right according to the position and direction of the first straight line.

[0065] Step a3: determining the slope corresponding to the second straight line in each image area based on the position information of the second straight line in each image area.

[0066] The second straight line refers to a straight line identified in each image region. Specifically, the coordinates of the starting point and the ending point of the second straight line in each region are extracted, and then the slope of the second straight line is calculated using the coordinates of these points.

[0067] Step a4, determining the target direction of the second straight line in each image area based on the average value of the slope.

[0068] The target direction refers to a unified directional information determined based on the slope of the second straight line in the image area. Specifically, the average value of the slope represents the overall inclination trend of these second straight lines. Therefore, by calculating the slope of the second straight line in each image area and taking the average value of these slopes, an overall direction trend, i.e., the target direction, can be obtained. For example, the second straight line in the left area is mainly vertical, while the second straight line in the upper area is mainly horizontal.

[0069] Step a5, extending the second straight line according to the target direction to obtain multiple corner points.

[0070] The second straight line in each image area is extended according to the target direction. Specifically, the two ends of the second straight line are extended in the target direction until the straight line intersects with the image boundary or reaches the set maximum extension distance. In this way, the extended straight line forms multiple intersections in the image, and these intersections are new corner points. These corner points will be used in the subsequent building image correction step to achieve accurate correction of the image.

[0071] In the above implementation, by dividing the enhanced image into regions based on the information of the first straight line, and further using the position information of the second straight line in each image region to determine the slope and the target direction, the key features in the image can be more accurately identified. By calculating the average value of the slope and extending the second straight line in the target direction, the accuracy of corner point identification can be improved.

[0072] Step S204, correcting the building image based on multiple corner points to obtain a corrected building image.

[0073] After inferring the multiple corner points corresponding to the building image, the transformation matrix is ​​calculated by matching the relationship between these corner points and the real geometric structure. The transformation matrix is ​​used to perform geometric correction on the building image and adjust the perspective distortion of the image so that the proportion and perspective of the building image are more in line with the actual situation.

[0074] In some optional implementations, the above step S204 includes:

[0075] Step b1, determining perspective transformation parameters based on multiple corner points.

[0076] The perspective transformation parameter refers to a perspective transformation matrix used to restore the perspective distortion of the building image to a normal viewing angle. Specifically, the cv2.getPerspectiveTransform method in the computer vision library OpenCV can be used to calculate the perspective transformation matrix based on a plurality of known corner points.

[0077] Step b2, correcting the building image according to the perspective transformation parameters to obtain a corrected building image.

[0078] Using the calculated perspective transformation matrix, the perspective transformation is applied to the original building image through the OpenCV cv2.warpPerspective method. Specifically, the cv2.warpPerspective method remaps each pixel in the image according to the transformation rule based on the perspective transformation matrix to generate a new image without perspective distortion.

[0079] In the above implementation, by determining the perspective transformation parameters based on multiple corner points, the building image can be accurately geometrically corrected to eliminate the deviation in the image caused by the shooting angle or perspective distortion. The accurate calculation of the perspective transformation parameters ensures the true proportion and geometric shape of the building image, and improves the accuracy and usability of the image. The corrected building image provides a clearer and more standardized image basis for subsequent component identification, engineering quantity calculation, etc., thereby improving the accuracy and efficiency of the entire engineering quantity determination process.

[0080] Step S205: perform component recognition on the building image to determine all building components in the building image. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0081] Step S206, select a reference component from the building components and generate a first engineering quantity attribute of the reference component. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0082] Step S207: Determine the second engineering quantity attributes of the remaining building components based on the first engineering quantity attribute of the reference component. Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.

[0083] Step S208: Process data according to the first engineering quantity attribute and the second engineering quantity attribute to obtain the engineering quantity of each building component. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.

[0084] The method for determining the quantity of work provided by the embodiment of the present invention significantly improves the image quality and accuracy by performing image enhancement and correction on the building image before component recognition. Image enhancement can highlight the key features in the image, thereby more effectively performing component recognition. By identifying and correcting the corner points in the image, the error caused by image distortion or shooting angle problems is reduced, thereby ensuring the accuracy of subsequent component recognition and quantity calculation.

[0085] In this embodiment, a method for determining engineering quantities is provided, which can be used for computer equipment, such as desktop computers, laptop computers, etc. Figure 3 is a flow chart of a method for determining engineering quantities according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0086] Step S301, obtain the building image to be processed. Figure 2 Step S201 of the illustrated embodiment will not be described in detail here.

[0087] Step S302: perform component recognition on the building image to determine all building components in the building image.

[0088] Specifically, the above step S302 includes:

[0089] Step S3021, input the building image into the pre-trained target detection model, and obtain the bounding box information in the building image through the target detection model.

[0090] The pre-trained target detection model refers to a deep learning model that has been trained with a large amount of data and is used to identify building components in building images, such as a YOLOv8 model. The bounding box information refers to the coordinates of the prediction box of each building component output by the target detection model, the prediction category corresponding to each prediction box, and the confidence of the prediction. Specifically, the input building image is resized to meet the input requirements of the target detection model, such as adjusting the image to a size of 640x640. The resized building image is input into the target detection model for inference, and the model outputs the position of each prediction box (the coordinates of the bounding box), the predicted category (window or wall), and the confidence of the prediction.

[0091] For example, when the target detection model is a YOLOv8 model, the training process of the YOLOv8 model is as follows: configure the training environment, ensure GPU support and install related dependent libraries; then, set hyperparameters such as learning rate, batch size and number of training rounds. Next, use data augmentation techniques (such as rotation, scaling, etc.) to improve the generalization ability of the model, and define loss functions (classification loss, positioning loss and confidence loss) to optimize the target detection accuracy of the model. The optimizer usually uses Adam or SGD to adjust the model weights by minimizing the loss function. During the training process, import the labeled dataset, evaluate the model accuracy through the validation set after each round of training, and use the early stopping strategy to prevent overfitting until the model accuracy reaches the predetermined standard. Finally, the training output is an optimized YOLOv8 model, which is stored as a weight file (.pt format) and can be used for subsequent reasoning.

[0092] Step S3022: If there are redundant bounding boxes in the bounding box information, the redundant bounding boxes are deleted to obtain various target boxes.

[0093] Redundant bounding boxes refer to the situation where multiple bounding boxes may overlap or identify the same object during the object detection process, resulting in duplicate boxes. Target boxes refer to the final bounding boxes after processing and removing redundancy, which accurately represent different target areas (building components) in the image. Specifically, if there are redundant bounding boxes in the bounding box information, algorithms such as non-maximum suppression (NMS) can be used to delete these overlapping parts and retain the most representative boxes (boxes with the highest confidence), ensuring that each target is marked only once, thereby obtaining each target box.

[0094] Step S3023: determine all building components in the building image based on each target frame.

[0095] Each target box represents a possible building component area in the building image. The target detection model will identify the specific building component type in the area based on pre-trained knowledge, such as walls, doors and windows. By classifying and locating each target box, all building components and their locations in the building image can be accurately identified and determined. Figure 4 shown.

[0096] Furthermore, the detected building components (such as windows and walls) can be marked with bounding boxes of different colors and displayed in the building image, or the location information of the detection results can be output. The detection results can be saved as images and JSON format files for subsequent analysis or further processing.

[0097] Step S3024, determining whether the component image in the building image is blocked.

[0098] The determination of whether a component image in a building image is blocked is performed by analyzing the integrity of the building component in the target box. Specifically, if the bounding box of a component overlaps with other components or objects, and the blocked area exceeds a certain proportion or area, the component image is considered to be possibly blocked.

[0099] Step S3025: If it is determined that the component image is blocked, the component image is repaired based on a preset repair rule.

[0100] If it is determined that the component image is blocked, the blocked component will be repaired according to the preset repair rules. Specifically, for common components such as exterior walls, the repair rules can be processed according to the structural characteristics of the building. For example, the bottom of the wall is usually on a horizontal line, so the blocked bottom area can be filled in; inside the contour, except for other categories of areas, the rest need to be filled in, such as Figure 5 Through these rules, occlusions can be effectively removed and the complete building image recognition results can be restored.

[0101] Step S303, select a reference component from the building components and generate the first engineering quantity attribute of the reference component. Figure 2 Step S206 of the illustrated embodiment will not be described in detail here.

[0102] Step S304: Determine the second engineering quantity attributes of the remaining building components based on the first engineering quantity attribute of the reference component. Figure 2 Step S207 of the illustrated embodiment will not be described in detail here.

[0103] Step S305: Process data according to the first engineering quantity attribute and the second engineering quantity attribute to obtain the engineering quantity of each building component. Figure 2Step S208 of the illustrated embodiment will not be described in detail here.

[0104] The method for determining the quantity of work provided by the embodiment of the present invention can automatically identify the building components in the image and quickly extract the bounding box information by inputting the building image into the pre-trained target detection model. By deleting the redundant bounding boxes, the recognition result is further optimized to ensure that the bounding box of each component is accurate and non-repetitive, thereby improving the accuracy and efficiency of recognition. Therefore, the method utilizes the pre-trained target detection model to avoid manual intervention, reduce human errors, and can greatly improve the processing speed in large-scale building image processing tasks. By judging whether the component image in the building image is occluded, the occlusion problem in the image can be intelligently identified and processed to ensure the integrity and accuracy of each building component. When it is determined that the component image is occluded, the preset patching rules are used to patch it, effectively fill the occluded part, and restore the complete appearance of the component, which not only improves the accuracy of image analysis, but also avoids component recognition errors caused by occlusion and enhances the robustness of the system.

[0105] In this embodiment, a method for determining engineering quantities is provided, which can be used for computer equipment, such as desktop computers, laptop computers, etc. Figure 6 is a flow chart of a method for determining engineering quantities according to an embodiment of the present invention. Figure 6 As shown, the process includes the following steps:

[0106] Step S401, obtain the building image to be processed. Figure 3 Step S301 of the illustrated embodiment will not be described in detail here.

[0107] Step S402: perform component recognition on the building image to determine all building components in the building image. Figure 3 Step S302 of the illustrated embodiment will not be described in detail here.

[0108] Step S403: Select a reference component from the building components and generate a first engineering quantity attribute of the reference component.

[0109] Specifically, the above step S403 includes:

[0110] Step S4031, in response to a reference selection operation generated for a building component, determining a reference component corresponding to the building component.

[0111] In response to the reference selection operation generated for the building component, the reference component corresponding to the building component can be determined by user input or an automated algorithm. Specifically, an object of known size in the building image (such as a ruler of known length, one side of a window, or the width of a door, etc.) can be manually selected by the user or automatically selected according to a preset rule as the reference component. The reference component should be on the same plane as the target object and avoid errors caused by perspective distortion as much as possible.

[0112] Step S4032: In response to the property editing operation on the reference component, determine the first engineering quantity property corresponding to the reference component.

[0113] The first engineering quantity attribute corresponding to the reference component may be the actual length of the reference component, such as the actual length of a door is 1 meter. Specifically, the actual length of the reference component is determined based on the information modified or supplemented by the user on the attribute of the reference component.

[0114] The method for determining the quantity of work provided by the embodiment of the present invention can effectively standardize the quantity calculation process of building components by selecting a reference component and generating its first quantity attribute. The selection of the reference component provides a reliable reference point for the entire building analysis, so that subsequent component analysis and quantity calculation can be performed based on a unified standard, avoiding errors caused by component diversity or different calculation methods. By responding to the attribute editing operation of the reference component, the system can dynamically adjust and update the quantity attributes of the reference component to ensure the real-time and accuracy of the calculation results.

[0115] Step S404: determining the second engineering quantity attributes of the remaining building components based on the first engineering quantity attributes of the reference component.

[0116] Specifically, the above step S404 includes:

[0117] Step S4041, obtaining pixel attributes of the reference component in the building image.

[0118] The pixel attribute refers to the pixel length of the reference component in the building image. Specifically, the pixel length of the reference component in the building image is calculated through the coordinates of the target box detected by the target detection model. For example, if a door in the image is selected as the reference component, the pixel length of the door is obtained.

[0119] Step S4042, determining a parameter conversion coefficient based on the pixel attribute and the first engineering quantity attribute.

[0120] The parameter conversion coefficient refers to the coefficient used to convert the pixel attribute of the reference component in the building image to its first engineering quantity attribute. Specifically, the conversion relationship between the pixel and the actual size is established through the pixel length and the actual length of the reference component. That is, the parameter conversion coefficient = actual length / pixel length.

[0121] Step S4043, determining the second engineering quantity attributes of the remaining building components according to the parameter conversion coefficients.

[0122] The second engineering quantity attribute of the remaining building components may be the actual length of the remaining building components. Specifically, for the remaining building components in the building image, the pixel length may be converted into the actual length by the following formula: actual length = pixel length of the remaining building components × parameter conversion coefficient. The actual size of the remaining building components may be calculated by the above conversion relationship between pixels and actual size.

[0123] The method for determining the engineering quantity provided by the embodiment of the present invention intelligently calculates the second engineering quantity attribute of the remaining building components through the first engineering quantity attribute of the reference component combined with its pixel attribute in the building image, thereby ensuring the consistency and accuracy of the engineering quantity calculation. By obtaining the pixel attribute of the reference component and determining the parameter conversion coefficient based on the relationship between the attribute and the first engineering quantity attribute, the system can automatically generalize the measurement results of the reference component to other components, thereby avoiding the duplication of work and errors that may be caused by calculating each component separately, and greatly improving the efficiency and accuracy of the engineering quantity calculation.

[0124] Step S405: Processing data according to the first engineering quantity attribute and the second engineering quantity attribute to obtain the engineering quantity of each building component.

[0125] According to the actual size of each building component, its corresponding area, volume or other engineering quantity indicators are further calculated. By summarizing and processing the engineering quantity attributes of all building components, the overall engineering quantity of the building is obtained and displayed in the form of a mask in the user interface, such as Figure 7 shown.

[0126] Step S406, obtaining the engineering quantity index of the building components.

[0127] Quantity indicators refer to the cost per square meter of each building component. Specifically, these quantity indicators can be set based on the project budget and unit cost standards to ensure accurate cost estimates for different types of building components (such as walls, windows, etc.).

[0128] Step S407: Generate a bill of quantities corresponding to the building image according to the engineering quantity index and the engineering quantity corresponding to each building component.

[0129] The bill of quantities is a detailed report or list containing the quantities and corresponding costs of each building component, generated based on the quantities and cost indicators of each building component. Specifically, based on the actual quantity of each building component (such as the area or size of the wall or window) and the corresponding quantity indicators (such as the cost per square meter), the total cost of each component is calculated, and a list containing the quantities and costs of all building components is generated, which can be displayed to the user in the form of a report, such as Figure 8 As shown, it is easy to view the cost details of each part.

[0130] The method for determining the quantity of work provided by the embodiment of the present invention can greatly improve the automation and accuracy of the quantity calculation by obtaining the quantity index of the building components and automatically generating the quantity list corresponding to the building image in combination with the actual quantity of each building component. By using the direct relationship between the quantity index and the quantity of the component, the system can efficiently generate a detailed list, avoiding manual calculation and input errors, and improving work efficiency and accuracy.

[0131] In the present embodiment, a device for determining the amount of engineering is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0132] This embodiment provides a device for determining the engineering quantity, such as Fig. 9 As shown, including:

[0133] A first acquisition module 501 is used to acquire a building image to be processed;

[0134] A first recognition module 502 is used to perform component recognition on the building image to determine all building components in the building image;

[0135] A selection module 503, for selecting a reference component from the building components and generating a first engineering quantity attribute of the reference component;

[0136] A determination module 504, configured to determine a second engineering quantity attribute of the remaining building components based on the first engineering quantity attribute of the reference component;

[0137] The processing module 505 is used to perform data processing according to the first engineering quantity attribute and the second engineering quantity attribute to obtain the engineering quantity of each building component.

[0138] In some optional embodiments, the above device further includes:

[0139] An enhancement module, used for performing image enhancement on the building image to obtain an enhanced image;

[0140] A second recognition module is used to recognize a first straight line in the enhanced image, and obtain a plurality of corner points corresponding to the enhanced image based on the first straight line;

[0141] The correction module is used to correct the building image based on multiple corner points to obtain a corrected building image.

[0142] In some optional implementations, the second identification module includes:

[0143] A division submodule, used for dividing the enhanced image into regions according to the position information of the first straight line to obtain a plurality of image regions;

[0144] A first determination submodule, configured to determine a slope corresponding to the second straight line in each image region based on position information of the second straight line in each image region;

[0145] A second determination submodule, used to determine a target direction of a second straight line in each image area based on an average value of the slopes;

[0146] The extension submodule is used to extend the second straight line according to the target direction to obtain multiple corner points.

[0147] In some optional embodiments, the correction module includes:

[0148] A third determination submodule, used to determine perspective transformation parameters based on multiple corner points;

[0149] The correction submodule is used to correct the building image according to the perspective transformation parameters to obtain a corrected building image.

[0150] In some optional implementations, the first identification module 502 includes:

[0151] The object detection submodule is used to input the building image into the pre-trained object detection model, and obtain the bounding box information of each building image through the object detection model;

[0152] A deletion submodule is used to delete redundant bounding boxes if there are any in the bounding box information, so as to obtain each target box;

[0153] The fourth determination submodule is used to determine all building components in the building image based on each target frame.

[0154] In some optional implementations, the first identification module 502 further includes:

[0155] A judgment submodule, used to judge whether the component image in the building image is blocked;

[0156] The repair submodule is used to repair the component image based on a preset repair rule if it is determined that the component image is blocked.

[0157] In some optional implementations, the selection module 503 includes:

[0158] a fifth determination submodule, for determining a reference component corresponding to the building component in response to a reference selection operation generated for the building component;

[0159] The sixth determination submodule is used to determine a first engineering quantity attribute corresponding to the reference component in response to the attribute editing operation on the reference component.

[0160] In some optional implementations, the determination module 504 includes:

[0161] An acquisition submodule, used for acquiring pixel attributes of the reference component in the building image;

[0162] A seventh determination submodule, used to determine a parameter conversion coefficient based on the pixel attribute and the first engineering quantity attribute;

[0163] The eighth determination submodule is used to determine the second engineering quantity attributes of the remaining building components according to the parameter conversion coefficient.

[0164] In some optional embodiments, the above device further includes:

[0165] The second acquisition module is used to obtain the engineering quantity index of the building components;

[0166] The generation module is used to generate a bill of quantities corresponding to the building image according to the engineering quantity indicators and the engineering quantities corresponding to each building component.

[0167] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0168] The engineering quantity determination device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0169] The engineering quantity determination device provided in the embodiment of the present invention can effectively improve the automation and accuracy of engineering quantity calculation by identifying components in the building image and selecting the reference component. The engineering quantity attributes of the remaining components are inferred by the reference component attributes, which simplifies the traditional manual measurement and calculation process, reduces human errors, and improves work efficiency. In addition, the data processing method can quickly obtain the engineering quantity of each building component, saving time and labor costs, and improving the accuracy and reliability of engineering quantity calculation.

[0170] The embodiment of the present invention also provides a computer device having the above Fig. 9 The quantity determination device shown.

[0171] See also Fig.10 , Fig.10 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig.10 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.10 A processor 10 is taken as an example.

[0172] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0173] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0174] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0175] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0176] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.

[0177] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0178] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0179] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0180] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for determining engineering quantity, characterized in that: The method comprises: Obtaining a building image to be processed; Performing component recognition on the building image to determine all building components in the building image; Selecting a reference component from the building components and generating a first engineering quantity attribute of the reference component; Determining second engineering quantity attributes of remaining building components based on the first engineering quantity attribute of the reference component; Data processing is performed according to the first engineering quantity attribute and the second engineering quantity attribute to obtain the engineering quantity of each of the building components.

2. The method according to claim 1, characterized in that Before performing component recognition on the building image to determine all building components in the building image, the method further includes: Performing image enhancement on the building image to obtain an enhanced image; Identifying a first straight line in the enhanced image, and obtaining a plurality of corner points corresponding to the enhanced image based on the first straight line; The building image is corrected based on the multiple corner points to obtain a corrected building image.

3. The method according to claim 2, characterized in that The obtaining a plurality of corner points corresponding to the enhanced image based on the first straight line includes: Dividing the enhanced image into regions according to the position information of the first straight line to obtain a plurality of image regions; Determining the slope corresponding to the second straight line in each of the image regions based on the position information of the second straight line in each of the image regions; determining a target direction of a second straight line in each of the image regions based on an average value of the slopes; The second straight line is extended according to the target direction to obtain the multiple corner points.

4. The method according to claim 2, characterized in that: The correcting the building image based on the multiple corner points to obtain a corrected building image includes: determining perspective transformation parameters based on the plurality of corner points; The building image is corrected according to the perspective transformation parameters to obtain a corrected building image.

5. The method according to claim 1, characterized in that The performing component recognition on the building image to determine all building components in the building image includes: Inputting the building image into a pre-trained target detection model, and obtaining each bounding box information in the building image through the target detection model; If there are redundant bounding boxes in the bounding box information, the redundant bounding boxes are deleted to obtain each target box; All building components in the building image are determined based on the target boxes.

6. The method according to claim 5, characterized in that Also includes: Determining whether a component image in the building image is blocked; If it is determined that the component image is blocked, the component image is repaired based on a preset repair rule.

7. The method according to claim 1, characterized in that The step of selecting a reference component from the building components and generating a first engineering quantity attribute of the reference component comprises: In response to a reference selection operation generated for the building component, determining a reference component corresponding to the building component; In response to a property editing operation on the reference component, a first engineering quantity property corresponding to the reference component is determined.

8. The method according to claim 1, characterized in that: The determining of the second engineering quantity attributes of the remaining building components based on the first engineering quantity attribute of the reference component comprises: Acquire pixel attributes of the reference component in the building image; Determining a parameter conversion coefficient based on the pixel attribute and the first engineering quantity attribute; According to the parameter conversion coefficient, the second engineering quantity attribute of the remaining building components is determined.

9. The method according to claim 1, characterized in that: Also includes: Obtaining the engineering quantity index of the building component; A bill of quantities corresponding to the building image is generated according to the engineering quantity index and the engineering quantities corresponding to each of the building components.

10. A device for determining engineering quantity, characterized in that: The device comprises: A first acquisition module, used for acquiring a building image to be processed; A first recognition module is used to perform component recognition on the building image to determine all building components in the building image; A selection module, used for selecting a reference component from the building components and generating a first engineering quantity attribute of the reference component; A determination module, configured to determine a second engineering quantity attribute of the remaining building components based on the first engineering quantity attribute of the reference component; A processing module is used to perform data processing according to the first engineering quantity attribute and the second engineering quantity attribute to obtain the engineering quantity of each of the building components.

11. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method for determining the engineering quantity according to any one of claims 1 to 9.