Method, device and electronic device for determining monitoring field of view of camera equipment
By acquiring the shadow feature points of the target object in the surveillance image of the camera device, calculating the solar azimuth angle and constructing the pixel ray conversion relationship, the problem of low efficiency and accuracy of the monitoring field of view of the camera device is solved, and automated monitoring field of view is realized. Improve the accuracy of the orientation angle calculation of the camera equipment.
Patent Information
- Application Number
- CN202411338985.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-09-25
AI Technical Summary
The efficiency and accuracy of monitoring field of vision determination in existing camera equipment is low, mainly due to the lack of accurate orientation information of camera equipment, which requires a lot of manual estimation, which consumes manpower and time.
By acquiring the shadow feature points of at least three target objects in the surveillance image of the imaging device, calculating the solar azimuth angle, and constructing the target pixel ray based on the shading feature points, the monitoring field of view of the imaging device is determined. The method includes calculating the solar azimuth angle, constructing the conversion relationship between the camera coordinate system and the world coordinate system, combining the shadow direction and the attitude parameters of the camera device, and calculating the monitoring direction and field of view of the camera device.
The accuracy of the orientation angle of the camera equipment is improved, and the distortion of shadow direction caused by attitude angle transformation is reduced. There is no need for manpower to estimate the orientation, which significantly improves the efficiency and accuracy of monitoring field of vision determination.
Smart Images

