Camera layout method and device
By establishing a linear planning mathematical model and optimizing the camera layout, the problem of poor camera layout based on subjective experience in the existing technology is solved, and full coverage of monitoring areas and efficient utilization of resources are achieved.
Patent Information
- Application Number
- CN202211293636.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-21
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2042-10-21
AI Technical Summary
In the prior art, the layout method of cameras based on personal subjective experience has poor layout effect, making it difficult to achieve full coverage of monitoring areas and easily cause resource waste.
By obtaining the set of supply points and demand points in the target monitoring area, combining the effective monitoring area and installation posture of the camera, a linear planning mathematical model is established to optimize the camera layout, ensuring that each demand point is covered by the effective monitoring area of at least one camera. And limit the installation position of the camera within the range of the supply point collection.
It achieves a better camera layout effect, reduces the use of cameras, reduces the probability of monitoring blind spots, and ensures full coverage of monitoring areas.
Smart Images

Figure CN115883981B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of surveillance camera site selection and layout, and specifically relates to a camera layout method and device. Background Art
[0002] With the enhancement of security awareness, video surveillance systems, as an important part of security work, have been widely used in various scenarios, such as general monitoring of regional cities, traffic network monitoring, face recognition, crowd behavior analysis, forest fire monitoring, etc.
[0003] For video surveillance systems, especially those in public areas, a large number of cameras are involved. The main problem to be solved is how to minimize the number of cameras while ensuring that all designated areas to be monitored are monitored by cameras.
[0004] At present, this kind of problem is mainly solved by video surveillance system designers based on their personal subjective experience. However, this method is prone to blind spots, that is, failure to achieve full coverage of the surveillance area, and it is also easy to waste resources, that is, using redundant cameras to complete the surveillance task. It can be seen that the existing camera layout method has the problem of poor layout effect. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a camera layout method and device to solve the problem of poor layout effect of the camera layout method based on personal subjective experience in the prior art.
[0006] In a first aspect, an embodiment of the present application provides a camera layout method, including:
[0007] Obtain a supply point set and a demand point set in the target monitoring area; wherein the supply point set is a set of location points in the target monitoring area where cameras can be installed, and the demand point set is a set of location points in the target monitoring area that need to be monitored and covered;
[0008] Obtaining an effective monitoring area and an installation posture set of a camera; wherein the installation posture set is a set of installation postures supported by the camera;
[0009] A camera layout model is established according to the supply point set, the demand point set, the effective monitoring area of the camera, and the installation posture set of the camera; wherein the camera layout model is a linear programming mathematical model, including: an objective function, a first constraint condition and a second constraint condition, the objective function is used to solve the minimum value of the number of camera installations based on the installation posture and installation position of the camera; the first constraint condition is used to limit each demand point in the demand point set to be covered by the effective monitoring area of at least one camera; the second constraint condition is used to limit the installation position of the camera to within the range of the supply point set;
[0010] The camera layout model is solved to obtain the minimum number of installed cameras, and the installation position and installation posture of each camera when the number of installed cameras takes the minimum value.
[0011] In a second aspect, an embodiment of the present application provides a camera layout device, including:
[0012] A first acquisition module is used to acquire a supply point set and a demand point set in a target monitoring area; wherein the supply point set is a set of location points in the target monitoring area where cameras can be installed, and the demand point set is a set of location points in the target monitoring area that need to be monitored and covered;
[0013] A second acquisition module is used to acquire an effective monitoring area and an installation posture set of a camera; wherein the installation posture set is a set of installation postures supported by the camera;
[0014] A model building module, used to build a camera layout model according to the supply point set, the demand point set, the effective monitoring area of the camera and the installation posture set of the camera; wherein the camera layout model is a linear programming mathematical model, including: an objective function, a first constraint condition and a second constraint condition, the objective function is used to solve the minimum value of the number of camera installations based on the installation posture and installation position of the camera; the first constraint condition is used to limit each demand point in the demand point set to be covered by the effective monitoring area of at least one camera; the second constraint condition is used to limit the installation position of the camera to within the range of the supply point set;
[0015] The model solving module is used to solve the camera layout model to obtain the minimum number of installed cameras and the installation position and installation posture of each camera when the number of installed cameras takes the minimum value.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps in the camera layout method described in the first aspect are implemented.
[0017] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps in the camera layout method described in the first aspect are implemented.
[0018] The technical solution provided in the embodiment of the present application uses a linear programming method to provide a minimum number of cameras required to fully cover the monitoring space, as well as the installation position and installation posture of the cameras when the number of cameras installed is at the minimum, given the monitoring space, monitoring requirements and camera parameters (such as the effective monitoring area and installation posture, etc.). Compared with the camera layout method based on personal subjective experience in the prior art, the embodiment of the present application can better solve the problem of full coverage layout of cameras, reduce the use of cameras and reduce the probability of monitoring blind spots, thereby obtaining a better camera layout effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A schematic diagram of a camera layout method according to an embodiment of the present application;
[0020] Figure 2 A schematic diagram of a target coordinate area provided in an embodiment of the present application;
[0021] Figure 3 A schematic diagram of the camera layout process in the example provided in the embodiment of the present application;
[0022] Figure 4 A schematic diagram of the target coordinate area in the example provided in the embodiment of the present application;
[0023] Figure 5 A schematic diagram of the output results in the example provided in the embodiment of the present application;
[0024] Figure 6 A schematic block diagram of a camera layout device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described below are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0026] It should be understood that "one embodiment" or "an embodiment" mentioned in the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner.
[0027] In the various embodiments of the present application, it should be understood that the serial numbers of the steps do not mean an absolute order of execution, and the execution order of each step should be determined by its function and internal logic. Therefore, the serial numbers of each step should not constitute an absolute limitation on the implementation process of the embodiments of the present application.
[0028] The camera layout method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0029] An embodiment of the present application provides a camera layout method, which is applied to electronic equipment.
[0030] like Figure 1 As shown, the camera layout method may include:
[0031] Step 101: Obtain a supply point set and a demand point set in a target monitoring area.
[0032] The supply point set is a set of location points in the target monitoring area where cameras can be installed, and the demand point set is a set of location points in the target monitoring area that need to be covered by monitoring.
[0033] In the embodiment of the present application, the target monitoring area can be set according to the actual monitoring scene, and can be set to a regular shape, such as a rectangle, a circle, etc., or it can be set to an irregular shape.
[0034] Step 102: Obtain the effective monitoring radius and installation posture set of the camera.
[0035] The actual effective monitoring radius of the camera can be set according to the model parameters of the camera required for monitoring (such as the maximum monitoring radius supported) and the actual coverage requirements of the monitoring scene (such as the required maximum monitoring radius). For example, if the maximum monitoring radius supported by the camera is 10 meters and the maximum monitoring radius required by the monitoring scene is 8 meters, the effective monitoring radius of the camera can be set to 8 meters. The effective monitoring radius of the camera can be set manually or automatically determined by the device based on the model parameters of the camera and the actual coverage requirements of the monitoring scene. It should be noted that the effective monitoring radius of the camera is less than or equal to the maximum monitoring radius supported by the camera.
[0036] Among them, the installation posture set is a set of installation postures supported by the camera. The installation posture described here can be understood as the installation orientation of the camera in the horizontal direction. The camera can rotate 360 degrees in the horizontal direction. When the effective monitoring area does not overlap, the maximum number of camera installation orientations is the number of camera installation postures, and each installation orientation corresponds to an installation posture. The number of camera installation postures can be determined based on the effective monitoring viewing angle of the camera. Assuming that the effective monitoring video angle of the camera is θ=π / 2, the number of camera installation postures is t=2π / θ=4, that is, there can be 4 installation postures.
[0037] Optionally, the camera installation posture set Γ can be expressed as: That is, t belongs to the natural number set that does not include 0, and the number of postures included in the installation posture set is t=card(Γ).
[0038] in, Indicates the installation posture of the camera. When the value is 1, it indicates the first installation posture of the camera. When the value is t, it indicates the tth installation posture of the camera. The installation posture represented by each number has been preset. Assuming that there are 4 installation postures, the number 1 can represent the installation posture facing due east, the number 2 can represent the installation posture facing due west, the number 3 can represent the installation posture facing due south, and the number 4 can represent the installation posture facing due north. In two-dimensional space, when the camera is installed, there is an angle α between the camera posture direction (the angle bisector direction of the monitoring angle of view) and the y-axis. If At this time, the camera installation posture can be defined as
[0039] Step 103: Establish a camera layout model according to the supply point set, the demand point set, the effective monitoring area of the camera, and the camera installation posture set.
[0040] The camera layout model established in the embodiment of the present application is a linear programming mathematical model, specifically an integer linear programming mathematical model. The model may include: an objective function, a first constraint condition, and a second constraint condition.
[0041] The objective function is used to solve the minimum number of camera installations based on the camera's installation posture and installation position. The camera can cover different demand points in different installation positions, so the number of cameras required for full coverage of the demand points may also be different. Therefore, when solving the minimum number of camera installations, the camera's installation position needs to be considered. The camera can cover different demand points in different installation postures, which will also affect the number of cameras used. Therefore, the camera's installation posture is also a factor that needs to be considered for full coverage of demand points. Compared to only referring to the installation position as a factor, the embodiment of the present application refers to more comprehensive factors when solving the minimum number of camera installations, which is conducive to improving the accuracy of the output results.
[0042] In order to ensure that each demand point can be covered by monitoring, that is, to achieve full coverage of demand points, a first constraint condition can be set to limit each demand point in the demand point set to be covered by the effective monitoring area of at least one camera, so as to avoid the problem of monitoring blind spots caused by missing demand points. Among them, the effective monitoring area of the camera can be determined based on the effective monitoring radius and effective monitoring angle of the camera. The effective monitoring area rotates around the camera as the camera installation posture changes. Generally, the effective monitoring area of a camera is a fan-shaped area. It can be defined that the demand point can be covered by the posture If it is covered by cameras, the demand point is in a fixed effective monitoring area.
[0043] In order to avoid the situation where the camera is installed at a position where it cannot be installed, a second constraint condition may be set to limit the installation position of the camera to within the range of the supply point set.
[0044] Step 104: Solve the camera layout model to obtain the minimum number of installed cameras, and the installation position and installation posture of each camera when the number of installed cameras takes the minimum value.
[0045] After the camera layout model is established, the model can be solved, that is, under the constraints of the first and second constraints, the objective function is solved to obtain the minimum number of camera installations when the full coverage condition of the demand points is met. Since the objective function is solved based on the installation posture and installation position of the camera, when the minimum number of camera installations is obtained, the installation position and installation posture of each camera when the installation number is the minimum can also be obtained. Finally, since the model is linear, the global optimal solution can be achieved, so that the minimum number of camera installations, the camera installation position, and the camera installation posture are also the optimal solution, which can reduce the use of cameras and reduce the probability of blind spots in monitoring, thereby better solving the problem of full coverage layout of cameras and obtaining better camera layout effects.
[0046] Optionally, when solving the model, the solvers that can be used include: open source solvers such as CBC and GLPK (GNU Linear Programming Kit), and commercial solvers such as CPLEX and GUROBI can also be used, which can be selected according to actual needs. In the embodiment of the present application, the pulp package of the Python language can be used to call the CBC solver to complete the model solution.
[0047] As an optional embodiment, step 101: obtaining a supply point set and a demand point set in a target monitoring area may include:
[0048] Step A1: Map the target monitoring area to a target coordinate area in a preset coordinate system.
[0049] In an embodiment of the present application, a target monitoring area including an area to be monitored and an area where a camera can be installed can be captured and then mapped to a preset coordinate system.
[0050] Optionally, the preset coordinate system may be a two-dimensional coordinate system, specifically a Cartesian coordinate system, or other types of coordinate systems. Figure 2 As shown in Figure (a), assuming that the target monitoring area is a rectangular area, the target monitoring area can be mapped to a target coordinate area 200 in a two-dimensional coordinate system, that is, a gray rectangular area in the figure. The coordinate point corresponding to the upper left corner of the target coordinate area 200 is the origin (0, 0).
[0051] Step A2: Gridding the target coordinate region to obtain multiple grids.
[0052] After mapping the target monitoring area to the target coordinate area in the preset coordinate system, the target coordinate area can be discretized, that is, gridded, to obtain multiple grids. Figure 2 As shown in FIG. 2( b ), after the target coordinate region 200 is gridded, 6×8 grids are obtained. The fineness of the grid division can be set according to actual needs, and the embodiment of the present application does not limit this.
[0053] After the gridding process is completed, if an incomplete grid is generated, it can be completed to form a complete grid, or it can be discarded. The specific setting can be based on actual needs. For example, the following strategy can be set: when the ratio of the area of the incomplete grid to the area of the complete grid is greater than or equal to a preset value, the incomplete grid is completed; when the ratio is less than a preset value, the incomplete grid can be discarded. The preset value can be a value greater than 0.5 and less than 1.
[0054] Step A3: Determine the first type of grids corresponding to the camera installable area predefined in the target monitoring area and the second type of grids corresponding to the monitoring coverage requirement area predefined in the target monitoring area among the obtained multiple grids.
[0055] In an embodiment of the present application, the areas in which cameras can be installed and the areas that need to be covered by monitoring can be pre-defined in the target monitoring area according to the actual monitoring environment. In this way, areas where cameras cannot be installed or are covered by monitoring due to obstructions can be avoided, thereby better adapting to monitoring environments with complex installation points and complex areas to be monitored, and improving the accuracy of demand points and supply points obtained subsequently.
[0056] In this step, based on the mapping relationship between the target monitoring area and the target coordinate area, the grid corresponding to the predefined camera installable area in the target coordinate area (i.e., the first type of grid) and the grid corresponding to the predefined monitoring coverage requirement area in the target coordinate area (i.e., the second type of grid) can be determined.
[0057] like Figure 2 As shown in Figure (c), the grids marked with triangles are the first type of grids, and the grids marked with circles are the second type of grids. Grids without triangles and circles represent areas where the field of view is blocked. Cameras cannot be installed in areas represented by such grids, and they cannot be covered by surveillance.
[0058] Step A4: Determine the coordinates of the center point of the first type of grid and the coordinates of the center point of the second type of grid.
[0059] Step A5: Determine the set consisting of the center points of the first type of grids as the supply point set, and determine the set consisting of the center points of the second type of grids as the demand point set.
[0060] In the embodiment of the present application, after the target coordinate area is gridded, the center point coordinates of each grid can be determined, and the center point coordinates are used to represent the corresponding grid area. The set of center point coordinates of the first type of grids is the supply point set, and the set of center point coordinates of the second type of grids is the demand point set.
[0061] Assume that the target coordinate area is a rectangular area, its horizontal coordinate value range is [0, m], its vertical coordinate value range is [0, n], the set of all grid center points in the target coordinate area is S, the horizontal coordinate of the grid center point is represented by i, and the vertical coordinate is represented by j, then S = {(i, j)}, where i≤m, j≤n. When i and j are both integers, then i, j∈N, that is, i and j both belong to the set of natural numbers. Assume that the supply point set is represented by C and the demand point set is represented by D, then The problem of selecting the location for full camera coverage can be summarized as the following mathematical problem: Given a set of two-dimensional points S, a set of supply points C, and a set of demand points D, determine the coverage relationship between supply points and demand points based on given camera parameters. By optimally allocating cameras to supply points and optimizing the installation posture, each demand point can be covered by the effective monitoring area of the camera.
[0062] In the embodiment of the present application, since the supply point set and the demand point set are obtained based on the predefined camera installable area and the monitoring coverage requirement area, and the predefined camera installable area and the monitoring coverage requirement area are set based on the actual monitoring environment, the demand points and supply points obtained in this way are more accurate.
[0063] As an optional embodiment, the objective function can be expressed as:
[0064]
[0065] The parameters in the objective function are explained as follows:
[0066] (1) i represents the horizontal coordinate of each grid center point, and j represents the vertical coordinate of each grid center point.
[0067] (2) m is the maximum value of the target coordinate area in the horizontal direction of the preset coordinate system, and n is the maximum value of the target coordinate area in the vertical direction of the preset coordinate system. The minimum values of the target coordinate area in the horizontal direction (i.e., the x-axis direction) and the vertical direction (i.e., the y-axis direction) of the preset coordinate system are both 0.
[0068] (3) Indicates the installation posture of the camera, t indicates The maximum value of For a detailed explanation of the camera installation posture, please refer to the explanation of the camera installation posture in step 102, which will not be repeated here.
[0069] (4) is the decision variable. If the camera is in the grid area corresponding to the grid center point (i, j) with posture If you install otherwise That is, if the camera is not in the grid area corresponding to the grid center point (i, j) If you install
[0070] Through the objective function, each grid center point and each installation posture of the camera can be traversed to determine the minimum number of camera installations.
[0071] In the embodiment of the present application, when the minimum value of the number of camera installations is obtained through the objective function, the decision variable when the number of camera installations takes the minimum value can also be obtained. Since the decision variable The camera installation position and camera installation posture angle are integrated into the decision variable The supply point to which the camera is assigned and the installation posture at the supply point can be obtained when the number of cameras installed is the minimum. In the embodiment of the present application, a model can be used to obtain the parameter information required for the full coverage layout of the camera, thereby solving the problem of the location selection and layout of the full coverage of the camera. And the decision variables The value of is an integer, which makes the model form an integer linear programming model, ensuring the solution of the optimal solution.
[0072] As an optional embodiment, the first constraint condition can be expressed as:
[0073]
[0074] The parameters in the first constraint are explained as follows:
[0075] (1)i a represents the horizontal coordinate of the center point of the first type of grid, j a Indicates the ordinate of the center point of the first type of grid.
[0076] (2)i b represents the horizontal coordinate of the center point of the second type of grid, j b Indicates the ordinate of the center point of the second type of grid.
[0077] (3) m is the maximum value of the target coordinate area in the horizontal direction of the preset coordinate system, and n is the maximum value of the target coordinate area in the vertical direction of the preset coordinate system. The minimum values of the target coordinate area in the horizontal and vertical directions of the preset coordinate system are both 0.
[0078] (4) Indicates the installation posture of the camera, t indicates The maximum value of For a detailed explanation of the camera installation posture, please refer to the explanation of the camera installation posture in step 102, which will not be repeated here.
[0079] (5) is a decision variable. If the camera is at the center of the grid (i a , j a ) The corresponding grid area is in the posture If you install otherwise That is, the camera is not at the center of the grid (i a , j a) The corresponding grid area is in the posture If you install
[0080] (6) is a parameter with a value of 0 or 1. If the camera is at the center of the grid (i a , j a ) The corresponding grid area is in the posture Installation, the effective monitoring area of the camera can cover the center point of the grid (i b, j b ) corresponds to the grid area, then otherwise That is, if the camera is at the center of the grid (i a , j a ) The corresponding grid area is in the posture Installation, the effective monitoring area of the camera cannot cover the center point of the grid (i b, j b ) corresponds to the grid area, then
[0081] (6) is a parameter with a value of 1, indicating that the center point of the grid (i b, j b ) belongs to the demand point set. The corresponding parameter is d ij , d ij is a parameter with a value of 0 or 1. If the grid center point (i, j) belongs to the demand point set, then d ij =1, otherwise d ij =0, that is, if the grid center point (i, j) does not belong to the demand point set, then d ij =0.
[0082] In the embodiment of the present application, the first constraint condition can ensure that each demand point in the demand point set is covered by the effective monitoring area of at least one camera, so as to achieve full coverage of the demand points.
[0083] As an optional embodiment, the second constraint condition can be expressed as:
[0084]
[0085] The parameters in the second constraint are explained as follows:
[0086] (1) i represents the horizontal coordinate of each grid center point, and j represents the vertical coordinate of each grid center point.
[0087] (2)c ij is a parameter with a value of 0 or 1. If the grid center point (i, j) belongs to the supply point set, then cij =1, otherwise c ij = 0, that is, the grid center point (i, j) does not belong to the supply point set, then c ij =0.
[0088] (3) Indicates the installation posture of the camera. For a detailed explanation of the camera installation posture, please refer to the explanation of the camera installation posture in step 102, which will not be repeated here.
[0089] (4) is a decision variable. If the camera is in the grid area corresponding to the grid center point (i, j) with posture If you install otherwise
[0090] In the embodiment of the present application, the second constraint condition can be used to limit the installation position of the camera to within the range of the supply point set to avoid the situation where the camera is installed at a position where it cannot be installed.
[0091] As an optional embodiment, the camera layout model in the embodiment of the present application may further include: a third constraint condition. The third constraint condition is used to limit the target demand point in the demand point set to be covered by the effective monitoring area of at least two cameras.
[0092] In actual monitoring scenarios, different areas may have different monitoring intensity requirements, that is, some areas only need one camera to cover, while some areas need multiple cameras for multi-angle monitoring. In order to meet the monitoring needs of such demand points that require multi-angle monitoring coverage, a third constraint condition can be set to limit the target demand points in the demand point set to be covered by the effective monitoring area of at least two cameras. The target demand points mentioned here are the demand points that require multi-angle monitoring coverage.
[0093] In an embodiment of the present application, based on the problem of full coverage layout of cameras, we can start from the actual monitoring scene requirements and, through the first constraint condition and the second constraint condition, meet the different monitoring coverage requirements of different areas in the same monitoring scene, thereby performing a better camera layout.
[0094] Among them, when the number of target demand points is at least two and different target demand points have different numbers of cameras required, the third constraint condition can be specifically set for different target demand points. For example, target demand point A needs to be covered by the effective monitoring area of two cameras, that is, 2 cameras are required, then the third constraint condition can be specifically: limit target demand point A to be covered by the effective monitoring area of at least two cameras; for another example, target demand point B needs to be covered by the effective monitoring area of three cameras, that is, 3 cameras are required, then the third constraint condition can be specifically: limit target demand point B to be covered by the effective monitoring area of at least three cameras.
[0095] Alternatively, the third constraint can be expressed as:
[0096]
[0097] The parameters in the third constraint are explained as follows:
[0098] (1)i a represents the horizontal coordinate of the center point of the first type of grid, j a Indicates the ordinate of the center point of the first type of grid.
[0099] (2)i b represents the horizontal coordinate of the center point of the second type of grid, j b Indicates the ordinate of the center point of the second type of grid.
[0100] (3)i b1 Represents the horizontal coordinate of the target demand point, j b1 represents the ordinate of the target demand point. Assuming that the set of target demand points is represented by P, then That is, P belongs to the demand point set D.
[0101] (4) m is the maximum value of the target coordinate area in the horizontal direction of the preset coordinate system, and n is the maximum value of the target coordinate area in the vertical direction of the preset coordinate system; the minimum value of the target coordinate area in the horizontal and vertical directions of the preset coordinate system is 0.
[0102] (5) Indicates the installation posture of the camera, t indicates The maximum value of For a detailed explanation of the camera installation posture, please refer to the explanation of the camera installation posture in step 102, which will not be repeated here.
[0103] (6) is a decision variable. If the camera is at the center point (i a , j a ) The corresponding grid area is in the posture If you install otherwise
[0104] (7) is a parameter with a value of 0 or 1. If the camera is at the center point (i a , j a ) The corresponding grid area is in the posture Installation, the effective monitoring area of the camera can cover the center point (i b, j b ) corresponds to the grid area, then otherwise
[0105] (8) In the Before explaining, let me first ij Explain. ij is a parameter with a value of 0 or 1. If the grid center point (i, j) belongs to the target demand point set, then p ij =1, otherwise p ij =0, that is, the grid center point (i, j) does not belong to the target demand point set, then p ij = 0. is a parameter with a value of 1, indicating that the center point of the grid (i b1 , j b1 ) is the target demand point.
[0106] (9) The value of T is the number of cameras required at the target demand point minus 1.
[0107] Finally, in order to better understand the technical solution provided by the embodiment of the present application, an example is further explained below. In this example, the full coverage of cameras at conventional demand points (ie, non-target demand points) is used as an example for explanation.
[0108] like Figure 3 As shown, the example may include the following steps:
[0109] Step 301: Initial parameter setting and data preprocessing.
[0110] First, if Figure 4 As shown, the target monitoring area is mapped to a target coordinate area 300 in a two-dimensional coordinate system, and the target coordinate area is gridded to obtain 13×11=143 network areas, assuming that m=13 and n=11.
[0111] Among the 143 grid areas, there are 72 grid areas that need to be monitored (corresponding to demand points), 52 grid areas where cameras can be installed (corresponding to supply points), and 19 blocked points (i.e. grid areas where cameras cannot be installed and the field of view is blocked). Among them, the grid areas marked with circles represent the grid areas that need to be monitored, the grid areas marked with triangles represent the grid areas where cameras can be installed, and the grid areas filled with slashes represent blocked points. By solving the coordinates of the center point of each grid, we can get the set S of all center points, the set C of supply points, and the set D of demand points.
[0112] In this example, the effective monitoring radius of the camera is selected as r=3, that is, the camera can cover a distance across 3 grids. The effective monitoring viewing angle θ of the camera is selected as π / 2, so the number of camera installation postures t=4 can be obtained.
[0113] Step 302: Parameter generation.
[0114] According to the demand point and supply point Figure 4 In the position, set the corresponding d ij Parameters and c ij parameter.
[0115] First, set the all-zero matrix d of dimension (m×n) and the all-zero matrix c of dimension (m×n) respectively. Traverse the supply point coordinates (i a ,j a ), the corresponding c[i a ][j a ] element is assigned a value of 1. Traverse the coordinates of the demand point (i b ,j b ), the corresponding d[i b ][j b ] element is assigned a value of 1.
[0116] According to the location of the demand point and the supply point, as well as the effective monitoring radius, effective monitoring angle and installation posture of the camera, set Parameters. First, create a zero matrix w of dimension (m×n×t×m×n). Then traverse the demand points, that is, The coordinates are (i b ,j b ) grid point, observe the point and each grid point (i a ,j a ), and traverse all the installation postures of the camera If the demand point (i b ,j b ) can be installed at the supply point (i a ,j a ) camera to If the posture covers otherwise After traversing all points, complete Parameter settings.
[0117] Step 303: Establish a linear programming mathematical model.
[0118] Establish the objective function:
[0119]
[0120] For the explanation of the parameters in the objective function, please refer to the previous description and will not be repeated here.
[0121] Create constraints: (1)
[0123] (2)
[0125]
[0126] For the explanation of the parameters in the two constraints, please refer to the previous description and will not be repeated here.
[0127] Step 304: solving the model.
[0128] According to the mathematical programming model established in step 303, the model is written using the pulp package of the Python language. Then, the d generated in step 302 is input. ij 、c ij , Matrix parameters are used to solve mathematical programming models.
[0129] Step 305: Output the result.
[0130] After the model is solved, the decision variable results are output. Because the entire mathematical programming is linear, the entire output result is optimal.
[0131] We can get the decision variable x 13,1,3 、x 4,1,2 、x 6,1,1 、x 1,11,0 、x 13,2,2 、x 8,4,0 、x 1,5,0 、x 8,5,1 、x 1,6,1 、x 12,6,1 、x 11,9,3 、x 5,9,3 、x 7,9,3 、x 11,10,2The value is 1, which means that at least 14 cameras need to be installed. For the specific installation points of the cameras and the coverage area of each camera, see Figure 5 ,in Figure 5 In the figure, the gray grids represent the grids where cameras can be installed, the gray grids with numbers represent the final camera installation points, the white grids with numbers represent the grids corresponding to the demand points that need to be monitored and have been covered, and the white grids with the same numbers represent the effective monitoring area covered by the same camera.
[0132] In the embodiment of the present application, the mathematical modeling of the camera layout is completed using the mathematical model of linear programming. The decision variables established in the modeling process are The camera installation position and camera installation posture can be integrated, so that when solving the model, not only the minimum number of camera installations can be obtained, but also the camera installation position and camera installation posture when the number of camera installations is the minimum can be solved at the same time. Secondly, the problem solving completed by the model based on integer linear programming can ensure the solution of the optimal solution. Thirdly, the grid-based discretization mathematical modeling process and the coverage relationship parameter w in the model fully consider each demand point, which can enable the model to better cope with obstructed and complex monitoring environments.
[0133] The above is a description of the camera layout method provided in the embodiment of the present application.
[0134] In summary, in the embodiments of the present application, for the problem of full camera coverage, the minimum number of cameras required to be installed is given, and the installation position and installation posture of the camera are also given. At the same time, because the camera layout model is linear, the overall result can be the optimal result. Secondly, on the basis of optimizing the full camera coverage, the business needs of some monitoring areas that require multi-angle coverage are met. Finally, the embodiments of the present application can well adapt to monitoring environments with obstructions, complex installation points, and complex monitoring areas.
[0135] The camera layout method provided in the embodiment of the present application is introduced above. The camera layout device provided in the embodiment of the present application will be introduced below with reference to the accompanying drawings.
[0136] like Figure 6 As shown, an embodiment of the present application also provides a camera layout device, which is applied to electronic equipment.
[0137] Wherein, the camera layout device may include:
[0138] The first acquisition module 601 is used to acquire a supply point set and a demand point set in a target monitoring area.
[0139] The supply point set is a set of location points in the target monitoring area where cameras can be installed, and the demand point set is a set of location points in the target monitoring area that need to be covered by monitoring.
[0140] The second acquisition module 602 is used to acquire the effective monitoring area and installation posture set of the camera.
[0141] The installation posture set is a set of installation postures supported by the camera.
[0142] The model building module 603 is used to build a camera layout model according to the supply point set, the demand point set, the effective monitoring area of the camera and the camera installation posture set.
[0143] Among them, the camera layout model is a linear programming mathematical model, including: an objective function, a first constraint condition and a second constraint condition. The objective function is used to solve the minimum number of camera installations based on the installation posture and installation position of the camera; the first constraint condition is used to limit each demand point in the demand point set to be covered by the effective monitoring area of at least one camera; the second constraint condition is used to limit the installation position of the camera to within the range of the supply point set.
[0144] The model solving module 604 is used to solve the camera layout model to obtain the minimum number of installed cameras and the installation position and installation posture of each camera when the number of installed cameras takes the minimum value.
[0145] Optionally, the first acquisition module 601 may include:
[0146] A mapping unit is used to map the target monitoring area into a target coordinate area in a preset coordinate system.
[0147] The gridding unit is used to perform gridding processing on the target coordinate area to obtain multiple grids.
[0148] The first determining unit is used to determine a first type of grid corresponding to a camera installable area predefined in the target monitoring area and a second type of grid corresponding to a monitoring coverage requirement area predefined in the target monitoring area among the multiple grids.
[0149] The second determining unit is used to determine the coordinates of the center point of the first type of grid and the coordinates of the center point of the second type of grid.
[0150] The third determining unit is used to determine a set consisting of the center point coordinates of the first type of grids as the supply point set, and to determine a set consisting of the center point coordinates of the second type of grids as the demand point set.
[0151] Optionally,
[0152]
[0153] Wherein, i represents the abscissa of each grid center point, j represents the ordinate of each grid center point, m represents the maximum value of the target coordinate area in the abscissa direction of the preset coordinate system, and n represents the maximum value of the target coordinate area in the ordinate direction of the preset coordinate system; Indicates the installation posture of the camera; is a decision variable. If the camera is in the grid area corresponding to the grid center point (i, j) with posture If you install otherwise
[0154] Optionally, the first constraint condition is expressed as:
[0155]
[0156] Among them, i a represents the horizontal coordinate of the center point of the first type of grid, j a represents the ordinate of the center point of the first type of grid; i b represents the horizontal coordinate of the center point of the second type of grid, j b represents the ordinate of the center point of the second type of grid; m is the maximum value of the target coordinate area in the horizontal direction of the preset coordinate system, and n represents the maximum value of the target coordinate area in the vertical direction of the preset coordinate system; Indicates the installation posture of the camera; is a decision variable. If the camera is at the center of the grid (i a , j a ) The corresponding grid area is in the posture If you install otherwise is a parameter with a value of 0 or 1. If the camera is at the center of the grid (i a , j a ) The corresponding grid area is in the posture The effective monitoring area of the camera can cover the center point of the grid (i b, j b ) corresponds to the grid area, then otherwise is a parameter with a value of 1, indicating that the center point of the grid (i b, j b ) belongs to the demand point set.
[0157] Optionally, the second constraint condition is expressed as:
[0158]
[0159] Where i represents the horizontal coordinate of each grid center point, j represents the vertical coordinate of each grid center point; c ij is a parameter with a value of 0 or 1. If the grid center point (i, j) belongs to the supply point set, then c ij =1, otherwise c ij =0; Indicates the installation posture of the camera; is a decision variable. If the camera is in the grid area corresponding to the grid center point (i, j) with posture If you install otherwise
[0160] Optionally, the camera layout model further includes: a third constraint condition, wherein the third constraint condition is used to limit the target demand point in the demand point set to be covered by the effective monitoring areas of at least two cameras.
[0161] Optionally, the third constraint condition is expressed as:
[0162]
[0163] Among them, i a represents the horizontal coordinate of the center point of the first type of grid, j a represents the ordinate of the center point of the first type of grid; i b represents the horizontal coordinate of the center point of the second type of grid, j b represents the ordinate of the center point of the second type of grid; i b1 represents the horizontal coordinate of the target demand point, j b1 represents the ordinate of the target demand point; m is the maximum value of the target coordinate area in the horizontal direction of the preset coordinate system, and n represents the maximum value of the target coordinate area in the vertical direction of the preset coordinate system; Indicates the installation posture of the camera; is a decision variable. If the camera is at the center point (i a , j a ) The corresponding grid area is in the posture If you install otherwise is a parameter with a value of 0 or 1. If the camera is at the center point (i a , j a ) The corresponding grid area is in the posture The effective monitoring area of the camera can cover the center point (i b, j b ) corresponds to the grid area, then otherwise is a parameter with a value of 1, indicating that the center point of the grid (i b1 , j b1 ) is the target demand point; the value of T is the number of cameras required for the target demand point minus 1.
[0164] The camera layout device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the camera layout device in the illustrated method embodiment will not be described again here.
[0165] In the embodiment of the present application, for the problem of full camera coverage, the minimum number of cameras required to be installed is given, and the installation position and installation posture of the camera are also given. At the same time, because the camera layout model is linear, the overall result can be the optimal result. Secondly, on the basis of optimizing the full camera coverage, the business needs of some monitoring areas that require multi-angle coverage are met. Finally, the embodiment of the present application can well adapt to monitoring environments with obstructions, complex installation points and complex monitoring areas.
[0166] An embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores a program or instruction that can be executed on the processor, and when the program or instruction is executed by the processor, the various steps of the above-mentioned camera layout method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0167] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned camera layout method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0168] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0169] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM, RAM, disk, CD, etc., including a number of instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0170] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A camera layout method, characterized in that: include: Obtain a supply point set and a demand point set in the target monitoring area; wherein the supply point set is a set of location points in the target monitoring area where cameras can be installed, and the demand point set is a set of location points in the target monitoring area that need to be monitored and covered; Obtaining an effective monitoring area and an installation posture set of a camera; wherein the installation posture set is a set of installation postures supported by the camera; A camera layout model is established according to the supply point set, the demand point set, the effective monitoring area of the camera, and the installation posture set of the camera; wherein the camera layout model is a linear programming mathematical model, including: an objective function, a first constraint condition and a second constraint condition, the objective function is used to solve the minimum value of the number of camera installations based on the installation posture and installation position of the camera; the first constraint condition is used to limit each demand point in the demand point set to be covered by the effective monitoring area of at least one camera; the second constraint condition is used to limit the installation position of the camera to within the range of the supply point set; Solving the camera layout model to obtain a minimum number of installed cameras, and an installation position and an installation posture of each camera when the number of installed cameras takes the minimum value; Wherein, obtaining the supply point set and the demand point set in the target monitoring area includes: The target monitoring area is mapped to a target coordinate area in a preset coordinate system; the target coordinate area is gridded to obtain a plurality of grids; a first type of grid corresponding to a camera installable area predefined in the target monitoring area and a second type of grid corresponding to a monitoring coverage requirement area predefined in the target monitoring area are determined among the plurality of grids; the center point coordinates of the first type of grid and the center point coordinates of the second type of grid are determined; a set of the center point coordinates of the first type of grid is determined as the supply point set, and a set of the center point coordinates of the second type of grid is determined as the demand point set; The camera layout model further includes: a third constraint condition, wherein the third constraint condition is used to limit the target demand point in the demand point set to be covered by the effective monitoring area of at least two cameras; The third constraint is expressed as: Among them, i a represents the horizontal coordinate of the center point of the first type of grid, j a represents the ordinate of the center point of the first type of grid; i b represents the horizontal coordinate of the center point of the second type of grid, j b represents the ordinate of the center point of the second type of grid; i b1 represents the horizontal coordinate of the target demand point, j b1 represents the ordinate of the target demand point; m is the maximum value of the target coordinate area in the horizontal direction of the preset coordinate system, and n represents the maximum value of the target coordinate area in the vertical direction of the preset coordinate system; Indicates the installation posture of the camera; is a decision variable. If the camera is at the center point (i a , j a ) The corresponding grid area is in the posture If installed, otherwise is a parameter with a value of 0 or 1. If the camera is at the center point (i a , j a ) The corresponding grid area is in the posture The effective monitoring area of the camera can cover the center point (i b , j b ) corresponds to the grid area, then otherwise is a parameter with a value of 1, indicating that the center point of the grid (i b1 , j b1 ) is the target demand point; the value of T is the number of cameras required for the target demand point minus 1.
2. The camera layout method according to claim 1, characterized in that: The objective function is: Wherein, i represents the abscissa of each grid center point, j represents the ordinate of each grid center point, m represents the maximum value of the target coordinate area in the abscissa direction of the preset coordinate system, and n represents the maximum value of the target coordinate area in the ordinate direction of the preset coordinate system; Indicates the installation posture of the camera; is a decision variable. If the camera is in the grid area corresponding to the grid center point (i, j) with posture If installed, otherwise 3. The camera layout method according to claim 1, characterized in that: The first constraint is expressed as: Among them, i a represents the horizontal coordinate of the center point of the first type of grid, j a represents the ordinate of the center point of the first type of grid; i b represents the horizontal coordinate of the center point of the second type of grid, j b represents the ordinate of the center point of the second type of grid; m is the maximum value of the target coordinate area in the horizontal direction of the preset coordinate system, and n represents the maximum value of the target coordinate area in the vertical direction of the preset coordinate system; Indicates the installation posture of the camera; is a decision variable. If the camera is at the center of the grid (i a , j a ) The corresponding grid area is in the posture If installed, otherwise is a parameter with a value of 0 or 1. If the camera is at the center of the grid (i a , j a ) The corresponding grid area is in the posture The effective monitoring area of the camera can cover the center point of the grid (i b , j b ) corresponds to the grid area, then otherwise is a parameter with a value of 1, indicating that the center point of the grid (i b , j b ) belongs to the demand point set.
4. The camera layout method according to claim 1, characterized in that: The second constraint is expressed as: Where i represents the horizontal coordinate of each grid center point, j represents the vertical coordinate of each grid center point; c ij is a parameter with a value of 0 or 1. If the grid center point (i, j) belongs to the supply point set, then c ij =1, otherwise c ij =0; Indicates the installation posture of the camera; is a decision variable. If the camera is in the grid area corresponding to the grid center point (i, j) with posture If installed, otherwise 5. A camera layout device, characterized in that: include: A first acquisition module is used to acquire a supply point set and a demand point set in a target monitoring area; wherein the supply point set is a set of location points in the target monitoring area where cameras can be installed, and the demand point set is a set of location points in the target monitoring area that need to be monitored and covered; A second acquisition module is used to acquire an effective monitoring area and an installation posture set of a camera; wherein the installation posture set is a set of installation postures supported by the camera; A model building module, used to build a camera layout model according to the supply point set, the demand point set, the effective monitoring area of the camera and the installation posture set of the camera; wherein the camera layout model is a linear programming mathematical model, including: an objective function, a first constraint condition and a second constraint condition, the objective function is used to solve the minimum value of the number of camera installations based on the installation posture and installation position of the camera; the first constraint condition is used to limit each demand point in the demand point set to be covered by the effective monitoring area of at least one camera; the second constraint condition is used to limit the installation position of the camera to within the range of the supply point set; A model solving module, used to solve the camera layout model to obtain a minimum number of installed cameras, and an installation position and installation posture of each camera when the number of installed cameras takes the minimum value; Wherein, the first acquisition module includes: A mapping unit, used to map the target monitoring area to a target coordinate area in a preset coordinate system; a gridding unit, used to perform gridding processing on the target coordinate area to obtain multiple grids; a first determination unit, used to determine a first type of grid corresponding to a camera installable area predefined in the target monitoring area, and a second type of grid corresponding to a monitoring coverage requirement area predefined in the target monitoring area among the multiple grids; a second determination unit, used to determine the center point coordinates of the first type of grid and the center point coordinates of the second type of grid; a third determination unit, used to determine a set of center point coordinates of the first type of grid as the supply point set, and determine a set of center point coordinates of the second type of grid as the demand point set; The camera layout model further includes: a third constraint condition, wherein the third constraint condition is used to limit the target demand point in the demand point set to be covered by the effective monitoring area of at least two cameras; The third constraint is expressed as: Among them, i a represents the horizontal coordinate of the center point of the first type of grid, j a represents the ordinate of the center point of the first type of grid; i b represents the horizontal coordinate of the center point of the second type of grid, j b represents the ordinate of the center point of the second type of grid; i b1 represents the horizontal coordinate of the target demand point, j b1 represents the ordinate of the target demand point; m is the maximum value of the target coordinate area in the horizontal direction of the preset coordinate system, and n represents the maximum value of the target coordinate area in the vertical direction of the preset coordinate system; Indicates the installation posture of the camera; is a decision variable. If the camera is at the center point (i a , j a ) The corresponding grid area is in the posture If installed, otherwise is a parameter with a value of 0 or 1. If the camera is at the center point (i a , j a ) The corresponding grid area is in the posture The effective monitoring area of the camera can cover the center point (i b , j b ) corresponds to the grid area, then otherwise is a parameter with a value of 1, indicating that the center point of the grid (i b1 , j b1 ) is the target demand point; the value of T is the number of cameras required for the target demand point minus 1.
6. The camera layout device according to claim 5, characterized in that: The objective function is: Wherein, i represents the abscissa of each grid center point, j represents the ordinate of each grid center point, m represents the maximum value of the target coordinate area in the abscissa direction of the preset coordinate system, and n represents the maximum value of the target coordinate area in the ordinate direction of the preset coordinate system; Indicates the installation posture of the camera; is a decision variable. If the camera is in the grid area corresponding to the grid center point (i, j) with posture If installed, otherwise 7. The camera layout device according to claim 5, characterized in that: The first constraint is expressed as: Among them, i a represents the horizontal coordinate of the center point of the first type of grid, j a represents the ordinate of the center point of the first type of grid; i b represents the horizontal coordinate of the center point of the second type of grid, j b represents the ordinate of the center point of the second type of grid; m is the maximum value of the target coordinate area in the horizontal direction of the preset coordinate system, and n represents the maximum value of the target coordinate area in the vertical direction of the preset coordinate system; Indicates the installation posture of the camera; is a decision variable. If the camera is at the center of the grid (i a , j a ) The corresponding grid area is in the posture If installed, otherwise is a parameter with a value of 0 or 1. If the camera is at the center of the grid (i a , j a ) The corresponding grid area is in the posture The effective monitoring area of the camera can cover the center point of the grid (i b , j b ) corresponds to the grid area, then otherwise is a parameter with a value of 1, indicating that the center point of the grid (i b , j b ) belongs to the demand point set.
8. The camera layout device according to claim 5, characterized in that: The second constraint is expressed as: Where i represents the horizontal coordinate of each grid center point, j represents the vertical coordinate of each grid center point; c ij is a parameter with a value of 0 or 1. If the grid center point (i, j) belongs to the supply point set, then c ij =1, otherwise c ij =0; Indicates the installation posture of the camera; is a decision variable. If the camera is in the grid area corresponding to the grid center point (i, j) with posture If installed, otherwise 9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the camera layout method according to any one of claims 1 to 4 are implemented.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the camera layout method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Monitoring camera layout method and device and computer readable storage medium
CN113163175A
Camera site selection method, device and equipment and computer readable storage medium
CN113935577A