Method and system for drawing camera shooting area, electronic device and storage medium
By calibrating the camera's installation orientation and tilt angle, and calculating the monitoring range based on the installation height, the problem of the camera's inability to capture panoramic views was solved, enabling comprehensive monitoring of the sea area and the generation of intuitive schematic diagrams, thus improving efficiency.
Patent Information
- Application Number
- CN202410069047.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-17
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2044-01-17
AI Technical Summary
In existing technologies, the camera is installed in a fixed position, which makes it impossible to capture and monitor a wide sea area. Furthermore, there is a lack of intuitive methods for generating maps of the sea area captured by the camera, which causes inconvenience to users.
By acquiring the camera's installation orientation and pitch angle, calibration is performed to determine the camera's actual shooting orientation and pitch angle. The monitoring range is calculated in conjunction with the installation height, and a fan-shaped shooting area is drawn on the electronic nautical chart.
It enables comprehensive imaging and monitoring of vast sea areas, generating intuitive sea area maps and improving user work efficiency.
Smart Images

Figure CN117593414B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of image processing and computer vision, and in particular, to a method for drawing a camera shooting area, a system for drawing a camera shooting area, an electronic device and a storage medium. BACKGROUND
[0002] At present, the existing technical solutions mostly use fixed camera installation positions, so they cannot comprehensively shoot and monitor vast sea areas. In addition, only target azimuth is applied in drawing a camera shooting area diagram, so when the camera is controlled to rotate by a gimbal, there is no intuitive method for generating a camera shooting sea area diagram, which brings inconvenience to users. SUMMARY
[0003] The present application aims to at least solve one of the problems in the prior art or related art.
[0004] To this end, a first aspect of the present application provides a method for drawing a camera shooting area.
[0005] A second aspect of the present application provides a system for drawing a camera shooting area.
[0006] A third aspect of the present application provides an electronic device.
[0007] A fourth aspect of the present application provides a storage medium.
[0008] Therefore, according to a first aspect of the present application, a method for drawing a camera shooting area is provided, which comprises: obtaining first azimuth information and a first pitch angle of a camera; calibrating the first azimuth information to obtain second azimuth information according to installation azimuth information of the camera; calibrating the first pitch angle to obtain a second pitch angle according to a pitch angle error value of the camera; determining a monitoring range of the camera according to the second pitch angle and an installation height of the camera; and drawing a camera shooting area according to the monitoring range of the camera and the second azimuth information.
[0009] The application provides a method for drawing a camera shooting area, which specifically comprises the following steps: first, obtaining first orientation information and a first tilt angle of the camera. The first orientation information refers to the orientation of the camera, and the first tilt angle refers to the included angle of the camera in the horizontal direction. Specifically, the first orientation information and the first tilt angle of the camera can be obtained through a holder under the camera, and specifically, the PTZ (P represents the orientation of the camera; T represents the tilt angle of the camera; and Z represents the focal length of the camera lens) value controlled by the holder can be used to obtain the first orientation information and the first tilt angle. Further, since the first orientation information and the first tilt angle are directly obtained through the holder, the first orientation information and the first tilt angle do not represent the real orientation information and tilt angle of the camera, wherein the camera installation position is not horizontal due to installation errors, environmental factors and the like, and there is a tilt angle, thereby causing the shooting angle deviation of the camera, and therefore, the first orientation information and the first tilt angle need to be calibrated. Specifically, the first orientation information is calibrated according to the installation orientation information of the camera to obtain second orientation information, and the first tilt angle is calibrated according to the tilt angle error value of the camera to obtain a second tilt angle. That is, first, the installation orientation information of the camera is obtained, wherein the installation orientation information of the camera can be directly obtained through the camera. Then, the first orientation information is calibrated according to the installation orientation information to obtain the second orientation information, that is, the actual shooting orientation of the camera is obtained by adding the installation orientation information and the first orientation information. Then, the tilt angle error value of the camera is obtained, and the second tilt angle is obtained by calibrating the first tilt angle according to the tilt angle error value. Specifically, the tilt angle error value and the first tilt angle are added to obtain the second tilt angle. Further, the monitoring range of the camera is determined according to the second tilt angle and the installation height of the camera, wherein the monitoring range of the camera refers to the horizontal distance between the shooting sea area of the camera and the installation position of the camera, and specifically, the second tilt angle and the installation height can be used to calculate the monitoring range of the camera by using a trigonometric function. Further, after the monitoring range of the camera is determined, the actual orientation of the camera, that is, the second orientation information and the monitoring range are used to draw a sector shooting area on an electronic chart with the installation position of the camera as the center, the second orientation information as the orientation and the monitoring range as the radius, thereby realizing the drawing of the camera shooting area. The method can realize the comprehensive shooting and monitoring of a wide sea area, generate an intuitive sea area schematic diagram, and help users to view the shooting position and shooting range of the current camera in combination with a map, thereby improving the work efficiency of the users.
[0010] The method for drawing a camera shooting area according to the application can have the following technical features.
[0011] In some embodiments, before the step of calibrating the first pitch angle according to the pitch angle error value of the camera to obtain the second pitch angle, the method of drawing the camera shooting area further comprises: obtaining third pitch angles of the camera under a plurality of third orientation information; and determining the pitch angle error value of the camera according to the plurality of third pitch angles.
[0012] In this embodiment, before the step of calibrating the first pitch angle according to the pitch angle error value of the camera to obtain the second pitch angle, the method comprises: firstly setting that there is a linear relationship between the orientation information of the camera and the pitch angle of the camera. Then, third pitch angles of the camera under a plurality of different orientation information are obtained, that is, the orientation of the camera is adjusted multiple times, and then the pitch angles under different orientations are obtained respectively, and then the plurality of different pitch angles are compared. If the pitch angles are the same, it means that there is no error value. If the pitch angles are different, the difference between the plurality of pitch angles is determined, and then the difference and the plurality of different orientation information are calculated to obtain the final pitch angle error value of the camera.
[0013] In some embodiments, the step of drawing the camera shooting area according to the monitoring range of the camera and the second orientation information comprises: obtaining the latitude and longitude coordinates of the camera and the visual angle of the camera; and drawing the camera shooting area on the electronic chart according to the latitude and longitude coordinates, the visual angle, the second orientation information, and the monitoring range.
[0014] In this embodiment, the step of drawing the camera shooting area according to the monitoring range of the camera and the second orientation information comprises: since the camera shooting area needs to be drawn on the electronic chart, the position of the camera and the maximum angle range that can be shot by the camera need to be determined. Therefore, the latitude and longitude coordinates of the camera and the visual angle of the camera, i.e. the angle that can be shot by the camera, are obtained. Then, the installation position of the camera is determined on the electronic chart according to the latitude and longitude coordinates of the camera, and then the fan-shaped shooting area is drawn on the electronic chart according to the installation position, the visual angle, the second orientation information, and the monitoring range, thereby realizing the drawing of the camera shooting area.
[0015] In some embodiments, the step of drawing the camera shooting area according to the latitude and longitude coordinates, the visual angle, the second orientation information, and the monitoring range on the electronic chart comprises: determining the center of the camera shooting area according to the latitude and longitude coordinates and the electronic chart; determining the central angle of the camera shooting area according to the visual angle and the second orientation information; determining the radius of the camera shooting area according to the monitoring range; and drawing the camera shooting area according to the center, the central angle, and the radius.
[0016] In the technical solution, the step of drawing the camera shooting area on the electronic chart according to the latitude and longitude coordinates, the visual angle, the second azimuth information and the monitoring range comprises: it can be understood that the camera shooting area is a sector-shaped shooting area, so only the central angle, the center and the radius of the sector need to be determined to draw the camera shooting area on the electronic chart. Therefore, first, the installation position of the camera is determined on the electronic chart according to the latitude and longitude coordinates of the camera, and the installation position is taken as the center of the camera shooting area, then the central angle of the camera shooting area is determined according to the visual angle and the second azimuth information, since the second azimuth information represents the direction of the camera, the central angle of the camera shooting area can be obtained by combining the second azimuth information with the visual angle. Further, the radius of the camera shooting area is determined according to the monitoring range, since the monitoring range refers to the horizontal distance between the camera shooting sea area and the installation position of the camera, so the monitoring range can be directly taken as the radius of the camera shooting area. Finally, the sector is drawn on the electronic chart according to the obtained center, central angle and radius, so the camera shooting area is obtained, and the drawing of the camera shooting area is realized.
[0017] According to a second aspect of the present application, a system for drawing a camera shooting area is provided, comprising: a first acquisition module, the first acquisition module is configured to acquire first azimuth information and a first pitch angle of a camera; a first calibration module, the first calibration module is configured to calibrate the first azimuth information to obtain second azimuth information according to installation azimuth information of the camera; a second calibration module, the second calibration module is configured to calibrate the first pitch angle to obtain a second pitch angle according to a pitch angle error value of the camera; a first determination module, the first determination module is configured to determine a monitoring range of the camera according to the second pitch angle and an installation height of the camera; and a first drawing module, the first drawing module is configured to draw the camera shooting area according to the monitoring range and the second azimuth information.
[0018] The system for drawing the camera shooting area provided by the application mainly comprises a first acquisition module, a first calibration module, a second calibration module, a first determination module and a first drawing module. The first acquisition module acquires the first orientation information and the first pitch angle of the camera. The orientation information refers to the orientation of the camera, and the pitch angle refers to the included angle of the camera in the horizontal direction. Specifically, the first orientation information and the first pitch angle of the camera can be acquired through the holder under the camera. Specifically, the PTZ (P represents the orientation of the camera; T represents the pitch angle of the camera; and Z represents the focal length of the camera lens) value controlled by the holder can be used to obtain the first orientation information and the first pitch angle. Further, since the first orientation information and the first pitch angle are directly acquired through the holder, the first orientation information and the first pitch angle do not represent the real shooting orientation information and the pitch angle of the camera. The camera installation position may not be horizontal due to installation errors, environmental factors and the like, so that the shooting angle of the camera is deviated, and therefore the first orientation information and the first pitch angle need to be calibrated. Specifically, the first calibration module calibrates the first orientation information according to the installation orientation information of the camera to obtain the second orientation information, and the second calibration module calibrates the first pitch angle according to the pitch angle error value of the camera to obtain the second pitch angle. That is, the installation orientation information of the camera is first acquired, and the installation orientation information of the camera can be directly acquired through the camera. Then, the first orientation information is calibrated according to the installation orientation information to obtain the second orientation information, that is, the actual shooting orientation of the camera is obtained by adding the installation orientation information and the first orientation information. Then, the pitch angle error value of the camera is acquired, and the first pitch angle is calibrated according to the pitch angle error value to obtain the second pitch angle. Specifically, the pitch angle error value and the first pitch angle are added to obtain the second pitch angle. Further, the first determination module determines the monitoring range of the camera according to the second pitch angle and the installation height of the camera. The monitoring range of the camera refers to the horizontal distance between the shooting sea area of the camera and the installation position of the camera. Specifically, the second pitch angle and the installation height can be used to calculate the monitoring range of the camera by using the trigonometric function. Further, after the monitoring range of the camera is determined, the first drawing module draws a sector shooting area on the electronic sea chart with the installation position of the camera as the center, with the second orientation information as the orientation, and with the monitoring range as the radius, according to the actual orientation of the camera, that is, the second orientation information and the monitoring range, so as to realize the drawing of the camera shooting area. The wide sea area can be fully shot and monitored, and an intuitive sea area schematic diagram is generated to help the user to view the position and the shooting range of the current camera shooting in combination with the map, and the working efficiency of the user is improved.
[0019] In some embodiments, the second obtaining module is further configured to obtain third pitch angles of the camera under a plurality of third azimuth information; and the second determining module is configured to determine the pitch angle error value of the camera according to the plurality of third pitch angles.
[0020] In this embodiment, the second obtaining module and the second determining module are further included. Firstly, a linear relationship between the azimuth information of the camera and the pitch angle of the camera is set. Then the second obtaining module obtains third pitch angles of the camera under a plurality of different azimuth information, i.e. the orientation of the camera is adjusted multiple times, and then the pitch angles under different orientations are obtained respectively, and then the plurality of different pitch angles are compared. If the pitch angles are the same, it means that there is no error value. If the pitch angles are different, the difference between the plurality of pitch angles is determined. Then the second determining module calculates according to the difference and the plurality of different azimuth information, so as to obtain the final pitch angle error value of the camera.
[0021] In some embodiments, the first drawing module comprises a third obtaining module configured to obtain the longitude and latitude coordinates of the camera and the visual angle of the camera; and a second drawing module configured to draw the camera shooting area on the electronic chart according to the longitude and latitude coordinates, the visual angle, the second azimuth information and the monitoring range.
[0022] In this embodiment, the first drawing module comprises the third obtaining module and the second drawing module. Since the camera shooting area needs to be drawn on the electronic chart, the position of the camera and the maximum angle range that can be shot by the camera need to be determined. Therefore, the third obtaining module obtains the longitude and latitude coordinates of the camera and the visual angle of the camera, i.e. the angle that can be shot by the camera. Then the second drawing module determines the installation position of the camera on the electronic chart according to the longitude and latitude coordinates of the camera, and then draws a fan-shaped shooting area on the electronic chart with the installation position as the center, the visual angle as the included angle, the second azimuth information as the orientation and the monitoring range as the radius.
[0023] In some embodiments, the second drawing module comprises a third determining module configured to determine the center of the camera shooting area according to the longitude and latitude coordinates and the electronic chart; a fourth determining module configured to determine the central angle of the camera shooting area according to the visual angle and the second azimuth information; a fifth determining module configured to determine the radius of the camera shooting area according to the monitoring range; and a third drawing module configured to draw the camera shooting area according to the center, the central angle and the radius.
[0024] In the technical solution, the second drawing module comprises a third determining module, a fourth determining module, a fifth determining module and a third drawing module. It can be understood that the camera shooting area is a sector-shaped shooting area, so that only the central angle of the sector, the center and the radius need to be determined to draw the camera shooting area on the electronic chart. Therefore, the third determining module determines the installation position of the camera on the electronic chart according to the latitude and longitude coordinates of the camera, and takes the installation position as the center of the camera shooting area, and then the fourth determining module determines the central angle of the camera shooting area according to the visual angle and the second azimuth information. Since the second azimuth information represents the direction of the camera, the central angle of the camera shooting area can be obtained by combining the second azimuth information with the visual angle. Further, the fifth determining module determines the radius of the camera shooting area according to the monitoring range. Since the monitoring range refers to the horizontal distance between the camera shooting sea area and the camera installation position, the monitoring range can be directly taken as the radius of the camera shooting area. Finally, the third drawing module draws a sector on the electronic chart according to the obtained center, central angle and radius, so as to obtain the camera shooting area, thereby realizing the drawing of the camera shooting area.
[0025] According to a third aspect of the present application, an electronic device is provided, 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 for drawing the camera shooting area according to any one of the above aspects when executing the computer program.
[0026] The electronic device provided by the present application can implement the technical effects of any one of the above technical solutions, and the steps of the method for drawing the camera shooting area are implemented when the processor executes the computer program, and thus the technical effects of any one of the above technical solutions are achieved, which will not be described here.
[0027] According to a fourth aspect of the present application, a storage medium is provided, which stores a computer program, and the computer program is executable on a processor to implement the steps of the method for drawing the camera shooting area according to any one of the above aspects.
[0028] The storage medium provided by the present application can implement the technical effects of any one of the above technical solutions, and the steps of the method for drawing the camera shooting area are implemented when the computer program is executed on the processor, and thus the technical effects of any one of the above technical solutions are achieved, which will not be described here.
[0029] Additional aspects and advantages of the present application will become apparent from the following description, or will be appreciated by those skilled in the art upon examination of the following description or will be learned from practice of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0030] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the following description, taken in conjunction with the accompanying drawings in which:
[0031] Figure 1One of flow charts of a method of mapping a camera shooting area of one embodiment of the present application is shown.
[0032] Figure 2 A camera horizontal monitoring range diagram of one embodiment of the present application is shown.
[0033] Figure 3 One of flow charts of a method of mapping a camera shooting area of one embodiment of the present application is shown.
[0034] Figure 4 One of flow charts of a method of mapping a camera shooting area of one embodiment of the present application is shown.
[0035] Figure 5 One of flow charts of a method of mapping a camera shooting area of one embodiment of the present application is shown.
[0036] Figure 6 One of flow charts of a method of mapping a camera shooting area of one embodiment of the present application is shown.
[0037] Figure 7 One of schematic block diagrams of a system of mapping a camera shooting area of one embodiment of the present application is shown.
[0038] Figure 8 One of schematic block diagrams of a system of mapping a camera shooting area of one embodiment of the present application is shown.
[0039] Figure 9 One of schematic block diagrams of a first mapping module of one embodiment of the present application is shown.
[0040] Figure 10 One of schematic block diagrams of a second mapping module of one embodiment of the present application is shown.
[0041] Figure 11 One of schematic block diagrams of an electronic device of one embodiment of the present application is shown. DETAILED DESCRIPTION
[0042] In order to more clearly understand the above-mentioned objects, features and advantages of the present application, the following further specifically describes the present application with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0043] In the following description, a lot of specific details are set forth in order to facilitate a full understanding of the present application, however, the present application can also be implemented in other ways different from those described herein, and therefore, the scope of protection of the present application is not limited to the specific embodiments disclosed below.
[0044] Figure 1 One of the flowcharts of the method of mapping the camera shooting area of one embodiment of the present application is shown. The method comprises the following steps:
[0045] Step 102: Obtain the first azimuth information and the first pitch angle of the camera;
[0046] Step 104: Calibrate the first azimuth information according to the installation azimuth information of the camera to obtain the second azimuth information;
[0047] Step 106: Calibrate the first pitch angle according to the pitch angle error value of the camera to obtain the second pitch angle;
[0048] Step 108: Determine the monitoring range of the camera according to the second pitch angle and the installation height of the camera;
[0049] Step 110: Map the camera shooting area according to the monitoring range of the camera and the second azimuth information.
[0050] The application provides a method for drawing a camera shooting area, which specifically comprises the following steps: first, obtaining first orientation information and a first tilt angle of the camera. The orientation information refers to the orientation of the camera, and the tilt angle refers to the included angle of the camera in the horizontal direction. Specifically, the first orientation information and the first tilt angle of the camera can be obtained through a holder under the camera, and specifically, the PTZ (P represents the orientation of the camera; T represents the tilt angle of the camera; and Z represents the focal length of the camera lens) value controlled by the holder can be obtained. Further, since the first orientation information and the first tilt angle are directly obtained through the holder, the first orientation information and the first tilt angle do not represent the real shooting orientation information and tilt angle of the camera. The camera installation position may not be horizontal due to installation errors, environmental factors and the like, and there is a tilt angle, thereby causing the shooting angle deviation of the camera, so it is necessary to standardize the first orientation information and the first tilt angle. Specifically, the first orientation information is calibrated according to the installation orientation information of the camera to obtain second orientation information, and the first tilt angle is calibrated according to the tilt angle error value of the camera to obtain second tilt angle. That is, first, the installation orientation information of the camera is obtained, and the installation orientation information of the camera can be directly obtained through the camera. Then, the first orientation information is calibrated according to the installation orientation information to obtain the second orientation information, that is, the installation orientation information and the first orientation information are added to obtain the actual shooting orientation of the camera. Then, the tilt angle error value of the camera is obtained, and the first tilt angle is calibrated according to the tilt angle error value to obtain the second tilt angle. Specifically, the tilt angle error value and the first tilt angle can be added to obtain the second tilt angle. Exemplarily, when the P value (P is the orientation angle) in the PTZ returned by the current camera shooting sea area is P, that is, the first orientation information is P, and the installation orientation is P0, then at this moment, the orientation angle from the camera installation point to the sea area is P1=P0+P, that is, the second orientation information is P1. Similarly, when the current orientation camera tilt angle is T, and the tilt angle error value is T0, the tilt angle from the camera installation point to the sea area is T1=T0+T, that is, the second tilt angle is T1.
[0051] Further, the monitoring range of the camera is determined according to the second pitch angle and the installation height of the camera, wherein the monitoring range of the camera refers to the horizontal distance between the camera and the installation position of the camera, and the monitoring range of the camera can be calculated by using the second pitch angle and the installation height and a trigonometric function. Further, after the monitoring range of the camera is determined, the actual orientation of the camera, i.e., the second azimuth information, and the monitoring range are used to draw a fan-shaped shooting area on the electronic sea chart, with the installation position of the camera as the center, the second azimuth information as the orientation, and the monitoring range as the radius, thereby realizing the drawing of the shooting area of the camera. The wide sea area is comprehensively shot and monitored, and an intuitive sea area schematic diagram is generated, which helps the user to view the position and shooting range of the current camera shot in combination with the map, and improves the work efficiency of the user.
[0052] Further, before the first azimuth information and the first pitch angle of the camera are acquired, the installation and calibration of the camera and the control of the pan-tilt head of the camera need to be performed. Specifically, first, the selection of the camera is performed, and the camera needs to have the function of pan-tilt head control, support rotation in all directions, and rotation up and down and left and right. The camera with the function of pan-tilt head control can be controlled in the system, and the device control console can output the PTZ value of the camera through the interface (remark: P represents the azimuth of the camera; T represents the pitch angle of the camera; Z represents the focal length of the camera lens). Further, the installation position of the camera is selected, and since the use scene is the supervision of ships on the sea, the monitoring sea area is relatively wide, and therefore the installation position of the camera is selected at a place without obstruction, open, and as high as possible to avoid strong wind and waves. For example, the top of a port building, the top of a communication tower, and other high points are selected and powered and networked to provide remote control of the camera to send instructions.
[0053] Further, the installation and calibration of the camera are performed, the installation position is determined, the camera is installed according to the selected position, and the stability and accuracy of the installation are ensured. Finally, the calibration operation is performed, including adjusting the horizontal angle, the vertical angle, and the focal length of the camera, and the like, to ensure the accuracy and clarity of the shooting picture. The installation height of the camera and the horizontal angle of the camera when shooting in each direction are measured and recorded. Finally, the PTZ of the camera is controlled by using the pan-tilt head of the camera, and the PTZ data is acquired. Specifically, the PTZ control unit can freely control the shooting range and the shooting direction of the camera by using the up, down, left, and right pan-tilt head control buttons in the system, and control the rotation and pitch movement of the camera. At the same time, the PTZ control unit uploads the PTZ value of the camera and the information related to the azimuth of the camera to the front-end webGIs platform, including the rotation angle, the pitch angle, the zoom, and the like. At the same time, the information related to the azimuth of the camera is acquired, such as the height, the azimuth angle, the pitch angle, and the longitude and latitude coordinates of the camera.
[0054] Figure 2A camera horizontal monitoring range diagram of one embodiment of the present application is shown. As shown in Figure 2 When the monitoring range of the camera is determined according to the second tilt angle and the installation height of the camera, the horizontal monitoring range of the camera, i.e. the horizontal monitoring ranges L1 and L2 of the camera to sea area B and sea area C, can be calculated by means of trigonometric functions, and the formula is:
[0055] L1=H×tan(90°-T1); L2=H×tan(90°-T2).
[0056] Wherein, H is the height of the camera from the water surface, i.e. the installation height of the camera, L1 is the horizontal monitoring range of the camera to sea area B, T1 is the tilt angle of the camera when shooting sea area B, the value range of T1 is 0~90°, because after exceeding 90°, the camera shoots the sky, and it is meaningless to draw the azimuth line, L2 is the horizontal monitoring range of the camera to sea area C, and T2 is the tilt angle of the camera when shooting sea area C.
[0057] Figure 3 A flowchart of a method for drawing a camera shooting area of one embodiment of the present application is shown. Before the step of calibrating the first tilt angle to obtain the second tilt angle according to the tilt angle error value of the camera, it comprises:
[0058] Step 302: obtaining a third tilt angle of the camera under a plurality of third azimuth information;
[0059] Step 304: determining the tilt angle error value of the camera according to a plurality of third tilt angles.
[0060] In this embodiment, the step of obtaining the tilt angle error value of the camera comprises: firstly, setting that there is a linear relationship between the azimuth information of the camera and the tilt angle of the camera. Then, obtaining the third tilt angle of the camera under a plurality of different azimuth information, i.e. adjusting the direction of the camera multiple times, then obtaining the tilt angle under different directions respectively, and then comparing a plurality of different tilt angles, if the tilt angles are the same, it means that there is no error value, if the tilt angles are different, then determining the difference between a plurality of tilt angles, and then calculating according to the difference and a plurality of different azimuth information, so as to obtain the final tilt angle error value of the camera.
[0061] Exemplarily, the step of calculating the tilt angle of the camera at any azimuth is: assuming that there is a linear relationship between the azimuth and the tilt angle. Given that the tilt angle of a flat plate is T at azimuth angle A, and the tilt angle T1 of the object on the flat plate when rotating to any azimuth angle A1, the calculation process is as follows:
[0062] That is: T1=abs(C)×T / 180°; C=180°-A;
[0063] Wherein, abs(C) represents the absolute value of the angle between the camera rotation direction and the measurement reference direction.
[0064] Figure 4 Fig. 3 shows a flowchart of a method for drawing a camera shooting area according to an embodiment of the present application; wherein the step of drawing the camera shooting area according to the camera monitoring range and the second direction information comprises:
[0065] Step 402: Obtain the latitude and longitude coordinates of the camera and the visual angle of the camera;
[0066] Step 404: Draw the camera shooting area on the electronic chart according to the latitude and longitude coordinates, the visual angle, the second direction information and the monitoring range.
[0067] In this embodiment, the step of drawing the camera shooting area according to the camera monitoring range and the second direction information comprises: the shooting area of the camera is related to the position of the camera and the maximum angle range that can be shot by the camera, so the latitude and longitude coordinates of the camera and the visual angle of the camera, i.e. the angle that can be shot by the camera, are obtained. Then the installation position of the camera is determined on the electronic chart according to the latitude and longitude coordinates of the camera, and then a fan-shaped shooting area is drawn on the electronic chart according to the installation position, the visual angle, the second direction information and the monitoring range, so as to realize the drawing of the camera shooting area.
[0068] Figure 5 Fig. 4 shows a flowchart of a method for drawing a camera shooting area according to an embodiment of the present application; wherein the step of drawing the camera shooting area according to the latitude and longitude coordinates, the visual angle, the second direction information and the monitoring range on the electronic chart comprises:
[0069] Step 502: Determine the center of the camera shooting area according to the latitude and longitude coordinates and the electronic chart;
[0070] Step 504: Determine the central angle of the camera shooting area according to the visual angle and the second direction information;
[0071] Step 506: Determine the radius of the camera shooting area according to the monitoring range;
[0072] Step 508: Draw the camera shooting area according to the center, the central angle and the radius.
[0073] In this embodiment, the step of drawing the camera shooting area on the electronic chart according to the latitude and longitude coordinates, the visual angle, the second azimuth information and the monitoring range comprises: it can be understood that the camera shooting area is a sector-shaped shooting area, so only the central angle, the center and the radius of the sector need to be determined to draw the camera shooting area on the electronic chart. Therefore, first, the installation position of the camera is determined on the electronic chart according to the latitude and longitude coordinates of the camera, and the installation position is taken as the center of the camera shooting area, then the central angle of the camera shooting area is determined according to the visual angle and the second azimuth information, since the second azimuth information represents the direction of the camera, the central angle of the camera shooting area can be obtained by combining the second azimuth information with the visual angle. Further, the radius of the camera shooting area is determined according to the monitoring range, since the monitoring range refers to the horizontal distance between the camera shooting sea area and the installation position of the camera, so the monitoring range can be directly taken as the radius of the camera shooting area. Finally, the sector is drawn on the electronic chart according to the obtained center, central angle and radius, so that the camera shooting area is obtained, and the drawing of the camera shooting area is realized.
[0074] Figure 6 Fig. 5 shows a flowchart of the method for drawing the camera shooting area according to an embodiment of the present application; wherein the method for drawing the camera shooting area comprises:
[0075] Step 602: turn on the camera;
[0076] Step 604: acquire the PTZ value of the camera through the device interface;
[0077] Step 606: calculate the installation azimuth and pitch angle error value of the camera;
[0078] Step 608: merge the installation point position of the camera and the real pitch angle of the camera to the shooting water area;
[0079] Step 610: calculate the horizontal monitoring range of the camera through the real pitch angle and the installation height of the camera;
[0080] Step 612: draw a sector-shaped shooting area on the electronic chart with the installation point position as the center through the azimuth, the horizontal monitoring range and the visual angle of the camera.
[0081] In this embodiment, the camera needs to be first turned on, and after the camera is turned on, the PTZ value of the camera is acquired through the device interface, so as to obtain the first azimuth information and the first pitch angle; further, the installation azimuth and the pitch angle error value of the camera also need to be calculated, that is, the shooting angle deviation caused by the fact that the installation position of the camera is not horizontal due to installation error, environmental factors and the like is calculated. Further, the first azimuth information and the first pitch angle are corrected, specifically, the installation azimuth of the camera is combined with the first azimuth information to obtain the azimuth from the camera installation point to the water area to be shot, and the first pitch angle is combined with the pitch angle error value to obtain the real pitch angle from the camera installation point to the water area to be shot. Further, the installation height of the camera, that is, the distance from the camera to the horizontal plane, is acquired, and then the horizontal monitoring range of the camera, that is, the maximum distance of the water area to be shot by the camera, is calculated through a trigonometric function according to the installation height and the real pitch angle. Further, according to the corrected azimuth, the horizontal monitoring range and the camera view angle, a fan-shaped shooting area is drawn on the electronic chart with the installation point as the center, specifically, the installation point of the camera is first determined on the electronic chart through the latitude and longitude of the camera, and then a fan-shaped graph is drawn on the electronic chart with the installation point as the center, with the corrected azimuth as the direction, with the camera view angle as the included angle, and with the horizontal monitoring range of the camera as the radius, so as to obtain the camera shooting area.
[0082] Figure 7 A schematic block diagram of a system for drawing a camera shooting area is shown, which is one of the embodiments of the present application; wherein the system for drawing a camera shooting area 70 comprises:
[0083] The first acquisition module 702 is configured to acquire the first azimuth information and the first pitch angle of the camera.
[0084] The first calibration module 704 is configured to calibrate the first azimuth information according to the installation azimuth information of the camera to obtain the second azimuth information.
[0085] The second calibration module 706 is configured to calibrate the first pitch angle according to the pitch angle error value of the camera to obtain the second pitch angle.
[0086] The first determination module 708 is configured to determine the monitoring range of the camera according to the second pitch angle and the installation height of the camera.
[0087] The first drawing module 710 is configured to draw the camera shooting area according to the monitoring range of the camera and the second azimuth information.
[0088] The system for drawing the camera shooting area provided by the application mainly comprises a first acquisition module 702, a first calibration module 704, a second calibration module 706, a first determination module 708 and a first drawing module 710. The first acquisition module 702 acquires the first orientation information and the first pitch angle of the camera. The orientation information refers to the orientation of the camera, and the pitch angle refers to the included angle of the camera in the horizontal direction. Specifically, the first orientation information and the first pitch angle of the camera can be acquired through the holder under the camera. Specifically, the PTZ (P represents the orientation of the camera; T represents the pitch angle of the camera; and Z represents the focal length of the camera lens) value controlled by the holder can be used to obtain the first orientation information and the first pitch angle. Further, since the first orientation information and the first pitch angle are directly acquired through the holder, the first orientation information and the first pitch angle do not represent the real shooting orientation information and the pitch angle of the camera. The camera installation position may not be horizontal due to installation errors, environmental factors and other factors, so that the shooting angle of the camera is deviated, and therefore the first orientation information and the first pitch angle need to be calibrated. Specifically, the first calibration module 704 calibrates the first orientation information according to the installation orientation information of the camera to obtain the second orientation information, and the second calibration module 706 calibrates the first pitch angle according to the pitch angle error value of the camera to obtain the second pitch angle. That is, the installation orientation information of the camera is first acquired, which can be directly acquired through the camera. Then, the first orientation information is calibrated according to the installation orientation information to obtain the second orientation information, that is, the actual shooting orientation of the camera is obtained by adding the installation orientation information and the first orientation information. Then, the pitch angle error value of the camera is acquired, and the first pitch angle is calibrated according to the pitch angle error value to obtain the second pitch angle. Specifically, the pitch angle error value and the first pitch angle are added to obtain the second pitch angle.
[0089] Further, the first determination module 708 determines the monitoring range of the camera according to the second pitch angle and the installation height of the camera. The monitoring range of the camera refers to the horizontal distance between the shooting sea area of the camera and the installation position of the camera. Specifically, the second pitch angle and the installation height can be used to calculate the monitoring range of the camera by using the trigonometric function. Further, after the monitoring range of the camera is determined, the first drawing module 710 draws a sector shooting area on the electronic sea chart by taking the installation position of the camera as the center, taking the second orientation information as the orientation, and taking the monitoring range as the radius, so as to realize the drawing of the camera shooting area. The wide sea area can be fully shot and monitored, and an intuitive sea area schematic diagram is generated to help the user to view the shooting position and the shooting range of the current camera in combination with the map, and the working efficiency of the user is improved.
[0090] Figure 8 Fig. 1 shows a schematic block diagram of a system for mapping a camera shooting area according to an embodiment of the present application, wherein the system for mapping a camera shooting area 70 further comprises:
[0091] a second obtaining module 712, configured to obtain third pitch angles of the camera under a plurality of third azimuth information of the camera;
[0092] a second determining module 714, configured to determine a pitch angle error value of the camera according to the plurality of third pitch angles.
[0093] In this embodiment, the system for mapping a camera shooting area 70 further comprises the second obtaining module 712 and the second determining module 714. Firstly, it is assumed that there is a linear relationship between the azimuth information of the camera and the pitch angle of the camera. Then the second obtaining module 712 obtains the third pitch angles of the camera under a plurality of different azimuth information of the camera, i.e. the orientation of the camera is adjusted multiple times, and then the pitch angles under different orientations are obtained respectively, and then the plurality of different pitch angles are compared, if the pitch angles are the same, it means that there is no error value, if the pitch angles are different, the difference between the plurality of pitch angles is determined, and then the second determining module 714 calculates according to the difference and the plurality of different azimuth information, so as to obtain the final pitch angle error value of the camera.
[0094] Figure 9 Fig. 2 shows a schematic block diagram of a first mapping module according to an embodiment of the present application, wherein the first mapping module 710 comprises:
[0095] a third obtaining module 7102, configured to obtain the longitude and latitude coordinates of the camera and the visual angle of the camera;
[0096] a second mapping module 7104, configured to map the camera shooting area on the electronic chart according to the longitude and latitude coordinates, the visual angle, the second azimuth information and the monitoring range.
[0097] In this embodiment, the first mapping module 710 comprises the third obtaining module 7102 and the second mapping module 7104. Since the camera shooting area needs to be mapped on the electronic chart, the position of the camera and the maximum angle range that can be shot by the camera need to be determined, therefore the third obtaining module 7102 obtains the longitude and latitude coordinates of the camera and the visual angle of the camera, i.e. the angle that can be shot by the camera. Then the second mapping module 7104 determines the installation position of the camera on the electronic chart according to the longitude and latitude coordinates of the camera, and then maps a fan-shaped shooting area on the electronic chart with the installation position as the center, the visual angle as the included angle, the second azimuth information as the orientation and the monitoring range as the radius.
[0098] Figure 10a schematic block diagram of a second drawing module of one embodiment of the present application is shown; wherein, the second drawing module 7104 comprises:
[0099] a third determining module 7106, configured to determine a center of the camera shooting area according to the latitude and longitude coordinates and the electronic chart;
[0100] a fourth determining module 7108, configured to determine a central angle of the camera shooting area according to the visual angle and the second azimuth information;
[0101] a fifth determining module 7110, configured to determine a radius of the camera shooting area according to the monitoring range;
[0102] a third drawing module 7112, configured to draw the camera shooting area according to the center, the central angle and the radius.
[0103] In the technical solution, the second drawing module 7104 comprises the third determining module 7106, the fourth determining module 7108, the fifth determining module 7110 and the third drawing module 7112. It can be understood that the camera shooting area is a fan-shaped shooting area, so that only the central angle, the center and the radius of the fan-shaped area are needed to draw the camera shooting area on the electronic chart. Therefore, the third determining module 7106 determines the installation position of the camera on the electronic chart according to the latitude and longitude coordinates of the camera, and takes the installation position as the center of the camera shooting area, and then the fourth determining module 7108 determines the central angle of the camera shooting area according to the visual angle and the second azimuth information. Since the second azimuth information represents the direction of the camera, the central angle of the camera shooting area can be obtained by combining the second azimuth information with the visual angle. Further, the fifth determining module 7110 determines the radius of the camera shooting area according to the monitoring range. Since the monitoring range refers to the horizontal distance between the camera shooting sea area and the installation position of the camera, the monitoring range can be directly taken as the radius of the camera shooting area. Finally, the third drawing module 7112 draws a fan-shaped graph on the electronic chart according to the obtained center, central angle and radius, so as to obtain the camera shooting area, and realize the drawing of the camera shooting area.
[0104] Figure 11 a schematic block diagram of an electronic device of one embodiment of the present application is shown; wherein, the electronic device 110 comprises a memory 1102, a processor 1104 and a computer program stored on the memory 1102 and executable on the processor 1104, and the processor 1104 implements the steps of the method for drawing the camera shooting area according to any one of the above embodiments when executing the computer program.
[0105] The electronic device 110 provided by the present application, when the processor 1104 executes the computer program, the steps of the method for drawing the camera shooting area are realized, and the technical effects of any of the above embodiments can be realized, and details are not repeated.
[0106] The embodiments of the fourth aspect of the present application provide a storage medium, which stores a computer program, and the computer program is executed by a processor to realize the steps of the method for drawing the camera shooting area according to any of the above embodiments.
[0107] The storage medium provided by the present application, when the computer program is executed by the processor, the steps of the method for drawing the camera shooting area are realized, and the technical effects of any of the above embodiments can be realized, and details are not repeated.
[0108] The method can be implemented in various ways according to specific features and / or example applications. For example, the method can be implemented by a combination of hardware, firmware, and / or software. For example, in a hardware implementation, the processor can be implemented in one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, electronic devices, other devices for performing the above functions, and / or combinations thereof.
[0109] The storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium can be an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples of the computer readable storage medium include a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, an encoded mechanical device (such as a punch card or a hole having a raised structure recorded with instructions), and any suitable combination of the above. The computer readable storage medium used herein should not be understood as a transmission signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium, or an electrical signal transmitted through a wire, etc.
[0110] In the description of the present specification, the terms "first", "second", etc. are only used for the purpose of description, and cannot be understood as indicating or implying relative importance, unless otherwise explicitly specified and limited; the terms "connection", "installation", "fixation" and the like should be understood in a broad sense, for example, "connection" can be fixed connection, can also be detachable connection, or integrally connected; can be directly connected, or indirectly connected through an intermediate medium. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0111] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "a specific embodiment" and the like means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0112] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for drawing the shooting area of a camera, characterized in that, The method comprises the following steps: obtaining first azimuth information and first pitch angle of a camera; calibrating the first azimuth information according to installation azimuth information of the camera to obtain second azimuth information; wherein the installation azimuth information is directly obtained by the camera, and the second azimuth information is obtained by adding the installation azimuth information and the first azimuth information; obtaining third pitch angles of the camera under multiple third azimuth information, and calculating the pitch angle of the camera under any azimuth information according to the first pitch angle and the second azimuth information; determining the pitch angle error value of the camera according to the multiple third pitch angles and the calculated pitch angle; calibrating the first pitch angle according to the pitch angle error value of the camera to obtain a second pitch angle; determining the monitoring range of the camera according to the second pitch angle and the installation height of the camera; drawing the camera shooting area according to the monitoring range of the camera and the second azimuth information; wherein the calculation of the pitch angle of the camera under any azimuth information according to the first pitch angle and the second azimuth information comprises: assuming that there is a linear relationship between the azimuth information of the camera and the pitch angle of the camera; calculating the pitch angle of the camera under any azimuth information according to T1=abs(C)×T / 180°, C=180°-A; wherein T1 is the pitch angle of the camera under any azimuth information, abs(C) represents the absolute value of the angle between the rotation azimuth of the camera and the measurement reference azimuth, T is the first pitch angle, and A is the second azimuth information; the step of drawing the camera shooting area according to the monitoring range of the camera and the second azimuth information comprises: obtaining the longitude and latitude coordinates of the camera and the visual angle of the camera; drawing the camera shooting area on an electronic chart according to the longitude and latitude coordinates, the visual angle, the second azimuth information, and the monitoring range.
2. The method of claim 1, wherein, the step of drawing the camera shooting area on an electronic chart according to the longitude and latitude coordinates, the visual angle, the second azimuth information, and the monitoring range comprises: determining the center of the camera shooting area according to the longitude and latitude coordinates and the electronic chart; determining the central angle of the camera shooting area according to the visual angle and the second azimuth information; determining the radius of the camera shooting area according to the monitoring range; drawing the camera shooting area according to the center, the central angle, and the radius.
3. A system for mapping a camera field of view, the system comprising: The method comprises the following steps: a first obtaining module for obtaining first azimuth information and first pitch angle of a camera; a first calibration module for calibrating the first azimuth information according to installation azimuth information of the camera to obtain second azimuth information; wherein the installation azimuth information is directly obtained by the camera, and the second azimuth information is obtained by adding the installation azimuth information and the first azimuth information; a second calibration module, configured to calibrate the first tilt angle according to a tilt angle error value of the camera to obtain a second tilt angle; a first determination module, configured to determine a monitoring range of the camera according to the second tilt angle and an installation height of the camera; a first drawing module, configured to draw a camera shooting area according to the monitoring range of the camera and the second azimuth information; a second acquisition module, configured to acquire third tilt angles of the camera under a plurality of third azimuth information, and calculate a tilt angle of the camera under any azimuth information according to the first tilt angle and the second azimuth information; a second determination module, configured to determine the tilt angle error value of the camera according to the third tilt angles and the calculated tilt angle; wherein the calculation of the tilt angle of the camera under any azimuth information according to the first tilt angle and the second azimuth information specifically comprises: assuming that there is a linear relationship between the azimuth information of the camera and the tilt angle of the camera; calculating the tilt angle of the camera under any azimuth information according to T1=abs(C)×T / 180°, C=180°-A; wherein T1 is the tilt angle of the camera under any azimuth information, abs(C) represents the absolute value of the angle between the rotation azimuth of the camera and the measurement reference azimuth, T is the first tilt angle, and A is the second azimuth information; the first drawing module comprises: a third acquisition module, configured to acquire the longitude and latitude coordinates of the camera and a visible angle of the camera; a second drawing module, configured to draw the camera shooting area on an electronic chart according to the longitude and latitude coordinates, the visible angle, the second azimuth information and the monitoring range.
4. The system for mapping a camera shot area of claim 3, wherein, the second drawing module comprises: a third determination module, configured to determine the center of the camera shooting area according to the longitude and latitude coordinates and the electronic chart; a fourth determination module, configured to determine the central angle of the camera shooting area according to the visible angle and the second azimuth information; a fifth determination module, configured to determine the radius of the camera shooting area according to the monitoring range; a third drawing module, configured to draw the camera shooting area according to the center, the central angle and the radius.
5. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the steps of the method for drawing the camera shooting area according to claim 1 or 2.
6. A storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to realize the steps of the method for drawing the camera shooting area according to claim 1 or 2.
Citation Information
Patent Citations
Monocular camera calibration and target geographic position extraction method based on GIS assistance
CN115760999A
Pitch angle dynamic correction method and device of pan-tilt camera, equipment and storage medium
CN117241142A
The monitoring systems for Marine aquaculture and a shaft aligning method of the cameras
KR1020160039587A