Camera site selection method, device, equipment and computer-readable storage medium

By building a camera site selection model and using an immune algorithm, the problem of unreasonable camera installation layout is solved, and a reasonable site selection layout is achieved, monitoring blind spots and obstructions block the field of view are avoided, and the utilization rate of the camera is improved.

CN113935577BActive Publication Date: 2024-12-06GCI SCI & TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111053163.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-08
Publication Date
2024-12-06
Estimated Expiration
2041-09-08

AI Technical Summary

Technical Problem

In the prior art, the camera installation layout is unreasonable, resulting in problems such as monitoring blind spots and obstructions blocking the field of view, reducing the utilization rate of the camera.

Method used

By obtaining the camera assembly information, a camera site selection model is constructed, and the improved immune algorithm is used to solve the model, considering the camera installation cost, maintenance cost, location and monitoring range, a reasonable site selection layout plan is obtained.

Benefits of technology

It avoids monitoring blind spots and obstructions blocking the field of view, improves the utilization rate of cameras, and provides efficient, low-cost, scientific and reasonable site selection solutions for public places.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113935577B_ABST
    Figure CN113935577B_ABST
Patent Text Reader

Abstract

The present invention discloses a camera site selection method, device, equipment and computer-readable storage medium, including: obtaining the assembly information of several cameras, wherein the assembly information includes the camera installation position and the camera monitoring range; constructing a camera site selection model according to the assembly information of the several cameras, wherein the constraints of the camera site selection model include the camera constraints in the area to be monitored, the number of cameras enabled and the camera monitoring range constraints; using an improved immune algorithm to solve the camera site selection model to obtain a camera site selection layout plan. By using the embodiments of the present invention, it is possible to reasonably layout cameras in public places to avoid blind spots in camera monitoring and obstructions to the field of view, thereby further improving the utilization rate of cameras.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of site selection and layout, and in particular to a camera site selection method, device, equipment and computer-readable storage medium. Background Art

[0002] For the purpose of maintaining public safety, it is necessary to install cameras in public places. At present, the installation layout of cameras is basically based on the experience of technicians to select the site, resulting in blind spots in camera monitoring and obstacles blocking the field of view, which makes the camera utilization rate low. Summary of the invention

[0003] The present invention provides a camera site selection method, device, equipment and computer-readable storage medium to solve the problem of unreasonable camera installation layout in the prior art. The present invention can reasonably arrange cameras in public places to avoid blind spots in camera monitoring and obstructions to the field of view, thereby further improving the utilization rate of cameras.

[0004] An embodiment of the present invention provides a camera site selection method, including:

[0005] Obtaining assembly information of a plurality of cameras, wherein the assembly information includes camera installation positions and camera monitoring ranges;

[0006] Constructing a camera site selection model according to the assembly information of the plurality of cameras, wherein the constraints of the camera site selection model include constraints on cameras within the area to be monitored, constraints on the number of cameras enabled, and constraints on the camera monitoring range;

[0007] An improved immune algorithm is used to solve the camera site selection model to obtain a camera site selection layout plan.

[0008] Furthermore, the camera site selection model is specifically:

[0009]

[0010] The constraints of the camera site selection model are:

[0011]

[0012]

[0013]

[0014]

[0015]

[0016] Where N is the set of areas to be monitored, M is the set of camera installation locations, and d ij is the actual monitoring range of the camera to the monitored area, i∈N, j∈M, j′∈M, P is the number of cameras enabled, B is the camera installation cost, r is the value generated by the camera installation, (1+r) t represents (1+r) to the power of t, t is an arbitrary number, k is the coefficient of camera life reduction, D i is the number of cameras installed in the monitoring area, G is the maximum monitoring range of the camera at a camera installation location, x ij is a 0-1 variable. When x ij =1, it means that the monitored area i is monitored by camera j, otherwise it is 0, y j′ is a 0-1 variable. j′ =1, it indicates other cameras j′ in the same monitoring area, otherwise it is 0.

[0017] Furthermore, the improved immune algorithm is used to solve the camera location selection model, including:

[0018] Step 1, generating an initial antibody group, obtaining p1 initial antibodies that meet preset qualification conditions, and forming an initial antibody group with p2 antibodies in the memory bank;

[0019] Step 2, for each antibody in the antibody group, respectively calculate the affinity value between the antibody and the antigen, the similarity value between antibodies, the antibody density and the expected reproduction probability of the antibody;

