Disclosure of Invention
The invention provides a fountain control method based on computer aided design, which aims to solve the problem that the existing fountain is started without considering the attractiveness of the fountain as a landscape to tourists, and adopts the following technical scheme:
one embodiment of the invention provides a fountain control method based on computer aided design, which comprises the following steps:
acquiring tourist position information, fountain position information and fountain related parameters in a scenic spot; the fountain related parameters comprise the activity level of each fountain in the scenic spot, the effective range of each activity level of each fountain and the number of opening persons of each activity level of each fountain;
respectively carrying out simulation on the fountain position information and the tourist position information to obtain a fountain graph structure and a tourist graph structure, and carrying out graph clustering on the tourist graph structure according to the number of nodes in the fountain graph structure to obtain a plurality of tourist categories;
acquiring a first starting threshold value of each fountain according to the number of starting persons of all activity levels of each fountain, which are larger than the current activity level, and the number of first tourists in the effective range of all activity levels, which are larger than the current activity level;
obtaining the simulated opening probability of each fountain according to the distance between each fountain and each tourist category, the relative direction difference between each fountain and each tourist category and the number of second tourists of each tourist category;
and performing interactive control on each fountain in the scenic spot according to a comparison result of the simulated opening probability of each fountain obtained by computer simulation and the first opening threshold.
Optionally, the obtaining of the plurality of classes of tourists includes a specific method that:
and carrying out graph clustering on the tourist map structure by adopting a Grignard-Newman algorithm, selecting a graph to cluster to form a clustering result with the smallest difference between the number of the classes and the number of nodes of the fountain map structure, and taking the clustering result as a plurality of classes in the obtained clustering result, namely a plurality of tourist classes.
Optionally, the obtaining the first starting threshold of each fountain includes the specific method:
wherein,
indicates the fifth->
A first opening threshold of a fountain>
For the next higher activity level of the current state of the fountain, is based on>
Indicates the fifth->
The first fountain>
Number of persons on each activity level>
Indicates that the fountain is on>
Number of first visitors in the active range of the individual activity level->
Represents the number of activity levels of the fountain>
Indicates that the fountain is on>
Number of persons on each activity level>
Indicates that the fountain is on>
A first number of guests of an active range of activity levels.
Optionally, the relative direction difference between each fountain and each tourist category is obtained by the following specific method:
the method comprises the steps of obtaining a track sequence of each tourist according to position information of each tourist, obtaining a principal component direction and a corresponding characteristic value of each tourist through a PCA algorithm, selecting the direction with the largest characteristic value as a principal direction of the tourist, adding principal direction vectors of all the tourists in each tourist category as a first advancing direction of each tourist category, obtaining a second advancing direction of a centroid of each tourist category pointing to each fountain, and taking a difference value between the first advancing direction and the second advancing direction corresponding to each fountain as a relative direction difference between each fountain and each tourist category.
Optionally, the obtaining of the simulated turn-on probability of each fountain includes the specific method:
wherein,
indicates the fifth->
Simulated turn-on probability for a fountain>
Represents the number of guest categories in which the graph is clustered, and>
indicates the fifth->
A second guest number in a guest category, greater than or equal to>
Indicates the fifth->
Each guest category and +>
Distance between several fountains>
Is the first->
Fountain and a fifth +>
The relative directional differences of the individual classes of guests, device for selecting or keeping>
Normalization processing representing a difference in relative direction>
An exponential function with a natural constant as the base is shown.
The technical scheme of the invention at least has the following beneficial effects:
by clustering the visitor nodes at every moment every other time period, categories close to the number of the fountains are obtained, and the method is favorable for obtaining the fountain nodes corresponding to different visitors, and reflects the congregation of the visitors (people often go out or visit congregation, such as a person going out or a tourist group) compared with the method for directly calculating the corresponding fountain nodes of each visitor, and is favorable for better simulation of the actual situation through a computer; by calculating the trend that the tourists point to each fountain, the tourist number limiting condition of each fountain is weakened according to the trend, the tourists are attracted to gather in one area, the starting index of the fountain in a higher mode is reached, the user experience can be improved, and the scenic spot goodness contribution degree of the fountain landscape is improved.
By means of a computer aided design land method, an interaction model is designed by combining position distribution of tourists in a scenic area and scenic spot interaction data such as a fountain in the scenic area, interaction control of the tourists and the scenic area is achieved, the functions of automatically analyzing scene data according to scene requirements and then achieving automatic aided design are achieved, the requirements of the tourists on automatic interaction of the scenic area are improved, and user experience is further improved.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
The first embodiment provided by the invention is as follows:
step S101, collecting data in a scene needing computer aided design.
In this embodiment, a scenic spot is described as an example of a computer aided design object, and interactive objects existing in the scenic spot are tourists and scenic spot objects, where the scenic spot objects include exhibition halls, sculptures, fountain, lights, flowers, plants, trees, and the like in the scenic spot.
It should be noted that, in order to perform computer-aided design on a scenic spot, a virtual scene of the scenic spot needs to be constructed in advance, that is, a terrain object and a scenery object of the scenic spot are established into a virtual three-dimensional scene and then are imported into computer-aided design software, the commonly used computer-aided software is traditional CAD and special Lumion for garden landscape design, but the invention adopts an illusion 5 game Engine (Unreal Engine 5) with a great design freedom and functionality, and the game Engine is not only used for game design and movie design, but also suitable for other fields of computer-aided design.
The embodiment firstly needs to acquire the position information of the tourists; specifically, the tourist position information can be obtained by tracking through a handheld terminal or a camera, the handheld terminal is used for explaining scenic spots of a user, meanwhile, the user can ask questions through the terminal to reach an area where the user wants to go, and meanwhile, a GPS positioning chip is embedded in the terminal, so that the tourist position information can be obtained; the camera tracking is carried out on the images acquired by the scenic spot cameras, because the actual coordinate position of each camera is known, the tourist areas on the images are obtained through person identification, then the target tourist image coordinate system acquired by the cameras is converted into the world coordinate system through the existing method, the conversion function in the OpenCV library can be adopted for realizing, the position information of the tourists is further obtained, and the position information of the tourists is imported into computer aided design software.
It should be noted that, because the scenery spot objects are fixed in the virtual scene in the computer aided design software, the positions of the scenery spot objects in the virtual scene can be directly obtained.
Because the scenic spot object needs to interact with the tourist, interaction parameters need to be designed for the scenic spot object in computer aided design software, for example, for buildings such as exhibition halls, the interaction parameters are designed to be the opening and closing of a gate or a window, the indoor temperature and humidity, the indoor and outdoor light intensity and the like; for the fountain, the interaction parameters are activity levels, the number of opening people of each activity level and the like, and for flowers, plants, trees, statues and the like, the corresponding interaction parameters are voice broadcast, video display content information and the like.
This embodiment is in order to realize automatic computer aided design, need come automatic change according to the visitor distribution condition in scenic spot and make things convenient for the interactive parameter of sight spot object, utilize computer aided design software to design an interactive model, this model input visitor information, the interactive parameter of output sight spot object, when making the visitor be in different distribution state, sight spot object has different interactive state, for example open the window of exhibition hall different positions more according to the position of visitor in the exhibition hall room and motion state and ventilate, for example again when the visitor walked towards the fountain, the activity level of fountain open response, or change light state.
S102, clustering the tourists according to the position information of the tourists in the computer aided design software to obtain a plurality of classes of the tourists.
The method comprises the steps of obtaining the position of each tourist in a scenic spot in real time, leading the position into computer-aided design software in real time, generating a human body model at the position of each tourist in the computer-aided design software, and designing actions through the human body model, so that the human body model can generate the same movement trend as the tourist in a real scene.
The method comprises the steps that positions of all tourists at the same time are obtained in computer aided design software, clustering is conducted on the positions, and a plurality of classes of the tourists are obtained; because the tourists and the scenic spot objects generally interact with one scenic spot object, the tourists need to be classified, interaction parameter adjustment is carried out on a plurality of tourist groups when the scenic spot objects are interacted, and the problems of poor interaction effect and weak generalization capability of a designed interaction model caused by only considering a single tourist individual are avoided.
It should be noted that common clustering methods include a mean shift clustering method, a graph clustering method, and the like.
And S103, acquiring a threshold range of the scenic spot object interaction parameter change according to the position distribution of the tourists.
When the scenic spot object interacts with the tourist, the interaction parameters of the scenic spot object need to be changed according to the position distribution, the motion state or the number of the tourists, and therefore a threshold value for changing the current interaction parameter of the scenic spot object into the next interaction parameter needs to be calculated. The specific method comprises the following steps: obtaining the number of tourists in the preset range of the scenic spot object under the real-time current interaction parameter in computer aided design software
And acquiring the number of people required by the preset scenic spot object in the next interactive parameter
(ii) a Designing a threshold change model in the computer-aided design software, the model inputting->
And &>
The threshold value of the output sight object changing from the current interaction parameter to the next interaction parameter->
。
For example, in this embodiment:
and step S104, obtaining the probability that the current interaction parameter of the sight spot object is changed into the next interaction parameter according to the types of the sight spot object and the tourist.
The method comprises the steps of obtaining the distance d between a tourist category and a scenic spot object, the number v of tourists in the tourist category, and the difference between the moving direction of the tourists and the direction of the scenic spot object in real time
。
Designing a probability evaluation model in computer aided design software, inputting d, v and
outputting a probability that the current interaction parameter of the sight object becomes the next interaction parameter &>
。
For example, in this embodiment:
and S105, designing an interaction model according to the threshold variation model and the probability evaluation model, and further obtaining an interaction method of the tourist and the scenic spot objects.
In computer aided design software, an interactive model is designed, and the input of the model is
、/>
And an interaction parameter a, when>
The interaction result output by the time interaction model is as follows: the scenic spot object is switched to the next interactive parameter, so that the interaction between the scenic spot object and the tourist is realized; when/is>
The interaction result output by the time interaction model is as follows: the scene object keeps the current interaction parameters unchanged, i.e. the scene object keeps the current state unchanged.
The method for acquiring the interaction parameter a comprises the following steps: randomly generating N different numbers in the interval of 0 to 2, and taking the numbers as a respectively; the method is equivalent to that N interactive models exist in computer aided design software, each model in the N interactive models operates for 1 day respectively, and operates for N days in total, the number corresponding to one day with the largest number of scenic spot visitors is selected as the final interactive parameter a in the N days, and then the interactive model constructed by the interactive parameters interacts with scenic spot objects. In the present embodiment, N =50 is described as an example.
It should be noted that, when the interaction parameter a is obtained, the influence of non-variable factors or interference factors such as weather, holidays, and the like needs to be eliminated for the N days, and a conventional method in the field of data analysis or data statistics in the specific method is not described again. On the other hand, in order to save the time cost for obtaining a, a may be set with a preset value, for example, let a =1.
In this embodiment, the interaction model is designed by using a computer aided design method, so that the scenic spot interaction can be realized according to specific tourist data of the scenic spot.
The invention provides an embodiment two:
referring to fig. 1, a flowchart of a fountain control method based on computer aided design according to a second embodiment of the present invention is shown, where the method includes the following steps:
and S001, obtaining tourist position information, fountain position information and fountain related parameters in the scenic spot.
Because the fountain is used as a landscape and is necessarily related to tourists when being started, the position information of the tourists and the position information of the fountain need to be acquired at first; meanwhile, each fountain landscape has related parameters including the activity level of each fountain, the effective range of each activity level of each fountain and the number of people starting each activity level of each fountain, fountain position information and fountain related parameters are input into a computer in advance for simulation, and visitor position information can be obtained through various methods.
Specifically, the tourist position information can be obtained by tracking through a handheld terminal or a camera, the handheld terminal is used for explaining scenic spots of a user, meanwhile, the user can ask questions through the terminal to reach an area where the user wants to go, and meanwhile, a GPS positioning chip is embedded in the terminal, so that the tourist position information can be obtained; the cameras track images acquired through the scenic spot cameras, because the actual coordinate position of each camera is known, a tourist area on the images is obtained through person identification, then a target tourist image coordinate system acquired by the cameras is converted into a world coordinate system through the existing method, the target tourist image coordinate system can be realized by adopting a conversion function in an OpenCV library, and further the position information of the tourists is obtained.
It should be noted that scenic spot fountains usually have a plurality of activity levels, and it is impossible to keep the highest activity level running all the time due to the influence of energy consumption, and the purpose of the fountain is to attract visitors to view, and only when the number of visitors is more, the fountain with the higher activity level is opened.
And S002, respectively carrying out simulation according to the fountain position information and the tourist position information to obtain a fountain graph structure and a tourist graph structure, and carrying out graph clustering on the tourist graph structure to obtain a plurality of tourist categories.
Performing simulation on computer aided design software through the acquired fountain position information and the acquired tourist position information to obtain simulated fountains and tourists, and respectively constructing a fountain graph structure and a tourist graph structure, wherein nodes of the fountain graph structure represent each fountain, edge values represent distances between the fountains, and the graph structure is an undirected graph; the nodes in the tourist map structure represent each tourist, the edge values represent the distances among different tourists, and the map structure is an undirected graph.
It should be noted that, because the difference between the number of nodes in the visitor graph structure and the number of nodes in the fountain graph structure is large, and a large amount of calculation is required to calculate the fountain nodes corresponding to visitors, the nodes are replaced by categories in the way of graph clustering for the visitor graph structure, which is convenient for calculating the fountain nodes corresponding to visitors.
Specifically, the number of fountain nodes in the fountain graph structure is
![Figure DEST_PATH_IMAGE033](https://patentimages.storage.***apis.com/a0/ae/7b/69125281c252c9/DEST_PATH_IMAGE033.png)
And carrying out graph clustering on the tourist graph structure according to the number of the fountain nodes, and adopting a Grignard-Newman algorithm. The gri-niemann algorithm clustering is to form different categories by gradually removing the edges of the largest betweenness in the graph structure, so that after removing the edges of the largest betweenness each time, a category number can be obtained, that is, the category number after removing the edges of the largest betweenness can form a category number sequence, for example: [1, 2,3, \8230]Since two categories are not necessarily formed when the edge of the first largest media is removed, it may happen that no new category is formed after a plurality of edges are removed, as two 1's in the example indicate that no new category is formed when the first edge and the second edge are removed. Selecting the corresponding class division condition closest to the fountain node number as the result of graph clustering, specifically, calculating each element and ^ or ^ in the class number sequence>
![Figure 707575DEST_PATH_IMAGE033](https://patentimages.storage.***apis.com/1d/2c/8d/5c52698f7f31e5/707575DEST_PATH_IMAGE033.png)
And selecting the classification condition corresponding to the minimum difference as a graph clustering result of the tourist graph structure, wherein each classification is called as each tourist classification.
And step S003, calculating a first starting threshold value of starting the next higher activity level of each fountain under the current state.
Calculating to obtain the number of first visitors of each fountain in the next higher activity level effective range in the current state, wherein the number of the first visitors refers to the number of visitors which are in the corresponding activity level effective range from the fountain, and when the number of the visitors is too small, the requirement for starting the fountain cannot be met; meanwhile, the more the number of the tourists in the effective range is, the higher the level of the fountain when the fountain is opened is, and better experience can be brought to the tourists.
It should be noted that, the activity level of the fountain is input in the computer system in advance, the height, scale and water flow variation diversity of the fountains with different activity levels are different, and the higher the level of the fountain is, the better the ornamental effect brought to the tourists is; meanwhile, the fountains with different activity levels correspond to different effective ranges and the number of opening persons, the fountain with higher activity level is larger in effective range, and the number of opening persons is more. For example: the activity grades are divided into 5 types of A, B, C, D and E, wherein the grade A is the lowest, and the grade E is the highest; the effective distance corresponding to each activity level is respectively as follows: f (A), f (B), f (C), f (D) and f (E), wherein the effective range of each activity level of each fountain is set to be a circular area with the fountain as the center and the radius as the effective distance; the number of openers corresponding to each activity level is respectively as follows: n (A), N (B), N (C), N (D), N (E); the activity level of each fountain, the corresponding effective range and the number of opening people, wherein the effective distance refers to a distance value that the fountain can be seen in the distance and crowding is not shown, and a user can set the distance value according to actual conditions. For example: a and B are 2 fountains, and three activity levels are as follows: a (20 persons in the category a), b (30 persons) and c (50 persons), wherein the effective distances corresponding to the effective ranges of the three activity levels of the fountain A are as follows: a-a:10m, A-b:20m, A-c:30m.
Further, according to the number of first visitors in the effective range of the next higher activity level of each fountain started in the current state, a first starting threshold value of the next activity level of each fountain started is calculated, specifically, the first starting threshold value is used for calculating the number of the first visitors in the effective range of the next higher activity level of each fountain started in the current state
For example, the fountain may be calculated by turning on the first turn-on threshold of the next higher activity level in the current state as follows:
wherein,
for the next higher activity level of the current state of the fountain, is based on>
Indicates the fifth->
The first fountain>
Based on activity level, activate number of persons>
Indicates that the fountain is first>
Number of first visitors in the active range of the individual activity level->
Represents the number of activity levels of the fountain>
Indicates that the fountain is on>
Number of persons on each activity level>
Indicates that the fountain is on>
Number of first visitors in the active range of the individual activity level->
A number representing a higher activity level than the current activity level outside of the outgoing next activity level, wherein->
。
At this time, the difference between the number of first visitors in the effective range of the next higher activity level and the number of next higher activity level openers
The smaller the fountain should be switched on next higher activity level, corresponding first switching-on threshold>
The smaller; meanwhile, when the fountain with the next activity level is started, although the number of the first tourists does not meet the number of the started people with the higher activity level, the effective range of the attraction of the fountain can be improved to the higher activity level, and then the ratio of the number of the first tourists to the number of the started people with the higher activity level is greater than or equal to>
The larger the fountain is, the larger the satisfaction degree is, the higher the next activity level of the fountain in the current state should be started, and the smaller the corresponding first starting threshold value is; and calculating the mean value of the satisfaction degrees of the subsequent higher levels as the relevant parameters of the first opening threshold.
And step S004, calculating the distance between each fountain and each tourist category, the relative direction difference between each fountain and each tourist category and the number of second tourists in each tourist category to obtain the simulated opening probability of each fountain.
According to the distances between the gathering positions of the tourists and different fountain nodes, the relation between the advancing trend directions of gathered tourist groups and the positions of the fountains and the number of the tourists in each gathered tourist group, simulation is carried out through computer assistance, and the simulated opening probability of each fountain node is obtained and serves as a parameter for controlling the scenic spot fountain subsequently.
It should be noted that, in the traditional method for intelligently assisting fountain control through a computer, only the number of visitors in the effective range of the fountain is considered, the influence of the future trend on the fountain and the visitors is not considered, the fountain itself is not considered as a reference factor with certain attractiveness as a landscape, the fountain opening control under the method has less contribution to the goodness of the whole scenic spot, the future trend can be taken as a parameter to be introduced into the traditional fountain control, the potential gathering direction of the visitors and the fountain attraction existing in the direction are calculated, so that the visitors can advance towards the fountain in the direction with higher probability, the number of people for opening the fountain with higher activity level is further met, the subsequent development of fountain opening is simulated by using the computer, and the scenic spot fountain is further controlled.
Specifically, after each guest category is obtained through graph clustering in step S002, a category center of each guest category needs to be determined, and the calculation method of the category center of each guest category is as follows: calculating the sum of the distances between each tourist in a certain tourist category and all other tourists, and taking the tourist node corresponding to the minimum distance sum as a category center node of the tourist category; further, the distance between each tourist category center node and each fountain node is calculated, and the straight line distance is adopted for calculation. At the moment, for each fountain, the smaller the tourist class and the distance between the tourist class and the fountain are, the more the fountain should be opened; the more the number of the second tourists in the tourist category with smaller distance is, the more the fountain should be opened; the more the number of the types of tourists with smaller distance is, the more the fountain is opened; the second number of guests is the number of guest nodes in each guest category.
It should be noted that, the relative direction difference between each fountain and each guest category is calculated, the relative direction difference represents the advancing trend of each guest category towards a certain fountain, the relative direction difference is represented by the difference between the first advancing direction of the guest category and the second advancing direction of the guest category, the center node of which points to the fountain, and the smaller the relative direction difference is, the more likely the guest category is to advance to the periphery of the corresponding fountain, the more the fountain should be opened.
Specifically, the track sequence of each tourist is obtained according to the position information of each tourist, and at the moment, if the position information of the tourist is obtained by adopting the handheld terminal, the advancing track can be directly obtained; if the position information of the tourists is obtained by adopting the camera tracking, the advancing track of each tourist can be obtained by the multi-camera cooperative target tracking technology; after the forward track of each guest is obtained, the coordinates of each guest at different time can form a sequence, which is called a track sequence, and it should be noted that the obtained coordinates are coordinates in a world coordinate system, and the image coordinates of the same guest in different images are all converted into the world coordinate system.
Further, a track sequence of any one tourist is analyzed through a PCA algorithm, the track sequence is a position sequence, a plurality of principal component directions corresponding to the tourist can be obtained, each principal component direction is a two-dimensional unit vector, each principal component direction corresponds to a characteristic value, and the principal component direction with the largest characteristic value is selected as the principal direction of the tourist. Further, the principal direction vectors of all the tourists in each tourist class are added to serve as the first advancing direction of each tourist class
Recording the mean value of the positions of all the tourists in each tourist category as a category center, and acquiring a second advance direction which points to each fountain from the category center>
The absolute value of the difference between the first forward direction and the second forward direction corresponding to each fountain is->
As a relative direction difference of each fountain from each guest category>
. Please refer to fig. 2, each main direction, the first forward direction and the second forward direction are counted in the direction coordinate systemThe total angle of the direction is (-179 degrees and 180 degrees)]359 integer degree directions in (1), wherein-180 degrees and 180 degrees are the same direction.
Further, in the first place
Taking a fountain as an example, the simulated turn-on probability of the fountain node>
The calculating method comprises the following steps: />
Wherein,
represents the number of visitor categories, based on the graph clustering, and->
Represents a fifth or fifth party>
A second number of guests of a guest category,
represents a fifth or fifth party>
Each guest category and the fifth->
The distance between the fountains>
Is the first->
A fountain and the ^ h->
The relative directional differences of the individual classes of guests, device for selecting or keeping>
Normalized treatment, representing a difference in relative direction>
An exponential function with a natural constant as the base is represented for normalization processing.
At this time, the
Each guest category and +>
Distance between fountains>
The smaller the number of the first or second criterion>
The closer a guest class is to the fifth->
The fountain can enter the effective range of the fountain more, and the opening probability of the fountain is higher; a fifth or fifth letter>
A number of second guests in an individual guest category>
The more, if the category proceeds to a fifth +>
In the effective range of each fountain, the fountain is more suitable to be started, and the fountain starting probability is higher; is/are>
A fountain and the ^ h->
Relative direction discrepancy for individual guest category->
The smaller, the more likely it is that the guest category is to proceed to the @>
The fountain is more likely to be turned on around the fountain.
And S005, controlling the fountain in the scenic region according to the comparison result of the simulated starting probability of each fountain and the first starting threshold value.
The method comprises the steps that computer simulation is carried out, according to visitor position information, fountain position information and fountain related parameters, the simulation starting probability and a first starting threshold value of each fountain in the simulation are obtained, the fountain with the simulation starting probability larger than or equal to the first starting threshold value is controlled to be started according to node information of the fountain, and starting operation of equipment such as a water pump, a motor and light of the fountain in a scenic spot is included; and for the fountain with the simulated opening probability smaller than the first opening threshold, the current activity state of the corresponding scenic spot fountain is maintained, the fountain which is not opened is not started, and the fountain which is opened maintains the current activity state.
The process of obtaining the interaction control method according to the simulated opening probability and the first opening threshold value of each fountain is an interaction model obtained based on computer aided design in the embodiment, the interaction model realizes automatic computer aided design based on scenic spot object data and tourist data, and meets the requirements of automatic, intelligent and high experience of the tourist on scenic spots.
So far, the second embodiment is implemented by taking fountain interactive control as an example, and the computer aided design of scenic spots is completed. The implementer can also further obtain the design of the interaction model of other sight objects in other embodiments based on the two embodiments of the invention.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.