Figure CN118864567B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of camera equipment, and in particular to a method, device and electronic device for determining a monitoring field of view of a camera equipment. Background Art
[0002] At present, with the continuous development of information technology, the field of social governance can display the location and orientation of camera equipment on electronic maps to count the monitoring coverage and the location where new cameras need to be installed. There are a certain scale of monitoring equipment, which only has the approximate Global Positioning System (GPS) position but no camera equipment orientation, and it is impossible to count the monitoring range of the camera equipment. In related technologies, calculating the orientation of the camera equipment requires people who are very familiar with the relevant environment to estimate the orientation of the camera equipment monitoring screen, which consumes a lot of manpower and machines, resulting in low efficiency and accuracy in determining the monitoring field of view of the camera equipment.
[0003] Currently, no effective solution has been proposed for the problem of low efficiency and accuracy in determining the monitoring field of view of camera equipment in related technologies. Summary of the invention
[0004] Embodiments of the present application provide a method, device, and electronic device for determining a monitoring field of view of a camera device, so as to at least solve the problem of low efficiency and accuracy in determining a monitoring field of view of a camera device in the related art.
[0005] In a first aspect, an embodiment of the present application provides a method for determining a monitoring field of view of a camera device, the method comprising:
[0006] Acquire a monitoring image of the camera device, and acquire shadow feature points of at least three target objects in the monitoring image;
[0007] Calculating the solar azimuth according to the shooting information of the monitoring image, and calculating the shadow direction corresponding to each of the target objects according to the solar azimuth;
[0008] Based on the shadow feature point, construct a corresponding target pixel ray, and determine a conversion relationship between the target pixel ray and the world coordinate system;
[0009] Based on the conversion relationship, the shadow direction and the shadow feature points, a monitoring field of view of the camera device is determined.
[0010] In some embodiments, the shooting information includes shooting time and shooting location; and calculating the solar azimuth according to the shooting information corresponding to the monitoring image includes:
[0011] Calculating the picture time difference according to the shooting position, calculating the true solar time according to the picture time difference and the shooting time, and calculating the hour angle according to the true solar time;
[0012] Calculating the declination according to the shooting time;
[0013] Calculating the solar altitude angle according to the hour angle, the declination and the shooting position;
[0014] The solar azimuth angle is calculated according to the solar altitude angle, the hour angle, the declination and the shooting position.
[0015] In some embodiments, the calculating the solar azimuth angle according to the solar altitude angle, the hour angle, the declination and the shooting position includes:
[0016] Calculating an initial azimuth angle according to the solar altitude angle, the hour angle, the declination and the shooting position;
[0017] It is determined whether the shooting time is greater than or equal to noon time, and the solar azimuth is calculated based on the determination result and the initial azimuth.
[0018] In some embodiments, the shadow feature point includes a shadow start point and a shadow end point; and constructing a corresponding target pixel ray based on the shadow feature point includes:
[0019] Constructing a first target pixel ray in the camera coordinate system according to the shadow starting point, the optical center of the camera device and the unknown focal length;
[0020] A second target pixel ray located in the camera coordinate system is constructed according to the shadow end point, the optical center of the camera device and the unknown focal length.
[0021] In some embodiments, determining the transformation relationship between the camera coordinate system and the world coordinate system of the target pixel ray includes:
[0022] Determine a first conversion relationship between the camera coordinate system and the world coordinate system for the first target pixel ray according to an unknown yaw angle and an unknown pitch angle of the camera device;
[0023] A second conversion relationship between the camera coordinate system and the world coordinate system is determined for the second target pixel ray according to the unknown yaw angle and the unknown pitch angle.
[0024] In some embodiments, determining the monitoring direction of the camera device based on the conversion relationship, the shadow direction and the shadow feature point includes:
[0025] Determine a correspondence between a first target pixel ray, a second target pixel ray, and the shadow direction in the world coordinate system;
[0026] Establishing a parameter solving model according to the first conversion relationship, the second conversion relationship and the corresponding relationship;
[0027] Inputting the shadow feature points of the at least three target objects into the parameter solution model respectively, and calculating the yaw angle parameter, the pitch angle parameter and the focal length parameter of the camera device;
[0028] The monitoring direction of the camera device is determined according to the yaw angle parameter and the pitch angle parameter, and the field of view angle of the camera device is determined according to the focal length parameter; the monitoring field of view includes the monitoring direction and the field of view angle.
[0029] In some embodiments, each of the target objects is captured in the same surveillance image; or, each of the target objects is captured in surveillance images in different time periods.
[0030] In a second aspect, an embodiment of the present application provides a monitoring field of view determination device for a camera device, the device comprising:
[0031] An acquisition module, used to acquire a monitoring image of the camera device and acquire shadow feature points of at least three target objects in the monitoring image;
[0032] A shadow direction calculation module, used to calculate the solar azimuth according to the shooting information of the monitoring image, and calculate the shadow direction corresponding to each target object according to the solar azimuth;
[0033] A conversion module, used to construct a corresponding target pixel ray based on the shadow feature point, and determine a conversion relationship between the target pixel ray and the monitoring direction of the camera device;
[0034] The field of view determination module is used to determine the monitoring field of view of the camera device based on the conversion relationship, the shadow direction and the shadow feature points.
[0035] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for determining a monitoring field of view of a camera device as described in the first aspect above is implemented.
[0036] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for determining a monitoring field of view of a camera device as described in the first aspect above.
[0037] Compared with the related art, the monitoring field of view determination method, device and electronic device of the camera device provided in the embodiment of the present application obtain the monitoring image of the camera device and obtain the shadow feature points of at least three target objects in the monitoring image; calculate the solar azimuth according to the shooting information of the monitoring image, and calculate the shadow direction corresponding to each target object according to the solar azimuth; construct the corresponding target pixel ray based on the shadow feature point, and determine the conversion relationship between the target pixel ray and the world coordinate system; determine the monitoring field of view of the camera device based on the conversion relationship, shadow direction and shadow feature point. Based on this, the monitoring field of view determination method of the camera device is supported by calculating the orientation angle of the camera device through the shadow angle of the object in the camera device shooting picture, and based on the principle that the pixel coordinates can be converted to the ray in the world coordinate system, by inputting more than 3 groups of shadow feature points at different positions, the accuracy of the camera device orientation can be effectively improved, and the distortion of the shadow direction caused by the transformation of the camera device attitude angle can be effectively reduced, and there is no need for human effort to estimate the orientation of the camera device picture, which solves the problem of efficiency and accuracy in determining the monitoring field of view of the camera device.
[0038] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0040] Figure 1 It is a hardware structure block diagram of a terminal of a monitoring field of view determination method of a camera device according to an embodiment of the present application;
[0041] Figure 2 is a flow chart of a method for determining a monitoring field of view of a camera device according to an embodiment of the present application;
[0042] Figure 3 is a flow chart of another method for determining a monitoring field of view of a camera device according to an embodiment of the present application;
[0043] Figure 4 It is a structural block diagram of a monitoring field of view determination device of a camera device according to an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the contents disclosed in the present application, some changes such as design, manufacturing or production based on the technical contents disclosed in the present application are only conventional technical means, and should not be understood as insufficient contents disclosed in the present application.
[0045] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0046] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantity limitation, and may indicate the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application means greater than or equal to two. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. The terms "first", "second", "third" and the like involved in the present application are merely used to distinguish similar objects and do not represent a specific ordering of the objects.
[0047] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. Taking running on a terminal as an example, Figure 1 1 is a hardware structure block diagram of a terminal of a monitoring field of view determination method of a camera device according to an embodiment of the present application. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0048] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the monitoring field of view determination method of the camera device in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0049] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0050] This embodiment provides a method for determining a monitoring field of view of a camera device. Figure 2 is a flow chart of a method for determining a monitoring field of view of a camera device according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps:
[0051] Step S210: acquiring a monitoring image from a camera device, and acquiring shadow feature points of at least three target objects in the monitoring image.
[0052] The target object can be a pre-marked object in the environment that can be monitored by the camera device. Usually, objects perpendicular to the ground plane in the environment are selected as target objects, such as electric poles, trees or people. The shadow body perpendicular to the ground plane can show more obvious shadow features in the monitoring image. Therefore, by selecting objects perpendicular to the ground plane in the environment as target objects, it can effectively assist the subsequent shadow feature recognition. The shadow feature points of each target object obtained from the monitoring image can be the middle point, starting point or end point of the shadow.
[0053] In addition, it should be noted that the at least three target objects mentioned above may be objects at different positions in the same image taken by the same camera device; or, a part of the target objects, or all the target objects, may be objects in images taken by the same camera device in different time periods.
[0054] Step S220, calculating the solar azimuth according to the shooting information of the monitoring image, and calculating the shadow direction corresponding to each target object according to the solar azimuth.
[0055] The solar azimuth, that is, the azimuth of the sun, refers to the angle between the projection of the sun's rays on the ground plane and the local meridian, which can be roughly regarded as the angle between the shadow of a straight line erected on the ground in the sun and the south direction. Among them, a model method can be used to determine the solar azimuth corresponding to the monitoring image based on the longitude and latitude information of the shooting point where the camera is located combined with the shooting time point, or any other possible method can be used to determine the solar azimuth information. For example, the solar azimuth can be calculated based on the longitude and latitude information and the shooting time point combined with astronomical mathematical formulas. Afterwards, the actual shadow direction can be determined based on the solar azimuth, that is, the direction opposite to the solar azimuth is determined as the actual shadow direction of the target object in the corresponding monitoring image.
[0056] Step S230: construct corresponding target pixel rays based on the shadow feature points, and determine the conversion relationship between the target pixel rays in the camera coordinate system and the world coordinate system.
[0057] For at least two shadow feature points such as shadow endpoints, the corresponding target pixel rays passing through each shadow feature point can be constructed starting from the optical center of the camera. The target pixel rays can be transformed from the camera coordinate system to the world coordinate system based on the rotation matrix constructed by the pitch angle and yaw angle of the camera device. Among them, the camera coordinate system is a coordinate system constructed by the camera device; usually, the camera coordinate system is established with the focusing center (i.e., optical center) of the camera device as the origin and the optical axis as the Z axis. The world coordinate system is a fixed, global coordinate system used to describe the absolute positions of all objects in the environment.
[0058] Step S240, determining the monitoring field of view of the camera device based on the conversion relationship, the shadow direction and the shadow feature points.
[0059] Among them, the relationship between the target pixel ray and the pitch angle, yaw angle, and focal length of the camera device can be determined through the above conversion relationship. Based on the constructed relationship, the above calculated shadow direction and at least three groups of shadow feature points are substituted, and finally the monitoring direction and field angle of the camera device can be calculated, thereby determining the monitoring field of view of the camera device. It should be understood that in the above-mentioned method for determining the monitoring field of view of the camera device, there is no requirement for the shooting time of the camera device (not limited to a certain time period), and it is only necessary that the shadow of the target object exists in the picture shot by the camera device.
[0060] In the above-mentioned method for determining the monitoring field of view of the camera device, by constructing the target pixel ray and the conversion relationship between the target pixel ray and the world coordinate system, the monitoring field of view of the camera device is finally determined based on the conversion relationship and the shadow direction, thereby supporting the monitoring field of view determination method of calculating the orientation angle of the camera device through the shadow angle of the object in the picture taken by the camera device, and based on the principle that pixel coordinates can be converted into rays in the world coordinate system, by inputting more than 3 groups of shadow feature points in different positions, the accuracy of the orientation of the camera device can be effectively improved, and the shadow direction distortion caused by the posture angle transformation of the camera device can be effectively reduced. There is no need for human resources to estimate the orientation of the camera device picture, which solves the problem of efficiency and accuracy in determining the monitoring field of view of the camera device.
[0061] In some embodiments, the shooting information includes shooting time and shooting location; the calculation of the solar azimuth angle according to the shooting information corresponding to the monitoring image may also include the following steps:
[0062] Step S221, calculate the picture time difference according to the shooting position, calculate the true solar time according to the picture time difference and the shooting time, and calculate the hour angle according to the true solar time.
[0063] The image time difference refers to the time zone difference between the shooting location of the corresponding surveillance image and Beijing time. The calculation formula of the time difference is as follows:
[0064]
[0065] In the above formula, delt time It is used to indicate the time difference, and lon is used to indicate the longitude of the shooting location.
[0066] Apparent solar time, also known as apparent solar time or simply apparent time, is a time system in astronomy. It takes the time interval between two consecutive transits of the center of the sun's apparent disk (i.e. the sun is at its highest point) as a true solar day, and divides this true solar day into 24 hours for timing. One of the calculation formulas for true solar time is as follows:
[0067] ST=time+delt time
[0068] In the above formula, ST is used to represent the true solar time; time is used to represent the specific shooting time of the monitoring image, for example, the shooting time point expressed in the form of hours-minutes-seconds.
[0069] The hour angle is defined as the angle of the sun relative to the meridian of the observer's location, measured in hours (15° per hour). The formula for calculating the hour angle h based on true solar time is as follows:
[0070] h=15×(ST-12)
[0071] Step S222, calculating the declination according to the shooting time.
[0072] Declination is one of the two coordinate data in the equatorial coordinate system in astronomy (the other is right ascension), which is similar to latitude on the earth and is the projection of latitude on the celestial sphere. In this embodiment, one of the calculation formulas for declination is as follows:
[0073]
[0074] In the above formula, δ D Used to indicate declination, day refers to the number of days from January 1st when the photo was taken.
[0075] Step S223, calculating the solar altitude angle according to the hour angle, declination and shooting position.
[0076] The solar altitude angle is the angle between the sun's rays and the horizon at the observation point. One of the calculation formulas for the solar altitude angle is as follows:
[0077]
[0078] in, It is used to indicate the solar altitude angle, and lat is used to indicate the latitude of the shooting location.
[0079] Step S224, calculating the solar azimuth angle according to the solar altitude angle, hour angle, declination and shooting position.
[0080] Through the above steps S221 to S224, the true solar time, hour angle, declination, solar altitude angle and solar azimuth are calculated based on the shooting time, shooting position and picture time difference, thereby taking into account multiple factors such as solar declination, earth rotation and geographical latitude of the observation point, ensuring the calculation accuracy. In addition, this method is not only applicable to the calculation of solar azimuth at a specific location and a specific time, but can also be extended to the calculation of different locations, different dates and times. As long as the correct parameters (such as shooting time and shooting position) are input, the corresponding solar azimuth can be obtained, so it also provides a wide range of applications.
[0081] In some embodiments, the above-mentioned calculation of the solar azimuth angle according to the solar altitude angle, hour angle, declination and shooting position may also include the following steps:
[0082] The initial azimuth is calculated according to the solar altitude angle, hour angle, declination and shooting position; it is determined whether the shooting time is greater than or equal to noon time, and the solar azimuth is calculated based on the determination result and the initial azimuth.
[0083] Specifically, the initial solar azimuth angle The calculation formula is as follows:
[0084]
[0085] Next, in order to further improve the accuracy of the solar azimuth angle, it is also possible to determine whether the shooting time point corresponding to the monitoring image is after noon, and finally calculate the solar azimuth angle angle with the preparation direction as 0° and the clockwise rotation direction as positive. The calculation formula can be expressed as follows:
[0086]
[0087] Through the above embodiment, taking into account the change of the solar azimuth before and after noon, the judgment of the shooting time point is also supplemented, and the initial azimuth is adjusted based on the judgment result of this time point, thereby effectively improving the calculation accuracy of the solar azimuth, and then improving the accuracy of determining the monitoring field of view of the camera equipment.
[0088] In some embodiments, the shadow feature points include a shadow start point and a shadow end point; wherein the shadow start point is a point in the shadow end point that is relatively close to the target object, and the shadow end point is a point in the shadow end point that is relatively far from the target object. The above-mentioned construction of the corresponding target pixel ray based on the shadow feature points may also include the following steps:
[0089] According to the shadow starting point, the optical center of the camera device and the unknown focal length, a first target pixel ray located in the camera coordinate system is constructed; according to the shadow ending point, the optical center of the camera device and the unknown focal length, a second target pixel ray located in the camera coordinate system is constructed.
[0090] The first target pixel ray and the second target pixel ray can be expressed as follows:
[0091]
[0092] In the above formula, (u, v) represents the target pixel coordinates, that is, the coordinates of the target object's shadow start point or shadow end point in the camera coordinate system. (ncx, ncy) is the image center coordinate, which is the projection of the camera's optical center in the image. f is used to represent the unknown focal length to be solved.
[0093] In some embodiments, the above-mentioned determination of the conversion relationship between the camera coordinate system and the world coordinate system of the target camera may further include the following steps:
[0094] According to the unknown yaw angle and pitch angle of the camera device, the first transformation relationship between the camera coordinate system and the world coordinate system of the first target pixel ray is determined; according to the unknown yaw angle and pitch angle, the second transformation relationship between the camera coordinate system and the world coordinate system of the second target pixel ray is determined.
[0095] Specifically, assuming that the yaw angle of the camera device is , the yaw angle is δ, the focal length is f, then we can get the following formula:
[0096]
[0097] In the above formula, R z is the rotation matrix around the z-axis (yaw angle), which can be expressed as:
[0098]
[0099] R y is the rotation matrix around the y-axis (pitch angle), which can be expressed as:
[0100]
[0101] Rconvert It is a matrix that converts the x, y, and z axes of the world coordinate system to each other, which can be expressed as:
[0102]
[0103] x w ,y w 、z w are the x-axis, y-axis, and z-axis components of the target pixel ray in the world coordinate system. The starting point of the ray is the world coordinate system coordinate of the camera. Through the above embodiment, the ray coordinates in the camera coordinate system can be converted to the world coordinate system using the pitch angle, yaw angle, and focal length of the camera device, so that the relationship between the target pixel ray and the pitch angle, yaw angle, and focal length of the camera device can be determined based on the conversion relationship.
[0104] In some embodiments, the above-mentioned determining the monitoring direction of the camera device based on the conversion relationship, the shadow direction and the shadow feature point may also include the following steps:
[0105] Determine the correspondence between the first target pixel ray, the second target pixel ray, and the shadow direction in the world coordinate system; establish a parameter solution model based on the first conversion relationship, the second conversion relationship and the corresponding relationship; input the shadow feature points of at least three target objects into the parameter solution model respectively, and calculate the yaw angle parameter, pitch angle parameter and focal length parameter of the camera device; determine the monitoring direction of the camera device based on the yaw angle parameter and the pitch angle parameter, and determine the field of view of the camera device based on the focal length parameter; the monitoring field of view includes the monitoring direction and the field of view angle.
[0106] Among them, through the above steps of calculating the solar azimuth, the direction k value of the starting point and the end point of the shadow in the actual scene can be obtained (that is, the tan value of the complementary angle of the solar azimuth). In addition, since the starting point and the end point of the shadow are on the same ground plane, that is, the z coordinates in the actual scene are equal, and the starting points of the first target pixel ray and the second target pixel ray are both the coordinates of the camera in the world coordinate system, they can be offset as (0, 0, 0).
[0107] Since k represents the direction of the shadow on the ground plane, it corresponds to the intersection of the starting point ray and the ending point ray on the ground plane, and the slope formed between their intersections is k. For this intersection, considering that the starting points of the two rays are the same and both are on the ground plane, the z-axis components are the same. In other words, the first target pixel ray and the second target pixel ray can be equivalently expressed as ; When z is the same, x and y are the coordinates on the ground plane, expressed as: , .
[0108] Based on the above analysis, the corresponding relationship between the first target pixel ray, the second target pixel ray and the shadow direction is as follows:
[0109]
[0110] In the above formula, x w1 ,y w1 、z w1 are the x-axis, y-axis, and z-axis components of the first target pixel ray passing through the shadow starting point in the world coordinate system. w2 ,y w2 、z w2 They are respectively the x-axis, y-axis, and z-axis components of the second target pixel ray passing through the shadow endpoint in the world coordinate system.
[0111] By combining the expressions of the first conversion relationship, the second conversion relationship and the corresponding relationship, the following equation group can be established as a parameter to solve the mathematical model:
[0112]
[0113] In the mathematical model established above, there are three unknown quantities, namely the pitch angle, yaw angle and focal length of the camera device. Because these three parameters are fixed in the camera device at the same fixed point, when at least three sets of shadow starting points and shadow end points are obtained as input, more than three sets of the above equations can be obtained, and the pitch angle, yaw angle and focal length of the camera device can be solved by optimization methods such as particle swarm or Newton gradient iteration method, and then the orientation angle and field of view of the camera device can be obtained. Among them, the orientation angle of the camera device, that is, the monitoring direction is determined by the yaw angle and the pitch angle. The yaw angle determines the rotation in the horizontal direction, while the pitch angle determines the rotation in the vertical direction. The size of the field of view angle is inversely proportional to the focal length; in this embodiment, the field of view angle of the camera device can be determined according to the focal length parameter obtained by solving. After determining the monitoring direction and field of view angle, the monitoring field of view of the camera device can be determined.
[0114] Through the above embodiments, while improving the accuracy of calculating the orientation of the camera device, the field of view angle and the pitch angle of the camera device can also be calculated, thereby ensuring the comprehensiveness of the monitoring field of view of the camera device.
[0115] The embodiments of the present application are described and illustrated below through preferred embodiments. Figure 3 is a flow chart of another method for determining a monitoring field of view of a camera device according to an embodiment of the present application. Figure 3 As shown, the process includes the following steps:
[0116] Step S301, obtaining the longitude and latitude of the shooting location where the camera device is located.
[0117] Step S302, obtaining the shadow starting point and the shadow ending point of each target object in the monitoring image in the actual scene, and obtaining the image shooting time.
[0118] Step S303, constructing corresponding target pixel rays according to the shadow starting point and shadow end point of each monitoring image from monitoring image 1 to monitoring image n; calculating the solar azimuth according to the shooting time of each monitoring image, and determining the actual scene shadow direction corresponding to each image according to the calculated solar azimuth.
[0119] Step S304: Calculate the orientation and field of view of the camera device according to the output result of the above step S303, so as to determine the parameters of the camera device.
[0120] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0121] This embodiment also provides a monitoring field of view determination device for a camera device, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the terms "module", "unit", "subunit", etc. may be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0122] Figure 4 is a structural block diagram of a monitoring field of view determination device of a camera device according to an embodiment of the present application, such as Figure 4 As shown, the device includes: an acquisition module 41, which is used to acquire a monitoring image of a camera device and acquire shadow feature points of at least three target objects in the monitoring image; a shadow direction calculation module 42, which is used to calculate the solar azimuth according to the shooting information of the monitoring image, and calculate the shadow direction corresponding to each target object according to the solar azimuth; a conversion module 43, which is used to construct corresponding target pixel rays based on the shadow feature points, and determine the conversion relationship between the target pixel rays and the monitoring direction of the camera device; a field of view determination module 44, which is used to determine the monitoring field of view of the camera device based on the conversion relationship, the shadow direction and the shadow feature points.
[0123] In some embodiments, the shooting information includes shooting time and shooting location; the shadow direction calculation module 42 is also used to calculate the picture time difference according to the shooting location, calculate the true solar time according to the picture time difference and the shooting time, and calculate the hour angle according to the true solar time; the shadow direction calculation module 42 calculates the declination according to the shooting time; calculates the solar altitude angle according to the hour angle, declination and shooting location; the shadow direction calculation module 42 is also used to calculate the solar azimuth according to the solar altitude angle, hour angle, declination and shooting location.
[0124] In some of the embodiments, the shadow direction calculation module 42 is also used to calculate the initial azimuth according to the solar altitude angle, hour angle, declination and shooting position; the shadow direction calculation module 42 is also used to determine whether the shooting time is greater than or equal to noon time, and calculate the solar azimuth based on the determination result and the initial azimuth.
[0125] In some of the embodiments, the shadow feature points include a shadow start point and a shadow end point; the conversion module 43 is also used to construct a first target pixel ray in the camera coordinate system according to the shadow start point, the optical center of the camera device and the unknown focal length; the conversion module 43 constructs a second target pixel ray in the camera coordinate system according to the shadow end point, the optical center of the camera device and the unknown focal length.
[0126] In some of the embodiments, the above-mentioned conversion module 43 is also used to determine a first conversion relationship between the camera coordinate system and the world coordinate system for the first target pixel ray based on the unknown yaw angle and the unknown pitch angle of the camera device; the conversion module 43 determines a second conversion relationship between the camera coordinate system and the world coordinate system for the second target pixel ray based on the unknown yaw angle and the unknown pitch angle.
[0127] In some of the embodiments, the field of view determination module 44 is also used to determine the correspondence between the first target pixel ray, the second target pixel ray, and the shadow direction in the world coordinate system; the field of view determination module 44 is also used to establish a parameter solution model based on the first conversion relationship, the second conversion relationship and the corresponding relationship; the field of view determination module 44 is also used to input the shadow feature points of at least three target objects into the parameter solution model respectively, and calculate the yaw angle parameters, pitch angle parameters and focal length parameters of the camera device; the field of view determination module 44 is also used to determine the monitoring direction of the camera device based on the yaw angle parameters and the pitch angle parameters, and determine the field of view angle of the camera device based on the focal length parameters; the monitoring field of view includes the monitoring direction and the field of view angle.
[0128] In some of the embodiments, each target object is captured in the same surveillance image; or, each target object is captured in surveillance images in different time periods.
[0129] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0130] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0131] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0132] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0133] S1, obtaining a monitoring image from a camera device, and obtaining shadow feature points of at least three target objects in the monitoring image.
[0134] S2, calculating the solar azimuth according to the shooting information of the monitoring image, and calculating the shadow direction corresponding to each target object according to the solar azimuth.
[0135] S3, based on the shadow feature points, construct the corresponding target pixel ray, and determine the conversion relationship between the target pixel ray and the world coordinate system.
[0136] S4, determining the monitoring field of view of the camera device based on the conversion relationship, the shadow direction and the shadow feature points.
[0137] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0138] In addition, in combination with the monitoring field of view determination method of the camera device in the above embodiment, the embodiment of the present application can provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by the processor, any of the monitoring field of view determination methods of the camera device in the above embodiment is implemented.
[0139] Those skilled in the art should understand that the technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0140] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for determining a monitoring field of view of a camera device, characterized in that: The method comprises: Acquire a monitoring image of the camera device, and acquire shadow feature points of at least three target objects in the monitoring image; Calculating the solar azimuth according to the shooting information of the monitoring image, and calculating the shadow direction corresponding to each of the target objects according to the solar azimuth; Based on the shadow feature points, a corresponding target pixel ray is constructed, including: Construct the first target pixel ray in the camera coordinate system according to the shadow starting point, the optical center of the camera device and the unknown focal length; Constructing a second target pixel ray located in the camera coordinate system according to the shadow endpoint, the optical center of the camera device and the unknown focal length; The target pixel ray refers to a ray passing through each of the shadow feature points, starting from the optical center of the camera device; the shadow feature point includes the shadow start point and the shadow end point; Determining the transformation relationship between the camera coordinate system and the world coordinate system of the target pixel ray includes: Determine a first conversion relationship between the camera coordinate system and the world coordinate system for the first target pixel ray according to an unknown yaw angle and an unknown pitch angle of the camera device; Determine a second conversion relationship between the camera coordinate system and the world coordinate system for the second target pixel ray according to the unknown yaw angle and the unknown pitch angle; Determining the monitoring field of view of the camera device based on the conversion relationship, the shadow direction and the shadow feature point includes: Determine a correspondence between a first target pixel ray, a second target pixel ray, and the shadow direction in the world coordinate system; Establishing a parameter solving model according to the first conversion relationship, the second conversion relationship and the corresponding relationship; Inputting the shadow feature points of the at least three target objects into the parameter solution model respectively, and calculating the yaw angle parameter, the pitch angle parameter and the focal length parameter of the camera device; The monitoring direction of the camera device is determined according to the yaw angle parameter and the pitch angle parameter, and the field of view angle of the camera device is determined according to the focal length parameter; the monitoring field of view includes the monitoring direction and the field of view angle.
2. The method for determining the monitoring field of view of a camera device according to claim 1, characterized in that: The shooting information includes shooting time and shooting location; and the calculating the solar azimuth according to the shooting information corresponding to the monitoring image includes: Calculating the picture time difference according to the shooting position, calculating the true solar time according to the picture time difference and the shooting time, and calculating the hour angle according to the true solar time; Calculating the declination according to the shooting time; Calculating the solar altitude angle according to the hour angle, the declination and the shooting position; The solar azimuth angle is calculated according to the solar altitude angle, the hour angle, the declination and the shooting position.
3. The method for determining the monitoring field of view of a camera device according to claim 2, characterized in that: The step of calculating the solar azimuth angle according to the solar altitude angle, the hour angle, the declination and the shooting position comprises: Calculating an initial azimuth angle according to the solar altitude angle, the hour angle, the declination and the shooting position; It is determined whether the shooting time is greater than or equal to noon time, and the solar azimuth is calculated based on the determination result and the initial azimuth.
4. The method for determining the monitoring field of view of a camera device according to any one of claims 1 to 3, characterized in that: The target objects are captured in the same surveillance image; or, the target objects are captured in surveillance images in different time periods.
5. A monitoring field of view determination device for a camera device, characterized in that: The device comprises: An acquisition module, used to acquire a monitoring image of the camera device and acquire shadow feature points of at least three target objects in the monitoring image; A shadow direction calculation module, used to calculate the solar azimuth according to the shooting information of the monitoring image, and calculate the shadow direction corresponding to each target object according to the solar azimuth; A conversion module, used to construct a corresponding target pixel ray based on the shadow feature point, and determine a conversion relationship between the target pixel ray and the monitoring direction of the camera device; The conversion module is also used to construct a first target pixel ray located in the camera coordinate system according to the shadow starting point, the optical center of the camera device and the unknown focal length; The conversion module is also used to construct a second target pixel ray located in the camera coordinate system according to the shadow end point, the optical center of the camera device and the unknown focal length; The conversion module is also used to determine a first conversion relationship between the camera coordinate system and the world coordinate system for the first target pixel ray according to an unknown yaw angle and an unknown pitch angle of the camera device; The conversion module is further used to determine a second conversion relationship between the camera coordinate system and the world coordinate system for the second target pixel ray according to the unknown yaw angle and the unknown pitch angle; The target pixel ray refers to a ray passing through each of the shadow feature points, starting from the optical center of the camera device; the shadow feature point includes the shadow start point and the shadow end point; A field of view determination module, used to determine the monitoring field of view of the camera device based on the conversion relationship, the shadow direction and the shadow feature points; The field of view determination module is further used to determine the corresponding relationship between the first target pixel ray, the second target pixel ray, and the shadow direction in the world coordinate system; The field of view determination module is further used to establish a parameter solution model according to the first conversion relationship, the second conversion relationship and the corresponding relationship; The field of view determination module is also used to input the shadow feature points of the at least three target objects into the parameter solution model respectively, and calculate the yaw angle parameter, pitch angle parameter and focal length parameter of the camera device; The field of view determination module is also used to determine the monitoring direction of the camera device according to the yaw angle parameter and the pitch angle parameter, and determine the field of view angle of the camera device according to the focal length parameter; the monitoring field of view includes the monitoring direction and the field of view angle.
6. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the monitoring field of view determination method of the camera device according to any one of claims 1 to 4.
7. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the monitoring field of view determination method of the camera device according to any one of claims 1 to 4 when running.