[0020] Step 3, determine whether the termination condition is met, if so, end; if not, proceed to the next step;

[0021] Step 4, updating the memory bank, arranging the antibodies in the antibody group in descending order according to affinity value, first extracting the first p antibodies and storing them in the memory bank, and then extracting the first p1 antibodies to form the parent population;

[0022] Step 5, performing selection, crossover and mutation operations on the parent population to obtain a new population, and then taking out p2 antibodies from the memory bank to form a new generation antibody population;

[0023] Step 6: Return to step 2.

[0024] Furthermore, the step of obtaining p1 initial antibodies that meet preset qualification conditions comprises:

[0025] Generate initial antibodies, shuffle the order of elements in the set of camera installation locations, and execute Randomly select two elements at different positions to exchange, and obtain the exchanged elements. Select the first l elements from them to form the initial antibody, where m is the total number of camera installation positions;

[0026] For the initial antibody, the monitored area i is allocated to other monitored areas and satisfies the capacity constraint usd cap(j) +demand i ≤C j camera j, let x ij =1, and update usd cap(j) =USD cap(j) +demand i Repeat this step until all the monitored areas i are traversed. i When all of the above conditions can be met and the total number of cameras in all the areas to be monitored does not exceed the preset total number, the initial antibody is determined to be an initial antibody that meets the preset qualification conditions, wherein, usd cap(j) The area to be monitored is the area that the camera has monitored. i C is the range to be monitored in the monitoring area. j is the actual monitoring capacity of the camera, x ij =1 means that the monitored area i is monitored by camera j;

[0027] When the initial antibodies do not meet the preset qualification conditions, the initial antibodies continue to be generated until p1 initial antibodies meeting the preset qualification conditions are obtained.

[0028] Furthermore, the selection operation is specifically:

[0029] According to the expected reproduction probability, parent antibodies parent1 and parent antibodies parent2 are selected from the parent population.

[0030] Furthermore, the crossover operation includes:

[0031] When the random number γ randomly generated between [0, 1] is less than or equal to the preset crossover rate range θ, a single-point crossover operation is selected to obtain offspring antibodies child1 and child2;

[0032] When the randomly generated random number γ between [0, 1]> the preset crossover rate range θ, a two-point crossover operation is selected to obtain offspring antibodies child1 and child2.

[0033] Furthermore, the single-point crossover operation is specifically as follows:

[0034] A crossover point q is randomly selected between 2 and l-1, and the elements of the parent antibody parent1 and the parent antibody parent2 after the crossover point q are exchanged to obtain antibodies parent′1 and parent′2, where l is the length of the antibody;

[0035] When the exchanged element r1 in the antibody parent′1 already exists in the antibody parent1, find the position R1 where the element r1 is located in the antibody parent1, and find the element r′1 at the position R1 in the antibody parent2, and replace the element r1 in the antibody parent′1 with the element r′1. Repeat this step until there is no duplicate element in the antibody parent′1, and obtain the offspring antibody child1;

[0036] When the exchanged element r2 in the antibody parent′2 already exists in the antibody parent2, find the position R2 where the element r2 is located in the antibody parent2, and find the element r′2 at the position R2 in the antibody parent1, and change the element r2 in the antibody parent′2 to the element r′2. Repeat this step until there is no duplicate element in the antibody parent′1, and obtain the offspring antibody child2.

[0037] The embodiment of the present invention further provides a camera site selection device, comprising:

[0038] A data acquisition module, used to acquire the assembly information of a plurality of cameras, wherein the assembly information includes the camera installation position and the camera monitoring range;

[0039] A model building module, used to build a camera site selection model according to the assembly information of the plurality of cameras, wherein the constraints of the camera site selection model include constraints on cameras within the area to be monitored, constraints on the number of cameras enabled, and constraints on the camera monitoring range;

[0040] The site selection and layout solution module is used to solve the camera site selection model by using an improved immune algorithm to obtain a camera site selection and layout solution.

[0041] An embodiment of the present invention also provides a device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements any of the above-mentioned camera site selection methods when executing the computer program.

[0042] An embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute any of the camera site selection methods described above.

