Method, device, equipment and storage medium for measuring angle between booms
The boom image is acquired and processed through the camera device, the fitting line segments are screened and the angle between the images is calculated, which solves the problem of high cost in measuring the angle between the booms in the existing technology, and realizes an efficient and low-cost measurement method.
Patent Information
- Application Number
- CN202210625745.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-02
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2042-06-02
AI Technical Summary
In the prior art, the cost of measuring the angle between the booms is high and multiple electrical sensors are required.
Obtain the real-time boom image through the camera device, perform fitting processing to obtain a set of fitting line segments, combine the preset first and second areas, screen out the first and second boom line segments, and calculate the angle between the images And determine the true angle based on the preset angle mapping relationship.
It is possible to reduce measurement costs while ensuring measurement accuracy. There is no need to lay out multiple electrical sensors, and computer vision technology is used to efficiently measure the angle between the arms.
Smart Images

Figure CN115218827B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a method, device, electronic device and non-transient computer-readable storage medium for measuring an angle between booms. Background Art
[0002] During the use of construction machinery such as concrete pump trucks, it is necessary to measure the deployment angle of the boom in the deployed state. For example, when controlling the boom to be deployed to a target angle or retracted to an initial state, it is necessary to obtain the current angle between the booms in real time.
[0003] In the related art, traditional electrical sensors can be used to measure the angle between the booms of engineering machinery. For example, the horizontal inclination of each boom is obtained by an inclination sensor or an inertial sensor, and then the angle between the booms is determined. This solution requires the deployment of multiple electrical sensors, which has a high hardware cost. Summary of the invention
[0004] The present invention provides a method, device, electronic device and non-transitory computer-readable storage medium for measuring the angle between booms, so as to solve the technical problem of high cost of measuring the angle between booms in related technologies, so as to reduce the measurement cost while ensuring the measurement accuracy.
[0005] The present invention provides a method for measuring an angle between booms, comprising:
[0006] A real-time boom image is acquired through a camera device, wherein the boom includes a first boom and a second boom, and the camera device is installed on the first boom and the shooting direction is fixed relative to the first boom; the real-time boom image is fitted to obtain a set of fitted line segments; a fitting line segment is selected from the set of fitting line segments, and the overlap between the fitting line segment and a preset first area and a second area is calculated respectively, and the fitting line segments corresponding to the overlap greater than a threshold are respectively used as the first boom line segment and the second boom line segment, wherein the first area is determined according to the position of the first boom in the real-time boom image, and the second area is determined according to the movement range of the second boom in the real-time boom image; the image angle between the second boom line segment and the first boom line segment is calculated, and the real angle between the first boom and the second boom is determined according to the image angle and a preset angle mapping relationship, wherein the angle mapping relationship includes a mapping relationship between the real angle and the image angle between the first boom and the second boom.
[0007] According to a method for measuring an angle between booms provided by the present invention, the first area is determined in the following manner: a regional anchor point of the first area is obtained by a camera device, wherein the first area is a preset grid within the motion range of the second boom after dividing a historical image into preset grids, and the regional anchor point is a center point of each preset grid within the first area; and the first area is determined based on the regional anchor point.
[0008] According to a method for measuring the angle between booms provided by the present invention, before calculating the image angle between the second boom line segment and the first boom line segment, and based on the image angle and a preset angle mapping relationship, the method also includes: acquiring the historical image and the real angle between the first boom and the second boom when the second boom is in the posture in the historical image; acquiring the image angle between the first boom and the second boom in the historical image based on the historical image; and confirming the angle mapping relationship between the real angle and the image angle.
[0009] According to a method for measuring an angle between booms provided by the present invention, calculating the image angle between the second boom line segment and the first boom line segment includes: calculating the image angle based on an inverse trigonometric function algorithm, the first boom line segment and the second boom line segment.
[0010] According to a method for measuring an angle between booms provided by the present invention, before performing fitting processing on the real-time boom image, the method further includes: preprocessing the real-time boom image, and the preprocessing includes a noise reduction processing operation and / or a grayscale image generation operation.
[0011] According to a method for measuring the angle between booms provided by the present invention, the real-time boom image is fitted to obtain a set of fitted line segments, including: using an edge detection algorithm to perform edge detection processing on the first boom image to obtain an edge detection result; and using a feature detection algorithm to convert the edge detection result to obtain a set of fitted line segments.
[0012] According to a method for measuring the angle between booms provided by the present invention, the degree of overlap between at least two of the fitting line segments and a preset first area is calculated respectively, and the fitting line segment corresponding to the degree of overlap greater than a threshold is used as the second boom line segment, including: if the ratio of the length of the current fitting line segment entering the first area to the total length of the current fitting line segment is greater than or equal to the threshold, then the current fitting line segment is used as the first boom line segment and the second boom line segment.
[0013] The present invention provides an angle measurement device between booms, comprising: an image acquisition unit, used for acquiring a real-time boom image through a camera device, wherein the boom comprises a first boom and a second boom, and the camera device is installed on the first boom and the shooting direction is fixed relative to the first boom; an image processing unit, used for performing fitting processing on the real-time boom image to obtain a set of fitting line segments; a line segment screening unit, used for selecting fitting line segments from the set of fitting line segments, respectively calculating the overlap between the fitting line segments and a preset first area and a second area, and taking the fitting line segments corresponding to the overlap greater than a threshold as the first boom line segments and the second boom line segments, respectively, wherein the first area is determined according to the position of the first boom in the real-time boom image, and the second area is determined according to the movement range of the second boom in the real-time boom image; an angle acquisition unit, used for calculating the image angle between the second boom line segment and the first boom line segment, and determining the real angle between the first boom and the second boom according to the image angle and a preset angle mapping relationship, wherein the angle mapping relationship includes a mapping relationship between the real angle and the image angle between the first boom and the second boom.
[0014] According to a device for measuring an angle between booms provided by the present invention, the device also includes a region determination unit, which is used to obtain a region anchor point of a first region through a camera device, wherein the first region is a preset grid within the motion range of the second boom after dividing a historical image into preset grids, and the region anchor point is a center point of each preset grid within the first region; the first region is determined based on the region anchor point.
[0015] According to a device for measuring the angle between booms provided by the present invention, the device also includes an angle mapping table establishing unit, which is used to: obtain the historical image and the real angle between the first boom and the second boom when the second boom is in the posture in the historical image; obtain the image angle between the first boom and the second boom in the historical image according to the historical image; and confirm the angle mapping relationship between the real angle and the image angle.
[0016] According to the device for measuring the angle between booms provided by the present invention, the angle acquisition unit is further used to calculate the image angle according to an inverse trigonometric function algorithm, the first boom line segment and the second boom line segment.
[0017] According to a device for measuring an angle between booms provided by the present invention, the device further comprises an image preprocessing unit for preprocessing the real-time boom image, wherein the preprocessing comprises a noise reduction operation and / or a grayscale image generation operation.
[0018] According to a device for measuring the angle between booms provided by the present invention, the image processing unit is further used to: use an edge detection algorithm to perform edge detection processing on the first boom image to obtain an edge detection result; and use a feature detection algorithm to convert the edge detection result to obtain a set of fitting line segments.
[0019] According to a boom angle measuring device provided by the present invention, the line segment screening unit is also used for: if the ratio of the length of the current fitting line segment entering the first area to the total length of the current fitting line segment is greater than or equal to the threshold, then the current fitting line segment is used as the first boom line segment and the second boom line segment.
[0020] The present invention also provides an operating machine, comprising the above-mentioned device for measuring the angle between booms.
[0021] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned methods for measuring the angle between arms are implemented.
[0022] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above-mentioned methods for measuring the angle between booms are implemented.
[0023] The present invention provides a method, device, electronic device and non-transitory computer-readable storage medium for measuring the angle between booms. By performing image processing on a first boom image taken by a fixedly mounted camera device, at least two fitting line segments are obtained, and a second boom line segment is obtained in combination with a preset first area. Then, the angle between the two booms is obtained based on the first boom line segment, the second boom line segment and a preset angle mapping table. This realizes the measurement of the angle between booms through computer vision technology, without the need to layout multiple electrical sensors, and can reduce measurement costs while ensuring measurement accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 This is one of the flow diagrams of the method for measuring the angle between booms provided by the present invention;
[0026] Figure 2 is a schematic diagram of a preset grid provided by the present invention;
[0027] Figure 3 This is the second flow chart of the method for measuring the angle between booms provided by the present invention;
[0028] Figure 4 It is a structural schematic diagram of the device for measuring the angle between booms provided by the present invention;
[0029] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] The terms used in one or more embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present invention. The singular forms of "a", "said" and "the" used in one or more embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present invention refers to and includes any or all possible combinations of one or more associated listed items.
[0032] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present invention, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present invention, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0033] Exemplary embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0034] like Figure 1 FIG. 1 is a flow chart of a method for measuring the angle between booms according to an embodiment of the present invention. The method provided by the embodiment of the present invention can be executed by any electronic device with computer processing capabilities, such as a terminal or a server. Figure 1 As shown, the method for measuring the angle between booms includes:
[0035] Step 102, acquiring a real-time boom image by using a camera device, wherein the boom includes a first boom and a second boom, and the camera device is installed on the first boom and a shooting direction is fixed relative to the first boom.
[0036] Specifically, if the first arm rotates, the camera device rotates accordingly to ensure that the camera device can capture the boundary area between the first arm and the second arm with the same viewing angle. In different arm images, the extension direction of the first arm remains unchanged.
[0037] Step 104: performing fitting processing on the real-time boom image to obtain a set of fitting line segments.
[0038] Specifically, the set of fitting line segments includes a first boom line segment corresponding to the first boom, and the first boom line segment is determined based on a length extension direction of the first boom.
[0039] The real-time arm image can be processed by edge detection algorithms and feature detection algorithms. Edge detection is used to detect areas of the image where the intensity changes dramatically. Feature detection is a primary operation in image processing that checks each pixel to determine whether the pixel represents a feature.
[0040] Step 106, selecting a fitting line segment from the fitting line segment set, calculating the overlap between the fitting line segment and the preset first area and second area respectively, and taking the fitting line segments corresponding to the overlap greater than a threshold as the first boom line segment and the second boom line segment respectively, wherein the first area is determined according to the position of the first boom in the real-time boom image, and the second area is determined according to the movement range of the second boom in the real-time boom image.
[0041] Specifically, the first area is used to filter and select the fitted line segments to obtain the second boom line segments. The center points of the preset grids in the first area can be selected as the area anchor points, and the coverage of the first area can be determined by calculation based on the coordinates of the area anchor points, so as to filter out some invalid line segments based on the coverage.
[0042] Step 108, calculate the image angle between the second boom line segment and the first boom line segment, and determine the real angle between the first boom and the second boom based on the image angle and a preset angle mapping relationship, wherein the angle mapping relationship includes a mapping relationship between the real angle and the image angle between the first boom and the second boom.
[0043] The technical solution of the embodiment of the present invention can extract the arm features based on the traditional RGB image data to obtain the arm edge fitting line under low-cost conditions, and further obtain the first arm line segment and the second arm line segment according to the preset first area screening, and obtain the angle between the arms in combination with the angle mapping table. This solution only uses the classic algorithm of traditional computer vision, does not need to collect data sets and manually annotate data, has extremely low cost, and has extremely low requirements for computing resources, so it can reduce the cost of measuring the angle between the arms.
[0044] In an embodiment of the present invention, the camera device may be an RGB camera, and its resolution needs to be no less than 480P. The RGB camera is fixed at a pre-selected position by a fixing device such as a bracket, and the position may be a position on one of the two arms whose angle is to be measured. The image captured by the camera device is transmitted to an electronic device including a processor for processing, and the electronic device may be a master controller of the engineering machinery, or other embedded electronic devices, and is not limited thereto.
[0045] The first area is determined in the following manner: a regional anchor point of the first area is obtained by using a camera device, wherein the first area is a preset grid within a preset second arm motion range after the historical image is divided into preset grids, the historical image is obtained by taking pictures with the camera device, and the regional anchor point is a center point of each preset grid within the first area; the first area can be obtained and determined based on the regional anchor point.
[0046] The first area is the arm feature area.
[0047] In an embodiment of the present invention, it is also necessary to obtain the angle mapping relationship in advance. Specifically, when obtaining the angle mapping relationship, it is necessary to obtain the historical image and the real angle between the first boom and the second boom when the corresponding second boom is in the posture in the historical image; obtain the image angle of the first boom and the second boom in the historical image according to the historical image; and confirm the angle mapping relationship between the real angle and the image angle.
[0048] After the camera device is fixed at the set installation position, the shooting direction of the camera device lens is fixed. When the boom is in different postures, the camera device captures historical boom images. Through manual measurement, the real angle of the second boom in different postures can be obtained. According to the historical boom images of the second boom in different postures, the image angle of the second boom in different postures can be obtained. According to the mapping relationship between the real angle and the image angle, an angle mapping table can be obtained.
[0049] like Figure 2As shown, the preset frame in the shaded part is the first area, and the center point of the preset frame in the first area is the area anchor point. The camera device is installed on the first arm 201, and its camera faces the junction of the first arm 201 and the second arm 202. When the first arm 201 rotates, the camera device can rotate with the first arm 201. One end of the second arm 202 is rotatably connected to the first arm 201, and the other end of the second arm 202 is rotatably connected to the third arm 203. If it is necessary to measure the angle between the second arm 202 and the third arm, the camera device needs to be installed on the second arm 202 or the third arm so that the camera device rotates with the rotation of the arm.
[0050] Before step 104, the real-time boom image is preprocessed, and the preprocessing includes a noise reduction operation and / or a grayscale image generation operation.
[0051] In step 104, the candy algorithm may be used to perform edge detection processing on the first arm image to obtain an edge detection result, and the Hough transform algorithm may be used to convert the edge detection result to obtain a set of fitting line segments.
[0052] Canny algorithm is one of the most classic and advanced algorithms in image edge detection algorithms. It can realize non-maximum suppression based on edge gradient direction and perform double threshold hysteresis threshold processing. Hough transform can be used to identify features in objects. It can not only identify straight lines, but also any shapes such as circles and ellipses.
[0053] The Canny algorithm and Hough transform can be used to perform more accurate line segment identification with less computing power to find the contour edge segments of the first arm and the second arm.
[0054] In step 106, if the ratio of the length of the current fitting line segment entering the first region to the total length of the current fitting line segment is greater than or equal to a threshold, the current fitting line segment is used as the second boom line segment.
[0055] The coordinates of the region anchor point may be used to locate the first region. The fitting line segments are screened and filtered according to the first region, that is, the fitting line segments are screened and filtered according to the region anchor point.
[0056] When screening, the line segments whose ratio of the length of the current fitting line segment entering the first area to the total length of the current fitting line segment is less than the set threshold are discarded, and the line segments greater than or equal to the set threshold are the second arm frame line segments representing the second arm frame.
[0057] In step 108, when calculating the image angle between the second boom line segment and the first boom line segment, the image angle may be calculated according to an inverse trigonometric function algorithm, the first boom line segment, and the second boom line segment.
[0058] Specifically, the inverse trigonometric function includes an inverse tangent function and an inverse cosine function. The calculation formula of the inverse tangent function is arctan((k1-k2) / (1+k1*k2)), and the inverse cosine function is arccos(x1*x2 / |x1|*|x2|), where k1 and k2 are the slopes of the two line segments, respectively.
[0059] By comparing the calculated image angle with the angle mapping table, the angle between the first boom and the second boom in the real environment corresponding to the current boom image can be obtained.
[0060] For example, in the real angle mapping table, when the image angle between the first arm and the second arm is 45°, the real angle between the first arm and the second arm is 90°. Based on this, mapping can be performed, and then when the image angle calculation result in the image space is 45°, the final real angle output is 90°.
[0061] like Figure 3 As shown, in one embodiment of the present invention, an RGB camera 301 collects image data to form an RGB data frame 302. By performing image processing on the RGB data frame, a fitting line segment set 303 can be obtained. The fitting line segment set is filtered using a pre-selected regional anchor point 304 to obtain a target line segment set 305. The target line segment set 305 includes two line segments, which can represent the edges of the first boom and the second boom. Combining the target line segment set 305 with the pre-established real angle mapping table 306, the target angle 307 can be obtained.
[0062] The technical solution of the embodiment of the present invention can process images at a higher frequency and output the angle data between the arms. Specifically, the frequency of image processing can reach 10 frames per second, so that instantaneous errors caused by vibration or other special circumstances can be effectively avoided. The error of the angle calculation result in the technical solution of the embodiment of the present invention can be controlled between 1° and 2°.
[0063] The method for measuring the angle between booms provided by the present invention obtains at least two fitting line segments by performing image processing on a first boom image taken by a fixedly installed camera device, obtains a second boom line segment in combination with a preset first area, and then obtains the angle between the two booms based on the first boom line segment, the second boom line segment and a preset angle mapping table. The method realizes the measurement of the angle between booms by using computer vision technology, does not require the layout of multiple electrical sensors, and can reduce the measurement cost while ensuring the measurement accuracy.
[0064] The device for measuring the angle between booms provided by the present invention is described below. The device for measuring the angle between booms described below and the method for measuring the angle between booms described above can be referred to each other.
[0065] like Figure 4 As shown, a device for measuring the angle between booms according to an embodiment of the present invention comprises:
[0066] The image acquisition unit 402 can be used to acquire a real-time boom image through a camera device, wherein the boom includes a first boom and a second boom, and the camera device is installed on the first boom and the shooting direction is fixed relative to the first boom.
[0067] The image processing unit 404 may be used to perform fitting processing on the real-time boom image to obtain a set of fitting line segments.
[0068] The line segment screening unit 406 can be used to select fitting line segments from the fitting line segment set, calculate the overlap between the fitting line segments and the preset first area and the second area respectively, and use the fitting line segments corresponding to the overlap greater than the threshold as the first boom line segments and the second boom line segments respectively, wherein the first area is determined according to the position of the first boom in the real-time boom image, and the second area is determined according to the movement range of the second boom in the real-time boom image.
[0069] The angle acquisition unit 408 can be used to calculate the image angle between the second boom line segment and the first boom line segment, and determine the real angle between the first boom and the second boom based on the image angle and a preset angle mapping relationship, wherein the angle mapping relationship includes a mapping relationship between the real angle and the image angle between the first boom and the second boom.
[0070] In an embodiment of the present invention, the device further includes a region determination unit, which can be used to obtain a region anchor point of a first region through a camera device, wherein the first region is a preset frame within a preset second arm motion range after the historical image is divided into preset frames, the historical image is obtained by taking pictures with the camera device, and the region anchor point is a center point of each preset frame within the first region; the first region is determined based on the region anchor point acquisition.
[0071] In an embodiment of the present invention, the device also includes an angle mapping table establishing unit, which can be used to: obtain the historical image and the actual angle between the first boom and the second boom when the second boom is in the posture in the historical image; obtain the image angle of the first boom and the second boom in the historical image according to the historical image; and confirm the angle mapping relationship between the actual angle and the image angle.
[0072] In the embodiment of the present invention, the angle acquisition unit may also be used to calculate the image angle according to an inverse trigonometric function algorithm, the first arm line segment and the second arm line segment.
[0073] In an embodiment of the present invention, the device further comprises an image preprocessing unit, which can be used to: preprocess the real-time boom image, wherein the preprocessing comprises a noise reduction operation and / or a grayscale image generation operation.
[0074] In the embodiment of the present invention, the image processing unit may also be used to: perform edge detection processing on the first boom image using an edge detection algorithm to obtain an edge detection result; and convert the edge detection result using a feature detection algorithm to obtain a set of fitting line segments.
[0075] In an embodiment of the present invention, the line segment screening unit may also be used to: if the ratio of the length of the current fitting line segment entering the first region to the total length of the current fitting line segment is greater than or equal to a threshold, use the current fitting line segment as the second boom line segment.
[0076] Since the various functional modules of the device for measuring the angle between booms in the example embodiment of the present invention correspond to the steps of the example embodiment of the method for measuring the angle between booms mentioned above, for details not disclosed in the embodiment of the device of the present invention, please refer to the embodiment of the method for measuring the angle between booms mentioned above.
[0077] The device for measuring the angle between booms provided by the present invention obtains at least two fitting line segments by performing image processing on a first boom image taken by a fixedly installed camera device, obtains a second boom line segment in combination with a preset first area, and then obtains the angle between the two booms based on the first boom line segment, the second boom line segment and a preset angle mapping table. This realizes the measurement of the angle between booms through computer vision technology, does not require the layout of multiple electrical sensors, and can reduce measurement costs while ensuring measurement accuracy.
[0078] An embodiment of the present invention further provides a working machine, comprising the device for measuring the angle between booms as described above.
[0079] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5As shown, the electronic device may include: a processor (processor) 510, a communication interface (Communications Interface) 520, a memory (memory) 530 and a communication bus 550, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 550. The processor 510 can call the logic instructions in the memory 530 to execute the method for measuring the angle between booms, which method includes: acquiring a real-time boom image through a camera device, wherein the boom includes a first boom and a second boom, and the camera device is installed on the first boom and the shooting direction is fixed relative to the first boom; performing fitting processing on the real-time boom image to obtain a set of fitting line segments; selecting fitting line segments from the set of fitting line segments, respectively calculating the overlap between the fitting line segments and the preset first area and the second area, and taking the fitting line segments corresponding to the overlap greater than the threshold as the first boom line segment and the second boom line segment, respectively, wherein the first area is determined according to the position of the first boom in the real-time boom image, and the second area is determined according to the movement range of the second boom in the real-time boom image; calculating the image angle between the second boom line segment and the first boom line segment, and determining the real angle between the first boom and the second boom according to the image angle and a preset angle mapping relationship, wherein the angle mapping relationship includes a mapping relationship between the real angle and the image angle between the first boom and the second boom.
[0080] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0081] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the angle measurement method between booms provided by the above methods, and the method includes: acquiring a real-time boom image through a camera device, wherein the boom includes a first boom and a second boom, and the camera device is installed on the first boom and the shooting direction is fixed relative to the first boom; performing fitting processing on the real-time boom image to obtain a set of fitting line segments; selecting fitting line segments from the set of fitting line segments, and calculating the fitting line segments respectively. The overlap between a line segment and a preset first area and a second area, and the fitting line segments corresponding to the overlap greater than a threshold are respectively used as the first boom line segment and the second boom line segment, wherein the first area is determined according to the position of the first boom in the real-time boom image, and the second area is determined according to the movement range of the second boom in the real-time boom image; the image angle between the second boom line segment and the first boom line segment is calculated, and the real angle between the first boom and the second boom is determined according to the image angle and a preset angle mapping relationship, wherein the angle mapping relationship includes a mapping relationship between the real angle and the image angle between the first boom and the second boom.
[0082] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the above-mentioned methods for measuring the angle between booms, the methods comprising: acquiring a real-time boom image through a camera device, wherein the boom comprises a first boom and a second boom, the camera device is installed on the first boom and the shooting direction is fixed relative to the first boom; performing fitting processing on the real-time boom image to obtain a set of fitting line segments; selecting fitting line segments from the set of fitting line segments, and respectively calculating the overlap between the fitting line segments and the preset first area and the second area. , and use the fitting line segments corresponding to the overlap greater than the threshold as the first boom line segment and the second boom line segment respectively, wherein the first area is determined according to the position of the first boom in the real-time boom image, and the second area is determined according to the movement range of the second boom in the real-time boom image; the image angle between the second boom line segment and the first boom line segment is calculated, and the real angle between the first boom and the second boom is determined according to the image angle and a preset angle mapping relationship, wherein the angle mapping relationship includes a mapping relationship between the real angle and the image angle between the first boom and the second boom.
[0083] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0084] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0085] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for measuring the angle between booms, characterized in that: include: Acquire a real-time boom image by means of a camera device, wherein the boom includes a first boom and a second boom, and the camera device is mounted on the first boom and a shooting direction is fixed relative to the first boom; Performing fitting processing on the real-time boom image to obtain a set of fitting line segments; Selecting a fitting line segment from the fitting line segment set, respectively calculating the overlap between the fitting line segment and a preset first region and a second region, and taking the fitting line segments corresponding to the overlap greater than a threshold as the first boom line segment and the second boom line segment, respectively, wherein the first region is determined according to the position of the first boom in the real-time boom image, and the second region is determined according to the movement range of the second boom in the real-time boom image; Calculate the image angle between the second boom line segment and the first boom line segment, and determine the real angle between the first boom and the second boom based on the image angle and a preset angle mapping relationship, wherein the angle mapping relationship includes a mapping relationship between the real angle and the image angle between the first boom and the second boom.
2. The method according to claim 1, characterized in that The first area is determined by: Acquire a region anchor point of a first region by means of a camera device, wherein the first region is a preset frame within the motion range of the second boom after the historical image is divided into preset frames, and the region anchor point is a center point of each preset frame within the first region; The first area is determined according to the area anchor point acquisition.
3. The method according to claim 2, characterized in that Before calculating the image angle between the second boom line segment and the first boom line segment and mapping the image angle to a preset angle, the method further includes: Acquire the historical image and a real angle between the first boom and the second boom corresponding to the posture of the second boom in the historical image; Acquire, according to the historical image, an image angle between the first boom and the second boom in the historical image; An angle mapping relationship between the real angle and the image angle is confirmed.
4. The method according to claim 3, characterized in that The acquiring, according to the historical image, an image angle between the first boom and the second boom in the historical image comprises: The image angle is calculated according to an inverse trigonometric function algorithm, the first arm frame line segment and the second arm frame line segment.
5. The method according to claim 1, characterized in that Before performing fitting processing on the real-time boom image, the method further includes: The real-time boom image is preprocessed, and the preprocessing includes a noise reduction processing operation and / or a grayscale image generation operation.
6. The method according to claim 1, characterized in that The fitting process is performed on the real-time boom image to obtain a set of fitting line segments, including: Perform edge detection processing on the first boom image using an edge detection algorithm to obtain an edge detection result; The edge detection result is converted using a feature detection algorithm to obtain a set of fitting line segments.
7. The method according to claim 1, characterized in that The respectively calculating the overlap between the fitting line segment and the preset first area and the second area, and taking the fitting line segments corresponding to the overlap greater than the threshold as the first boom line segment and the second boom line segment, respectively, comprises: If the ratio of the length of the current fitting line segment entering the first region to the total length of the current fitting line segment is greater than or equal to the threshold, the current fitting line segment is used as the first boom line segment and the second boom line segment.
8. A device for measuring the angle between booms, characterized in that: include: An image acquisition unit, used for acquiring a real-time boom image through a camera device, wherein the boom comprises a first boom and a second boom, and the camera device is mounted on the first boom and a shooting direction is fixed relative to the first boom; An image processing unit, used for performing fitting processing on the real-time boom image to obtain a set of fitting line segments; a line segment screening unit, configured to select a fitting line segment from the fitting line segment set, calculate the overlap between the fitting line segment and a preset first region and a second region, and use the fitting line segments corresponding to the overlap greater than a threshold as the first boom line segment and the second boom line segment, respectively, wherein the first region is determined according to the position of the first boom in the real-time boom image, and the second region is determined according to the movement range of the second boom in the real-time boom image; An angle acquisition unit is used to calculate the image angle between the second boom line segment and the first boom line segment, and determine the real angle between the first boom and the second boom according to the image angle and a preset angle mapping relationship, wherein the angle mapping relationship includes a mapping relationship between the real angle and the image angle between the first boom and the second boom.
9. A working machine, characterized in that: It comprises the device for measuring the angle between arms as claimed in claim 8.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Cantilever detection method and device
CN108510469A
Detection method and device of parking space and direction and angle thereof, equipment and medium
CN110706509A