Court area identification method and device, and storage medium
By acquiring the depth map and RGB map of the golf course, generating point cloud data and combining color and texture features, the problem that the golf cart's visual recognition system cannot accurately identify the golf course area is solved, achieving more precise area control and avoiding golf course damage.
Patent Information
- Application Number
- CN202510561706.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-09-19
AI Technical Summary
The golf cart's visual recognition system has difficulty accurately judging different areas on the course, causing the cart to easily enter restricted areas and cause damage to the course.
By acquiring the depth map and RGB map of the court captured by the image acquisition device, point cloud data is generated. The type of court area can be accurately identified by combining the point cloud fluctuation amplitude, color distribution characteristics and texture distribution characteristics.
The accuracy of course area recognition is improved, the risk of golf carts mistakenly entering restricted areas is reduced, and the course ground is protected.
Smart Images

Figure CN120673022A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device, and storage medium for identifying a court area. Background Art
[0002] A golf bag cart is a device designed to assist golfers in carrying their golf bags and related equipment. Typically equipped with a lidar sensor or visual recognition system, these carts can autonomously follow the user by acquiring position and distance information and combining it with visual algorithms to identify the user's location. However, golf course greens and bunkers are off-limits for golf bag carts because the turf and sand in these areas are fragile, and entering them could cause damage. Currently, golf bag carts' visual recognition systems struggle to accurately distinguish between different areas on the course, making it easy for them to mistakenly enter restricted areas and cause damage.
[0003] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is prior art. Summary of the Invention
[0004] The main purpose of this application is to provide a golf course area recognition method, device and storage medium, aiming to solve the technical problem that the current golf bag cart's visual recognition system has difficulty in accurately judging different areas on the golf course.
[0005] To achieve the above objectives, the present application proposes a method for identifying a court area, the method comprising: Obtaining a depth map and an RGB map of the court captured by an image acquisition device; generating point cloud data based on the depth map, and determining a point cloud fluctuation amplitude corresponding to the court according to the point cloud data; determining a color distribution feature and a texture distribution feature of the court based on the RGB image; The area type of the court is determined based on the color distribution characteristics and texture distribution characteristics of the court and the fluctuation amplitude of the point cloud corresponding to the court.
[0006] In one embodiment, the step of generating point cloud data based on the depth map and determining the point cloud fluctuation amplitude corresponding to the court according to the point cloud data includes: Determine the three-dimensional coordinates of the pixel points in the depth map according to the depth map and the internal parameters of the image acquisition device to obtain point cloud data; The point cloud fluctuation amplitude corresponding to the court is determined according to the variance and / or range of the height of the point cloud data, wherein the height of the point cloud data is the z-axis coordinate of the pixel point.
[0007] In one embodiment, the step of determining the color distribution characteristics and texture distribution characteristics of the court based on the RGB image includes: Determine the color moment of each channel of the RGB image in the RGB color space, and use the color moment as the color distribution feature; The RGB image is converted into a grayscale image, the LBP value and the grayscale co-occurrence matrix of each pixel in the grayscale image are determined, and the LBP value and the grayscale co-occurrence matrix are used as the texture distribution features.
[0008] In one embodiment, the step of determining the area type of the court based on the color distribution characteristics and texture distribution characteristics of the court and the fluctuation amplitude of the point cloud corresponding to the court includes: Clustering the points in the point cloud data according to the fluctuation amplitude of the point cloud, and dividing the court into different areas according to the clustering results; The region types of the different regions are determined based on the point cloud fluctuation amplitudes, color distribution characteristics, and texture distribution characteristics corresponding to the different regions.
[0009] In one embodiment, the step of clustering the points in the point cloud data according to the fluctuation amplitude of the point cloud and dividing the court into different areas according to the clustering results includes: Determining cluster labels of points in the point cloud data according to the clustering results; Traverse each point in the point cloud data, and if there are other points with different cluster labels in the neighborhood of the current point, use the current point as the dividing point; Area boundaries are determined based on the dividing points, and the court is divided into different areas according to the area boundaries.
[0010] In one embodiment, the step of determining the region types of the different regions based on the point cloud fluctuation amplitudes, color distribution characteristics, and texture distribution characteristics corresponding to the different regions includes: Connecting the point cloud fluctuation amplitudes, color distribution features, and texture distribution features corresponding to the different regions to construct comprehensive feature vectors corresponding to the different regions; Obtaining regional feature vectors corresponding to different regional types, and determining similarities between the comprehensive feature vector and the regional feature vector; Based on the similarity, the region types of the different regions corresponding to the comprehensive feature vectors are determined.
[0011] In one embodiment, after the step of determining the area type of the court based on the color distribution characteristics and texture distribution characteristics of the court and the fluctuation amplitude of the point cloud corresponding to the court, the step further includes: When controlling the golf bag vehicle to travel along a current path, if the area boundary is detected on the current path, determining a distance between the golf bag vehicle and the area boundary; When the distance is equal to a preset distance threshold, determining the area type of the forward area corresponding to the current path, and judging whether the forward area is a restricted area; If the forward area is a restricted area, the golf bag vehicle is controlled to stop traveling.
[0012] In one embodiment, after the step of controlling the golf bag vehicle to stop traveling if the forward area is a restricted area, the method further includes: determining a current location of the golf bag cart; Prompt information is generated and output based on the current position and the area type of the forward area.
[0013] In addition, to achieve the above-mentioned purpose, the present application also proposes a court area identification device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the court area identification method described above.
[0014] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the steps of the court area identification method described above are implemented.
[0015] The present application provides a method for identifying a golf course area, which obtains a depth map and an RGB map of the golf course captured by an image acquisition device, generates point cloud data based on the depth map, and determines the point cloud fluctuation amplitude corresponding to the golf course based on the point cloud data. Then, the color distribution characteristics and texture distribution characteristics of the golf course are determined based on the RGB map. Finally, the area type of the golf course is determined based on the color distribution characteristics and texture distribution characteristics of the golf course and the point cloud fluctuation amplitude corresponding to the golf course.
[0016] The above method distinguishes terrain undulations through the amplitude of point cloud fluctuations, identifies the main color of the area through color distribution features, and analyzes surface texture through texture distribution features. By combining depth maps, RGB maps and point cloud data, it overcomes the limitations of single data, makes the golf course area identification more comprehensive and accurate, and reduces the risk of golf carts accidentally entering restricted areas. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0019] Figure 1 A flowchart of the first embodiment of the method for identifying a golf course area is provided in this application; Figure 2 A flowchart of the second embodiment of the method for identifying a golf course area is provided in this application; Figure 3 Schematic diagram of the device structure of the hardware operating environment involved in the court area recognition method in the embodiment of the present application.
[0020] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0021] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not intended to limit the present application.
[0022] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0023] A golf bag cart is a device designed to assist golfers in carrying their golf bags and related equipment. Typically equipped with a lidar sensor or visual recognition system, these carts can autonomously follow the user by acquiring position and distance information and combining it with visual algorithms to identify the user's location. However, golf course greens and bunkers are off-limits for golf bag carts because the turf and sand in these areas are fragile, and entering them could cause damage. Currently, golf bag carts' visual recognition systems struggle to accurately distinguish between different areas on the course, making it easy for them to mistakenly enter restricted areas and cause damage.
[0024] In view of the above problems, this application proposes a method for identifying a court area, which obtains a depth map and an RGB map of the court captured by an image acquisition device, generates point cloud data based on the depth map, and determines the point cloud fluctuation amplitude corresponding to the court based on the point cloud data. Then, the color distribution characteristics and texture distribution characteristics of the court are determined based on the RGB map. Finally, based on the color distribution characteristics and texture distribution characteristics of the court, as well as the point cloud fluctuation amplitude corresponding to the court, the area type of the court is determined.
[0025] The above method distinguishes terrain undulations through the amplitude of point cloud fluctuations, identifies the main color of the area through color distribution features, and analyzes surface texture through texture distribution features. By combining depth maps, RGB maps and point cloud data, it overcomes the limitations of single data, makes the golf course area identification more comprehensive and accurate, and reduces the risk of golf carts accidentally entering restricted areas.
[0026] It should be noted that the execution entity of this embodiment can be a computing service device with data processing, network communication, and program execution functions, or an electronic device capable of implementing the above functions, a court area recognition system, etc. The following uses the court area recognition system as an example to illustrate this embodiment and the following embodiments.
[0027] Based on this, the first embodiment proposed in this application provides a method for identifying a court area. Figure 1 In this embodiment, the court area recognition method includes steps S10 to S40: Step S10: Acquire a depth map and an RGB map of the court captured by an image capture device.
[0028] For example, a depth camera and an RGB-D camera are installed on a golf cart to simultaneously acquire depth information and color image information of the golf course. The depth camera actively projects infrared light or a structured light pattern onto the golf course surface, and then calculates the depth value of each pixel based on the phase difference or time difference of the reflected light, thereby generating a depth map. The depth map is stored as a grayscale image, and the grayscale value is proportional to the distance of the object from the camera. The color image sensor portion of the RGB-D camera simultaneously captures the color image information of the golf course and generates a standard RGB image containing pixel values of the three channels R (red), G (green), and B (blue) to describe the color information of the scene. The RGB-D camera can be a monocular camera or a binocular camera.
[0029] Step S20: generating point cloud data based on the depth map, and determining a point cloud fluctuation amplitude corresponding to the court according to the point cloud data.
[0030] It can be understood that point cloud fluctuation amplitude, as a characteristic of point cloud data variation in the height direction, can reflect the degree of topographical undulation in various areas of a golf course. For example, on a golf course's putting green, since the green is where players putt, the turf must be smooth to ensure an accurate ball trajectory. Therefore, from the point cloud data, the coordinates of pixels in the green area vary less in the z-axis direction, meaning their height values are relatively stable, resulting in a smaller point cloud fluctuation amplitude. Bunkers, on the other hand, are hazards on a golf course. Their edges often have a distinct slope or step-like structure, forming a boundary with the surrounding area. This topographic variation causes significant variations in the z-axis height values of the point cloud data at the bunker's edges, increasing the point cloud fluctuation amplitude. Similarly, other areas of a golf course, such as rough, will exhibit different point cloud fluctuation amplitudes due to their topographical characteristics. Therefore, different areas of a golf course can be distinguished based on their corresponding point cloud fluctuation amplitudes.
[0031] Optionally, step S20 includes steps S21 and S22: Step S21 : determining the three-dimensional coordinates of the pixel points in the depth map according to the depth map and the internal parameters of the image acquisition device to obtain point cloud data.
[0032] For example, first obtain the intrinsic parameters of the depth camera, including parameters such as focal length (fx, fy) and principal point coordinates (cx, cy). These parameters are used to convert the pixel coordinates in the depth map into point coordinates in three-dimensional space. Then, traverse each pixel point (m, n) in the depth map to obtain its corresponding depth value d. For each pixel point, calculate its coordinates (x, y, z) in three-dimensional space based on the camera intrinsic parameters and the depth value. For example: x = (n-cx) d / fx;y=(m-cy) d / fy; z=d. Then, the calculated three-dimensional coordinates (x, y, z) of each point are stored in the point cloud data structure to form a complete point cloud dataset.
[0033] Step S22: determining the point cloud fluctuation amplitude corresponding to the court according to the variance and / or range of the height of the point cloud data, wherein the height of the point cloud data is the z-axis coordinate of the pixel point.
[0034] For example, for any target point in the point cloud dataset, a neighborhood area of the target point is constructed by using K nearest neighbors or fixed radius nearest neighbors, and other neighboring points in the neighborhood area are determined. The range of the neighborhood area can be adjusted according to the actual accuracy requirements. Then, the height difference between the target point and each neighboring point in the z-axis direction is calculated. For example, for the target point and its neighboring points , the height difference is Δ =∣ − ∣. Among them, Target point height, For neighboring points height.
[0035] Optionally, for each target point, determine whether the target point is in the adjacent area and all adjacent points The maximum value of the height difference Δ and minimum value Δ . Define the point cloud fluctuation amplitude corresponding to the target point =Δ −Δ .
[0036] Optionally, determine the average value μ of the height difference between the target point and all its neighboring points, calculate the square of the difference between each height difference and the average, and then average them to get the variance .variance It reflects the degree of discreteness of the height difference. The larger the variance, the greater the fluctuation amplitude of the point cloud.
[0037] Optionally, a comprehensive volatility index can be defined by combining the range and variance methods. For example: = + .in, and is the weight coefficient, which can be adjusted according to specific application requirements.
[0038] Optionally, the fluctuation amplitude result corresponding to each point is visualized, for example, by displaying the point cloud fluctuation amplitude of each point through color coding.
[0039] Step S30: determining the color distribution characteristics and texture distribution characteristics of the court based on the RGB image.
[0040] As is understandable, on a golf course, the color of the grass on the grassy surface differs significantly from the color of the sand in the bunker areas, allowing for color characteristics to distinguish between grassy and bunker areas. Furthermore, within a grassy area, different areas have distinct textures. For example, the turf on the putting green is meticulously mowed, resulting in a smooth surface and fine, uniform texture. Texture analysis reveals that the texture of the putting green exhibits less pronounced directionality, exhibiting relatively smooth texture characteristics. The texture of the fairway turf is slightly rougher than that of the putting green, but still maintains a certain regularity. Due to the design and maintenance of the fairway, its texture direction may have certain directional characteristics, such as along the run of the fairway. These texture characteristics can be used to assist in identifying fairway areas. In contrast, the grass in the rough grows more freely, with greater variation in texture direction and density, exhibiting more complex texture characteristics. Compared to the fairways and putting greens, the texture of the rough is more disordered, and the complexity of the texture can be used to assist in identifying this area. Therefore, by analyzing the color and texture distribution characteristics of different areas within a golf course, it is possible to more accurately identify different sections of the course.
[0041] Optionally, step S30 includes steps S31 and S32: Step S31 : determining the color moment of each channel of the RGB image in the RGB color space, and using the color moment as the color distribution feature.
[0042] For example, an RGB image is divided into three separate channels: R, G, and B. Each channel is a two-dimensional matrix representing the grayscale value of the corresponding color channel. The color moments of each channel are then calculated, including the first-order moment, second-order moment, and third-order moment. The first-order moment is obtained by calculating the average value of all pixel values in each channel, reflecting the average level of the channel color and indicating the brightness or dimness of the overall image color. The second-order moment is obtained by calculating the average value of the square of the deviation of each channel pixel value from the mean, reflecting the degree of dispersion of the color distribution. The third-order moment is obtained by calculating the average value of the cube of the deviation of each channel pixel value from the mean, reflecting the symmetry of the color distribution. Finally, the calculated first-order moment, second-order moment, and third-order moment of the three channels R, G, and B are integrated into a feature vector as the color distribution feature.
[0043] Step S32: convert the RGB image into a grayscale image, determine the LBP value and gray-level co-occurrence matrix of each pixel in the grayscale image, and use the LBP value and the gray-level co-occurrence matrix as the texture distribution features.
[0044] For example, the steps of determining the LBP (Local Binary Patterns) value of each pixel in the grayscale image are as follows: first, convert the RGB image into a grayscale image by weighted averaging, and for each pixel in the grayscale image, select other pixels in its surrounding neighborhood, for example, select 3 Refers to a square area with 3 rows and 3 columns, centered on the pixel and consisting of 8 adjacent pixels. The grayscale value of the central pixel is compared with the grayscale value of the neighboring pixels. If the grayscale value of the neighboring pixel is greater than or equal to the grayscale value of the central pixel, it is assigned a value of 1; otherwise, it is assigned a value of 0. The comparison results are then arranged clockwise into a binary number, which is then converted to a decimal number and used as the LBP value of the central pixel.
[0045] Exemplarily, the step of determining the grayscale co-occurrence matrix for each pixel in the grayscale image is as follows: quantizing the grayscale value of the grayscale image to a preset level, such as 0-255. Counting the number of times a pixel with a grayscale value i and a pixel with a grayscale value j appear simultaneously at a preset direction and distance, and constructing a grayscale co-occurrence matrix. The preset direction and distance can be set according to specific needs. For example, the preset direction can be 0°, 45°, 90°, or 135°, and the distance can be 1, 2, or 3, etc.
[0046] Optionally, the energy, contrast, correlation and entropy characteristics are determined according to the gray level co-occurrence matrix, and the energy, contrast, correlation and entropy are used as texture distribution characteristics.
[0047] Energy is calculated by calculating the sum of the squares of all elements in the gray-level co-occurrence matrix, reflecting the uniformity of the texture. Contrast is calculated by calculating the sum of the products of the elements in the gray-level co-occurrence matrix and their row and column means, reflecting the clarity of the texture. Correlation is calculated by calculating the ratio of the covariance of the rows and columns in the gray-level co-occurrence matrix to the product of the row and column variances, reflecting the directionality of the texture. Entropy is calculated by calculating the sum of the negative logarithms of all elements in the gray-level co-occurrence matrix, reflecting the complexity of the texture.
[0048] Step S40 : determining the area type of the court based on the color distribution characteristics and texture distribution characteristics of the court and the fluctuation amplitude of the point cloud corresponding to the court.
[0049] Optionally, the color moment and color histogram of each channel are extracted from the RGB image, the LBP value and the energy, contrast, correlation and entropy of the grayscale co-occurrence matrix are extracted from the grayscale image, and the point cloud fluctuation amplitude is extracted from the point cloud data. The above identification features are sequentially spliced into a one-dimensional vector to form a comprehensive feature vector. The comprehensive feature vector is classified using a machine learning classification algorithm to determine the area type of the stadium.
[0050] For example, assume a support vector machine model is used to classify golf course areas. RGB images, depth maps, and point cloud data are collected from various areas, including greens, bunkers, fairways, and rough, across multiple golf courses. The color distribution features, texture distribution features, and point cloud fluctuation amplitude features of each area are extracted to form regional feature vectors, which serve as sample data. The sample data is divided into a training set and a test set. The support vector machine model is trained using the training set. An RBF (Radial Basis Function) and appropriate penalty parameters are selected. A loss function is defined to measure the difference between the model's predicted values and the true values, and an optimization algorithm is selected to minimize the loss function. The training set is then divided into multiple small batches of data subsets, which are fed into the model sequentially for forward propagation to obtain predicted values. Simultaneously, the loss function is calculated, and the gradients are computed using the backpropagation algorithm to update the model parameters. Multiple training cycles are repeated until the model's performance on the validation set meets the preset standard. Finally, the trained support vector machine model is applied to the stadium area recognition system. The comprehensive feature vectors corresponding to each area of the stadium are input into the trained support vector machine model. The support vector machine model predicts the area type of each area based on the comprehensive feature vectors corresponding to each area.
[0051] Optionally, step S40 includes steps S41-S42: Step S41 : clustering the points in the point cloud data according to the fluctuation amplitude of the point cloud, and dividing the court into different areas according to the clustering results.
[0052] Alternatively, select an appropriate clustering algorithm, such as K-means (K-means clustering algorithm) or DBSCAN (Density-Based Spatial Clustering of Applications with Noise), using the point cloud fluctuation amplitude as the primary clustering feature and combining it with other geometric features, such as the x and y coordinates of the point cloud data. Determine clustering parameters based on the specific regional distribution of the golf course. For example, determine the number of clusters K in K-means based on the number of different areas within the golf course, or determine the neighborhood radius and minimum number of points in DBSCAN based on the area of different golf course areas. Run the clustering algorithm to divide the point cloud data into different cluster areas.
[0053] For example, suppose you want to identify the green, sand, and other grass areas on a golf course. You can use the K-means clustering algorithm and set the number of clusters to three, one for each of the green, sand, and other grass areas. First, extract the point cloud fluctuation amplitude corresponding to each point on the course, normalize it, and map it to the interval [0, 1] using the min-max normalization method. Next, randomly select the point cloud fluctuation amplitudes of three points as initial cluster centers, or use another algorithm to select initial cluster centers. For each remaining point, calculate its Euclidean distance to each initial cluster center and assign each point to the cluster category with the closest Euclidean distance. Next, for each cluster category, calculate the average point cloud fluctuation amplitude of all points belonging to that cluster category and use the average point cloud fluctuation amplitude as the new cluster center. Calculate the difference between the new cluster center and the old initial cluster center. If the difference is less than a predefined threshold, the clustering results are considered converged and the algorithm terminates. Otherwise, repeat the clustering process until the clustering results converge.
[0054] Optionally, step S41 includes steps S411 to S413: Step S411 : determining cluster labels of points in the point cloud data according to the clustering result.
[0055] For example, after executing the clustering algorithm, the court area recognition system can classify points in the point cloud data into different clusters based on the magnitude of the point cloud fluctuations. Each point is assigned a cluster label indicating its cluster category. By analyzing the distribution of cluster labels for each point in the point cloud data corresponding to the court, the distribution of different areas on the court can be determined.
[0056] Step S412: traverse each point in the point cloud data. If there are other points with different cluster labels in the neighborhood of the current point, the current point is used as a dividing point.
[0057] Step S413: determining area boundaries based on the dividing points, and dividing the court into different areas according to the area boundaries.
[0058] For example, a neighborhood of K nearest neighbors is defined. For each point, the cluster labels of its K nearest neighbors are queried. If any of the K nearest neighbors have a different cluster label, the current point in the point cloud data is marked as a demarcation point. Next, all points marked as demarcation points are extracted, and the Alpha shape algorithm is used to construct region boundaries based on the demarcation points, dividing the court into different regions. Alternatively, the Delaunay triangulation algorithm is used to triangulate the demarcation points. Based on the results of the Delaunay triangulation, the region boundaries are determined and the court is divided into different regions.
[0059] Understandably, while conventional golf carts can roughly identify the grass surrounding the vehicle through their visual systems when following a player, they are inaccurate in identifying the boundaries between different grass areas, providing only a vague boundary. When approaching a boundary such as a putting green, conventional area recognition methods struggle to accurately determine whether the cart is about to cross the boundary, hindering precise area control. This can easily lead to the cart straying onto the putting green and causing damage. In this embodiment, however, since each point in the point cloud data carries 3D coordinate information, after determining the area boundary based on the demarcation point, the 3D coordinate information of the area boundary, i.e., a precise boundary line, can be obtained. When controlling the cart on the course, precise area control can be performed based on the cart's own position coordinates and the 3D coordinate information of the area boundary, preventing the cart from straying into restricted areas such as the putting green and causing damage.
[0060] Optionally, in order to improve the recognition accuracy of region boundaries, each point in the point cloud data is traversed. If there are other points with different cluster labels in the neighborhood of the current point, the current point is used as the dividing point, and then the region boundary is determined based on the color distribution characteristics and texture distribution characteristics of the area where the dividing point is located.
[0061] Exemplarily, the color gradient of each channel of the pixel corresponding to each boundary point in the RGB color space is calculated. The color gradient represents the rate of change of color in space and can be obtained by calculating the color difference between adjacent pixels. If the color gradient of the boundary point is large, it means that the color difference on both sides of the boundary point is obvious, and the boundary recognition may be more accurate; if the color gradient of the boundary point is small, it means that the colors on both sides of the boundary point are relatively similar, which may be where the boundary recognition is inaccurate. When the color gradient of each channel of the pixel corresponding to the boundary point in the RGB color space is greater than the maximum preset color gradient threshold, the dividing point is retained; when the color gradient of each channel of the pixel corresponding to the boundary point in the RGB color space is less than or equal to the minimum preset color gradient threshold, the dividing point is deleted. Similarly, for each boundary point, the texture distribution features of the areas within the preset ranges on both sides are extracted, and the difference between the texture distribution features of the two areas is determined, for example, the difference between the grayscale co-occurrence matrices corresponding to the two areas and / or the difference between the LBP values corresponding to the two areas are determined using methods such as Euclidean distance and cosine similarity. If the difference between the texture distribution characteristics of the areas within the preset range on both sides of the boundary point is greater than the preset difference, the boundary point is retained. If the difference between the texture distribution characteristics of the areas within the preset range on both sides of the boundary point is less than or equal to the preset difference, the boundary point is deleted. Finally, the region boundary is constructed based on the retained boundary points.
[0062] Step S42: determining the region types of the different regions based on the point cloud fluctuation amplitudes, color distribution characteristics, and texture distribution characteristics corresponding to the different regions.
[0063] Optionally, step S42 includes steps S421 to S423: Step S421 : Connecting the point cloud fluctuation amplitudes, color distribution features, and texture distribution features corresponding to the different regions to construct comprehensive feature vectors corresponding to the different regions.
[0064] Step S422: obtaining regional feature vectors corresponding to different region types, and determining the similarity between the comprehensive feature vector and the regional feature vector.
[0065] Step S423: Determine the region types of the different regions corresponding to the comprehensive feature vectors based on the similarity.
[0066] For example, the color distribution features, texture distribution features, and point cloud fluctuation amplitude of each region are extracted to form a comprehensive feature vector. These corresponding features are then extracted from a known sample of region types to construct a region feature vector corresponding to each region type. Similarity metrics such as cosine similarity and Euclidean distance are used to calculate the similarity between the comprehensive feature vector and each region feature vector. The calculated similarity values are compared to find the region feature vector that is most similar to the comprehensive feature vector. Based on the region type corresponding to the most similar region feature vector, the region type corresponding to the comprehensive feature vector is determined.
[0067] Optionally, after the court is divided into different areas, it is detected whether there is a signboard indicating the area category in each area. If there is a signboard in the area, the text information in the signboard is identified, and the area type of the area is determined according to the text information.
[0068] For example, a deep learning object detection algorithm can be used to detect whether a sign is present in each area. If a sign is detected in a certain area, a text detection algorithm is used to detect text areas in the detected sign area. An optical character recognition algorithm is then used to perform text recognition on the detected text area. Based on the recognized text content and the names of pre-defined area types, the type of the area is determined. For example, if the sign reads "green" or "sand", the area type can be determined.
[0069] In this embodiment, by combining the point cloud fluctuation amplitude, color distribution characteristics and texture distribution characteristics, a comprehensive feature vector is constructed to more comprehensively and accurately capture the terrain characteristics of the golf course, improve the accuracy of area recognition, and reduce the risk of golf bag carts accidentally entering restricted areas.
[0070] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 2 After step S40, the court area recognition method further includes steps S50 to S70: Step S50 : When the golf bag vehicle is controlled to travel along the current path, if the area boundary is detected on the current path, the distance between the golf bag vehicle and the area boundary is determined.
[0071] Step S60: When the distance is equal to a preset distance threshold, the area type of the forward area corresponding to the current path is determined, and whether the forward area is a restricted area is judged.
[0072] Step S70: If the forward area is a restricted area, the golf bag vehicle is controlled to stop traveling.
[0073] The golf cart can plan a path around the course based on the players' positions. While controlling the cart along the current path, the cart's real-time coordinates are matched against a pre-stored course map to identify the boundaries of the current area and its surroundings. If a boundary is detected along the current path, the 3D coordinates of the boundary point are obtained from the corresponding point cloud data. The distance between the 3D coordinates of the boundary point and the cart's real-time coordinates is then calculated.
[0074] Optionally, to prevent the golf bag cart from accidentally entering a restricted area, a preset distance threshold is set. When the distance between the golf bag cart and the area boundary reaches the preset distance threshold, the area type of the forward travel area is determined to be a restricted area. A restricted area is a user-defined area that the golf bag cart is prohibited from entering. The area types corresponding to the restricted area can be stored in a data table in the course area recognition system. The course area recognition system matches the area type of the forward travel area with the aforementioned data table. If a match is found, the forward travel area is determined to be a restricted area. The course area recognition system generates a stop command and sends it to the golf bag cart, causing the golf bag cart to stop.
[0075] Traditional visual recognition systems for golf carts often only provide relatively vague area demarcation and lack precise identification of area boundaries. Once a golf cart approaches the boundary of a restricted area, due to the lack of precise distance monitoring and effective control mechanisms, the cart may mistakenly enter the restricted area, causing damage to the grass. However, unlike traditional visual area recognition methods for golf carts, this embodiment accurately identifies the boundaries of different areas and obtains the three-dimensional coordinates of points on the boundary lines. When the golf cart approaches the boundary of a restricted area, the distance between the cart and the restricted area boundary is monitored and the cart is controlled to stop outside the boundary line, preventing the cart from mistakenly entering the restricted area and damaging the grass.
[0076] Optionally, after the step of controlling the golf bag cart to stop traveling, the method further includes: determining the current position of the golf bag cart and the area type of the forward area, and generating and outputting prompt information based on the current position and the area type of the forward area.
[0077] For example, the golf cart's current location coordinates are obtained through a positioning device on the cart. Based on these coordinates, the cart's current location type is determined. A prompt is generated to alert the player based on the cart's current location type and the type of the area it is currently traveling toward. For example, if the cart detects that the area it is traveling toward is a putting green, the golf course area recognition system generates a voice prompt, "Entering the putting green ahead. Vehicle has automatically stopped. Please manually select a new route." The corresponding text prompt and an image of the putting green area are displayed on the display screen. After receiving the prompt, the user can request a new detour route via the touchscreen or voice command.
[0078] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the court area recognition method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0079] The present application provides a court area recognition device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the court area recognition method in the above-mentioned embodiment 1.
[0080] Reference below Figure 3 , which shows a schematic diagram of the structure of a court area recognition device suitable for implementing the embodiment of the present application. The court area recognition device in the embodiment of the present application may include but is not limited to a mobile terminal such as a golf bag cart. Figure 3The court area identification device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0081] like Figure 3 As shown, the court area recognition device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for the operation of the court area recognition device. Processing device 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to I / O interface 1006: input devices 1007, such as a touchscreen, touchpad, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008, such as a liquid crystal display (LCD), speaker, vibrator, etc.; storage device 1003, such as a magnetic tape or hard disk; and communication device 1009. The communication device 1009 can allow the court area identification device to communicate with other devices wirelessly or by wire to exchange data. Although the figures show court area identification devices with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented or have alternatively.
[0082] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0083] The course area recognition device provided in this application, utilizing the course area recognition method described in the aforementioned embodiment, can address the technical issue of golf carts' visual recognition systems struggling to accurately identify different areas within a course. Compared to the prior art, the course area recognition device provided in this application offers the same beneficial effects as the course area recognition method described in the aforementioned embodiment. Other technical features of this course area recognition device are the same as those disclosed in the aforementioned embodiment and are not further elaborated here.
[0084] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0085] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0086] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, a computer program) stored thereon, wherein the computer-readable program instructions are used to execute the court area recognition method in the above-mentioned embodiment.
[0087] The computer-readable storage medium provided herein may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including, but not limited to, wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.
[0088] The computer-readable storage medium may be included in the court area recognition device; or may exist independently without being incorporated into the court area recognition device.
[0089] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the court area recognition device, the court area recognition device can write computer program code for performing the operations of the present application in one or more programming languages or a combination thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, or as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, via the Internet using an Internet service provider).
[0090] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of code, and the module, program segment or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, as well as the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0091] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.
[0092] The computer-readable storage medium provided in this application stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned course area recognition method. This computer-readable storage medium can address the technical issue of golf carts' visual recognition systems being unable to accurately identify different areas within a course. Compared to the prior art, the computer-readable storage medium provided in this application offers the same beneficial effects as the course area recognition method provided in the aforementioned embodiments, and will not be further elaborated upon here.
[0093] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for identifying a court area, characterized in that: Applied to a golf cart, the golf course area recognition method includes: Obtaining a depth map and an RGB map of the court captured by an image acquisition device; generating point cloud data based on the depth map, and determining a point cloud fluctuation amplitude corresponding to the court according to the point cloud data; determining a color distribution feature and a texture distribution feature of the court based on the RGB image; The area type of the court is determined based on the color distribution characteristics and texture distribution characteristics of the court and the fluctuation amplitude of the point cloud corresponding to the court.
2. The court area recognition method according to claim 1, wherein: The step of generating point cloud data based on the depth map and determining the point cloud fluctuation amplitude corresponding to the court according to the point cloud data includes: Determine the three-dimensional coordinates of the pixel points in the depth map according to the depth map and the internal parameters of the image acquisition device to obtain point cloud data; The point cloud fluctuation amplitude corresponding to the court is determined according to the variance and / or range of the height of the point cloud data, wherein the height of the point cloud data is the z-axis coordinate of the pixel point.
3. The court area recognition method according to claim 1, wherein: The step of determining the color distribution characteristics and texture distribution characteristics of the court based on the RGB image includes: Determine the color moment of each channel of the RGB image in the RGB color space, and use the color moment as the color distribution feature; The RGB image is converted into a grayscale image, the LBP value and the grayscale co-occurrence matrix of each pixel in the grayscale image are determined, and the LBP value and the grayscale co-occurrence matrix are used as the texture distribution features.
4. The method for identifying a court area according to claim 1, wherein: The step of determining the area type of the court based on the color distribution characteristics and texture distribution characteristics of the court and the fluctuation amplitude of the point cloud corresponding to the court includes: Clustering the points in the point cloud data according to the fluctuation amplitude of the point cloud, and dividing the court into different areas according to the clustering results; The region types of the different regions are determined based on the point cloud fluctuation amplitudes, color distribution characteristics, and texture distribution characteristics corresponding to the different regions.
5. The method for identifying a court area according to claim 4, wherein: The step of clustering the points in the point cloud data according to the fluctuation amplitude of the point cloud and dividing the court into different areas according to the clustering results includes: Determining cluster labels of points in the point cloud data according to the clustering results; Traverse each point in the point cloud data, and if there are other points with different cluster labels in the neighborhood of the current point, use the current point as the dividing point; Area boundaries are determined based on the dividing points, and the court is divided into different areas according to the area boundaries.
6. The method for identifying a court area according to claim 4, wherein: The step of determining the region types of the different regions based on the point cloud fluctuation amplitudes, color distribution characteristics, and texture distribution characteristics corresponding to the different regions includes: Connecting the point cloud fluctuation amplitudes, color distribution features, and texture distribution features corresponding to the different regions to construct comprehensive feature vectors corresponding to the different regions; Obtaining regional feature vectors corresponding to different regional types, and determining similarities between the comprehensive feature vector and the regional feature vector; Based on the similarity, the region types of the different regions corresponding to the comprehensive feature vectors are determined.
7. The method for identifying a court area according to claim 5, wherein: After the step of determining the area type of the court based on the color distribution characteristics and texture distribution characteristics of the court and the fluctuation amplitude of the point cloud corresponding to the court, the method further includes: When controlling the golf bag vehicle to travel along a current path, if the area boundary is detected on the current path, determining a distance between the golf bag vehicle and the area boundary; When the distance is equal to a preset distance threshold, determining the area type of the forward area corresponding to the current path, and judging whether the forward area is a restricted area; If the forward area is a restricted area, the golf bag vehicle is controlled to stop traveling.
8. The method for identifying a court area according to claim 7, wherein: After the step of controlling the golf bag vehicle to stop traveling if the forward area is a restricted area, the method further includes: determining a current location of the golf bag cart; Prompt information is generated and output based on the current position and the area type of the forward area.
9. A court area identification device, characterized in that: The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the court area recognition method according to any one of claims 1 to 8.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the court area recognition method according to any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Tennis court type determination method and device based on visual algorithm and storage medium
CN121033560A
Tennis court type determination method and device based on visual algorithm, and storage medium
CN121033560B