[0043] Compared with the prior art, the embodiments of the present invention provide a camera site selection method, device, equipment and computer-readable storage medium, which obtains the assembly information of several cameras, and then constructs a camera site selection model according to the assembly information of the several cameras, wherein the constraints of the camera site selection model include the constraints of the cameras in the area to be monitored, the constraints of the number of cameras enabled and the constraints of the camera monitoring range, and finally adopts an improved immune algorithm to solve the camera site selection model to obtain a camera site selection layout plan. The embodiments of the present invention obtain a reasonable camera site selection layout plan for public places by considering the camera installation cost, camera maintenance cost, camera installation location and number, camera service life and camera monitoring range, which can avoid the phenomenon of camera monitoring blind spots, obstructions blocking the field of view, too many cameras in some areas and insufficient cameras in some areas, and provide a high-efficiency, low-cost and scientifically reasonable site selection layout plan for camera installation in public places. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 is a flowchart of a camera site selection method provided by an embodiment of the present invention;

[0045] Figure 2 is a flow chart of an improved immune algorithm provided by an embodiment of the present invention;

[0046] Figure 3 It is a structural schematic diagram of a camera site selection device provided by an embodiment of the present invention;

[0047] Figure 4 It is a structural schematic diagram of a device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] See also Figure 1 , is a flow chart of a camera site selection method provided by an embodiment of the present invention, the method comprising:

[0050] S11, obtaining assembly information of a plurality of cameras, wherein the assembly information includes camera installation positions and camera monitoring ranges;

[0051] S12, constructing a camera site selection model according to the assembly information of the plurality of cameras, wherein the constraints of the camera site selection model include constraints on cameras within the area to be monitored, constraints on the number of cameras enabled, and constraints on the camera monitoring range;

[0052] S13. Using an improved immune algorithm to solve the camera site selection model, obtain a camera site selection layout plan.

[0053] In an optional embodiment, the camera site selection model is specifically:

[0054]

[0055] The constraints of the camera site selection model are:

[0056]

[0057]

[0058]

[0059]

[0060]

[0061] Where N is the set of areas to be monitored, M is the set of camera installation locations, and d ij is the actual monitoring range of the camera to the monitored area, i∈N, j∈M, j′∈M, P is the number of cameras enabled, B is the camera installation cost, r is the value generated by the camera installation, (1+r) t represents (1+r) to the power of t, t is an arbitrary number, k is the coefficient of camera life reduction, D i is the number of cameras installed in the monitoring area, G is the maximum monitoring range of the camera at a camera installation location, x ij is a 0-1 variable. When x ij =1, it means that the monitored area i is monitored by camera j, otherwise it is 0, y j′ is a 0-1 variable. j′ =1, it indicates other cameras j′ in the same monitoring area, otherwise it is 0.

[0062] It can be understood that the actual monitoring range refers to the monitoring range actually monitored when the camera is in a camera installation position. This takes into account the phenomenon that the camera has blind spots and obstructions block the field of view.

[0063] It should be noted that formula (1) is the objective function of the model, which represents the sum of the camera installation cost and the camera annual maintenance cost. Formula (2) is the camera constraint in the monitored area, which means that a monitored area i is monitored by only one camera j. Formula (3) is the camera activation number constraint, which means that the number of cameras activated is P, that is, the number of cameras in operation. Formula (4) is the camera monitoring range constraint, which is a constraint on the camera monitoring range. Formulas (5)-(6) are constraints on the decision variable x. ij ,y j ′ is constrained by its value range, that is,

[0064]

[0065]

[0066] In the embodiment of the present invention, a camera site selection model is constructed with the minimum sum of camera installation cost and camera annual maintenance cost as the optimization goal, while taking into account the camera installation location and number, camera service life and camera monitoring range, and solving the camera site selection model through an improved immune algorithm, thereby providing a high-efficiency, low-cost and scientifically reasonable site selection layout plan for camera installation in public places;

[0067] As an improvement of the above solution, the improved immune algorithm is used to solve the camera location selection model, including:

[0068] Step 1, generating an initial antibody group, obtaining p1 initial antibodies that meet preset qualification conditions, and forming an initial antibody group with p2 antibodies in the memory bank;

[0069] Step 2, for each antibody in the antibody group, respectively calculate the affinity value between the antibody and the antigen, the similarity value between antibodies, the antibody density and the expected reproduction probability of the antibody;

[0070] Step 3, determine whether the termination condition is met, if so, end; if not, proceed to the next step;

