A machine vision-based object height measurement method and system
By using a machine vision-based approach, object height is calculated using a target detection model and an image acquisition device, solving the problems of manual intervention and low accuracy in traditional measurement methods, and achieving efficient and automated object height measurement.
Patent Information
- Application Number
- CN202211343619.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-10-28
- Filing Date
- 2022-10-31
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-10-31
AI Technical Summary
Traditional methods are difficult to use efficiently and at low cost to measure tall objects, such as buildings, and require human intervention, resulting in low accuracy and efficiency.
A machine vision-based approach is used to acquire images of objects through an image acquisition device, determine the relative height and acquisition error using a target detection model, and calculate the true height of the object by combining the set height of the image acquisition device and the image height.
It achieves high-precision, automated, and rapid object height measurement, reducing the tedious steps of manual measurement and data calculation, and can provide real-time feedback on changes in building height.
Smart Images

Figure CN115752359B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to an object height measurement method and system based on machine vision. BACKGROUND
[0002] When measuring a high object (such as a building), it is usually not possible to measure its height directly, but to measure it by using traditional optical methods (such as binocular matching method, structured light method, etc.). For example, the traditional method includes manually using an electronic range finder, a total station instrument, etc. to accurately measure above-ground and underground buildings, which is high in cost and involves manual participation.
[0003] The traditional measurement method requires high camera functions and parameters or strict conditions, so it is considered to use the computing power of a computer and the method of machine vision to automatically measure the height of a building under construction and to real-time feedback the height of the building in change. SUMMARY
[0004] Embodiments of the present application are implemented as follows:
[0005] An object height measurement method based on machine vision, comprising:
[0006] acquiring an image of a detected object along a horizontal direction by an image acquisition device;
[0007] determining a relative height of the detected object and an acquisition error in the image based on a target detection model; the acquisition error is related to the target detection model;
[0008] determining a real height of the detected object based on a set height of the image acquisition device, a height of the image, the relative height of the detected object and the acquisition error.
[0009] In some embodiments, the calculation process of determining the real height D2 of the detected object includes:
[0010]
[0011] wherein D1 is the set height of the image acquisition device; H is the height of the image; h is the relative height of the detected object; a is the acquisition error. h
[0012] In some embodiments, the shooting center of the image acquisition device is located at the midpoint of the vertical direction of the image.
[0013] In some embodiments, the target detection model includes a OneStage model.
[0014] In some embodiments, the determining the relative height of the detected object and the acquisition error of the detected object in the image based on the target detection model comprises:
[0015] determining the relative height of the detected object and the type of the detected object in the image based on the target detection model;
[0016] determining the acquisition error based on the type of the detected object.
[0017] In some embodiments, the image capturing device is a camera or a video camera.
[0018] If the image capturing device is a video camera, the image of the detected object is captured through one or more video frames.
[0019] The present application also provides a machine vision-based object height measurement system, comprising:
[0020] an image capturing module, configured to capture an image of a detected object along a horizontal direction through an image capturing device;
[0021] a target detection module, configured to determine the relative height of the detected object and an acquisition error of the detected object in the image based on a target detection model; the acquisition error is related to the target detection model;
[0022] a height determination module, configured to determine the real height of the detected object based on the set height of the image capturing device, the height of the image, the relative height of the detected object and the acquisition error.
[0023] The technical scheme of the present application at least has the following beneficial effects:
[0024] The machine vision-based object height measurement method provided by the present application utilizes the high-precision features of machine vision and the powerful computing and learning capabilities of artificial intelligence models, accurately and quickly obtains the height of the detected object, and reduces the cumbersome steps and large amount of data calculation caused by manual measurement. BRIEF DESCRIPTION OF DRAWINGS
[0025] In order to more clearly illustrate the technical scheme of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0026] Figure 1 A scene diagram of the machine vision-based object height measurement system shown in some embodiments of the present application;
[0027] Figure 2 A flow chart of a machine vision based object height measurement method according to some embodiments of the present application;
[0028] Figure 3 A schematic diagram of an image of an object to be detected according to some embodiments of the present application.
[0029] Figure 4 A structure diagram of a PSFE target detection network according to some embodiments of the present application. DETAILED DESCRIPTION
[0030] In order to make the objects, technical solutions, and advantages of the embodiments of the present application clearer, the following will combine the drawings for clear, complete description of the technical solutions in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. The components of the embodiments of the present application described and shown in the drawings can be arranged and designed in various different configurations.
[0031] It should be understood that the "system", "device", "unit" and / or "module" used herein is a method for distinguishing different components, elements, parts, sections or assemblies at different levels. However, if other words can achieve the same purpose, the words can be replaced by other expressions.
[0032] Flowcharts in the specification are used to illustrate the operations performed by the system according to the embodiments of the specification. It should be understood that the preceding or subsequent operations are not necessarily performed in sequence. Instead, each step can be processed in reverse order or simultaneously. Meanwhile, other operations can be added to these processes, or one or more steps can be removed from these processes.
[0033] 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 claimed present application, but only represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor are within the scope of protection of the present application.
[0034] EMBODIMENTS
[0035] REFERENCE Figure 1 , Figure 1 A machine vision based object height measurement system according to some embodiments of the present application, which includes a tower crane 110, an image capturing device 120, and a building 130.
[0036] The tower crane 110 is used to install the image capturing device 120. In some embodiments, the image capturing device 120 can be arranged to slide along the tower crane 110. In some other embodiments, the image capturing device 120 can also be installed at other locations, such as a drone or other buildings, etc.
[0037] The image capturing device 120 can be a camera, a video camera or other devices capable of taking pictures or videos.
[0038] The building 130 is the detected object. In other embodiments, the detected object can also be a bridge, a tree, etc.
[0039] Reference is made to Figure 2 , Figure 2 The machine vision-based object height measurement method shown in some embodiments of the present application can be performed by the image capturing device 120 in Figure 1 or a device with computing capability connected thereto. The method comprises:
[0040] S210: capturing an image of the detected object in a horizontal direction by the image capturing device;
[0041] S220: determining a relative height of the detected object and a capture error in the image based on a target detection model; the capture error is related to the target detection model;
[0042] S230: determining a real height of the detected object based on a set height of the image capturing device, a height of the image, the relative height of the detected object and the capture error.
[0043] The purpose of capturing an image of the detected object in a horizontal direction is to ensure that the image will not be distorted due to the viewing angle, which may otherwise lead to inaccurate measurement. In some embodiments, the image capturing device can have an image correction function, in which case it is not necessary to keep horizontal when taking pictures, and only the corrected image can be used in subsequent steps.
[0044] The image capturing device can be a camera or a video camera. If the image capturing device is a video camera, the image of the detected object is captured by one or more video frames.
[0045] In some embodiments, the center of the image capturing device is located at the midpoint of the vertical direction of the image, i.e. the central axis of the line of sight is perpendicular to the surface of the detected object, to ensure measurement accuracy.
[0046] Reference is made to Figure 3 Since the target detection model may have a capture error a hTo ensure measurement accuracy, errors need to be eliminated in subsequent calculations. It should be noted that the acquisition error α... h The value can be positive or negative.
[0047] In S220, determining the relative height and acquisition error of the detected object in the image based on the target detection model includes:
[0048] The relative height and type of the detected object in the image are determined based on the target detection model.
[0049] The acquisition error is determined based on the type of the object being detected.
[0050] In some embodiments, when obtaining the relative height of the detected object, a label of the type of the detected object is output, and different acquisition error calculation formulas within the model are selected by the label of the type of the detected object.
[0051] For example, such as Figure 4 As shown, the target detection model is a OneStage network, specifically an Object Detection Network Based on Preserving SizeFeature Extraction (PSFE), which includes: a width and height feature extraction layer, a feature extraction layer, a small target prediction layer, and an output layer; the width and height feature extraction layer is used to preserve the aspect ratio of the detected object in the image of the detected object.
[0052] For example, the input image width and height N of the object detection network that preserves size feature extraction is a multiple of 32. That is, it is divisible by 8, 16, and 32 simultaneously. The model outputs the target prediction results for the grid regions corresponding to the original image scaled down by 8, 16, and 32, respectively. The target detection results are obtained by calculating probability and confidence. The results are: target center point coordinates (x, y), offset distance (w, h), confidence C, and categories p1 to p80, i.e., [x, y, w, h, c, p1, p2, p3… p80]. Here, the number of categories is 80, which is not a constant value; the specific number of categories is set according to the dataset used when training the model. Here, 80 categories are used as an example.
[0053] The model network has the following internal parameters, with a total of 155 layers:
[0054]
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064] The object detection network reserving the size feature extraction effectively makes the scale of the detected object in the feature extraction process lossless, and ensures the detection accuracy. At the same time, the memory occupation is small, and it is convenient to transplant to the processing device.
[0065] In some embodiments, taking the building under construction as an example, the collection error α h The model can be determined according to the parameters of the model, which is not limited in the present application. Determined, wherein L Iou The model can be determined according to the parameters of the model, which is not limited in the present application.
[0066] In some embodiments, the real height D2 of the detected object can be determined in S230 by the following formula:
[0067]
[0068] Wherein, D1 is the setting height of the image taking device; H is the height of the image; h is the relative height of the detected object; α h is the collection error.
[0069] In some embodiments, a machine vision-based object height measurement system is also provided, comprising:
[0070] An image collection module is configured to collect the image of the detected object along the horizontal direction by the image taking device;
[0071] A target detection module is configured to determine the relative height of the detected object in the image and the collection error based on the target detection model; the collection error is related to the target detection model;
[0072] A height determination module is configured to determine the real height of the detected object based on the setting height of the image taking device, the height of the image, the relative height of the detected object and the collection error.
[0073] Some embodiments of the present application provide a machine vision-based object height measurement method, which utilizes the high-precision features of machine vision and the powerful computing and learning capabilities of artificial intelligence models to accurately and quickly obtain the height of the detected object, reducing the cumbersome steps and large amount of data calculation brought by manual measurement. And it can automatically measure the height of the building under construction and real-time feedback the changing building height.
[0074] The above describes certain embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in a different order than those in the embodiments and still achieve desirable results. In addition, the processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing can be advantageous or possible.
[0075] It should be noted that different embodiments can produce different beneficial results, and in different embodiments, the beneficial results that can be produced can be any one or combination of the above, or any other beneficial result that can be obtained.
[0076] The above has described the basic concepts, and it is obvious that the above detailed disclosure is only as an example and does not constitute a limitation on the present specification for those skilled in the art. Although it is not explicitly stated here, those skilled in the art can make various modifications, improvements and corrections to the present specification. Such modifications, improvements and corrections are suggested in the present specification, so such modifications, improvements and corrections still belong to the spirit and scope of the exemplary embodiments of the present specification.
[0077] At the same time, the present specification uses specific words to describe the embodiments of the present specification. As "one embodiment", "an embodiment", and / or "some embodiments" means a certain feature, structure or characteristic related to at least one embodiment of the present specification. Therefore, it should be emphasized and noted that the "an embodiment" or "one embodiment" or "one alternative embodiment" mentioned in different places in the present specification does not necessarily refer to the same embodiment. In addition, some features, structures or characteristics in one or more embodiments of the present specification can be properly combined.
[0078] Moreover, those skilled in the art will appreciate that the aspects of the specification can be practiced by employing one or more computer-based data processing systems, such as computing devices, servers, computing devices, and / or other devices, as described herein. Such data processing systems can be capable of carrying out operations in accordance with various embodiments of this specification. Additionally, those skilled in the art will appreciate that the aspects of the specification can be practiced by one or more data processing systems, such as computing devices, servers, computing devices, and / or other devices, as described herein. Such data processing systems can be capable of carrying out operations in accordance with various embodiments of this specification.
Claims
1. A method for measuring the height of an object based on machine vision, characterized in that, The method comprises: acquiring an image of the detected object along a horizontal direction by an image acquisition device; determining a relative height and an acquisition error of the detected object in the image based on a target detection model; the acquisition error is related to the target detection model; determining a real height of the detected object based on a setting height of the image acquisition device, a height of the image, the relative height of the detected object, and the acquisition error; the calculation process of determining the real height D2 of the detected object comprises: Wherein, D1 is the setting height of the image taking device; H is the height of the image; h is the relative height of the detected object; α h is the collection error, and collection error α h Based on Determination, wherein L Iou may be determined according to the parameters of the model.
2. The object height measurement method based on machine vision according to claim 1, wherein: the shooting center of the image acquisition device is located at the midpoint of the image in the vertical direction.
3. The machine vision-based object height measurement method of claim 1, wherein, The target detection model comprises: a reserved width and height feature extraction layer, a feature extraction layer, a small target prediction layer, and an output layer; the reserved width and height feature extraction layer is used to reserve the width and height ratio of the detected object in the image of the detected object.
4. The machine vision-based object height measurement method of claim 1, wherein, The determination of the relative height and the acquisition error of the detected object in the image based on the target detection model comprises: determining the relative height of the detected object in the image and the type of the detected object based on the target detection model; determining the acquisition error based on the type of the detected object.
5. The machine vision-based object height measurement method of claim 1, wherein: The image acquisition device is a camera or a video camera; if the image acquisition device is a video camera, the image of the detected object is acquired through one or more video frames.
6. A machine vision based object height measurement system, characterized in that, The method comprises: an image acquisition module for acquiring an image of a detected object along a horizontal direction by an image acquisition device; a target detection module for determining a relative height and an acquisition error of the detected object in the image based on a target detection model; the acquisition error is related to the target detection model; a height determination module for determining a real height of the detected object based on a setting height of the image acquisition device, a height of the image, the relative height of the detected object, and the acquisition error; the calculation process of determining the real height D2 of the detected object comprises: Wherein, D1 is the setting height of the image taking device; H is the height of the image; h is the relative height of the detected object; α h is the collection error, and collection error α h Based on Determination, wherein L Iou may be determined according to the parameters of the model.
7. A machine vision-based object height measurement system according to claim 6, wherein, the calculation process of determining the real height D2 of the detected object by the height determination module comprises: wherein D1 is the setting height of the image acquisition device; H is the height of the image; h is the relative height of the detected object; and h is the acquisition error.
8. An object height measurement device based on machine vision, comprising a processor and a storage medium, the storage medium being used to store computer instructions, and the processor being used to execute at least part of the computer instructions to realize any one of the object height measurement methods based on machine vision in claims 1-5.
Citation Information
Patent Citations
Target height measurement system based on deep learning method
CN111260720A
Width measurement system using CCD camera and errorcompensation device
KR1020020016448A