Camera calibration method and device, camera and storage medium
By capturing the sun's image and calculating its azimuth and elevation angle, the accurate calibration of the camera's orientation is achieved, the problems of high angular error and cost in the prior art are solved, and the accuracy of event location reporting is improved.
Patent Information
- Application Number
- CN202311780679.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2025-06-24
AI Technical Summary
The existing camera calibration methods rely on electronic compass and accelerometers, which have problems with angular error and high cost, especially when the earth's magnetic field changes, resulting in deviations in the location of the event.
By controlling the camera to rotate according to preset rotation rules, and collecting the target picture in real time, when the target picture contains the sun's image and is in the center, the current Julian day count, the sun's time angle and position information relative to the camera are determined, the sun's target azimuth angle and elevation angle are calculated, and the camera's orientation is calibrated based on these angles.
This enables accurate calibration of the orientation of the camera without increasing hardware costs, reducing deviations in the location of the event occurrence.
Smart Images

Figure CN120201180A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cameras, and in particular to a camera calibration method, device, camera, and storage medium. Background Art
[0002] Cameras are often used in occasions such as forest fire prevention and event monitoring. The rotation angle of the camera is used to determine the direction where an event occurs, and means such as lidar, infrared rangefinder, and trigonometric function calculation are used to determine the distance from the location where the event occurs to the camera, so as to report the accurate location where the event occurs.
[0003] In order to accurately determine the direction where an event occurs, the accuracy of the initial orientation calibration of the camera is particularly important. Among them, the camera orientation calibration can be divided into azimuth calibration and pitch angle calibration. Figure 1a FIG. is a schematic diagram of azimuth calibration of a camera provided by the prior art. As Figure 1a shown, generally one of true south, true north, true east, or true west is selected as the reference azimuth for azimuth calibration. Of course, other azimuths can also be selected as the reference azimuth. Figure 1b FIG. is a schematic diagram of pitch angle calibration of a camera provided by the prior art. As Figure 1b shown, generally the horizontal plane is selected as the pitch angle reference plane. Of course, other angular planes can also be selected as the pitch angle reference plane.
[0004] Since the Earth has a magnetic field, the two magnetic poles are roughly located at the two poles of the Earth's geography, and the direction of the magnetic field lines of the geomagnetism is transmitted from south to north. Therefore, in the related art, mainly through an electronic compass, physical phenomena such as the Hall effect, magnetic saturation principle, and magnetoresistance effect are used to determine the direction of the local magnetic field lines, so as to determine the azimuth orientation of the camera; an accelerometer is used to calculate the angle between the camera and the direction of gravity, so as to determine the pitch angle of the camera. However, using an electronic compass to indicate the direction has a certain angular error, which will cause a deviation in the location reported by the camera for the event. The farther the distance, the greater the deviation. Moreover, since the two magnetic poles of the Earth's magnetic field are not in the same position as the two poles of the geography, in most regions of the Earth, the direction of the magnetic field lines does not necessarily point to the true north-south direction, there is a certain geomagnetic declination, and the geomagnetic declination in different regions is also different. In addition, the position of the geomagnetic poles changes irregularly every year. Therefore, the magnitude of the geomagnetic declination cannot be predicted in space and time. Exemplarily, Figure 2 FIG. is a schematic diagram of the deviation between the event occurrence position feedback by a camera in the prior art and the true event occurrence position. As Figure 2As shown, the magnetic declination in a certain area in a certain year is about 10°. If the actual location of the event is 10 km away from the camera, then the location of the event reported by the camera is about 1.75 km different from the actual location of the event. When using an accelerometer to determine the pitch angle of the camera, an accelerometer needs to be configured in the camera, which incurs certain costs. Summary of the Invention
[0005] The present invention provides a camera calibration method, device, camera and storage medium, which can accurately calibrate the orientation of the camera without increasing the hardware cost.
[0006] According to one aspect of the present invention, there is provided a camera calibration method, including:
[0007] In response to the triggering of a camera calibration event, controlling the camera to rotate according to a preset rotation rule and collecting a target image in real time during the rotation;
[0008] When the target image contains a sun image and the sun image is located at the center position of the target image, determining the current Julian day number, the hour angle of the sun relative to the camera, and the position information of the camera;
[0009] According to the current Julian day number, the hour angle, and the position information, determining the target azimuth angle of the sun and the target elevation angle of the sun relative to the camera;
[0010] Calibrating the orientation of the camera based on the target elevation angle and the target azimuth angle.
[0011] According to another aspect of the present invention, there is provided a camera calibration device, including:
[0012] A target image acquisition module, configured to, in response to the triggering of a camera calibration event, control the camera to rotate according to a preset rotation rule and collect a target image in real time during the rotation;
[0013] A position and time information determination module, configured to determine the current Julian day number, the hour angle of the sun relative to the camera, and the position information of the camera when the target image contains a sun image and the sun image is located at the center position of the target image;
[0014] An orientation information determination module, configured to determine the target azimuth angle of the sun and the target elevation angle of the sun relative to the camera according to the current Julian day number, the hour angle, and the position information;
[0015] An orientation calibration module, configured to calibrate the orientation of the camera based on the target elevation angle and the target azimuth angle.
[0016] According to another aspect of the present invention, there is provided a camera, the camera comprising:
[0017] at least one processor; and
[0018] a memory communicatively connected to the at least one processor; wherein,
[0019] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the camera calibration method according to any embodiment of the present invention.
[0020] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the camera calibration method according to any embodiment of the present invention when executed.
[0021] The camera calibration solution of the embodiments of the present invention, in response to the triggering of a camera calibration event, controls the camera to rotate according to a preset rotation rule, and collects a target image in real time during the rotation; when the target image contains a sun image and the sun image is located at the center position of the target image, determines the current Julian day number, the hour angle of the sun relative to the camera, and the position information of the camera; determines the target azimuth angle of the sun and the target elevation angle of the sun relative to the camera according to the current Julian day number, the hour angle, and the position information; and calibrates the orientation of the camera based on the target elevation angle and the target azimuth angle. Through the technical solution provided by the embodiments of the present invention, the orientation of the camera can be accurately calibrated without increasing the hardware cost.
[0022] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings without creative efforts based on these drawings.
[0024] Figure 1a A schematic diagram of the azimuth calibration of a camera provided by the prior art;
[0025] Figure 1b A schematic diagram of the pitch angle calibration of a camera provided by the prior art;
[0026] Figure 2 Schematic diagram of the effect that there is a deviation between the event occurrence position fed back by the camera in the prior art and the actual event occurrence position;
[0027] Figure 3 Flowchart of a camera calibration method provided in Embodiment 1 of the present invention;
[0028] Figure 4 Schematic diagram of the relative position relationship between the sun and the camera provided in an embodiment of the present invention;
[0029] Figure 5 Flowchart of a camera calibration method provided in Embodiment 2 of the present invention;
[0030] Figure 6 Schematic diagram of the structure of a camera calibration device provided in Embodiment 3 of the present invention;
[0031] Figure 7 Schematic diagram of the structure of the camera for implementing the camera calibration method of the embodiment of the present invention. Detailed implementation manners
[0032] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those clearly listed steps or units, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0034] Embodiment 1
[0035] Figure 3The following is a flowchart of a camera calibration method provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of calibrating the orientation of a camera. This method can be executed by a camera calibration device, which can be implemented in the form of hardware and / or software, and the camera calibration device can be configured in the camera. As Figure 3 shown, the method includes:
[0036] S310. In response to the triggering of a camera calibration event, control the camera to rotate according to a preset rotation rule, and collect a target image in real time during the rotation.
[0037] Among them, the camera is a rotatable camera. For example, the camera is a pan-tilt camera or a dome camera. It should be noted that the type of the camera is not limited in the embodiments of the present invention. In the embodiments of the present invention, when detecting a camera calibration instruction input by a user, a camera calibration event can be triggered. In response to the triggering of the camera calibration event, control the camera to rotate according to a preset rotation rule, and collect a target image in real time during the rotation. Among them, the target image is a scene image of the scene monitored by the camera collected during the rotation of the camera. Exemplarily, the camera can be controlled to rotate step by step at a certain angle to scan the sky, and try to ensure that the viewing angle of the camera can cover the entire sky.
[0038] Optionally, in response to the triggering of a camera calibration event, controlling the camera to rotate according to a preset rotation rule includes: in response to the triggering of the camera calibration event, when the camera is in a wide-angle mode or the field of view angle of the camera is the largest, control the camera to rotate according to a preset rotation rule.
[0039] S320. When the target image contains a sun image and the sun image is located at the center position of the target image, determine the current Julian day number, the hour angle of the sun relative to the camera, and the position information of the camera.
[0040] In an embodiment of the present invention, it is determined whether the target image collected in real time contains a solar image and the solar image is located at the center of the target image. If so, the current Julian day number, the hour angle of the sun relative to the camera, and the position information of the camera are determined. If not, the camera is controlled to continue rotating and collect the target image based on a preset rotation rule until the target image contains a solar image and the solar image is located at the center of the target image. Exemplarily, when the target image contains a solar image and the solar image is located at the center of the target image, the current date information and the current time information are determined, and the current Julian day number is determined according to the current date information and the current time information. Among them, the current date information, the current time information, and the position information of the camera can be determined based on the positioning and time service module built in the camera. Among them, the current date information can be understood as the date information of year (Y), month (M), and day (D), such as a certain year, a certain month, and a certain day, the current time information can be understood as the time information of hour (H), minute (MIN), and second (SEC), such as a certain hour, a certain minute, and a certain second, and the position information of the camera can include the longitude information and the latitude information of the camera. Exemplarily, if the current date information includes year (Y), month (M), and day (D), and the current time information includes hour (H), minute (MIN), and second (SEC), the current Julian day number can be determined according to the following formula:
[0041] JDN = 365.25 * (Y + 4716) + 30.6001 * (M + 1) + D - 1524.5;
[0042] Hour part = H + MIN / 60 + SEC / 3600;
[0043] Julian day number JD = JDN + hour part (in decimal form).
[0044] In an embodiment of the present invention, the hour angle of the sun relative to the camera is determined according to the current date information (year (Y), month (M), day (D)) and the current time information (hour (H), minute (MIN), second (SEC)). Optionally, when the target image contains a solar image and the solar image is located at the center of the target image, determining the hour angle of the sun relative to the camera includes: when the target image contains a solar image and the solar image is located at the center of the target image, determining the current date information and the current time information; determining the current ecliptic longitude of the sun according to the current date information, and determining the right ascension of the sun according to the current ecliptic longitude; determining the sidereal time of the current location of the camera according to the current time information and the current date information; and determining the hour angle of the sun relative to the camera according to the right ascension and the sidereal time.
[0045] Exemplarily, determine the current ecliptic longitude β of the sun according to the current date information. The ecliptic longitude refers to the longitude of the sun on the ecliptic. Among them, the current ecliptic longitude β of the sun can be calculated according to the following formula
[0046] β = M + w;
[0047] M = 357.5291 + 0.98560028×b;
[0048] w = 282.9404 + 4.70935×10^-5×b;
[0049] Among them, β represents the current ecliptic longitude of the sun, M represents the mean anomaly of the sun, w represents the longitude of the perigee of the sun, and b is the number of days from 12:00 on January 1, 2000, to the current date information of the prime meridian.
[0050] In the embodiment of the present invention, determine the right ascension of the sun according to the current ecliptic longitude. Among them, the right ascension of the sun refers to the longitude of the sun on the celestial sphere, and it is a quantity that changes with time. Specifically, the right ascension of the sun can be determined according to the following formula:
[0051] μ = tan -1 [sin(β)×cos(ε)÷cos(β)];
[0052] Among them, μ represents the right ascension of the sun, and ε represents the obliquity of the ecliptic, generally 23.44°.
[0053] According to the current date information and the current time information, determine the sidereal time of the current location of the camera. Among them, the sidereal time is a representation method of a kind of time information in astronomy. Then, according to the right ascension and the sidereal time, determine the hour angle of the sun relative to the camera. Specifically, calculate the hour angle of the sun relative to the camera according to the following formula: hour angle (ω) = sidereal time - right ascension of the sun (μ).
[0054] Optionally, before determining the current Julian day number, the hour angle of the sun relative to the camera, and the position information of the camera when the target image contains a sun image and the sun image is located at the center position of the target image, it further includes: judging whether the target image contains a sun image based on a target detection algorithm. If so, determine the target position of the sun image in the target image; determine the rotation mode of the camera according to the target position and the center point position of the target image; control the rotation of the camera based on the rotation mode so that the sun image is located at the center position of the target image.
[0055] In an embodiment of the present invention, a target image is collected in real time during the rotation of a camera. Based on a target detection algorithm, it is determined whether the target image contains a sun image. If so, the target position of the sun image in the target image is determined. The target position may be the position information of the center point of the sun image in the target image, such as the pixel point where the center point of the sun image is located in the target image. According to the target position and the center point position of the target image, the rotation mode of the camera is determined. For example, the relative position relationship between the target position and the center point position of the target image is determined, and the rotation mode of the camera is determined according to the relative position relationship. The rotation mode may include horizontal rotation and / or vertical rotation. The camera is controlled to rotate based on the rotation mode, and the target image is collected in real time until the sun image is located at the center position of the target image, that is, the center point of the sun image coincides with the center point of the target image. Optionally, before determining whether the target image contains a sun image based on the target detection algorithm, preprocessing may be performed on the target image. The preprocessing operations may include operations such as denoising and enhancing contrast. Optionally, when it is determined based on the target detection algorithm that the target image does not contain a sun image, the camera is returned to rotate according to a preset rotation rule, and the target image is collected in real time during the rotation until the target image contains a sun image.
[0056] Optionally, it further includes: when it is determined that the target image does not contain a sun image within a preset time period, after an interval of a preset duration, the camera is returned to be controlled to rotate according to a preset rotation rule, and the target image is collected in real time during the rotation until it is determined that the target image contains a sun image within the preset time period. It can be understood that when none of the target images collected by controlling the camera to rotate and in real time within the preset time period contain a sun image, it may be due to weather reasons, such as cloudy or rainy days resulting in no sun in the sky, so it is impossible to detect a sun image in the target image. At this time, after an interval of a preset duration, such as one day or several hours later, the camera is controlled again to rotate according to a preset rotation rule, and the target image is collected in real time during the rotation until it is detected that the target image contains a sun image within the preset time period starting from the time point when the camera is re-controlled to rotate according to the preset rotation rule.
[0057] S330. According to the current Julian day number, the hour angle, and the position information, determine the target azimuth angle of the sun and the target elevation angle of the sun relative to the camera.
[0058] In an embodiment of the present invention, based on a preset algorithm, the elevation angle and azimuth angle of the sun relative to the camera can be calculated according to the current Julian day number, hour angle, and the position information of the camera. For the convenience of description, the elevation angle of the sun relative to the camera is referred to as the target elevation angle, and the azimuth angle of the sun relative to the preset reference direction is referred to as the target azimuth angle. Exemplarily, the camera can send the current Julian day number, hour angle, and the position information of the camera to the server through the Internet, so that the server calculates the elevation angle and azimuth angle of the sun relative to the camera based on the preset algorithm and the received above information.
[0059] Optionally, the position information includes latitude information; determining the target azimuth angle of the sun and the target elevation angle of the sun relative to the camera according to the current Julian day number, the hour angle, and the position information includes: determining the declination angle of the sun according to the current Julian day number; determining the target elevation angle of the sun relative to the camera according to the declination angle, the hour angle, and the latitude information; determining the target azimuth angle of the sun according to the target elevation angle, the declination angle, and the hour angle.
[0060] Calculate the declination angle of the sun according to the obtained Julian day number, where the declination angle represents the position of the sun relative to the celestial equator. For example, the declination angle of the sun can be calculated according to the following formula:
[0061] sin(δ) = sin(23.439 - 0.0000004 * d);
[0062] where δ represents the declination angle of the sun, and d represents the difference between the Julian day number JD and 2451545.0.
[0063] In an embodiment of the present invention, according to the declination angle δ of the sun, the hour angle ω, and the latitude information φ, calculate the target elevation angle θ of the sun relative to the camera. Specifically, calculate the target elevation angle according to the following formula:
[0064] sin(θ) = sin(δ) × sin(φ) + cos(δ) × cos(φ) × cos(ω);
[0065] Calculate the target azimuth angle of the sun according to the hour angle ω of the sun, the latitude information (φ), and the target elevation angle θ. Specifically, calculate the target azimuth angle α according to the following formula:
[0066] sin(α) = -(cos(δ) × sin(ω)) / cos(θ); or,
[0067] cos(α) = (sin(δ) × cos(φ) - cos(δ) × sin(φ) × cos(ω)) / cos(θ);
[0068] Wherein, the target azimuth angle represents the direction angle of the sun relative to a preset reference direction. Generally, the due north direction is used as the preset reference direction. Therefore, the target azimuth angle represents the direction angle deviating from the due north direction. Generally, when the sun is in the due north direction, the target azimuth angle is 0 degrees; when the sun is in the due east direction, the target azimuth angle is 90 degrees; when the sun is in the due south direction, the target azimuth angle is 180 degrees; and when the sun is in the due west direction, the target azimuth angle is 270 degrees.
[0069] Exemplarily, Figure 4 FIG. is a schematic diagram of the relative position relationship between the sun and the camera provided by an embodiment of the present invention.
[0070] S340. Calibrate the orientation of the camera based on the target elevation angle and the target azimuth angle.
[0071] Optionally, calibrating the orientation of the camera based on the target elevation angle and the target azimuth angle includes: controlling the camera to rotate by the target elevation angle in the vertical direction so that the elevation angle of the camera is 0, and controlling the camera to rotate by the target azimuth angle in the horizontal direction so that the orientation of the camera faces the preset reference direction. In the embodiment of the present invention, with the due north direction as the preset reference direction, the target elevation angle of the sun relative to the camera is used as the initial elevation angle of the camera, and the target azimuth angle of the sun is used as the initial azimuth angle of the camera. Control the camera to rotate by the target elevation angle in the vertical direction so that the elevation angle of the camera is 0, and rotate by the target azimuth angle in the horizontal direction so that the orientation of the camera faces the due north direction, thereby realizing the calibration of the orientation of the camera.
[0072] Exemplarily, as Figure 4 shown, after determining the target elevation angle θ of the sun and the target azimuth angle α of the sun through S310-S330, control the camera to rotate by θ through the vertical motor of the camera so that the elevation angle of the camera is 0°, and control the camera to rotate counterclockwise (looking vertically down) by α through the horizontal motor of the camera so that the direction corresponding to the center of the camera's field of view is the due north direction, thereby completing the calibration of the camera orientation.
[0073] Optionally, in order to improve the accuracy of camera calibration, S310-S330 can be executed multiple times. For example, execute S310-S330 continuously for multiple days to obtain multiple target elevation angles and target azimuth angles, and calculate the mean values of the multiple target elevation angles and the mean values of the multiple target azimuth angles respectively. Calibrate the orientation of the camera based on the mean values of the multiple target elevation angles and the mean values of the multiple target azimuth angles.
[0074] The camera calibration method according to an embodiment of the present invention, in response to the triggering of a camera calibration event, controls the camera to rotate according to a preset rotation rule, and collects a target image in real time during the rotation; when the target image contains a sun image and the sun image is located at the center position of the target image, determines the current Julian day number, the hour angle of the sun relative to the camera, and the position information of the camera; determines the target azimuth angle of the sun and the target elevation angle of the sun relative to the camera according to the current Julian day number, the hour angle, and the position information; and calibrates the orientation of the camera based on the target elevation angle and the target azimuth angle. Through the technical solution provided by the embodiment of the present invention, the orientation of the camera can be accurately calibrated without increasing the hardware cost.
[0075] In some embodiments, in response to the triggering of a camera calibration event, controlling the camera to rotate according to a preset rotation rule includes: in response to the triggering of a camera calibration event, when the camera is in a wide-angle mode or the field of view angle of the camera is the largest, controlling the camera to rotate according to a preset rotation rule. In the embodiment of the present invention, to improve the efficiency of searching for the sun, when a camera calibration event is triggered, first control the camera to be in a wide-angle mode or make the field of view angle of the camera the largest, and then control the camera to rotate based on a preset rotation rule. For example, the camera can be first controlled by a horizontal motor to rotate horizontally by 360° and collect a target image in real time. If no sun image exists in the target image, then control the camera to rotate vertically by 360° based on a vertical motor and collect a target image in real time to determine whether a sun image exists in the target image, and so on, until a sun image is found in the target image.
[0076] Embodiment 2
[0077] Figure 5 is a flowchart of a camera calibration method provided by Embodiment 2 of the present invention. As Figure 5 shown, the method includes:
[0078] S510. In response to the triggering of a camera calibration event, when the camera is in a wide-angle mode or the field of view angle of the camera is the largest, control the camera to rotate according to a preset rotation rule, and collect a target image in real time during the rotation.
[0079] S520. Based on an object detection algorithm, determine whether the target image contains a sun image. If so, execute S530; otherwise, return to execute S510.
[0080] S530. Determine the target position of the sun image in the target image.
[0081] S540. Determine the rotation mode of the camera according to the target position and the center point position of the target image.
[0082] S550. Control the rotation of the camera based on the rotation mode so that the sun image is located at the center position of the target screen.
[0083] S560. Determine the current Julian day number, the hour angle of the sun relative to the camera, and the position information of the camera.
[0084] S570. Determine the target azimuth angle of the sun and the target elevation angle of the sun relative to the camera according to the current Julian day number, the hour angle, and the position information.
[0085] S580. Control the camera to rotate the target elevation angle in the vertical direction so that the elevation angle of the camera is 0, and control the camera to rotate the target azimuth angle in the horizontal direction so that the orientation of the camera is the preset reference direction.
[0086] The camera calibration method according to the embodiment of the present invention can accurately calibrate the orientation of the camera without increasing the hardware cost.
[0087] Embodiment III
[0088] Figure 6 It is a schematic structural diagram of a camera calibration device provided by Embodiment III of the present invention. As Figure 6 shown, the device includes:
[0089] A target screen acquisition module 610, configured to control the camera to rotate according to a preset rotation rule in response to the triggering of a camera calibration event, and acquire a target screen in real time during the rotation process;
[0090] A position and time information determination module 620, configured to determine the current Julian day number, the hour angle of the sun relative to the camera, and the position information of the camera when the target screen contains a sun image and the sun image is located at the center position of the target screen;
[0091] An orientation information determination module 630, configured to determine the target azimuth angle of the sun and the target elevation angle of the sun relative to the camera according to the current Julian day number, the hour angle, and the position information;
[0092] An orientation calibration module 640, configured to calibrate the orientation of the camera based on the target elevation angle and the target azimuth angle.
[0093] Optionally, the position information includes latitude information;
[0094] The orientation information determination module includes:
[0095] A declination angle determination unit, configured to determine the declination angle of the sun according to the Julian day number;
[0096] A target elevation angle determination unit for determining a target elevation angle of the sun relative to the camera according to the declination angle, the hour angle, and the latitude information;
[0097] A target azimuth angle determination unit for determining a target azimuth angle of the sun according to the target elevation angle, the declination angle, and the hour angle.
[0098] Optionally, the position and time information determination module is configured to:
[0099] When the target image contains a sun image and the sun image is located at the center position of the target image, determine the current date information and the current time information;
[0100] Determine the current ecliptic longitude of the sun according to the current date information, and determine the right ascension of the sun according to the current ecliptic longitude;
[0101] Determine the sidereal time of the current location of the camera according to the current time information and the current date information;
[0102] Determine the hour angle of the sun relative to the camera according to the right ascension and the sidereal time.
[0103] Optionally, the orientation calibration module is configured to:
[0104] Control the camera to rotate the target elevation angle in the vertical direction so that the elevation angle of the camera is 0, and control the camera to rotate the target azimuth angle in the horizontal direction so that the orientation of the camera is the preset reference direction.
[0105] Optionally, the device further includes:
[0106] A target position determination module for, before determining the current Julian day number, the hour angle of the sun relative to the camera, and the position information of the camera when the target image contains a sun image and the sun image is located at the center position of the target image, judging whether the target image contains a sun image based on a target detection algorithm, and if so, determining the target position of the sun image in the target image;
[0107] A rotation mode determination module for determining the rotation mode of the camera according to the target position and the center point position of the target image;
[0108] A camera control module for controlling the camera to rotate based on the rotation mode so that the sun image is located at the center position of the target image.
[0109] Optionally, the device further includes:
[0110] A loop control module is configured to, when it is determined that the target image does not contain a sun image within a preset time period, after an interval of a preset duration, return to execute controlling the camera to rotate according to a preset rotation rule, and collect the target image in real time during the rotation until it is determined that the target image contains a sun image within the preset time period.
[0111] Optionally, the target image acquisition module is configured to:
[0112] In response to the triggering of a camera calibration event, when the camera is in a wide-angle mode or the field of view angle of the camera is the largest, control the camera to rotate according to a preset rotation rule.
[0113] The camera calibration device provided by the embodiments of the present invention can execute the camera calibration method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.
[0114] Embodiment 4
[0115] Figure 7 FIG. shows a schematic structural diagram of a camera 10 that can be used to implement the embodiments of the present invention. The camera is intended to represent various forms of digital computers, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The camera can also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device (such as a helmet, glasses, a watch, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described herein and / or claimed.
[0116] As Figure 7 shown, the camera 10 includes at least one processor 11, and a memory communicatively connected to at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. Among them, the memory stores a computer program executable by at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the camera 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0117] Multiple components in camera 10 are connected to I / O interface 15, including: input unit 16, such as a keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as a disk, optical disc, etc.; and communication unit 19, such as a network card, modem, wireless communication transceiver, etc. Communication unit 19 allows camera 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0118] Processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 executes the various methods and processes described above, such as the camera calibration method.
[0119] In some embodiments, the camera calibration method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto camera 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the camera calibration method described above can be executed. Alternatively, in other embodiments, processor 11 can be configured to execute the camera calibration method by any other suitable means (e.g., by means of firmware).
[0120] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGA), application-specific integrated circuits (ASIC), application-specific standard products (ASSP), systems-on-chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0121] A computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, a special purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0122] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, 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), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0123] To provide interaction with a user, the systems and techniques described herein can be implemented on a camera that has: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the camera. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).
[0124] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.
[0125] The computing system can include clients and servers. The clients and servers are generally far from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0126] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.
[0127] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A camera calibration method, characterized in that, Including: In response to the triggering of a camera calibration event, controlling the camera to rotate according to a preset rotation rule, and collecting a target image in real time during the rotation. When the target image contains a sun image and the sun image is located at the center position of the target image, determining the current Julian day number, the hour angle of the sun relative to the camera, and the position information of the camera. Based on the current Julian day number, the hour angle, and the position information, determining the target azimuth angle of the sun and the target elevation angle of the sun relative to the camera. Calibrating the orientation of the camera based on the target elevation angle and the target azimuth angle.
2. The method according to claim 1, wherein The position information includes latitude information. Based on the current Julian day number, the hour angle, and the position information, determining the target azimuth angle of the sun and the target elevation angle of the sun relative to the camera includes: Determining the declination angle of the sun according to the current Julian day number. Determining the target elevation angle of the sun relative to the camera according to the declination angle, the hour angle, and the latitude information. Determining the target azimuth angle of the sun according to the target elevation angle, the declination angle, and the hour angle.
3. The method according to claim 1, wherein When the target image contains a sun image and the sun image is located at the center position of the target image, determining the hour angle of the sun relative to the camera includes: When the target image contains a sun image and the sun image is located at the center position of the target image, determining the current date information and the current time information. Determining the current ecliptic longitude of the sun according to the current date information, and determining the right ascension of the sun according to the current ecliptic longitude. Determining the sidereal time of the current location of the camera according to the current time information and the current date information. Determining the hour angle of the sun relative to the camera according to the right ascension and the sidereal time.
4. The method according to claim 1, wherein Calibrating the orientation of the camera based on the target elevation angle and the target azimuth angle includes: Controlling the camera to rotate the target elevation angle in the vertical direction so that the elevation angle of the camera is 0, and controlling the camera to rotate the target azimuth angle in the horizontal direction so that the orientation of the camera is the preset reference direction.
5. The method according to claim 1, wherein Before determining the current Julian day number, the hour angle of the sun relative to the camera, and the position information of the camera when the target image contains a sun image and the sun image is located at the center position of the target image, it further includes: Based on an object detection algorithm, determining whether the target image contains a sun image. If so, determining the target position of the sun image in the target image. According to the target position and the center point position of the target image, determining the rotation mode of the camera. Based on the rotation mode, controlling the camera to rotate so that the sun image is located at the center position of the target image.
6. The method according to claim 5, characterized in that It further includes: When it is determined that the target image does not contain a sun image within a preset time period, after an interval of a preset duration, returning to execute controlling the camera to rotate according to a preset rotation rule, and collecting a target image in real time during the rotation until it is determined that the target image contains a sun image within the preset time period.
7. The method according to claim 1, wherein In response to the triggering of a camera calibration event, control the camera to rotate according to a preset rotation rule, including: In response to the triggering of a camera calibration event, when the camera is in the wide-angle mode or the field of view angle of the camera is the largest, control the camera to rotate according to a preset rotation rule.
8. A camera calibration device, characterized in that, Including: A target image acquisition module, configured to, in response to the triggering of a camera calibration event, control the camera to rotate according to a preset rotation rule, and acquire a target image in real time during the rotation; A position and time information determination module, configured to determine the current Julian day number, the hour angle of the sun relative to the camera, and the position information of the camera when the target image contains a sun image and the sun image is located at the center position of the target image; An orientation information determination module, configured to determine the target azimuth angle of the sun and the target elevation angle of the sun relative to the camera according to the current Julian day number, the hour angle, and the position information; An orientation calibration module, configured to calibrate the orientation of the camera based on the target elevation angle and the target azimuth angle.
9. A camera, characterized in that, The camera includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the camera calibration method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions, and the computer instructions are used to implement the camera calibration method according to any one of claims 1-7 when executed by a processor.