[0071] It can be understood that the termination condition is that the affinity between the antibody and the antigen is optimal;

[0072] Step 4, updating the memory bank, arranging the antibodies in the antibody group in descending order according to affinity value, first extracting the first p antibodies and storing them in the memory bank, and then extracting the first p1 antibodies to form the parent population;

[0073] Step 5, performing selection, crossover and mutation operations on the parent population to obtain a new population, and then taking out p2 antibodies from the memory bank to form a new generation antibody population;

[0074] Step 6: Return to step 2.

[0075] It can be understood that p1 is the first preset number, p2 is the second preset number, and p is the third preset number.

[0076] The flowchart of an improved immune algorithm provided by the embodiment of the present invention is as follows: Figure 2 As shown, it can be understood that the objective function and solution of the camera site selection model correspond to the "antigen" and "antibody" in the biological immune system. During the algorithm iteration process, the affinity between the antibody and the antigen gradually increases, and finally the antibody with the best affinity value is generated, which is the optimal camera site selection layout plan.

[0077] As an improvement of the above scheme, the step of obtaining p1 initial antibodies that meet preset qualification conditions includes:

[0078] Generate initial antibodies, shuffle the order of elements in the set of camera installation locations, and execute Randomly select two elements at different positions to exchange, and obtain the exchanged elements. Select the first l elements from them to form the initial antibody, where m is the total number of camera installation positions;

[0079] For the initial antibody, the monitored area i is allocated to other monitored areas and satisfies the capacity constraint usd cap(j) +demand i ≤C j camera j, let x ij =1, and update usd cap(j) =USD cap(j) +demand i Repeat this step until all the monitored areas i are traversed. i When all of the above conditions can be met and the total number of cameras in all the areas to be monitored does not exceed the preset total number, the initial antibody is determined to be an initial antibody that meets the preset qualification conditions, wherein, usd cap(j) The area to be monitored is the area that the camera has monitored. i C is the range to be monitored in the monitoring area. j is the actual monitoring capacity of the camera, x ij =1 means that the monitored area i is monitored by camera j;

[0080] When the initial antibodies do not meet the preset qualification conditions, the initial antibodies continue to be generated until p1 initial antibodies meeting the preset qualification conditions are obtained.

[0081] It should be noted that the location and layout plan of cameras in public places can form an antibody of length l (l is the number of normally operating cameras), and each antibody represents a sequence of normally operating cameras, that is, a sequence of solutions. For m camera installation locations, l locations are selected to install cameras. Assuming that the m camera installation locations are numbered 1, 2, ..., m (m>1), they constitute an element in the set of camera installation locations, then antibody l = [M1, M2, ..., M l ] represents a feasible solution, where M j =M1,M2,…,M l represents l non-repeating numbers randomly generated from 1, 2, ..., m, M j Indicates each camera mounting position in the antibody.

[0082] In a specific embodiment, the step of obtaining p1 initial antibodies that meet preset qualification conditions comprises:

[0083] Step A, generate the initial antibody, shuffle the order of the elements 1, 2, ..., m (m>1) in the set of camera installation positions, randomly select two elements in different positions to exchange and execute times, obtain the exchanged elements, and select the first l elements from them to form the initial antibody, where m is the total number of camera installation positions;

[0084] Step B, for the initial antibody, allocate the monitored area i to other monitored areas and satisfy the capacity constraint usd cap(j) +demand i ≤C j camera j, let x ij =1, and update usd cap(j) =USD cap(j) +demand i Repeat this step until all the monitored areas i are traversed. i When all the required monitoring areas are monitored and the total number of cameras in all the required monitoring areas does not exceed the preset total number, the initial antibody is determined to be the initial antibody that meets the preset qualified conditions, wherein, usd cap(j) The area to be monitored is the area that the camera has monitored. i C is the range to be monitored in the monitoring area. j is the actual monitoring capacity of the camera, x ij =1 means that the monitored area i is monitored by camera j;

[0085] Step C: when the initial antibodies do not meet the preset qualification conditions, return to step A until p1 initial antibodies meeting the preset qualification conditions are obtained.

[0086] In the embodiment of the present invention, the quality of the initial antibody group is optimized by obtaining initial antibodies that meet preset conditions, and the excellent characteristics of the high-quality antibodies can be retained by setting up a memory bank to store high-quality antibodies.

