Method, device, equipment and storage medium for determining camera position
By obtaining the position coordinates of the tower crane hook and the camera adjustment angle, and calculating the camera's initial installation position and shooting angle, the problem of difficult camera position determination during tower crane high-altitude operations is solved, and automatic camera tracking and efficient shooting are achieved.
Patent Information
- Application Number
- CN202211705166.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-12-28
AI Technical Summary
During high-altitude operations on tower cranes, it is difficult to accurately determine the initial installation position and initial shooting angle of the camera, resulting in the camera being unable to effectively follow the hook for shooting.
By obtaining the position coordinates of the tower crane hook at multiple test positions and the camera adjustment angle, a three-dimensional spatial coordinate system is established, and the initial installation position and initial shooting angle of the camera relative to the tower crane are calculated.
The camera position and angle can be accurately determined without manual measurement, which simplifies the measurement process and improves the accuracy and efficiency of the camera following the hook.
Smart Images

Figure CN115724349B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, equipment and storage medium for determining a camera position. Background Art
[0002] When working at high altitude on a tower crane, due to the long boom and high lifting height, it is difficult for workers to visually observe the exact position of the hook on the boom and the actual lifting situation. In this case, it is necessary to install a camera to track and capture the hook, and then transmit the real-time video of the hook to the tower crane control room for auxiliary observation. The initial installation position and initial shooting angle of the camera need to be determined in a timely manner so that the camera shooting angle can be automatically adjusted according to the initial position of the camera so that the camera follows the hook and captures the scene. Due to the large size of the tower crane, the camera cannot be installed too far away from the tower crane. However, if the camera is installed near the tower crane, it is difficult to manually measure the initial installation position of the camera on the spot, and the measurement error is large, making it impossible to obtain accurate measurement results. Therefore, it is difficult to accurately adjust the camera shooting angle to automatically track and capture the hook.
[0003] Therefore, how to automatically and accurately determine the initial installation position and initial shooting angle of the camera relative to the tower crane has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention
[0004] The object of the present invention is to provide a method, apparatus, device and storage medium for determining the position of a camera, which can efficiently and accurately determine the initial installation position and initial shooting angle of the camera.
[0005] According to one aspect of the present invention, a method for determining a camera position is provided, the method comprising:
[0006] Obtaining the hook position coordinates of the tower crane hook at a test position; wherein the number of the test positions is greater than or equal to three;
[0007] Obtaining a camera adjustment angle used when the camera photographs the hook at the test position; wherein the camera is used to photograph the operating status of the hook;
[0008] An initial installation position of the camera relative to the tower crane and an initial shooting angle of the camera relative to the tower crane are calculated according to the hook position coordinates and the camera adjustment angle.
[0009] Optionally, obtaining the hook position coordinates of the tower crane hook at the test position includes:
[0010] The intersection of the tower crane boom and the tower crane body is set as the origin, the direction along the tower crane boom and away from the origin is set as the first coordinate axis, the direction perpendicular to the first coordinate axis on the horizontal plane is set as the second coordinate axis, and the direction of the tower body is set as the third coordinate axis to establish a three-dimensional space coordinate system;
[0011] respectively determining the hook position coordinates of the hook at each test position in the three-dimensional space coordinate system;
[0012] The hook position coordinates include: a first coordinate value for a first coordinate axis, a second coordinate value for a second coordinate axis, and a third coordinate value for a third coordinate axis, and the second coordinate value in each hook position coordinate is 0, and the third coordinate value in each hook position coordinate is the same.
[0013] Optionally, obtaining a camera adjustment angle used when the camera photographs the hook at the test position includes:
[0014] Acquiring a test horizontal adjustment angle and a test pitch adjustment angle used when the camera is adjusted from the initial shooting angle to a test shooting angle; wherein, when the camera is adjusted to the test shooting angle, the hook located at the test position appears at the center of the camera's shooting image;
[0015] The test horizontal adjustment angle and the test pitch adjustment angle are set as the camera adjustment angles.
[0016] Optionally, calculating an initial installation position of the camera relative to the tower crane and an initial shooting angle of the camera relative to the tower crane based on the hook position coordinates and the camera adjustment angle includes:
[0017] Calculating, based on the first coordinate value and the second coordinate value of the hook at each test position and the test horizontal adjustment angle of the hook at each test position, the coordinate value of the camera on the first coordinate axis, the coordinate value of the camera on the second coordinate axis, and the initial horizontal shooting angle of the camera relative to the first coordinate axis;
[0018] Calculating the coordinate value of the camera on the third coordinate axis and the initial pitch shooting angle of the camera relative to the third coordinate axis based on the first coordinate value and the third coordinate value of the hook at each test position and the test pitch adjustment angle of the hook at each test position;
[0019] Setting the coordinate value of the camera on the first coordinate axis, the coordinate value of the camera on the second coordinate axis, and the coordinate value of the camera on the third coordinate axis as the initial installation position of the camera relative to the tower crane;
[0020] The initial horizontal shooting angle and the initial pitch shooting angle are set as the initial shooting angles.
[0021] Optionally, after calculating the initial installation position of the camera relative to the tower crane and the initial shooting angle of the camera relative to the tower crane, the method further includes:
[0022] Sort the first coordinate values of the hooks at the respective test positions in ascending order to obtain a test position sorting result;
[0023] Calculating the test distance from the camera to each test position in sequence according to the test position sorting result to obtain a test distance sorting result;
[0024] Determine whether the test distances in the test distance sorting result are successively larger. If so, determine that the installation area of the camera is the root area of the tower crane boom. If not, determine that the installation area of the camera is the tip area of the tower crane boom.
[0025] Optionally, after calculating the initial installation position of the camera relative to the tower crane and the initial shooting angle of the camera relative to the tower crane, the method further includes:
[0026] During use of the tower crane, when it is detected that the hook moves from an initial position to a final position, obtaining the initial position coordinates of the initial position and the final position coordinates of the final position;
[0027] Calculating a horizontal angle to be adjusted and a pitch angle to be adjusted of the camera according to the initial position coordinates, the final position coordinates, the initial installation position, the initial shooting angle, and the installation area;
[0028] The shooting angle of the camera is adjusted according to the horizontal angle to be adjusted and the pitch angle to be adjusted so that the hook appears at the center of the shooting picture of the camera.
[0029] In order to achieve the above object, the present invention further provides a device for determining a camera position, the device comprising:
[0030] An acquisition module, configured to acquire the hook position coordinates of a tower crane hook at a test position; wherein the number of the test positions is greater than or equal to three;
[0031] An angle module, used to obtain a camera adjustment angle used when the camera photographs the hook at the test position; wherein the camera is used to photograph the operating status of the hook;
[0032] A calculation module is used to calculate the initial installation position of the camera relative to the tower crane and the initial shooting angle of the camera relative to the tower crane according to the hook position coordinates and the camera adjustment angle.
[0033] Optionally, the computing module is further configured to:
[0034] Calculating, based on the first coordinate value and the second coordinate value of the hook at each test position and the test horizontal adjustment angle of the hook at each test position, the coordinate value of the camera on the first coordinate axis, the coordinate value of the camera on the second coordinate axis, and the initial horizontal shooting angle of the camera relative to the first coordinate axis;
[0035] Calculating the coordinate value of the camera on the third coordinate axis and the initial pitch shooting angle of the camera relative to the third coordinate axis based on the first coordinate value and the third coordinate value of the hook at each test position and the test pitch adjustment angle of the hook at each test position;
[0036] Setting the coordinate value of the camera on the first coordinate axis, the coordinate value of the camera on the second coordinate axis, and the coordinate value of the camera on the third coordinate axis as the initial installation position of the camera relative to the tower crane;
[0037] The initial horizontal shooting angle and the initial pitch shooting angle are set as the initial shooting angles.
[0038] In order to achieve the above-mentioned purpose, the present invention also provides a computer device, which specifically includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the camera position determination method described above when executing the computer program.
[0039] In order to achieve the above object, the present invention further provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method for determining the position of a camera described above.
[0040] The camera position determination method, device, equipment and storage medium provided by the present invention obtain the hook position coordinates of the hook at the test position and the camera adjustment angle when the hook is in each test position, and calculate the initial installation position of the camera relative to the tower crane and the initial shooting angle of the camera relative to the tower crane. The operator can obtain the initial installation position and initial shooting angle of the camera without manual measurement, thereby reducing the measurement difficulty. When the operator operates the hook to perform high-altitude operations, there is no need to manually adjust the shooting angle of the camera. The horizontal angle and pitch angle that the camera needs to be deflected can be directly obtained through simple calculation, so that the camera can automatically follow and shoot the hook in real time, making it easy to observe the operation conditions of the hook when lifting heavy objects, thereby improving operation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Various other advantages and benefits will become apparent to those skilled in the art by reading the detailed description of the preferred embodiment below. The accompanying drawings are only for the purpose of illustrating the preferred embodiment and are not to be considered as limiting the present invention. In the accompanying drawings:
[0042] Figure 1 A schematic diagram of an optional flow chart of the method for determining the camera position provided in Example 1;
[0043] Figure 2 A schematic diagram of a camera in a three-dimensional space coordinate system provided in Example 1;
[0044] Figure 3 Schematic diagram of the hook at different test positions in the three-dimensional space coordinate system provided in Example 1;
[0045] Figure 4 A schematic diagram of the relative positions of the hook and the camera in a two-dimensional top-view coordinate system provided in Example 1;
[0046] Figure 5 A schematic diagram of the relative positions of the hook and the camera in a two-dimensional side-view coordinate system provided in Example 1;
[0047] Figure 6 A schematic diagram of determining the installation area of a camera provided in Example 1;
[0048] Figure 7 A schematic diagram of an optional structure for determining the camera position provided in Example 3;
[0049] Figure 8 This is a schematic diagram of an optional hardware architecture of the computer device provided in Example 4. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0051] Example 1
[0052] The embodiment of the present invention provides a method for determining the position of a camera, such as Figure 1 As shown, the method specifically includes the following steps:
[0053] Step S101: obtaining the hook position coordinates of the tower crane's hook at a test position; wherein the number of the test positions is greater than or equal to three.
[0054] Specifically, the diameter and number of rotations of the roller currently controlling the hook's movement on the tower crane boom are used to determine the hook's position information, such as its luffing distance, rotation angle, and lifting height. This position information is then used to determine the hook's position coordinates at each test position. Determining the hook's position coordinates at each test position is a prior art technique and will not be described in detail in this embodiment.
[0055] Furthermore, the camera is fixedly installed in one position and cannot be moved. The camera is used to shoot the position and actual situation of the tower crane's hook in real time, and broadcast the video shot by the camera to the tower crane control room in real time, so that the operator can clearly observe the operation of the hook.
[0056] Preferably, the camera is installed on the tower crane boom, and the installation area on the tower crane boom can be divided into an arm root area and an arm tip area.
[0057] Furthermore, the step S101 further includes the following steps:
[0058] Step A1: Set the intersection of the tower crane boom and the tower crane body as the origin, set the direction along the tower crane boom and away from the origin as the first coordinate axis, set the direction perpendicular to the first coordinate axis on the horizontal plane as the second coordinate axis, and set the direction of the tower body as the third coordinate axis to establish a three-dimensional space coordinate system.
[0059] Among them, such as Figure 2 As shown, when calculating the initial installation position of the camera relative to the tower crane, the camera is regarded as a point in the three-dimensional space coordinate system, and the relative distance between the point and the tower crane is calculated.
[0060] Step A2: respectively determining the hook position coordinates of the hook at each test position in the three-dimensional space coordinate system.
[0061] The hook position coordinates include: a first coordinate value for a first coordinate axis, a second coordinate value for a second coordinate axis, and a third coordinate value for a third coordinate axis, and the second coordinate value in each hook position coordinate is 0, and the third coordinate value in each hook position coordinate is the same.
[0062] Specifically, if Figure 3 As shown, due to the influence of gravity, the hook of the tower crane is perpendicular to the tower crane boom, so the second coordinate value of the hook position coordinate of the hook is 0, and after the first test position of the hook is determined, the hook height of the subsequent test positions is not changed, so the third coordinate value of the hook in each hook position coordinate is the same.
[0063] In this embodiment, during traditional tower crane operation, the operator in the tower crane control room controls the movement of the trolley on the tower crane boom and then controls the hook on the trolley to lift the heavy object. At this time, it is necessary to install a camera to record the operating status of the hook. After the camera is installed, if the camera is to automatically adjust the shooting angle following the hook, it is also necessary to determine the initial installation position and initial shooting angle of the camera relative to the tower crane. However, since the tower crane is located at a high position, the installation position of the camera is also relatively high, so it is difficult for the staff to manually measure the position of the camera. Therefore, in this embodiment, a calculation scheme is provided for accurately calculating the initial installation position and initial shooting angle of the camera by obtaining the hook position coordinates of the test position of the hook. There is no need to manually measure the position of the camera, which improves the accuracy of determining the camera position and simplifies the calculation logic. After obtaining the initial installation position and initial shooting angle of the camera, the horizontal angle and pitch angle that the camera needs to deflect are calculated by obtaining the real-time position of the hook to automatically adjust the camera, so that the camera can accurately record the working condition of the hook without manual control, helping the operator to better control the hook.
[0064] Step S102: obtaining a camera adjustment angle used when the camera photographs the hook at the test position; wherein the camera is used to photograph the operating status of the hook.
[0065] The camera adjustment angle includes a test horizontal adjustment angle and a test pitch adjustment angle. The test horizontal adjustment angle (Pan, P value) represents the camera's horizontal movement angle, that is, the horizontal rotation angle of the camera lens. The test pitch adjustment angle (Tilt, T value) represents the camera's vertical movement angle, that is, the high and low pitch angles of the camera lens. By obtaining the camera adjustment angle corresponding to each test position of the hook, that is, a hook position coordinate (X n , Yn , Z n ) corresponds to a camera adjustment angle (P c , T c ).
[0066] Specifically, step S102 includes the following steps:
[0067] Step B1: Obtain the test horizontal adjustment angle and the test pitch adjustment angle used when the camera is adjusted from the initial shooting angle to the test shooting angle; wherein, when the camera is adjusted to the test shooting angle, the hook located at the test position appears at the center of the camera's shooting screen.
[0068] Specifically, the operator adjusts the horizontal angle and the pitch angle of the camera by controlling the camera remote control device so that the hook is framed at the center of the camera's shooting image, so that the operator can observe the working status of the hook through the camera.
[0069] Step B2: setting the test horizontal adjustment angle and the test pitch adjustment angle as the camera adjustment angle.
[0070] Among them, since the operator has not obtained the initial shooting angle of the camera at this time, he cannot obtain the shooting angle when shooting the hook, and can only obtain the test horizontal adjustment angle and the test pitch adjustment angle through the remote control device.
[0071] Step S103: Calculating the initial installation position of the camera relative to the tower crane and the initial shooting angle of the camera relative to the tower crane based on the hook position coordinates and the camera adjustment angle; wherein the number of the test positions is greater than or equal to three.
[0072] Preferably, the number of the test locations is equal to three.
[0073] Specifically, the initial installation position is defined as the camera's origin, with the intersection of the crane's boom and tower body as the camera's origin. The distances from the camera to the three coordinate axes are used as the camera's initial installation position relative to the crane. The initial shooting angle refers to the camera's initial, unadjusted horizontal and pitch angles after it is installed in a fixed position.
[0074] Furthermore, the step S103 includes the following steps:
[0075] Step C1: Based on the first coordinate value and the second coordinate value of the hook at each test position, and the test horizontal adjustment angle of the hook at each test position, calculate the coordinate value of the camera on the first coordinate axis, the coordinate value of the camera on the second coordinate axis, and the initial horizontal shooting angle of the camera relative to the first coordinate axis.
[0076] Specifically, if Figure 4 As shown, step C1 extracts a two-dimensional top-view coordinate system including a first coordinate axis and a second coordinate axis from a three-dimensional space coordinate system, i.e., a top view of the tower crane. At the same time, the number of test positions is set to three, and the camera installation area is set to the base of the tower crane boom. The calculation is performed according to the following process:
[0077] Step C11: Obtain the coordinates (X1, Y1) of the hook at the test position A in the two-dimensional overhead coordinate system, the shooting angle (P1, T1) of the camera when shooting the hook at the test position A, the coordinates (X2, Y2) of the hook at the test position B, the shooting angle (P1, T1) of the camera when shooting the hook at the test position B, the coordinates (X2, Y2) of the hook at the test position C, and the shooting angle (P3, T3) of the camera when shooting the hook at the test position C; wherein, they increase from X1 to X3, and Y1, Y2, and Y3 are all 0.
[0078] Step C12: Set the position coordinates of the camera to P(X c , Y c ), set the angle θ formed by the perpendicular line of the position coordinate of the camera perpendicular to the first coordinate axis and the line connecting the test position A to the camera position, and obtain the angle α1 of ∠APB and the angle α2 of ∠APC according to the shooting angle of the camera; where α1=|P2-P1|, α2=|P3-P1|.
[0079] Step C13: According to The first coordinate value Xc, the second coordinate value Yc, and θ of the camera are obtained.
[0080] Step C14: The initial horizontal shooting angle of the camera relative to the tower crane is [1-(90°-θ)].
[0081] Step C2: Based on the first coordinate value and the third coordinate value of the hook at each test position, and the test pitch adjustment angle of the hook at each test position, calculate the coordinate value of the camera on the third coordinate axis and the initial pitch shooting angle of the camera relative to the third coordinate axis.
[0082] Specifically, if Figure 5As shown, step C2 extracts a two-dimensional side view coordinate system containing the first coordinate axis and the third coordinate axis from the three-dimensional space coordinate system, i.e., the side view of the tower crane. At the same time, the number of test positions is set to three, and the camera installation area is set to the base area of the tower crane boom. The calculation is performed according to the following process:
[0083] Step C21: Obtain the coordinates (X1, Z1) of the hook at the test position A in the two-dimensional side view coordinate system, as well as the shooting angle (P1, T1) of the camera when shooting the hook at the test position A, the coordinates (X2, Z2) of the hook at the test position B, the shooting angle (P1, T1) of the camera when shooting the hook at the test position B, the coordinates (X2, Z2) of the hook at the test position C, and the shooting angle (P3, T3) of the camera when shooting the hook at the test position C; wherein, they increase from X1 to X3 in sequence, and Z1, Z2, and Z3 are all the same.
[0084] Step C22: Set the position coordinates of the camera to P(X c , Z c ), set the angle γ formed by the line parallel to the first coordinate axis and the line connecting the test position A to the camera position, and obtain the angle β1 of ∠APB and the angle β2 of ∠APC in the two-dimensional side view coordinate system according to the shooting angle of the camera; wherein, β1 = |T2-T1|, β2 = |T3-T1|.
[0085] Step C23: According to To solve the third coordinate value Z of the camera c ,γ.
[0086] Step C24: The initial pitch angle of the camera relative to the tower crane is (γ-T1)
[0087] It should be noted that in this embodiment, only the calculation of the initial installation position of the camera relative to the tower crane and the initial shooting angle of the camera relative to the tower crane through three test positions are listed. When the number of test positions is greater than three, the calculation logic provided by this embodiment can also be used to complete the calculation. The calculation process when there are more than three test positions is not listed here.
[0088] Step C3: setting the coordinate value of the camera on the first coordinate axis, the coordinate value of the camera on the second coordinate axis, and the coordinate value of the camera on the third coordinate axis as the initial installation position of the camera relative to the tower crane.
[0089] Step C4: setting the initial horizontal shooting angle and the initial pitch shooting angle as the initial shooting angle.
[0090] Furthermore, if Figure 6 As shown, after step S103, the method further includes:
[0091] Step D101: sorting the first coordinate values of the hooks at the respective test positions in ascending order to obtain a test position sorting result.
[0092] Step D102: Calculate the test distance from the camera to each test position in sequence according to the test position sorting result to obtain a test distance sorting result.
[0093] Step D103: Determine whether the test distances in the test distance sorting result are successively larger. If so, determine that the installation area of the camera is the base area of the tower crane boom. If not, determine that the installation area of the camera is the tip area of the tower crane boom.
[0094] Among them, since the camera is installed near the tower crane, but the tower crane boom is long, one camera cannot meet the needs of observing the tower crane operation situation, so it is necessary to install cameras in the tower crane boom root area and the tower crane boom tip area for easy observation. However, since when adjusting the camera shooting angle so that the camera follows the hook rotation, the adjustment angle of the camera in the tower crane boom root area and the tower crane boom tip area is different, it is necessary to determine the installation area of each camera separately so that each camera can perfectly follow the hook to shoot. By determining the installation area of the camera in the above way, there is no need for manual recording, avoiding the error of adjusting the camera angle due to manual omission, so that the camera cannot follow the hook to shoot.
[0095] Furthermore, after step S103, the method further includes:
[0096] Step E1: During use of the tower crane, when it is detected that the hook moves from an initial position to a final position, the initial position coordinates of the initial position and the final position coordinates of the final position are acquired.
[0097] Step E2: Calculating the horizontal angle to be adjusted and the pitch angle to be adjusted of the camera according to the initial position coordinates, the final position coordinates, the initial installation position, the initial shooting angle, and the installation area.
[0098] Step E3: adjusting the shooting angle of the camera according to the horizontal angle to be adjusted and the pitch angle to be adjusted so that the hook appears at the center of the shooting picture of the camera.
[0099] In this embodiment, by obtaining the hook position coordinates of the hook in the test position and obtaining the camera adjustment angle when the hook is in each test position, the initial installation position of the camera relative to the tower crane, the initial shooting angle of the camera relative to the tower crane, and the installation area of the camera are calculated. The position information and shooting angle information of the camera can be obtained without manual measurement, which helps the operator to only control the hook to lift heavy objects when operating the hook. There is no need to manually adjust the shooting angle of the camera. The horizontal angle and pitch angle that the camera needs to be deflected can be directly obtained through the position information of the hook, and the effect of the camera automatically following the hook to shoot can be easily achieved, so that the camera can follow and shoot the operation of the hook in real time, which is convenient for observing the operation of the hook lifting heavy objects, improving work efficiency, and avoiding distraction of the operator.
[0100] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0101] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0102] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method.
[0103] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
[0104] Example 2
[0105] The embodiment of the present invention provides a device for determining the position of a camera, such as Figure 7 As shown, the device specifically includes the following components:
[0106] An acquisition module 701 is configured to acquire the hook position coordinates of a tower crane hook at a test position; wherein the number of the test positions is greater than or equal to three;
[0107] An angle module 702 is used to obtain a camera adjustment angle used when the camera is used to photograph the hook at the test position; wherein the camera is used to photograph the operating status of the hook;
[0108] The calculation module 703 is used to calculate the initial installation position of the camera relative to the tower crane and the initial shooting angle of the camera relative to the tower crane according to the hook position coordinates and the camera adjustment angle.
[0109] The acquisition module 701 is further configured to:
[0110] The intersection of the tower crane boom and the tower crane body is set as the origin, the direction along the tower crane boom and away from the origin is set as the first coordinate axis, the direction perpendicular to the first coordinate axis on the horizontal plane is set as the second coordinate axis, and the direction of the tower body is set as the third coordinate axis to establish a three-dimensional space coordinate system;
[0111] respectively determining the hook position coordinates of the hook at each test position in the three-dimensional space coordinate system;
[0112] The hook position coordinates include: a first coordinate value for a first coordinate axis, a second coordinate value for a second coordinate axis, and a third coordinate value for a third coordinate axis, and the second coordinate value in each hook position coordinate is 0, and the third coordinate value in each hook position coordinate is the same.
[0113] Specifically, the angle module 702 is further configured to:
[0114] The intersection of the tower crane boom and the tower crane body is set as the origin, the direction along the tower crane boom and away from the origin is set as the first coordinate axis, the direction perpendicular to the first coordinate axis on the horizontal plane is set as the second coordinate axis, and the direction of the tower body is set as the third coordinate axis to establish a three-dimensional space coordinate system;
[0115] respectively determining the hook position coordinates of the hook at each test position in the three-dimensional space coordinate system;
[0116] The hook position coordinates include: a first coordinate value for a first coordinate axis, a second coordinate value for a second coordinate axis, and a third coordinate value for a third coordinate axis, and the second coordinate value in each hook position coordinate is 0, and the third coordinate value in each hook position coordinate is the same.
[0117] Furthermore, the angle module 702 is further configured to:
[0118] Acquiring a test horizontal adjustment angle and a test pitch adjustment angle used when the camera is adjusted from the initial shooting angle to a test shooting angle; wherein, when the camera is adjusted to the test shooting angle, the hook located at the test position appears at the center of the camera's shooting image;
[0119] The test horizontal adjustment angle and the test pitch adjustment angle are set as the camera adjustment angles.
[0120] Specifically, the calculation module 703 is further configured to:
[0121] Calculating, based on the first coordinate value and the second coordinate value of the hook at each test position and the test horizontal adjustment angle of the hook at each test position, the coordinate value of the camera on the first coordinate axis, the coordinate value of the camera on the second coordinate axis, and the initial horizontal shooting angle of the camera relative to the first coordinate axis;
[0122] Calculating the coordinate value of the camera on the third coordinate axis and the initial pitch shooting angle of the camera relative to the third coordinate axis based on the first coordinate value and the third coordinate value of the hook at each test position and the test pitch adjustment angle of the hook at each test position;
[0123] Setting the coordinate value of the camera on the first coordinate axis, the coordinate value of the camera on the second coordinate axis, and the coordinate value of the camera on the third coordinate axis as the initial installation position of the camera relative to the tower crane;
[0124] The initial horizontal shooting angle and the initial pitch shooting angle are set as the initial shooting angles.
[0125] Furthermore, the device further comprises:
[0126] Sort the first coordinate values of the hooks at the respective test positions in ascending order to obtain a test position sorting result;
[0127] Calculating the test distance from the camera to each test position in sequence according to the test position sorting result to obtain a test distance sorting result;
[0128] Determine whether the test distances in the test distance sorting result are successively larger. If so, determine that the installation area of the camera is the root area of the tower crane boom. If not, determine that the installation area of the camera is the tip area of the tower crane boom.
[0129] Furthermore, the device further comprises:
[0130] During use of the tower crane, when it is detected that the hook moves from an initial position to a final position, obtaining the initial position coordinates of the initial position and the final position coordinates of the final position;
[0131] Calculating a horizontal angle to be adjusted and a pitch angle to be adjusted of the camera according to the initial position coordinates, the final position coordinates, the initial installation position, the initial shooting angle, and the installation area;
[0132] The shooting angle of the camera is adjusted according to the horizontal angle to be adjusted and the pitch angle to be adjusted so that the hook appears at the center of the shooting picture of the camera.
[0133] Example 3
[0134] This embodiment also provides a computer device, such as a smart phone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server or cabinet server (including an independent server or a server cluster composed of multiple servers) that can execute programs. Figure 8 As shown, the computer device 80 of this embodiment includes at least but not limited to: a memory 801 and a processor 802 that can be interconnected via a system bus. It should be noted that Figure 8 Only computer device 80 is shown having components 801 - 802 , but it should be understood that implementing all of the illustrated components is not a requirement, and greater or fewer components may alternatively be implemented.
[0135] In this embodiment, the memory 801 (i.e., storage medium) includes flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, a magnetic disk, an optical disk, etc. In some embodiments, the memory 801 may be an internal storage unit of the computer device 80, such as the hard disk or memory of the computer device 80. In other embodiments, the memory 801 may also be an external storage device of the computer device 80, such as a plug-in hard disk equipped on the computer device 80, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Of course, the memory 801 may also include both the internal storage unit of the computer device 80 and its external storage devices. In this embodiment, the memory 801 is generally used to store the operating system and various application software installed on the computer device 80. In addition, the memory 801 may also be used to temporarily store various types of data that have been output or are about to be output.
[0136] In some embodiments, the processor 802 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other chip for determining the position of the camera. The processor 802 is generally used to control the overall operation of the computer device 80.
[0137] Specifically, in this embodiment, the processor 802 is configured to execute a program of a method for determining a camera position stored in the memory 801. When the program of the method for determining a camera position is executed, the following steps are implemented:
[0138] Obtaining the hook position coordinates of the tower crane hook at a test position; wherein the number of the test positions is greater than or equal to three;
[0139] Obtaining a camera adjustment angle used when the camera photographs the hook at the test position; wherein the camera is used to photograph the operating status of the hook;
[0140] An initial installation position of the camera relative to the tower crane and an initial shooting angle of the camera relative to the tower crane are calculated according to the hook position coordinates and the camera adjustment angle.
[0141] The specific implementation process of the above method steps can be found in Example 1, and this embodiment will not be repeated here.
[0142] Example 4
[0143] This embodiment further provides a computer storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App store, etc., on which a computer program is stored. When the computer program is executed by a processor, the following method steps are implemented:
[0144] Obtaining the hook position coordinates of the tower crane hook at a test position; wherein the number of the test positions is greater than or equal to three;
[0145] Obtaining a camera adjustment angle used when the camera photographs the hook at the test position; wherein the camera is used to photograph the operating status of the hook;
[0146] An initial installation position of the camera relative to the tower crane and an initial shooting angle of the camera relative to the tower crane are calculated according to the hook position coordinates and the camera adjustment angle.
[0147] The specific implementation process of the above method steps can be found in Example 1, and this embodiment will not be repeated here.
[0148] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0149] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0150] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method.
[0151] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for determining a camera position, characterized in that: The method comprises: Obtaining the hook position coordinates of the tower crane hook at a test position; wherein the number of the test positions is greater than or equal to three; Obtaining a camera adjustment angle used when the camera photographs the hook at the test position; wherein the camera is used to photograph the operating status of the hook, and the camera adjustment angle includes a test horizontal adjustment angle and a test pitch adjustment angle, wherein the test horizontal adjustment angle represents the camera's horizontal movement angle, and the test pitch adjustment angle represents the camera's vertical movement angle; Calculating an initial installation position of the camera relative to the tower crane and an initial shooting angle of the camera relative to the tower crane according to the hook position coordinates and the camera adjustment angle; The obtaining of the hook position coordinates of the tower crane hook at the test position includes: The intersection of the tower crane boom and the tower crane body is set as the origin, the direction along the tower crane boom and away from the origin is set as the first coordinate axis, the direction perpendicular to the first coordinate axis on the horizontal plane is set as the second coordinate axis, and the direction of the tower body is set as the third coordinate axis to establish a three-dimensional space coordinate system; respectively determining the hook position coordinates of the hook at each test position in the three-dimensional space coordinate system; The hook position coordinates include: a first coordinate value for a first coordinate axis, a second coordinate value for a second coordinate axis, and a third coordinate value for a third coordinate axis, and the second coordinate value in each hook position coordinate is 0, and the third coordinate value in each hook position coordinate is the same; The calculating, based on the hook position coordinates and the camera adjustment angle, an initial installation position of the camera relative to the tower crane and an initial shooting angle of the camera relative to the tower crane comprises: Calculating, based on the first coordinate value and the second coordinate value of the hook at each test position and the test horizontal adjustment angle of the hook at each test position, the coordinate value of the camera on the first coordinate axis, the coordinate value of the camera on the second coordinate axis, and the initial horizontal shooting angle of the camera relative to the first coordinate axis; Calculating the coordinate value of the camera on the third coordinate axis and the initial pitch shooting angle of the camera relative to the third coordinate axis based on the first coordinate value and the third coordinate value of the hook at each test position and the test pitch adjustment angle of the hook at each test position; Setting the coordinate value of the camera on the first coordinate axis, the coordinate value of the camera on the second coordinate axis, and the coordinate value of the camera on the third coordinate axis as the initial installation position of the camera relative to the tower crane; The initial horizontal shooting angle and the initial pitch shooting angle are set as the initial shooting angles.
2. The method for determining the camera position according to claim 1, wherein: The obtaining of a camera adjustment angle used when the camera shoots the hook at the test position includes: Acquiring a test horizontal adjustment angle and a test pitch adjustment angle used when the camera is adjusted from the initial shooting angle to a test shooting angle; wherein, when the camera is adjusted to the test shooting angle, the hook located at the test position appears at the center of the camera's shooting image; The test horizontal adjustment angle and the test pitch adjustment angle are set as the camera adjustment angles.
3. The method for determining the camera position according to claim 1, wherein: After calculating the initial installation position of the camera relative to the tower crane and the initial shooting angle of the camera relative to the tower crane, the method further includes: Sort the first coordinate values of the hooks at the respective test positions in ascending order to obtain a test position sorting result; Calculating the test distance from the camera to each test position in sequence according to the test position sorting result to obtain a test distance sorting result; Determine whether the test distances in the test distance sorting result are successively larger. If so, determine that the installation area of the camera is the root area of the tower crane boom. If not, determine that the installation area of the camera is the tip area of the tower crane boom.
4. The method for determining the camera position according to claim 3, wherein: After calculating the initial installation position of the camera relative to the tower crane and the initial shooting angle of the camera relative to the tower crane, the method further includes: During use of the tower crane, when it is detected that the hook moves from an initial position to a final position, obtaining the initial position coordinates of the initial position and the final position coordinates of the final position; Calculating a horizontal angle to be adjusted and a pitch angle to be adjusted of the camera according to the initial position coordinates, the final position coordinates, the initial installation position, the initial shooting angle, and the installation area; The shooting angle of the camera is adjusted according to the horizontal angle to be adjusted and the pitch angle to be adjusted so that the hook appears at the center of the shooting picture of the camera.
5. A device for determining a camera position, characterized in that: The device comprises: An acquisition module, configured to acquire the hook position coordinates of a tower crane hook at a test position; wherein the number of the test positions is greater than or equal to three; an angle module, configured to obtain a camera adjustment angle used when the camera photographs the hook at the test position; wherein the camera is used to photograph the operating status of the hook, and the camera adjustment angle includes a test horizontal adjustment angle and a test pitch adjustment angle, wherein the test horizontal adjustment angle represents the camera's horizontal movement angle, and the test pitch adjustment angle represents the camera's vertical movement angle; a calculation module, configured to calculate an initial installation position of the camera relative to the tower crane and an initial shooting angle of the camera relative to the tower crane according to the hook position coordinates and the camera adjustment angle; The acquisition module is specifically used for: The intersection of the tower crane boom and the tower crane body is set as the origin, the direction along the tower crane boom and away from the origin is set as the first coordinate axis, the direction perpendicular to the first coordinate axis on the horizontal plane is set as the second coordinate axis, and the direction of the tower body is set as the third coordinate axis to establish a three-dimensional space coordinate system; respectively determining the hook position coordinates of the hook at each test position in the three-dimensional space coordinate system; The hook position coordinates include: a first coordinate value for a first coordinate axis, a second coordinate value for a second coordinate axis, and a third coordinate value for a third coordinate axis, and the second coordinate value in each hook position coordinate is 0, and the third coordinate value in each hook position coordinate is the same; The calculation module is specifically used for: Calculating, based on the first coordinate value and the second coordinate value of the hook at each test position and the test horizontal adjustment angle of the hook at each test position, the coordinate value of the camera on the first coordinate axis, the coordinate value of the camera on the second coordinate axis, and the initial horizontal shooting angle of the camera relative to the first coordinate axis; Calculating the coordinate value of the camera on the third coordinate axis and the initial pitch shooting angle of the camera relative to the third coordinate axis based on the first coordinate value and the third coordinate value of the hook at each test position and the test pitch adjustment angle of the hook at each test position; Setting the coordinate value of the camera on the first coordinate axis, the coordinate value of the camera on the second coordinate axis, and the coordinate value of the camera on the third coordinate axis as the initial installation position of the camera relative to the tower crane; The initial horizontal shooting angle and the initial pitch shooting angle are set as the initial shooting angles.
6. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 4 when executing the computer program.
7. A computer 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 4 are implemented.
Citation Information
Patent Citations
A spatial positioning method of tower crane based on machine vision
CN109215081A
Crane work monitoring device
JP2013193825A