Three-dimensional virtual simulation method and system based on image processing
By optimizing the cloth simulation algorithm and using the color and geometric information of point clouds, the problem of inaccurate recognition of ground point clouds in complex mountainous areas is solved, and the three-dimensional virtual simulation effect is improved.
Patent Information
- Application Number
- CN202410924692.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-11
Smart Images

Figure CN118468612B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a three-dimensional virtual simulation method and system based on image processing. Background Art
[0002] Virtual reality technology is a technology that makes people feel as if they are in the scene through human-computer interaction. It can be used in battlefield command and battlefield simulation confrontation training. In order to provide a real combat environment during battlefield simulation, it is usually necessary to establish a three-dimensional virtual model of the target battlefield.
[0003] When building a three-dimensional virtual model of complex terrain such as mountainous areas, it is necessary to first build a ground model, so it is necessary to first identify the ground point cloud data in the collected point cloud data. However, due to the complex undulations of mountainous terrain and the interference of vegetation, a ground point cloud filtering algorithm is needed to identify the ground point cloud data. Common ground point cloud filtering can be summarized into three categories: slope, morphology, and surface filtering methods. Among the surface filtering methods, the cloth point cloud filtering simulation performs well in the ground point cloud filtering of complex mountainous areas, but the high-precision cloth point cloud filtering has a large amount of calculation and a long data processing time; and at low precision, the algorithm will not fit the cloth to the ground point cloud in some steep locations on the ground, and will not make full use of the color and geometric information in the point cloud data, resulting in the inability to identify the ground point cloud, which in turn makes the simulation effect of the ground three-dimensional model poor. Summary of the invention
[0004] In order to solve the technical problem of poor simulation effect caused by insufficient consideration of point cloud information and point cloud mismatch, this application provides a three-dimensional virtual simulation method and system based on image processing. The technical solutions adopted are as follows:
[0005] In a first aspect, the present application proposes a three-dimensional virtual simulation method based on image processing, the method comprising the following steps:
[0006] Obtain the location information and color information of the point cloud, and all point clouds constitute the initial mountain point cloud set;
[0007] According to the color information and position information of the point cloud, the grayscale intensity value and reference height of the point cloud are obtained respectively; according to the grayscale intensity value and reference height of all point clouds, the brightness compensation coefficient of the point cloud is obtained; according to the brightness compensation coefficient and color information of all point clouds, the ground color values of point clouds of different channels are obtained;
[0008] Get the normal vector of each point cloud, and get the local point cloud geometric complexity of each point cloud based on the normal vector of the point cloud and the difference in ground color values of point clouds in different channels;
[0009] The cloth simulation algorithm is optimized by the local point cloud geometric complexity of the point cloud, and the optimized cloth simulation algorithm is used to process the initial mountain point cloud set to complete the three-dimensional virtual simulation.
[0010] In the above scheme, in view of the problem that the traditional cloth filtering algorithm does not consider the color of the point cloud, the point cloud set is first segmented into regions, and the brightness compensation coefficient is calculated for each region to eliminate the color difference caused by the uneven distribution of light in the mountainous area. The reference height is further used as the weight and the brightness compensation coefficient is combined to calculate the ground color value of the point cloud to characterize the overall color difference of the point cloud data. The second color difference is calculated in combination with the point cloud color value, and the scale vectors at different scales are obtained by combining the first color difference and the distance difference, and then the local point cloud geometric complexity is obtained. Since the color difference is used as the weight, the local point cloud geometric complexity characterizes the direction change of the ground surface, and can identify the local uneven ground area. The shape reliability is calculated by the local angle of the actual point in the post-processing mechanism, and the post-processing threshold geometric weight is obtained by combining the local point cloud geometric complexity. The post-processing threshold at different positions is dynamically adjusted. A higher post-processing threshold is used for locations with normal ground shape and complex ground gullies, and a high post-processing threshold is avoided for areas with many plants. The ground point cloud can be more accurately identified, and the color information and position information of the terrain and point cloud are combined to improve the simulation effect of the ground three-dimensional model.
[0011] In one embodiment, the method of respectively obtaining the grayscale intensity value and the reference height of the point cloud according to the color information and the position information of the point cloud is:
[0012] The color information of the point cloud includes the color intensity values of the three channels in the RGB space; the color intensity values of the three channels are grayed to obtain the gray intensity values of the point cloud;
[0013] The position information of the point cloud includes the x-value, y-value and z-value corresponding to the x-axis, y-axis and z-axis. The xy plane is used as the reference plane, and the reference plane is divided into squares of several sizes. The squares are combined with the z-value to obtain a cuboid.
[0014] For each cuboid, the point cloud with the smallest z value in the cuboid is selected as the ground reference point cloud, and the difference in z value between each point cloud in the cuboid and the ground reference point cloud is used as the reference height of each point cloud.
[0015] In one embodiment, the method for obtaining the point cloud brightness compensation coefficient according to the grayscale intensity values and reference heights of all point clouds is:
[0016] Any point cloud in the cuboid is recorded as the target point cloud, and the absolute value of the difference in grayscale intensity between the target point cloud and the rest of the point clouds in the cuboid is taken as the brightness difference between the target point cloud and the rest of the point clouds; the absolute value of the difference in reference height between the target point cloud and the rest of the point clouds in the cuboid is normalized and taken as the height weight of the target point cloud and the rest of the point clouds;
[0017] The product of the brightness difference between the target point cloud and the rest of the point clouds and the height weight is used as the brightness supplement of the target point cloud and the rest of the point clouds. The brightness index of the target point cloud is obtained according to the brightness supplement of the target point cloud and all the rest of the point clouds. The mean of the brightness indexes of all the target point clouds is used as the brightness compensation coefficient of all the point clouds in the cuboid.
[0018] In the above scheme, the brightness compensation coefficient is calculated for each area, eliminating the color difference effect caused by the uneven distribution of light in the mountainous area.
[0019] In one embodiment, the method for obtaining the ground color values of point clouds of different channels according to the brightness compensation coefficients and color information of all point clouds is:
[0020] In the initial mountain point cloud set, under each channel, the reference height of each point cloud is obtained based on the position information, and the color intensity value of each point cloud is obtained based on the color information; the point cloud ground color value is obtained according to the reference height, color intensity value and brightness compensation coefficient; the point cloud ground color value of each channel is negatively correlated with the reference height, and the point cloud ground color value of each channel is positively correlated with the brightness compensation coefficient of all point clouds and the color intensity value of the channel, respectively.
[0021] In one embodiment, the method for obtaining the target component and obtaining the local point cloud geometric complexity of each point cloud according to the difference in the normal vector of the point cloud and the ground color values of the point clouds of different channels is:
[0022] In the initial mountain point cloud set, any point cloud is recorded as the central point cloud. For each central point cloud, a first preset number of point clouds closest to the central point cloud are selected and recorded as the first distance point clouds. The set consisting of the central point cloud and all the first distance point clouds is recorded as the small-scale point cloud set.
[0023] For each central point cloud, select a second preset number of point clouds closest to the central point cloud, record them as second distance point clouds, and record the set consisting of the central point cloud and all second distance point clouds as a large-scale point cloud set;
[0024] Any one of the two point cloud sets is recorded as the target point cloud set. For the target point cloud set, the first color difference of each point cloud is obtained according to the color difference between the central point cloud and each point cloud in different channels;
[0025] For the target point cloud set, the second color difference of each point cloud is obtained according to the color difference between each point cloud and the point cloud ground color value under different channels;
[0026] In the target point cloud set, the distance difference between the central point cloud and each point cloud is obtained, and the local point cloud direction weight of each point cloud is obtained according to the first color difference, the second color difference and the distance difference between the central point cloud and each point cloud;
[0027] In the target point cloud set, the normal vector of the target point cloud set is calculated according to the local point cloud direction weights of all point clouds and the normal vectors corresponding to all point clouds, and the local point cloud geometric complexity of the central point cloud is obtained according to the difference in normal vectors between the large-scale point cloud set and the small-scale point cloud set.
[0028] In the above scheme, color difference is used as weight, and the geometric complexity of the local point cloud represents the directional change of the ground surface, which can identify areas with local uneven ground.
[0029] In one embodiment, the method for obtaining the first color difference of each point cloud according to the color difference between the central point cloud and each point cloud in different channels is:
[0030] Under each channel, the absolute value of the difference between the color intensity value of the central point cloud and the color intensity value of each point cloud is taken as the channel color difference of each point cloud; the first color difference is obtained according to the channel color difference; the first color difference of each point cloud is positively correlated with the channel color difference of each point cloud under different channels.
[0031] In one embodiment, the method for obtaining the second color difference of each point cloud according to the color difference between each point cloud and the point cloud ground color value in different channels is:
[0032] Under each channel, the absolute value of the difference between the color intensity value of each point cloud and the ground color value of the point cloud under each channel is taken as the ground color difference of each point cloud; the ground color value of the point cloud is obtained according to the ground color difference; the ground color value of the point cloud under each channel is positively correlated with the ground color difference of each point cloud under different channels.
[0033] In one embodiment, the method for obtaining the distance difference between the central point cloud and each point cloud, and obtaining the local point cloud direction weight of each point cloud according to the first color difference, the second color difference of each point cloud and the distance difference between the central point cloud and each point cloud is:
[0034] The Euclidean distance between each point cloud and the central point cloud is calculated, and the Euclidean distance plus 1 is used as the distance difference between the central point cloud and each point cloud; the local point cloud direction weight is obtained according to the first color difference, the second color difference and the distance difference; the local point cloud direction weight of each point cloud is positively correlated with the first color difference, the second color difference and the distance difference between the central point cloud and each point cloud.
[0035] In one embodiment, the method of calculating the normal vector of the target point cloud set according to the local point cloud direction weights of all point clouds and the normal vectors corresponding to all point clouds, and obtaining the local point cloud geometric complexity of the central point cloud according to the normal vector difference between the large-scale point cloud set and the small-scale point cloud set is:
[0036] Taking the local point cloud direction weight of the point cloud as the weight, the normal vectors of all point clouds are comprehensively calculated to obtain the normal vector of the target point cloud set;
[0037] The normal vector of the large-scale point cloud set and the normal vector of the small-scale point cloud set are obtained, the difference between the normal vector of the large-scale point cloud set and the normal vector of the small-scale point cloud set is calculated to obtain the difference vector, and the modulus of the difference vector is used as the local point cloud geometric complexity of the central point cloud.
[0038] In a second aspect, an embodiment of the present application also provides a three-dimensional virtual simulation system based on image processing, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the steps of any one of the above-mentioned three-dimensional virtual simulation methods based on image processing are implemented.
[0039] The beneficial effects of this application are:
[0040] In view of the problem that the traditional cloth filtering algorithm does not consider the color of the point cloud, the point cloud set is first segmented into regions, and the brightness compensation coefficient is calculated for each region to eliminate the color difference caused by the uneven distribution of light in the mountainous area. The reference height is further used as the weight and the brightness compensation coefficient is combined to calculate the ground color value of the point cloud to characterize the overall color difference of the point cloud data. The second color difference is calculated in combination with the point cloud color value, and the scale vectors at different scales are obtained by combining the first color difference and the distance difference, and then the local point cloud geometric complexity is obtained. Since the color difference is used as the weight, the local point cloud geometric complexity characterizes the direction change of the ground surface and can identify the local uneven ground area. The shape reliability is calculated by the local angle of the actual point in the post-processing mechanism, and the post-processing threshold geometric weight is obtained by combining the local point cloud geometric complexity. The post-processing threshold at different positions is dynamically adjusted. A higher post-processing threshold is used for locations with normal ground shape and complex ground gullies, and a high post-processing threshold is avoided for areas with many plants. The ground point cloud can be more accurately identified, and the color information and position information of the terrain and point cloud are combined to improve the simulation effect of the ground three-dimensional model. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0042] Figure 1 A flowchart of a three-dimensional virtual simulation method based on image processing provided by an embodiment of the present application;
[0043] Figure 2 A specific flow chart for obtaining the geometric complexity of local point clouds;
[0044] Figure 3 This is a flowchart for obtaining the three-dimensional simulation effect of mountainous ground after improving the cloth simulation filtering algorithm. DETAILED DESCRIPTION
[0045] In order to further explain the technical means and effects adopted by the present application to achieve the predetermined invention purpose, the following is a detailed description of the three-dimensional virtual simulation method and system based on image processing proposed by the present application, its specific implementation method, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0046] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0047] Three-dimensional virtual simulation method and system embodiment based on image processing:
[0048] The specific scheme of the three-dimensional virtual simulation method based on image processing provided by the present application is described in detail below with reference to the accompanying drawings.
[0049] See also Figure 1 , which shows a flow chart of a three-dimensional virtual simulation method based on image processing provided by an embodiment of the present application, the method comprising the following steps:
[0050] Step S001, obtaining the location information and color information of the point cloud, and all point clouds constitute an initial mountain point cloud set.
[0051] Collect three-dimensional point cloud data, where the collected data includes the coordinates of the point cloud and the color intensity values of the three channels of the point cloud in the RGB color space.
[0052] In this embodiment, taking a mountainous area as an example, 3D laser radar and inertial measurement unit are used as airborne sensor devices, and drone measurement is used to obtain 3D point cloud data of a virtual target mountainous area. Au20 laser scanner acquisition is used as a data collection device. The device is a drone equipped with a point cloud measurement device, which can measure point cloud data through airborne radar and inertial measurement unit. The resolution between point clouds is 0.015, and the color information of the measured position is returned in real time by a high-definition camera and assigned to the corresponding point cloud.
[0053] All point clouds constitute the initial mountain point cloud set.
[0054] Step S002, obtaining point cloud ground color values under different channels according to the color information and position information of the point cloud.
[0055] When using a cloth simulation filtering algorithm to identify point cloud data, the traditional cloth simulation filtering algorithm does not take into account the color information of the point cloud data, which makes it easy to regard the fallen vegetation point clouds parallel to the ground as ground point clouds, resulting in errors in point cloud data processing. Therefore, this application analyzes the color information of the point cloud to optimize the cloth simulation algorithm.
[0056] First, for each point cloud, the grayscale intensity value of each point cloud is calculated by using the average weighted method through the color intensity values of the three channels of each point cloud in the RGB space.
[0057] It should be noted that, in this embodiment, the average weighted method is only a method for calculating the grayscale value of the point cloud, and the implementer may also use other grayscale methods, such as the average value method.
[0058] For point cloud data in mountainous areas, the color features represented by the point cloud data mostly come from the ground and plants, and the color difference between the plant point cloud and the ground point cloud is large, so the initial mountain point cloud set is first segmented.
[0059] Since the position coordinates of each point cloud include the x-axis coordinate, the y-axis coordinate and the z-axis coordinate, the xy plane is used as the reference plane, and the reference plane is divided into squares of several sizes. In this embodiment, the size of the square is 1m*1m. In the three-dimensional coordinate system, each square corresponds to a cuboid, and the length and width of the cuboid are the x-axis and the y-axis, respectively, and the height is the z-axis. For each cuboid, the point cloud with the smallest z value is selected in the cuboid and recorded as the ground reference point cloud, and the difference in z value between each point cloud in the cuboid and the ground reference point cloud is used as the reference height of each point cloud.
[0060] Preferably, in one embodiment of the present application, the absolute value of the difference between the z value of each point cloud and the z value of the ground reference point cloud is used as the reference height of each point cloud.
[0061] Preferably, in one embodiment of the present application, the sum of the absolute value of the difference between the z value of each point cloud and the z value of the ground reference point cloud and the number 1 is used as the reference height of each point cloud.
[0062] Furthermore, the brightness compensation coefficient of the cuboid is obtained according to the grayscale intensity values and reference heights of all point clouds. The specific method is as follows:
[0063] Any point cloud in the cuboid is recorded as the target point cloud, and the absolute value of the difference between the grayscale intensity values of the target point cloud and the other point clouds in the cuboid is used as the brightness difference between the target point cloud and the other point clouds; the absolute value of the difference between the reference heights of the target point cloud and the other point clouds in the cuboid is normalized and used as the height weight of the target point cloud and the other point clouds. In this embodiment, the normalization method can use a linear normalization method.
[0064] The product of the brightness difference between the target point cloud and the rest of the point clouds and the height weight is used as the brightness supplement of the target point cloud and the rest of the point clouds. The brightness index of the target point cloud is obtained according to the brightness supplement of the target point cloud and all the rest of the point clouds. The mean of the brightness indexes of all the target point clouds is used as the brightness compensation coefficient of all the point clouds in the cuboid.
[0065] Preferably, in one embodiment of the present application, the brightness of the target point cloud and all other point clouds are supplemented and added as the brightness index of the target point cloud.
[0066] Preferably, in one embodiment of the present application, the brightness of the target point cloud and all other point clouds are supplemented and the average is taken as the brightness index of the target point cloud.
[0067] The mountain point cloud is divided into regions. The ground height variation within a single cuboid is usually small, so its reference height can be used as the ground height of the point cloud. At the same time, the light intensity within a single cuboid varies little, so the average of its brightness index can be used as the brightness compensation coefficient.
[0068] Furthermore, the ground color values of point clouds of different channels are obtained according to the brightness compensation coefficients and color information of all point clouds. The specific steps are as follows:
[0069] In the initial mountain point cloud set, the point cloud ground color value of each channel is negatively correlated with the reference height, and the point cloud ground color value of each channel is positively correlated with the brightness compensation coefficient of all point clouds and the color intensity value of the channel, respectively. In this way, the point cloud ground color value of each channel is obtained.
[0070] Preferably, in one embodiment of the present application, the reciprocals of the reference heights of all point clouds are calculated, and all reciprocals are linearly normalized to obtain normalized weights; the sum of the brightness compensation coefficient of the point cloud and the color intensity of each channel is recorded as the first sum, the product of the normalized weight of the point cloud and the first sum is used as the single point cloud color, and the single point cloud colors of all point clouds under each channel are accumulated as the point cloud ground color value of each channel.
[0071] Preferably, in one embodiment of the present application, the inverse of the reference height of all point clouds is calculated, and all inverses are linearly normalized to obtain normalized weights; the sum of the brightness compensation coefficient of the point cloud and the color intensity of each channel is recorded as the first sum, the product of the normalized weight of the point cloud and the first sum is used as the single point cloud color, and the average of the single point cloud colors of all point clouds under each channel is used as the point cloud ground color value of each channel.
[0072] It should be noted that positive correlation means that when one variable increases, the other variable also increases, and the two variables change in the same direction. When one variable changes from large to small or from small to large, the other variable also changes from large to small or from small to large. The specific relationship can be a multiplication relationship, an addition relationship, or the idempotence of an exponential function, which is determined by actual application and is not specifically limited in this application.
[0073] It should be noted that negative correlation means that as one variable increases, the other variable decreases accordingly, and the two variables change in opposite directions. When one variable changes from large to small or from small to large, the other variable also changes from small to large or from large to small. The specific relationship can be a ratio relationship, a subtraction relationship, etc., which is determined by actual application, and this application does not impose any special restrictions.
[0074] The ground point cloud is identified by referring to the height, and the interference caused by the large mountainous area and uneven lighting is eliminated by the brightness compensation coefficient to obtain the ground color value of the point cloud, which is used as the color feature value of the ground point cloud in the initial point cloud in the mountainous area.
[0075] At this point, the point cloud ground color value of each channel in the target mountain area is obtained.
[0076] Step S003, obtaining the local point cloud geometric complexity of each point cloud according to the normal vector of the point cloud and the difference in ground color values of point clouds of different channels.
[0077] The normal vector of the point cloud represents the direction information of the point cloud, which is helpful for identifying the ground point cloud and the plant point cloud. Therefore, the initial mountain point cloud set is used as input, and the point cloud normal vector calculation method is used to output the normal vector of each point cloud in the initial mountain point cloud set. The normal vector calculation method is a well-known technology in the art and will not be described in detail.
[0078] In cloth simulation, there is a post-processing step. If a lower post-processing threshold is used, the ground point cloud cannot be recognized in areas with complex gullies. If a higher post-processing threshold is used, the plant point cloud will be mistakenly recognized as the ground point cloud in areas with complex vegetation. Therefore, it is necessary to obtain an optimized threshold.
[0079] First, in the initial mountain point cloud set, any point cloud is recorded as the central point cloud. For each central point cloud, a first preset number of point clouds closest to the central point cloud are selected and recorded as first distance point clouds. The set consisting of the central point cloud and all first distance point clouds is recorded as a small-scale point cloud set; in this embodiment, the first preset number is 10.
[0080] For each central point cloud, select a second preset number of point clouds closest to the central point cloud, record them as second distance point clouds, and record the set consisting of the central point cloud and all second distance point clouds as a large-scale point cloud set; in this embodiment, the second preset number is 20.
[0081] Furthermore, both the large-scale point cloud set and the small-scale point cloud set are recorded as target point cloud sets. For any target point cloud set, the first color difference of each point cloud is obtained according to the color difference between the central point cloud and each point cloud in different channels.
[0082] In each channel, the absolute value of the difference between the color intensity value of the central point cloud and the color intensity value of each point cloud is taken as the channel color difference of each point cloud; the first color difference of each point cloud is positively correlated with the channel color difference of each point cloud in different channels.
[0083] Preferably, in one embodiment of the present application, the channel color differences of each point cloud in different channels are added together and then the number 1 is added as the first color difference of each point cloud.
[0084] Preferably, in one embodiment of the present application, the channel color difference of each point cloud in different channels is averaged and then added with the number 1 as the first color difference of each point cloud.
[0085] Furthermore, for the target point cloud set, a second color difference of each point cloud is obtained according to the color difference between each point cloud and the point cloud ground color value under different channels.
[0086] Under each channel, the absolute value of the difference between the color intensity value of each point cloud and the ground color value of the point cloud under each channel is taken as the ground color difference of each point cloud; the ground color value of the point cloud under each channel is positively correlated with the ground color difference of each point cloud under different channels.
[0087] Preferably, in one embodiment of the present application, the ground color differences of each point cloud in different channels are added together and then the number 1 is added as the second color difference of each point cloud.
[0088] Preferably, in one embodiment of the present application, the ground color difference of each point cloud in different channels is averaged and then added with the number 1 as the second color difference of each point cloud.
[0089] Furthermore, in the target point cloud set, the distance difference between the central point cloud and each point cloud is obtained, and the local point cloud direction weight of each point cloud is obtained according to the first color difference, the second color difference and the distance difference between the central point cloud and each point cloud.
[0090] Calculate the Euclidean distance between each point cloud and the central point cloud, and add the Euclidean distance plus 1 as the distance difference between the central point cloud and each point cloud.
[0091] The local point cloud direction weight of each point cloud is positively correlated with the first color difference, the second color difference, and the distance difference between the central point cloud and each point cloud.
[0092] Preferably, in one embodiment of the present application, the sum of the first color difference and the second color difference of each point cloud is taken as the total color difference of each point cloud, and the product of the total color difference of each point cloud and the distance difference between each point cloud and the central point cloud is normalized and used as the local point cloud direction weight of each point cloud.
[0093] Preferably, in one embodiment of the present application, the sum of the first color difference and the second color difference of each point cloud is taken as the total color difference of each point cloud, the total color difference is taken as the base, the distance difference between each point cloud and the central point cloud is taken as the exponent, and the exponential function is normalized as the local point cloud direction weight of each point cloud.
[0094] Furthermore, in the target point cloud set, the normal vector of the target point cloud set is calculated according to the local point cloud direction weights of all point clouds and the normal vectors corresponding to all point clouds, and the local point cloud geometric complexity of the central point cloud is obtained according to the normal vector difference between the large-scale point cloud set and the small-scale point cloud set.
[0095] Taking the local point cloud direction weight of the point cloud as the weight, the normal vectors of all point clouds are comprehensively calculated to obtain the normal vector of the target point cloud set;
[0096] Preferably, in one embodiment of the present application, the product of the local point cloud direction weight of each point cloud and the normal vector of the point cloud is recorded as a weighted normal vector, and the sum of the weighted normal vectors of all point clouds in the target point cloud set is used as the normal vector of the target point cloud set.
[0097] Preferably, in one embodiment of the present application, the product of the local point cloud direction weight of each point cloud and the normal vector of the point cloud is recorded as a weighted normal vector, and the average of the weighted normal vectors of all point clouds in the target point cloud set is taken as the normal vector of the target point cloud set.
[0098] Get the normal vector of the large-scale point cloud set and the normal vector of the small-scale point cloud set, calculate the difference between the normal vector of the large-scale point cloud set and the normal vector of the small-scale point cloud set to get the difference vector, and use the modulus of the difference vector as the local point cloud geometric complexity of the center point cloud. The specific flow chart for obtaining the local point cloud geometric complexity is as follows: Figure 2 shown.
[0099] The normal vectors of different target point cloud sets finally obtained represent the local surface direction of the point cloud under the corresponding target point cloud set, that is, the surface direction of the suspected ground. Furthermore, the difference in the normal vectors of the two target point cloud sets characterizes the frequency of change in the local surface direction. Therefore, the vector modulus is used as the geometric complexity of the local point cloud. The larger the value, the more drastic the change in the ground curve at the center point cloud. The more complex the ground gullies are, the more suitable it is to use a high post-processing threshold. At the same time, the color difference is used as a weight, so the ground point cloud and the plant point cloud are distinguished. The local point cloud geometric complexity eliminates the interference of plants on the intensity of changes in the ground surface, and a lower post-processing threshold will be used for locations where the ground surface is not complex but there are many plant point clouds.
[0100] At this point, the local point cloud geometric complexity of each point cloud is obtained.
[0101] Step S004, optimizing the cloth simulation algorithm through the local point cloud geometric complexity of the point cloud to complete the three-dimensional virtual simulation.
[0102] In the cloth simulation filtering algorithm, there is a post-processing threshold in the post-processing step. If the height difference between the movable point and the actual point is less than the threshold, the movable point is moved to the actual point position and marked as an immovable point. The movable point is the virtual point iterated in the cloth simulation filtering algorithm, the interval between the movable points is 0.2m, and the actual point is the point cloud in the initial mountain point cloud set.
[0103] Traditional cloth simulation only uses the height difference between the movable point and the actual point as the judgment condition for post-processing, without considering whether the geometry of the actual point is reliable. In mountainous terrain, the ground surface usually changes at an obtuse angle.
[0104] Therefore, any movable point in post-processing is recorded as the target movable point. For each movable point, the Euclidean distance between the movable point and all actual points on the xy plane is calculated, and the actual point corresponding to the minimum Euclidean distance is recorded as the corresponding point of the movable point.
[0105] For the corresponding actual point, the Euclidean distance between it and all actual points is calculated. The two actual points with the smallest Euclidean distance and the three corresponding actual points form a plane. The angle between the normal vector of the plane and the normal vector of the corresponding actual point is obtained, and the ratio of the angle to 90° is used as the shape reliability of the movable point.
[0106] The closer the shape reliability is to 1, the closer the surface change at the corresponding actual point of the movable point is to the obtuse angle change, and a better cloth filter threshold can be used accordingly.
[0107] A basic threshold is set, and the product of the shape reliability of the movable point and the local point cloud geometric complexity of the corresponding actual point of the movable point is used to obtain the post-processing threshold geometric weight, and the product of the post-processing threshold geometric weight and the basic threshold is used as the post-processing threshold. In this embodiment, the value of the basic threshold is 0.5.
[0108] Among them, the post-processing threshold geometric weight integrates the color characteristics, local shape change intensity characteristics and geometric shape characteristics of the actual points, and assigns a higher filtering threshold to the point cloud with a high probability of being a ground point cloud, effectively identifying plant point clouds and ground point clouds, and can obtain better three-dimensional simulation effects on mountainous ground.
[0109] Furthermore, the cloth simulation filtering algorithm is used with the initial point cloud set in the mountain area as input. In the post-processing stage of the algorithm, the processing threshold calculated in the present embodiment is used instead of the traditional fixed threshold, and the output is the mountain ground point cloud set. The cloth simulation filtering algorithm is a well-known technology in the art and will not be described in detail. The flowchart of obtaining the three-dimensional simulation effect of the mountain ground after improving the cloth simulation filtering algorithm is shown in FIG. Figure 3 shown.
[0110] Finally, the mountain ground point cloud set is used as input, and a three-dimensional reconstruction algorithm, such as the Delaunay triangulation three-dimensional model reconstruction algorithm, is used for calculation, and the output is a ground point cloud model to complete the three-dimensional virtual simulation of the mountain ground.
[0111] At this point, the three-dimensional virtual simulation of the object is completed.
[0112] Based on the same inventive concept as the above method, an embodiment of the present invention also provides a three-dimensional virtual simulation system based on image processing, including a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, the steps of any one of the above-mentioned three-dimensional virtual simulation methods based on image processing are implemented.
[0113] It should be noted that the above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
[0114] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. Three-dimensional virtual simulation method based on image processing, It is characterized in that The method comprises the following steps: Obtain the location information and color information of the point cloud, and all point clouds constitute the initial mountain point cloud set; The grayscale intensity value and reference height of the point cloud are obtained respectively according to the color information and position information of the point cloud; the brightness compensation coefficient of the point cloud is obtained according to the grayscale intensity value and reference height of all point clouds; the ground color values of the point clouds of different channels are obtained according to the brightness compensation coefficient, position information and color information of all point clouds; Get the normal vector of each point cloud. For each point cloud, construct two point cloud sets based on the point clouds closest to the point cloud. For each point cloud set, obtain the local point cloud geometric complexity of each point cloud by combining the normal vector of the point cloud with the color difference of each point cloud in different channels, the color difference between different channels and the ground point cloud, and the distance between the point clouds. The cloth simulation algorithm is optimized by the local point cloud geometric complexity of the point cloud, and the optimized cloth simulation algorithm is used to process the initial mountain point cloud set to complete the three-dimensional virtual simulation.
2. The three-dimensional virtual simulation method based on image processing according to claim 1, It is characterized in that The method for respectively obtaining the grayscale intensity value and the reference height of the point cloud according to the color information and the position information of the point cloud is: The color information of the point cloud includes the color intensity values of the three channels in the RGB space; the color intensity values of the three channels are grayed to obtain the gray intensity values of the point cloud; The position information of the point cloud includes the x-value, y-value and z-value corresponding to the x-axis, y-axis and z-axis. The xy plane is used as the reference plane, and the reference plane is divided into squares of several sizes. The squares are combined with the z-value to obtain a cuboid. For each cuboid, the point cloud with the smallest z value in the cuboid is selected as the ground reference point cloud, and the difference in z value between each point cloud in the cuboid and the ground reference point cloud is used as the reference height of each point cloud.
3. The three-dimensional virtual simulation method based on image processing according to claim 2, It is characterized in that The method for obtaining the point cloud brightness compensation coefficient according to the grayscale intensity values and reference heights of all point clouds is: Any point cloud in the cuboid is recorded as the target point cloud, and the absolute value of the difference in grayscale intensity between the target point cloud and the rest of the point clouds in the cuboid is taken as the brightness difference between the target point cloud and the rest of the point clouds; the absolute value of the difference in reference height between the target point cloud and the rest of the point clouds in the cuboid is normalized and taken as the height weight of the target point cloud and the rest of the point clouds; The product of the brightness difference between the target point cloud and the rest of the point clouds and the height weight is used as the brightness supplement of the target point cloud and the rest of the point clouds. The brightness index of the target point cloud is obtained according to the brightness supplement of the target point cloud and all the rest of the point clouds. The mean of the brightness indexes of all the target point clouds is used as the brightness compensation coefficient of all the point clouds in the cuboid.
4. The three-dimensional virtual simulation method based on image processing according to claim 2, It is characterized in that The method for obtaining the ground color values of point clouds of different channels according to the brightness compensation coefficients, position information and color information of all point clouds is: In the initial mountain point cloud set, in each channel, the reference height of each point cloud is obtained based on the position information, and the color intensity value of each point cloud is obtained based on the color information; The point cloud ground color value is obtained according to the reference height, color intensity value and brightness compensation coefficient; the point cloud ground color value of each channel is negatively correlated with the reference height, and the point cloud ground color value of each channel is positively correlated with the brightness compensation coefficient of all point clouds and the color intensity value of the channel respectively.
5. The three-dimensional virtual simulation method based on image processing according to claim 2, It is characterized in that Two point cloud sets are constructed based on several point clouds closest to the point cloud; for each point cloud set, the method for obtaining the local point cloud geometric complexity of each point cloud is as follows: In the initial mountain point cloud set, any point cloud is recorded as the central point cloud. For each central point cloud, a first preset number of point clouds closest to the central point cloud are selected and recorded as the first distance point clouds. The set consisting of the central point cloud and all the first distance point clouds is recorded as the small-scale point cloud set. For each central point cloud, select a second preset number of point clouds closest to the central point cloud, record them as second distance point clouds, and record the set consisting of the central point cloud and all second distance point clouds as a large-scale point cloud set; Any one of the two point cloud sets is recorded as the target point cloud set. For the target point cloud set, the first color difference of each point cloud is obtained according to the color difference between the central point cloud and each point cloud in different channels; For the target point cloud set, the second color difference of each point cloud is obtained according to the color difference between each point cloud and the point cloud ground color value under different channels; In the target point cloud set, the distance difference between the central point cloud and each point cloud is obtained, and the local point cloud direction weight of each point cloud is obtained according to the first color difference, the second color difference and the distance difference between the central point cloud and each point cloud; In the target point cloud set, the normal vector of the target point cloud set is calculated according to the local point cloud direction weights of all point clouds and the normal vectors corresponding to all point clouds, and the local point cloud geometric complexity of the central point cloud is obtained according to the difference in normal vectors between the large-scale point cloud set and the small-scale point cloud set.
6. The three-dimensional virtual simulation method based on image processing according to claim 5, It is characterized in that The method for obtaining the first color difference of each point cloud according to the color difference between the central point cloud and each point cloud in different channels is: Under each channel, the absolute value of the difference between the color intensity value of the central point cloud and the color intensity value of each point cloud is taken as the channel color difference of each point cloud; the first color difference is obtained according to the channel color difference; the first color difference of each point cloud is positively correlated with the channel color difference of each point cloud under different channels.
7. The three-dimensional virtual simulation method based on image processing according to claim 5, It is characterized in that The method for obtaining the second color difference of each point cloud according to the color difference between each point cloud and the point cloud ground color value in different channels is: Under each channel, the absolute value of the difference between the color intensity value of each point cloud and the ground color value of the point cloud under each channel is taken as the ground color difference of each point cloud; the ground color value of the point cloud is obtained according to the ground color difference; the ground color value of the point cloud under each channel is positively correlated with the ground color difference of each point cloud under different channels.
8. The three-dimensional virtual simulation method based on image processing according to claim 5, It is characterized in that The method for obtaining the distance difference between the central point cloud and each point cloud, and obtaining the local point cloud direction weight of each point cloud according to the first color difference, the second color difference of each point cloud and the distance difference between the central point cloud and each point cloud is: The Euclidean distance between each point cloud and the central point cloud is calculated, and the Euclidean distance plus 1 is used as the distance difference between the central point cloud and each point cloud; the local point cloud direction weight is obtained according to the first color difference, the second color difference and the distance difference; the local point cloud direction weight of each point cloud is positively correlated with the first color difference, the second color difference and the distance difference between the central point cloud and each point cloud.
9. The three-dimensional virtual simulation method based on image processing according to claim 5, It is characterized in that The method of calculating the normal vector of the target point cloud set according to the local point cloud direction weights of all point clouds and the normal vectors corresponding to all point clouds, and obtaining the local point cloud geometric complexity of the central point cloud according to the normal vector difference between the large-scale point cloud set and the small-scale point cloud set is: Taking the local point cloud direction weight of the point cloud as the weight, the normal vectors of all point clouds are comprehensively calculated to obtain the normal vector of the target point cloud set; The normal vector of the large-scale point cloud set and the normal vector of the small-scale point cloud set are obtained, the difference between the normal vector of the large-scale point cloud set and the normal vector of the small-scale point cloud set is calculated to obtain the difference vector, and the modulus of the difference vector is used as the local point cloud geometric complexity of the central point cloud.
10. A three-dimensional virtual simulation system based on image processing, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, It is characterized in that When the processor executes the computer program, the steps of the three-dimensional virtual simulation method based on image processing as described in any one of claims 1 to 9 are implemented.