[0087] In one embodiment, antibodies are evaluated based on the affinity value between the antibody and the antigen, the similarity value between the antibodies, the antibody density, and the expected reproduction probability of the antibody:

[0088] The affinity value between the antibody and the antigen is the fitness value, which indicates the degree of recognition of the antibody to the antigen. The affinity value between the antibody and the antigen is calculated according to the following formula:

[0089]

[0090] In the formula, N is the set of areas to be monitored, M is the set of camera installation locations, and d ij is the actual monitoring range of the camera to the monitored area, i∈N,j∈M,j′∈M, P is the number of cameras enabled, B is the camera installation cost, r is the value generated by the camera installation, (1+r) t represents (1+r) to the power of t, t is an arbitrary number, k is the coefficient of camera life reduction, D i is the number of cameras installed in the monitoring area, G is the maximum monitoring range of the camera at a camera installation location, x ij is a 0-1 variable. When x ij =1, it means that the monitored area i is monitored by camera j, otherwise it is 0, y j′ is a 0-1 variable. j′ =1, it indicates other cameras j′ in the same monitoring area, otherwise it is 0.

[0091] The similarity value between antibodies indicates the similarity between antibodies. When two antibodies have the same code at consecutive R positions or more positions, it means that the two antibodies are similar, otherwise it means that the two antibodies are not similar. The antibody similarity value is calculated using the R-bit continuous method:

[0092]

[0093] In the formula, t k,v is the number of identical digits between antibody k and v, and l is the length of the antibody.

[0094] Antibody density refers to the ratio of similar antibodies in an antibody population. Antibody density is calculated according to the following formula:

[0095]

[0096] If S k,v >R, then Bk,v =1, otherwise B k,v = 0. R is the preset threshold, and N is the total number of antibodies in the antibody group.

[0097] The expected reproduction probability of an antibody is composed of two parts: the antibody affinity value and the antibody density. The expected reproduction probability of an antibody is calculated according to the following formula:

[0098]

[0099] Among them, η is a constant in the interval [0,1], ε k is the affinity between antibody and antigen, is the antibody density. The greater the affinity between the antibody and the antigen, the higher the expected reproduction probability, and vice versa.

[0100] In an optional embodiment, the selection operation is specifically:

[0101] According to the expected reproduction probability, parent antibodies parent1 and parent antibodies parent2 are selected from the parent population.

[0102] It can be understood that the greater the expected reproduction probability of an antibody, the higher its probability of being selected.

[0103] As an improvement of the above solution, the crossover operation includes:

[0104] When the random number γ randomly generated between [0,1] is less than or equal to the preset crossover rate range θ, a single-point crossover operation is selected to obtain offspring antibodies child1 and child2;

[0105] When the randomly generated random number γ between [0, 1]> the preset crossover rate range θ, a two-point crossover operation is selected to obtain offspring antibodies child1 and child2.

[0106] In one specific implementation, a preset crossover rate range θ∈[θ min ,θ max ], randomly generate a random number γ between [0,1], when γ≤θ, choose the single-point crossover operation, when γ>θ, choose the two-point crossover operation.

[0107] As an improvement of the above solution, the single-point crossover operation is specifically as follows:

[0108] A crossover point q is randomly selected between 2 and l-1, and the elements of the parent antibody parent1 and the parent antibody parent2 after the crossover point q are exchanged to obtain antibodies parent′1 and parent′2, where l is the length of the antibody;

[0109] When the exchanged element r1 in the antibody parent′1 already exists in the antibody parent1, find the position R1 where the element r1 is located in the antibody parent1, and find the element r1′ at the position R1 in the antibody parent2, and change the element r1 in the antibody parent′1 to the element r′1, and repeat this step until there is no duplicate element in the antibody parent′1, thereby obtaining the offspring antibody child1;

[0110] When the exchanged element r2 in the antibody parent′2 already exists in the antibody parent2, find the position R2 where the element r2 is located in the antibody parent2, and find the element r′2 at the position R2 in the antibody parent1, and change the element r2 in the antibody parent′2 to the element r′2. Repeat this step until there is no duplicate element in the antibody parent′2, and obtain the offspring antibody child2.

[0111] As an improvement of the above solution, the two-point crossover operation is specifically as follows:

