Method and device for arranging cameras in area
By combining the PointNet++ model and the Whale algorithm, and based on 3D point cloud data annotation and field of view score calculation, the layout of cameras in the park is optimized, which solves the problems of low efficiency and high cost of camera layout in existing technologies, and realizes an efficient and economical camera deployment solution.
Patent Information
- Application Number
- CN202411575826.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-12-16
AI Technical Summary
In existing technologies, the arrangement of campus cameras is inefficient, manual arrangement is costly and prone to field of view gaps, and algorithms based on field of view size cannot effectively deploy cameras in key areas.
By combining the PointNet++ model with the Whale algorithm, and through 3D point cloud data annotation and field-of-view score calculation, the camera layout scheme is optimized, taking into account the importance of building components and field-of-view priority.
It effectively reduces the number of cameras, improves the quality and efficiency of camera deployment, saves costs, ensures key areas are well-defended, and avoids the shortcomings of manual deployment.
Smart Images

Figure CN121145397A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of data processing, and particularly relates to a camera arrangement method and device in a region. BACKGROUND
[0002] In order to improve the safety in a park, a large number of cameras are usually arranged in the park. When arranging the cameras in the park, a manual arrangement method or a camera arrangement scheme based on a genetic algorithm or a particle swarm algorithm is usually used.
[0003] However, when the manual arrangement method is used, experienced personnel are needed to a great extent for processing, and the manual arrangement may cause visual field omissions or visual field repetitions, resulting in increased labor costs of camera arrangement and decreased arrangement effects. When the arrangement scheme based on the genetic algorithm or the particle swarm algorithm is used, since the related technologies are mostly based on visual field size to calculate a visual field score, important regions may not be laid out as the focus. Therefore, the camera arrangement method in the related technologies is low in efficiency. SUMMARY
[0004] The present disclosure provides a camera arrangement method and device in a region.
[0005] According to a first aspect of the present disclosure, a camera arrangement method in a region is provided, and the method comprises:
[0006] obtaining a three-dimensional point cloud model of a target region;
[0007] performing data labeling processing on the three-dimensional point cloud model to obtain a labeled three-dimensional point cloud model, and converting the labeled three-dimensional point cloud model into a visual field model of the target region; wherein the visual field model comprises a plurality of different building components, and different building components correspond to different priority levels representing different importance levels;
[0008] obtaining point position information for setting cameras in the visual field model, and obtaining visual field scores of each camera on the corresponding point position information; wherein the visual field score is positively correlated with the priority level;
[0009] arranging cameras in the target region based on the visual field scores.
[0010] According to a second aspect of the present disclosure, a camera arrangement device in a region is provided, and the device comprises:
[0011] a point cloud model obtaining module configured to obtain a three-dimensional point cloud model of a target region;
[0012] The data labeling module is configured to perform data labeling processing on the three-dimensional point cloud model to obtain a labeled three-dimensional point cloud model, and convert the labeled three-dimensional point cloud model into a field of view model of the target area. The field of view model includes a plurality of different building components, and different building components correspond to different priority levels representing different importance levels.
[0013] The field of view score acquisition module is configured to acquire point position information for setting cameras in the field of view model, and acquire a field of view score of each camera on the corresponding point position information. The field of view score is positively correlated with the priority level.
[0014] The arrangement module is configured to arrange the cameras in the target area based on the field of view scores.
[0015] According to a third aspect of the present disclosure, an electronic device is provided. The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the method described above when executing the program.
[0016] According to a fourth aspect of the present disclosure, a computer readable storage medium is provided, which stores a computer program. The program is executed by a processor to implement the method described above.
[0017] According to a fifth aspect of the present disclosure, a computer program product is provided, which includes a computer program. The computer program is executed by a processor to implement the method described above.
[0018] The arrangement method and device for cameras in a region provided by the embodiments of the present disclosure can obtain a three-dimensional point cloud model of a target area, and perform data labeling processing on the three-dimensional point cloud model to obtain a labeled three-dimensional point cloud model. The labeled three-dimensional point cloud model is converted into a field of view model of the target area. The field of view model includes a plurality of different building components, and different building components correspond to different priority levels representing different importance levels. Point position information for setting cameras in the field of view model can be acquired, and a field of view score of each camera on the corresponding point position information can be acquired. The field of view score is positively correlated with the priority level. The cameras are arranged in the target area based on the field of view scores. In this way, the problem of high cost caused by manual arrangement can be largely avoided. By considering the priority of the field of view, the embodiments can improve the arrangement quality by focusing on important areas within a limited cost. BRIEF DESCRIPTION OF DRAWINGS
[0019] More details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:
[0020] Figure 1A flowchart illustrating a method for arranging cameras within a region, as provided in an exemplary embodiment of this disclosure;
[0021] Figure 2 A schematic block diagram of the functional modules of a camera arrangement device within an area provided for an exemplary embodiment of this disclosure;
[0022] Figure 3 A structural block diagram of an electronic device provided as an exemplary embodiment of this disclosure;
[0023] Figure 4 A block diagram of a computer system provided for an exemplary embodiment of this disclosure. Detailed Implementation
[0024] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0025] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0026] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc., used in this disclosure are only used to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.
[0027] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0028] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0029] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0030] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0031] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device. It is understood that the above notification and user authorization process is merely illustrative and does not constitute a limitation on the implementation of this disclosure; other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0032] In the deployment of related technologies in smart parks, the main method still relies on manual, experience-based placement of surveillance camera locations. In a large park, hundreds of cameras require experienced staff to arrange them individually, significantly increasing labor costs. Moreover, manual camera placement can lead to gaps and duplication of views, resulting in increased deployment costs and reduced effectiveness.
[0033] While some campus camera deployment schemes based on genetic algorithms or particle swarm optimization have been proposed, these schemes simply calculate field-of-view scores based on the size of the field of view. However, in smart campus applications, different areas have different priorities, potentially leading to ineffective deployment in key areas. For example, when camera deployment is limited by budget or resources, priority should be given to key areas such as factories and office buildings.
[0034] Therefore, in order to solve the above-mentioned technical problems, this disclosure provides a campus security camera layout scheme based on the PointNet++ model and the whale algorithm. The main function is to use the 3D model of the campus to mark the importance score and camera position of each part of the campus, and then calculate the optimal camera layout scheme based on the obtained importance score and all possible deployment point information.
[0035] PointNet++ is a deep learning architecture designed specifically for processing 3D point cloud data. It aims to address the limitations of the original PointNet in processing point cloud data, particularly its insufficient capture of local structural information. By introducing a hierarchical feature learning framework, PointNet++ significantly improves the ability to represent point clouds with fine detail and generalize to complex scenes.
[0036] During the PointNet++ model training process, transfer learning can be used to obtain an AI (Artificial Intelligence) model based on labeled point cloud data of the campus.
[0037] In this example, the source code and dataset of PointNet++ can be obtained from Tensorflow first, and a pre-trained model can be trained.
[0038] For example, you can download the PointNet++ source code and the ModelNet40 dataset from TensorFlow to train a pre-trained PointNet++ model. TensorFlow is an end-to-end open-source machine learning platform.
[0039] In this embodiment, the pre-trained model obtained above is subjected to transfer learning using the prepared dataset.
[0040] Specifically, when deploying cameras in a park, a sample set can be created by collecting 3D point cloud datasets of the park's facilities and building doors and windows. These datasets are then compared with the corresponding components within the park to ensure the accuracy of the images. Different park building components have different 3D point cloud data and different priority indices; therefore, the more diverse the image sets, the stronger the trained model's ability to recognize the park's building components.
[0041] Before performing transfer learning on a pre-trained model using a dataset, the data in the dataset needs to be preprocessed according to the following steps:
[0042] 1) Format conversion: If the data storage format is not the format required by the model (such as NumPy arrays or PyTorch / TensorFlow tensors), then the corresponding conversion is required.
[0043] 2) Normalization of input data: Transform the coordinates of point cloud data to the range of 0-mean and 1-variance.
[0044] This yields three independent datasets: a training set, a test set, and a validation set. Each dataset should contain 3D point cloud data of individual building components within the park, with the same number of point cloud data points for each type of facility.
[0045] In this embodiment, when performing transfer learning on the pre-trained model using the dataset, it is necessary to adjust the hyperparameters in the model. Specifically, the grid search method can be used to verify and optimize the possible values of the hyperparameters in Table 1, which is a table of possible hyperparameter values.
[0046] Hyperparameters are parameters that need to be manually set before training the model. The grid search method iterates through all possible combinations of parameters by specifying a list of candidate values for the hyperparameters, trains and evaluates the model for each set of parameters, and finally selects the parameter combination with the best performance as the hyperparameters of the final model.
[0047] Table 1:
[0048] Hyperparameters Possible values Epoch number 10,20,30,50 Optimization algorithm RMSprop, Adam, SGD Learning rate 0.1,0.05,0.01,0.001,0.0001 Batch size 16,32,64 Dropout rate 0.1,0.2,0.3
[0049] Transfer learning of a pre-trained model is essentially retraining the pre-trained model using the training data. Since the building components are labeled based on 3D point cloud data, it must be treated as a classification problem, requiring the use of a multi-class cross-entropy loss function to calculate the loss value. The following formula (1) is the multi-class cross-entropy loss function formula:
[0050]
[0051] Where L represents the loss value calculated by the loss function.
[0052] C: Represents the number of label categories in the dataset, that is, the number of point cloud data of various building components in the dataset.
[0053] yi: is the one-hot encoding (value is 0 or 1) of the true label of the i-th point in class c.
[0054] pi: is the probability predicted by the model that the i-th point belongs to the c-th class.
[0055] Formula (1) represents the deviation between the model's prediction of the data in the dataset and the actual result. The sum of the deviations of each result is the actual loss value. For example, by traversing the possible values corresponding to each hyperparameter in Table 1, multiple sets of possible hyperparameter values are obtained. By obtaining the loss value corresponding to each set of possible hyperparameter values, the possible hyperparameter value corresponding to the set with the smallest loss value is taken as the optimal parameter of the model, and the trained PointNet++ model is obtained. In this way, the area where the cameras are arranged can be labeled using the trained PointNet++ model.
[0056] Therefore, a 3D point cloud model of the required standard park can be obtained, and this model can be labeled using the trained model described above. This allows for the labeling of key placement areas within the park, such as doors, windows, and roads, and the assignment of corresponding weights. Specifically:
[0057] (1) Original point cloud data annotation of the park: The obtained point cloud data of the park is annotated using the PointNet++ model trained above to obtain the annotated 3D point cloud model.
[0058] (2) Convert the annotated 3D point cloud model into a 3D model: Import the annotated 3D point cloud model into the 3Dmax software and convert the 3D point cloud model into a 3D model so that components of different priorities have different colors, or the higher the priority, the darker the color.
[0059] (3) 3D model conversion: Although the 3D model obtained in the embodiment has a priority, it actually represents a park model. What is needed in the end is the "view model" of the park. Boolean subtraction can be performed in 3ds Max software to obtain the view model of the park. The priority can be handled by using the gradient editor of 3ds Max to diffuse the color gradient and change the color of the old model to the new model.
[0060] Thus, a model simulating the field of view was obtained from the labeled point cloud model, and different priorities were represented by colors.
[0061] After obtaining the weighted 3D model and the possible camera locations, the whale algorithm is needed to find the optimal solution.
[0062] Specifically, because the implementation example prioritizes the importance of the 3D model, the scoring criterion for each camera arrangement is no longer the size of the field of view, but rather the weight score of the field of view. The weight score of the field of view can be calculated from the voxels in the 3D model. Using the previously labeled 3D model data, the number of voxels with each weight within the field of view is obtained, and then directly multiplied by the weight.
[0063] Therefore, the field of view score of the camera on possible point information can be calculated by the following formula (2).
[0064]
[0065] Where s represents the score obtained by the camera, i.e., the field of view score.
[0066] T: Represents the number of different weighted regions that are labeled.
[0067] wt: Represents the weight score for this region.
[0068] n t : Indicates the number of 3D model voxels occupied by the current region.
[0069] In this embodiment, each camera can calculate its field of view score according to the above formula. Each region's field of view score is calculated only once, ensuring that even if two cameras have overlapping fields of view, the overlapping portion will not be counted twice. The final score is the sum of the field of view scores from all cameras.
[0070] In this embodiment, by arranging multiple preset cameras at various locations in the park according to different arrangements, the total field of view score of the cameras corresponding to each arrangement scheme is obtained, and the arrangement scheme with the highest total field of view score can be taken as the optimal arrangement scheme.
[0071] The calculation process for obtaining the optimal field of view from multiple cameras can be viewed as a multi-objective optimization problem. The algorithm used in this embodiment is the non-dominated sorting multi-objective whale optimization algorithm, specifically the whale algorithm can be used to obtain the above-mentioned optimal arrangement scheme.
[0072] The predation strategy in this embodiment is the same as the normal whale algorithm, consisting of two steps: surrounding the prey and using a bubble net for capture. Due to the introduction of the Sine chaos mechanism, the basic formulas for these two steps have been partially modified in this embodiment.
[0073] (1) Introduction of Sine Chaos Mechanism: In the traditional whale algorithm, the convergence factor 'a' is a variable that decreases linearly from 2 to 0. However, complex optimization problems often have multiple local optima, and the linear decreasing strategy can actually hinder the algorithm's ability to escape local optima. Therefore, this paper proposes a nonlinear convergence factor, thus introducing the Sine chaos mechanism. The original mapping of the Sine chaos mapping is... This is the control coefficient, which can be directly selected as 4 in the example. However, in this algorithm, a larger convergence factor is needed in the early stages of computation to facilitate global traversal, while a smaller convergence factor is needed in the later stages of computation to accelerate convergence. Therefore, the example improves the mapping formula for sine chaos, which is simplified to:
[0074] x i+1 =cos(πx) i (3)
[0075] The value of the convergence factor 'a' after the change is:
[0076] a=a0cos(πx i (4)
[0077] Where a0 is a coefficient and i is a positive integer.
[0078] (2) Prey Encirclement Formula: In the multi-objective whale optimization algorithm, the behavior of encircling the prey manifests as other solutions moving closer to the global optimal solution (leader whale), and the formula is:
[0079]
[0080] in, It is the new position of individual i in generation t+1.
[0081] X lead It is the position of the current global optimal solution (leading whale).
[0082] e is a random vector that follows a standard normal distribution N(0,1) and is used to introduce random perturbations.
[0083] 'a' is the previously obtained convergence factor, which controls the speed at which an individual approaches the global optimum as the number of iterations increases.
[0084] t is the current iteration number.
[0085] (3) Bubble Web Hunting: The original formula for bubble web hunting in the WOA whale algorithm is:
[0086]
[0087] in:
[0088] is the velocity vector in the (t+1)th iteration. w is the inertia weight, used to balance the global search and the local search.
[0089] A is a term related to the attraction coefficient A, whose element values are usually in the range of [-1,1], representing the tendency of an individual to move toward the global optimal solution (or other leader whales). In this scheme, although the calculation method of the related convergence factor a has been changed, the formula for this parameter itself has not been modified.
[0090] C is a term related to the contraction coefficient C, and its elements also take values in the range of [-1,1]. Random perturbation is introduced to avoid getting trapped in local optima. Similar to the attraction coefficient A, the formula for this parameter itself has not been modified in this scheme.
[0091] It is the solution for the (t+1)th iteration, and its value is the value of the solution for the tth iteration. With velocity vector The sum of.
[0092] In the publicly provided embodiments, to enhance the algorithm's global search capability in the early stages and its local search capability in the later stages, the weights were improved to be dynamic:
[0093]
[0094] Among them, T max T represents the maximum weight value. min This represents the maximum weight value.
[0095] The campus security camera deployment scheme based on PointNet++ and the whale algorithm provided in this disclosure can annotate campus point cloud data using artificial intelligence (AI) annotation algorithms to arrange camera installation points, enabling the process from acquiring initial point cloud data to providing the optimal camera solution. By introducing and modifying sine chaotic mapping, the scheme improves global search capabilities in the initial stage and local search capabilities in the later stage. Furthermore, the embodiment modifies the inertia weight formula of the whale algorithm, introducing dynamic inertia weights to accelerate algorithm convergence.
[0096] Therefore, this embodiment effectively saves costs by using fewer cameras and arranging them according to field-of-view priority to achieve optimal field-of-view performance, significantly reducing the number of cameras needed in the park. It also improves deployment efficiency, avoiding the need for experienced engineers to manually deploy cameras in a large park to find placement points and implement security measures. This embodiment, through the use of artificial intelligence calculations, greatly improves efficiency. Furthermore, the implementation enhances deployment quality. Compared to related technologies, this embodiment considers field-of-view priority scores, improving deployment quality within a limited cost by focusing on key areas.
[0097] Based on the above embodiments, this disclosure also provides a method for arranging cameras within a region, such as... Figure 1 As shown, the method may include the following steps:
[0098] In step S110, a three-dimensional point cloud model of the target area is obtained.
[0099] In this embodiment, the target area can be a park where cameras need to be deployed, or a certain area of a city, or a building, etc., and the embodiment is not limited to these. A three-dimensional point cloud model of the target area can be obtained by means of LiDAR or other methods.
[0100] In step S120, the three-dimensional point cloud model is subjected to data annotation processing to obtain an annotated three-dimensional point cloud model, and the annotated three-dimensional point cloud model is converted into a view model of the target area.
[0101] The vision model includes multiple different building components, each representing a different level of importance.
[0102] In this embodiment, when annotating the 3D point cloud model, annotation can be done manually or through image recognition. For example, while acquiring the 3D point cloud model of the target area, image information of the target area can also be acquired. The image information can then be used to identify buildings, such as doors, windows, roads, or trees, within the target area, yielding recognition results. By establishing the association between the 3D point cloud model and this image information, the recognition results obtained through the image information are mapped back to the 3D point cloud model, thus achieving annotation of the 3D point cloud model. The association between the 3D point cloud target and the image information can be established through coordinate positions. For example, if the recognition result of the image corresponding to coordinate position A in the target area is "gate," then the building component of the 3D point cloud model corresponding to coordinate position A is also labeled as "gate."
[0103] In this embodiment, when performing data annotation processing on the 3D point cloud model, the 3D point cloud model can also be input into a component annotation model, and the component annotation model can be used to annotate the 3D point cloud model. Specifically, the component annotation model is obtained by training a pre-trained model using training samples. The training samples include annotation information, which includes building components and point location information.
[0104] In this embodiment, the building component is equivalent to representing the actual building on a 3D point cloud in a construction manner, and the point location information can be the locations of cameras set up in an existing park. This allows the 3D point cloud models of several parks that already contain labeled building components and point location information to be used as training samples to train a pre-trained model, resulting in a constructed labeled model. The constructed labeled model can be the PointNet++ model trained in the above embodiment.
[0105] During the training of the pre-trained model using training samples, as shown in Table 1, step S120 may further include the following steps:
[0106] In step S121, a hyperparameter table is obtained; wherein, the hyperparameter table includes multiple sets of different preset hyperparameter values.
[0107] As shown in Table 1, multiple sets of hyperparameters can be preset.
[0108] In step S122, the hyperparameter table is traversed, and the loss value corresponding to each group of preset hyperparameter values is obtained through the multi-class cross-entropy loss function.
[0109] In step S123, the target hyperparameter value is determined from the hyperparameter table based on the loss value, and the target hyperparameter value is used as the hyperparameter value of the component annotation model.
[0110] In the embodiment, for example, multiple sets of possible values of hyperparameters can be obtained by traversing the possible values corresponding to each hyperparameter in Table 1. By obtaining the loss value corresponding to each set of possible values of hyperparameters, the possible value of the hyperparameter corresponding to the set with the smallest loss value is taken as the optimal parameter of the model, and the trained PointNet++ model is obtained. In this way, the area to be labeled can be labeled using the trained PointNet++ model.
[0111] In step S130, the point information used to set the cameras in the field of view model is obtained, and the field of view score of each camera at the corresponding point information is obtained. The field of view score is positively correlated with the priority.
[0112] In this embodiment, the field of view information of each camera at the corresponding point information can be obtained, the number of target building components and voxels contained in the field of view information can be obtained, and the field of view score of each camera at the corresponding point information can be obtained based on the weight and voxel number corresponding to the target building components.
[0113] Specifically, the field of view score of each camera can be calculated using the above formula (2). By summing the field of view scores of each camera in the target area, the total field of view score can be obtained.
[0114] In step S140, cameras are arranged in the target area based on the field of view score.
[0115] In this embodiment, the number of targets in the target area can be obtained, and based on the number of targets and the field-of-view scores of each camera at its corresponding location, the optimal solution for the total field-of-view scores of all cameras in the target area is found using the target whale algorithm. The target whale algorithm includes a sine chaos mechanism, where the convergence factor decreases non-linearly.
[0116] Specifically, by combining equations (3) to (7) above and introducing an improved sine chaotic mapping formula, the convergence factor is increased in the early stage of the calculation to facilitate global traversal, while the convergence factor needs to be decreased in the later stage of the calculation. This can accelerate the convergence of the algorithm. Furthermore, by modifying the above weights to dynamic weights, the algorithm can enhance its global search capability in the early stage and its local search capability in the later stage. For details, please refer to the description of the above embodiments, which will not be repeated here.
[0117] The method for arranging cameras within a target area provided in this disclosure involves acquiring a 3D point cloud model of the target area and performing data annotation processing on the 3D point cloud model to obtain an annotated 3D point cloud model. The annotated 3D point cloud model is then converted into a field-of-view (DOR) model of the target area. This DRR model includes multiple different building components, each representing a different priority level. The location information for camera placement within the DRR model can be obtained, and the DRR score for each camera at its corresponding location can be acquired. The DRR score is positively correlated with the priority; cameras are then arranged within the target area based on the DRR scores. This largely avoids the high cost associated with manual arrangement, and by considering DRR priorities, the embodiment can improve the arrangement quality within a limited cost by focusing on key areas.
[0118] Based on the above embodiments, in another embodiment provided in this disclosure, step S120 may further include the following steps:
[0119] In step S124, the weights corresponding to each building component in the labeled 3D point cloud model are obtained.
[0120] In this embodiment, weights corresponding to each building component can be pre-established. For example, a weight mapping table can be set up, allowing the weight of a building component to be retrieved by looking up the table. The weight is positively correlated with priority; a higher weight indicates greater importance and higher priority.
[0121] In step S125, the priority of each building component is determined based on its weight.
[0122] In the embodiment, the corresponding priority level can be determined based on the specific value of the weight.
[0123] In step S126, each building component is assigned a corresponding color based on its priority. Different priority building components correspond to different colors.
[0124] In this embodiment, the annotated 3D point cloud model can be imported into 3D Max software, converting the 3D point cloud model into a 3D model, so that components with different priorities have different colors. For example, red indicates the highest priority and green indicates the lowest priority.
[0125] Alternatively, priority can be represented by the shades of the same color. For example, in a grayscale image, black has the highest priority and white has the lowest priority; that is, the higher the priority, the darker the color.
[0126] By dividing each functional module according to its corresponding function, this disclosure provides a camera arrangement device for an area, which can be a server, a terminal, or a chip applied to a server. Figure 2 This is a schematic block diagram illustrating the functional modules of a camera arrangement device within an area, provided as an exemplary embodiment of this disclosure. Figure 2 As shown, the camera arrangement in this area includes:
[0127] Point cloud model acquisition module 10 is used to acquire a 3D point cloud model of the target area;
[0128] The data annotation module 20 is used to perform data annotation processing on the three-dimensional point cloud model to obtain an annotated three-dimensional point cloud model, and convert the annotated three-dimensional point cloud model into a view model of the target area; wherein, the view model includes multiple different building components, and different building components correspond to different priorities of importance;
[0129] The field of view score acquisition module 30 is used to acquire the point information used to set the camera in the field of view model, and to acquire the field of view score of each camera at the corresponding point information; wherein, the field of view score is positively correlated with the priority.
[0130] The arrangement module 40 is used to arrange cameras in the target area based on the field of view score.
[0131] In another embodiment provided in this disclosure, the data annotation module is specifically used for:
[0132] The 3D point cloud model is input into the component annotation model, and component annotation is performed on the 3D point cloud model; wherein, the pre-trained model is trained using training samples to obtain the component annotation model, and the training samples include annotation information, which includes building component and point location information.
[0133] In another embodiment provided in this disclosure, the data annotation module is further configured to:
[0134] Obtain the hyperparameter table, which includes multiple sets of different preset hyperparameter values;
[0135] Traverse the hyperparameter table and obtain the loss value corresponding to each group of preset hyperparameter values through the multi-class cross-entropy loss function;
[0136] Based on the loss value, the target hyperparameter value is determined from the hyperparameter table, and the target hyperparameter value is used as the hyperparameter value of the component annotation model.
[0137] In another embodiment provided in this disclosure, the data annotation module is further configured to:
[0138] Obtain the weights corresponding to each building component in the annotated 3D point cloud model;
[0139] Based on the weights, the priorities corresponding to each building component are determined.
[0140] Based on the priority settings, each building component is assigned a corresponding color; wherein, building components with different priorities correspond to different colors.
[0141] In another embodiment provided in this disclosure, the field of view score acquisition module is further configured to:
[0142] Acquire the field-of-view information of each camera at its corresponding location;
[0143] The number of target building components and voxels contained in the field of view information is obtained, and based on the weights corresponding to the target building components and the number of voxels, the field of view scores of each camera at the corresponding point information are obtained.
[0144] In another embodiment provided in this disclosure, the field of view score acquisition module is further configured to:
[0145] Obtain the number of cameras in the target area;
[0146] Based on the number of targets and the field of view scores of each camera at the corresponding point information, the target whale algorithm is used to find the optimal solution for the total field of view scores of all cameras in the target area; wherein, the target whale algorithm includes a sine chaos mechanism, and the convergence factor in the sine chaos mechanism decreases nonlinearly.
[0147] The camera deployment device for a target area provided in this embodiment acquires a 3D point cloud model of the target area and performs data annotation processing on the 3D point cloud model to obtain an annotated 3D point cloud model. The annotated 3D point cloud model is then converted into a field-of-view model of the target area. The field-of-view model includes multiple different building components, each representing a different priority level. The device can acquire the point information used to set up the cameras in the field-of-view model and obtain the field-of-view score for each camera at its corresponding point information. The field-of-view score is positively correlated with the priority; cameras are deployed in the target area based on the field-of-view scores. This largely avoids the high cost problem caused by manual deployment, and by considering the priority of the field of view, the embodiment can improve the deployment quality within a limited cost by focusing on key areas.
[0148] This disclosure also provides an electronic device, including: at least one processor; a memory for storing processor-executable instructions; wherein the at least one processor is configured to execute the instructions to implement the methods disclosed in this disclosure.
[0149] Figure 3 This is a schematic diagram of the structure of an electronic device provided as an exemplary embodiment of this disclosure. For example... Figure 3 As shown, the electronic device 1800 includes at least one processor 1801 and a memory 1802 coupled to the processor 1801. The processor 1801 can perform the corresponding steps in the methods disclosed in the embodiments of this disclosure.
[0150] The processor 1801 described above can also be called a central processing unit (CPU), which can be an integrated circuit chip with signal processing capabilities. Each step in the method disclosed in this embodiment can be implemented by the integrated logic circuitry in the processor 1801 or by software instructions. The processor 1801 can be a general-purpose processor, a digital signal processor (DSP), an ASIC (Application Specific Integrated Circuit), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this embodiment can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules can be located in the memory 1802, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The processor 1801 reads information from the memory 1802 and, in conjunction with its hardware, completes the steps of the method described above.
[0151] Furthermore, various operations / processes according to this disclosure, implemented via software and / or firmware, can be transmitted from a storage medium or network to a computer system with a dedicated hardware architecture, such as... Figure 4 The computer system 1900 shown is equipped with the programs that constitute the software. When various programs are installed, the computer system is able to perform various functions, including those described above. Figure 4 A block diagram of a computer system provided for an exemplary embodiment of this disclosure.
[0152] Computer System 1900 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0153] like Figure 4 As shown, the computer system 1900 includes a computing unit 1901, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 1902 or a computer program loaded from a storage unit 1908 into a random access memory (RAM) 1903. The RAM 1903 may also store various programs and data required for the operation of the computer system 1900. The computing unit 1901, ROM 1902, and RAM 1903 are interconnected via a bus 1904. An input / output (I / O) interface 1905 is also connected to the bus 1904.
[0154] Multiple components in computer system 1900 are connected to I / O interface 1905, including: input unit 1906, output unit 1907, storage unit 1908, and communication unit 1909. Input unit 1906 can be any type of device capable of inputting information into computer system 1900. Input unit 1906 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of the electronic device. Output unit 1907 can be any type of device capable of presenting information and may include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 1908 may include, but is not limited to, hard disks and optical disks. Communication unit 1909 allows computer system 1900 to exchange information / data with other devices via a network such as the Internet, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0155] The computing unit 1901 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1901 performs the various methods and processes described above. For example, in some embodiments, the methods disclosed in this disclosure can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1908. In some embodiments, part or all of the computer program can be loaded and / or installed on an electronic device via ROM 1902 and / or communication unit 1909. In some embodiments, the computing unit 1901 can be configured to perform the methods disclosed in this disclosure by any other suitable means (e.g., by means of firmware).
[0156] This disclosure also provides a computer-readable storage medium, wherein when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is able to perform the methods disclosed in this disclosure.
[0157] The computer-readable storage medium in this disclosure can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. The aforementioned computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specifically, the aforementioned computer-readable storage medium may include electrical connections based on one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0158] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0159] This disclosure also provides a computer program product, including a computer program, wherein the computer program, when executed by a processor, implements the methods disclosed in the embodiments of this disclosure.
[0160] In embodiments of this disclosure, computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof. These programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network (including a local area network (LAN) or a wide area network (WAN)), or it can be connected to an external computer.
[0161] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0162] The modules, components, or units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules, components, or units do not necessarily constitute a limitation on the module, component, or unit itself.
[0163] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary hardware logic components that can be used include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0164] The above description is merely an embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0165] While specific embodiments of this disclosure have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of this disclosure. Those skilled in the art should understand that modifications can be made to the above embodiments without departing from the scope and spirit of this disclosure. The scope of this disclosure is defined by the appended claims.
Claims
1. A method for arranging cameras within a region, characterized in that, The method includes: Obtain a 3D point cloud model of the target region; The three-dimensional point cloud model is subjected to data annotation processing to obtain an annotated three-dimensional point cloud model, and the annotated three-dimensional point cloud model is converted into a view model of the target area; wherein, the view model includes multiple different building components, and different building components represent different priorities; Obtain the point information used to set up the camera in the field of view model, and obtain the field of view score of each camera at the corresponding point information; wherein, the field of view score is positively correlated with the priority. Based on the field of view score, cameras are arranged in the target area.
2. The method according to claim 1, characterized in that, The step of performing data annotation processing on the 3D point cloud model to obtain an annotated 3D point cloud model includes: The 3D point cloud model is input into the component annotation model, and component annotation is performed on the 3D point cloud model; wherein, the pre-trained model is trained using training samples to obtain the component annotation model, and the training samples include annotation information, which includes building component and point location information.
3. The method according to claim 2, characterized in that, The step of training the pre-trained model using training samples includes: Obtain the hyperparameter table, which includes multiple sets of different preset hyperparameter values; Traverse the hyperparameter table and obtain the loss value corresponding to each group of preset hyperparameter values through the multi-class cross-entropy loss function; Based on the loss value, the target hyperparameter value is determined from the hyperparameter table, and the target hyperparameter value is used as the hyperparameter value of the component annotation model.
4. The method according to claim 1, characterized in that, The step of converting the labeled 3D point cloud model into a view model of the target region includes: Obtain the weights corresponding to each building component in the annotated 3D point cloud model; Based on the weights, the priorities corresponding to each building component are determined. Based on the priority settings, each building component is assigned a corresponding color; wherein, building components with different priorities correspond to different colors.
5. The method according to claim 1, characterized in that, The step of obtaining the field-of-view score of each camera at the corresponding point information includes: Acquire the field-of-view information of each camera at its corresponding location; The number of target building components and voxels contained in the field of view information is obtained, and based on the weights corresponding to the target building components and the number of voxels, the field of view scores of each camera at the corresponding point information are obtained.
6. The method according to claim 5, characterized in that, The step of arranging cameras in the target area based on the field of view score includes: Obtain the number of cameras in the target area; Based on the number of targets and the field-of-view scores of each camera at the corresponding point information, the target whale algorithm is used to find the optimal solution for the total field-of-view scores of all cameras in the target area; wherein, the target whale algorithm includes a sine chaos mechanism, and the convergence factor in the sine chaos mechanism decreases nonlinearly.
7. A camera arrangement device within an area, characterized in that, The device includes: The point cloud model acquisition module is used to acquire a 3D point cloud model of the target area; The data annotation module is used to perform data annotation processing on the 3D point cloud model to obtain an annotated 3D point cloud model, and convert the annotated 3D point cloud model into a view model of the target area; wherein, the view model includes multiple different building components, and different building components represent different priorities; The field of view score acquisition module is used to acquire the point information used to set the cameras in the field of view model, and to acquire the field of view score of each camera at the corresponding point information; wherein, the field of view score is positively correlated with the priority. The arrangement module is used to arrange cameras in the target area based on the field of view score.
8. An electronic device, characterized in that, include: At least one processor; Memory for storing the at least one processor-executable instruction; The at least one processor is configured to execute the instructions to implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method as described in any one of claims 1-6.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method according to any one of claims 1-6.