[0112] Randomly select two different intersection points q1 and q2 between 2 and l-1, exchange the elements between the intersection q1 and the intersection q2 of the parent antibody parent1 and the parent antibody parent2 to obtain antibodies parent1′ and antibody parent2′, repeat this step until there are no repeated sequence numbers in the antibody parent1′ and there are no repeated sequence numbers in the antibody parent2′, and obtain offspring antibodies child1 and offspring antibodies child2, where l is the antibody length.

[0113] As an improvement of the above solution, the mutation operation is specifically as follows:

[0114] The elements contained in the child antibody child1 are recorded as child, that is, the set of camera installation positions where the normally operating cameras are located; the elements not contained in the child antibody child1 are recorded as Unopen, that is, the set of unenabled camera installation positions. Randomly select a camera installation position u∈child, the unenabled camera installation position Change the u in the offspring antibody child1 to To achieve the mutation operation, repeat this step until the mutation rate reaches the preset threshold μ, and obtain the mutated antibody child1'.

[0115] The elements contained in the child antibody child2 are recorded as child, that is, the set of camera installation positions where the normally operating cameras are located; the elements not contained in the child antibody child2 are recorded as Unopen, that is, the set of unenabled camera installation positions. Randomly select a camera installation position u∈child, the unenabled camera installation position Change the u in the descendant antibody child2 to To achieve the mutation operation, repeat this step until the mutation rate reaches the preset threshold μ, and obtain the mutated antibody child2'.

[0116] In the embodiment of the present invention, random mutations are introduced into antibodies to increase population diversity, thereby eliminating the stagnation of the algorithm in unpromising areas and exploring new search areas.

[0117] See also Figure 3 , is a schematic diagram of the structure of a camera site selection device provided by an embodiment of the present invention, the device comprising:

[0118] The data acquisition module 21 is used to acquire the assembly information of several cameras, wherein the assembly information includes the camera installation position and the camera monitoring range;

[0119] A model building module 22, used to build a camera site selection model according to the assembly information of the plurality of cameras, wherein the constraints of the camera site selection model include constraints on cameras within the area to be monitored, constraints on the number of cameras enabled, and constraints on the camera monitoring range;

[0120] The site selection and layout solution module 23 is used to solve the camera site selection model by using an improved immune algorithm to obtain a camera site selection and layout solution.

[0121] It should be noted that a camera site selection device provided in an embodiment of the present invention can implement all the processes of the camera site selection method described in any of the above embodiments. The functions in the device and the technical effects achieved are respectively the same as the functions and technical effects achieved by the camera site selection method described in the above embodiments, and will not be repeated here.

[0122] An embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the camera site selection method described in any of the above embodiments.

[0123] The present invention also provides a device, see Figure 4As shown, it is a structural diagram of a device provided by an embodiment of the present invention, wherein the device includes a processor 10, a memory 20, and a computer program stored in the memory 20 and configured to be executed by the processor 10, and the processor 10 implements the camera site selection method described in any of the above embodiments when executing the computer program.

[0124] Preferably, the computer program may be divided into one or more modules / units (such as computer program 1, computer program 2, ...), and the one or more modules / units are stored in the memory 20 and executed by the processor 10 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the device.

[0125] The processor 10 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor 10 may be any conventional processor. The processor 10 is the control center of the device, and various parts of the device are connected using various interfaces and lines.

[0126] The memory 20 mainly includes a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function, etc., and the data storage area can store related data, etc. In addition, the memory 20 can be a high-speed random access memory, or a non-volatile memory, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, and a flash card (Flash Card), etc., or the memory 20 can also be other volatile solid-state storage devices.

[0127] It should be noted that the above-mentioned device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that Figure 4 The structural diagram is merely an example of the above-mentioned device and does not constitute a limitation on the device. The device may include more or less components than shown in the figure, or a combination of certain components, or different components.

[0128] The camera site selection method, device, equipment and computer-readable storage medium provided by the embodiments of the present invention obtain the assembly information of several cameras, and then construct a camera site selection model according to the assembly information of the several cameras, wherein the constraints of the camera site selection model include the constraints of the cameras in the monitoring area, the constraints of the number of cameras enabled and the constraints of the camera monitoring range, and finally the improved immune algorithm is used to solve the camera site selection model to obtain the camera site selection layout plan. The embodiments of the present invention obtain a reasonable camera site selection layout plan for public places by considering the camera installation cost, camera maintenance cost, camera installation location and number, camera service life and camera monitoring range, which can avoid the phenomenon of camera monitoring blind spots, obstructions blocking the field of view, too many cameras in some areas and insufficient cameras in some areas, and provide a high-efficiency, low-cost and scientifically reasonable site selection layout plan for camera installation in public places.

[0129] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A camera site selection method, characterized in that: include: Obtaining assembly information of a plurality of cameras, wherein the assembly information includes camera installation positions and camera monitoring ranges; Constructing a camera site selection model according to the assembly information of the plurality of cameras, wherein the constraints of the camera site selection model include constraints on cameras within the area to be monitored, constraints on the number of cameras enabled, and constraints on the camera monitoring range; An improved immune algorithm is used to solve the camera location model to obtain a camera location layout plan; The camera site selection model is specifically: The constraints of the camera site selection model are: Where N is the set of areas to be monitored, M is the set of camera installation locations, and d ij is the actual monitoring range of the camera to the monitored area, i∈N,j∈M,j′∈M, P is the number of cameras enabled, B is the camera installation cost, r is the value generated by the camera installation, (1+r) t represents (1+r) to the power of t, t is an arbitrary number, k is the coefficient of camera life reduction, D i is the number of cameras installed in the monitoring area, G is the maximum monitoring range of the camera at a camera installation location, x ij is a 0-1 variable. When x ij =1, it means that the monitored area i is monitored by camera j, otherwise it is 0, y j′ is a 0-1 variable. j′ =1, it indicates other cameras j′ in the same monitoring area, otherwise it is 0; The improved immune algorithm is used to solve the camera location selection model, including: Step 1, generating an initial antibody group, obtaining p1 initial antibodies that meet preset qualification conditions, and forming an initial antibody group with p2 antibodies in the memory bank; Step 2, for each antibody in the antibody group, respectively calculate the affinity value between the antibody and the antigen, the similarity value between antibodies, the antibody density and the expected reproduction probability of the antibody; Step 3, determine whether the termination condition is met, if so, end; if not, proceed to the next step; Step 4, updating the memory bank, arranging the antibodies in the antibody group in descending order according to affinity value, first extracting the first p antibodies and storing them in the memory bank, and then extracting the first p1 antibodies to form the parent population; Step 5, performing selection, crossover and mutation operations on the parent population to obtain a new population, and then taking out p2 antibodies from the memory bank to form a new generation antibody population; Step 6: Return to step 2; The step of obtaining p1 initial antibodies that meet preset qualification conditions comprises: Generate initial antibodies, shuffle the order of elements in the set of camera installation locations, and execute Randomly select two elements at different positions to exchange, and obtain the exchanged elements. Select the first l elements from them to form the initial antibody, where m is the total number of camera installation positions; For the initial antibody, the monitored area i is allocated to other monitored areas and satisfies the capacity constraint usd cap(j) +demand i ≤C j camera j, let x ij =1, and update usd cap(j) =USD cap(j) +demand i Repeat this step until all the monitored areas i are traversed. i When all of the above conditions can be met and the total number of cameras in all the areas to be monitored does not exceed the preset total number, the initial antibody is determined to be an initial antibody that meets the preset qualification conditions, wherein, usd cap(j) The area to be monitored by the camera is demand. i C is the range to be monitored in the monitoring area. j is the actual monitoring capacity of the camera, x ij =1 means that the monitored area i is monitored by camera j; When the initial antibodies do not meet the preset qualification conditions, the initial antibodies continue to be generated until p1 initial antibodies meeting the preset qualification conditions are obtained.

2. The camera site selection method according to claim 1, characterized in that: The selection operation is specifically as follows: According to the expected reproduction probability, parent antibodies parent1 and parent antibodies parent2 are selected from the parent population.

3. The camera site selection method according to claim 2, characterized in that: The crossover operation includes: When the random number γ randomly generated between [0,1] is less than or equal to the preset crossover rate range θ, a single-point crossover operation is selected to obtain offspring antibodies child1 and child2; When the randomly generated random number γ between [0, 1]> the preset crossover rate range θ, a two-point crossover operation is selected to obtain offspring antibodies child1 and child2.

4. The camera site selection method according to claim 3, characterized in that: The single-point crossover operation is specifically as follows: A crossover point q is randomly selected between 2 and l-1, and the elements of the parent antibody parent1 and the parent antibody parent2 after the crossover point q are exchanged to obtain antibodies parent′1 and parent′2, where l is the length of the antibody; When the exchanged element r1 in the antibody parent′1 already exists in the antibody parent1, find the position R1 where the element r1 is located in the antibody parent1, and find the element r′1 at the position R1 in the antibody parent2, and replace the element r1 in the antibody parent′1 with the element r′1. Repeat this step until there is no duplicate element in the antibody parent′1, and obtain the offspring antibody child1; When the exchanged element r2 in the antibody parent′2 already exists in the antibody parent2, find the position R2 where the element r2 is located in the antibody parent2, and find the element r′2 at the position R2 in the antibody parent1, and change the element r2 in the antibody parent′2 to the element r′2. Repeat this step until there is no duplicate element in the antibody parent′2, and obtain the offspring antibody child2.

5. A camera site selection device, characterized in that: include: A data acquisition module, used to acquire the assembly information of a plurality of cameras, wherein the assembly information includes the camera installation position and the camera monitoring range; A model building module, used to build a camera site selection model according to the assembly information of the plurality of cameras, wherein the constraints of the camera site selection model include constraints on cameras within the area to be monitored, constraints on the number of cameras enabled, and constraints on the camera monitoring range; A site selection and layout solution module is used to solve the camera site selection model using an improved immune algorithm to obtain a camera site selection and layout solution; The camera site selection model is specifically: The constraints of the camera site selection model are: Where N is the set of areas to be monitored, M is the set of camera installation locations, and d ij is the actual monitoring range of the camera to the monitored area, i∈N,j∈M,j′∈M, P is the number of cameras enabled, B is the camera installation cost, r is the value generated by the camera installation, (1+r) t represents (1+r) to the power of t, t is an arbitrary number, k is the coefficient of camera life reduction, D i is the number of cameras installed in the monitoring area, G is the maximum monitoring range of the camera at a camera installation location, x ij is a 0-1 variable. When x ij =1, it means that the monitored area i is monitored by camera j, otherwise it is 0, y j′ is a 0-1 variable. j′ =1, it indicates other cameras j′ in the same monitoring area, otherwise it is 0; The improved immune algorithm is used to solve the camera location selection model, including: Step 1, generating an initial antibody group, obtaining p1 initial antibodies that meet preset qualification conditions, and forming an initial antibody group with p2 antibodies in the memory bank; Step 2, for each antibody in the antibody group, respectively calculate the affinity value between the antibody and the antigen, the similarity value between antibodies, the antibody density and the expected reproduction probability of the antibody; Step 3, determine whether the termination condition is met, if so, end; if not, proceed to the next step; Step 4, updating the memory bank, arranging the antibodies in the antibody group in descending order according to affinity value, first extracting the first p antibodies and storing them in the memory bank, and then extracting the first p1 antibodies to form the parent population; Step 5, performing selection, crossover and mutation operations on the parent population to obtain a new population, and then taking out p2 antibodies from the memory bank to form a new generation antibody population; Step 6: Return to step 2; The step of obtaining p1 initial antibodies that meet preset qualification conditions comprises: Generate initial antibodies, shuffle the order of elements in the set of camera installation locations, and execute Randomly select two elements at different positions to exchange, and obtain the exchanged elements. Select the first l elements from them to form the initial antibody, where m is the total number of camera installation positions; For the initial antibody, the monitored area i is allocated to other monitored areas and satisfies the capacity constraint usd cap(j) +demand i ≤C j camera j, let x ij =1, and update usd cap(j) =USD cap(j) +demand i Repeat this step until all the monitored areas i are traversed. i When all of the above conditions can be met and the total number of cameras in all the areas to be monitored does not exceed the preset total number, the initial antibody is determined to be an initial antibody that meets the preset qualification conditions, wherein, usd cap(j) The area to be monitored by the camera is demand. i C is the range to be monitored in the monitoring area. j is the actual monitoring capacity of the camera, x ij =1 means that the monitored area i is monitored by camera j; When the initial antibodies do not meet the preset qualification conditions, the initial antibodies continue to be generated until p1 initial antibodies meeting the preset qualification conditions are obtained.

6. A device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the camera site selection method according to any one of claims 1 to 4 when executing the computer program.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program; wherein, when the computer program is run, it controls the device where the computer-readable storage medium is located to execute the camera site selection method according to any one of claims 1 to 4.