Golf course measurement method and apparatus, electronic device, and readable storage medium
Patent Information
- Application Number
- CN202611167434.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-10-27
AI Technical Summary
这类方法在测量狗腿洞的拐点位置以及发球台到果岭、障碍物的距离时,通常需要多次布站、人工判读和手动计算,操作繁琐且受地形和天气影响较大,导致高尔夫球场距离测量的准确度较低
[0009]本申请实施例提供的高尔夫球场的测量方法、装置、电子设备及可读存储介质,其中,方法包括:获取高尔夫球场的球道边界、果岭边界、发球台位置和障碍物边界;基于球道边界、果岭边界、发球台位置和障碍物边界,确定高尔夫球场的发球台到高尔夫球场的果岭的第一距离以及发球台到障碍物边界的第二距离;基于球道边界、果岭边界和发球台位置,确定高尔夫球场的狗腿洞的战术距离;战术距离包括发球台到狗腿洞的拐点的第三距离和拐点到果岭的第四距离;基于第一距离、第二距离和战术距离,确定高尔夫球场的测量数据。这样,通过自动化几何规则确定常规距离与狗腿洞战术距离,提高了高尔夫球场距离测量的准确度。
Smart Images

Figure CN122982155A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of spatial data measurement technology, and in particular to methods, apparatus, electronic devices and readable storage media for measuring golf courses. Background Technology
[0002] Distance measurement on a golf course is a crucial foundation for course design, difficulty assessment, player strategy development, and daily operations management. Accurate measurement data helps course managers optimize layout, assists players in developing hitting strategies, and provides fair quantitative data for competitions.
[0003] Current technologies primarily rely on manual ground measurements using total stations and GPS positioning equipment, or on handheld laser rangefinders to obtain distance data. When measuring the corner points of dogleg holes and the distances from tees to greens and hazards, these methods typically require multiple station setups, manual interpretation, and manual calculations. This process is cumbersome and highly susceptible to terrain and weather conditions, resulting in low accuracy in golf course distance measurements. Summary of the Invention
[0004] In view of this, the embodiments of this application at least provide a method, apparatus, electronic device and readable storage medium for measuring golf courses, which improves the accuracy of golf course distance measurement by determining conventional distance and dogleg tactical distance through automated geometric rules.
[0005] This application mainly includes the following aspects: In a first aspect, embodiments of this application provide a method for measuring a golf course, the method comprising: Obtain the fairway boundaries, green boundaries, tee box locations, and hazard boundaries of a golf course; Based on the fairway boundary, the green boundary, the tee box location, and the hazard boundary, determine a first distance from the tee box to the green of the golf course and a second distance from the tee box to the hazard boundary. Based on the fairway boundaries, the green boundaries, and the tee positions, the tactical distance of the dogleg hole on the golf course is determined; the tactical distance includes a third distance from the tee to the turning point of the dogleg hole and a fourth distance from the turning point to the green; Measurement data for the golf course are determined based on the first distance, the second distance, and the tactical distance.
[0006] Secondly, embodiments of this application also provide a measuring device for a golf course, the measuring device for a golf course comprising: The data acquisition module is used to acquire the fairway boundaries, green boundaries, tee box positions, and hazard boundaries of the golf course; The first determining module is used to determine a first distance from the tee box to the green of the golf course and a second distance from the tee box to the boundary of the obstacle based on the fairway boundary, the green boundary, the tee box position and the obstacle boundary. The second determining module is used to determine the tactical distance of the dogleg hole of the golf course based on the fairway boundary, the green boundary and the tee position; the tactical distance includes a third distance from the tee to the turning point of the dogleg hole and a fourth distance from the turning point to the green; The third determining module is used to determine the measurement data of the golf course based on the first distance, the second distance, and the tactical distance.
[0007] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the machine-readable instructions are executed by the processor to perform the steps of the golf course measurement method as described above.
[0008] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the golf course measurement method described above.
[0009] The golf course measurement method, apparatus, electronic device, and readable storage medium provided in this application include: acquiring the fairway boundaries, green boundaries, tee positions, and hazard boundaries of the golf course; determining a first distance from the tee to the green and a second distance from the tee to the hazard based on the fairway boundaries, green boundaries, tee positions, and hazard boundaries; determining the tactical distance of the dogleg hole based on the fairway boundaries, green boundaries, tee positions, and hazard positions; the tactical distance includes a third distance from the tee to the turning point of the dogleg and a fourth distance from the turning point to the green; and determining the measurement data of the golf course based on the first distance, the second distance, and the tactical distance. This improves the accuracy of golf course distance measurement by automatically determining the regular distance and the dogleg tactical distance using geometric rules.
[0010] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0011] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A flowchart illustrating a method for measuring a golf course according to an embodiment of this application is shown; Figure 2 This illustration shows one of the functional block diagrams of a golf course measuring device provided in an embodiment of this application; Figure 3 This is a second functional block diagram of a measuring device for a golf course provided in an embodiment of this application; Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0014] To facilitate understanding of this application, the technical solutions provided in this application will be described in detail below with reference to specific embodiments.
[0015] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for measuring a golf course, as provided in an embodiment of this application. Figure 1 As shown in the embodiment of this application, the method for measuring a golf course includes the following steps: S101 retrieves the fairway boundaries, green boundaries, tee box positions, and hazard boundaries of a golf course.
[0016] Here, fairway boundaries, green boundaries, tee box locations, and hazard boundaries are the basic vector information of golf course spatial data, respectively describing the hitting area of the fairway, the outline of the green, the coordinates of different tee boxes, and the edges of dangerous areas such as bunkers and water features.
[0017] In this embodiment, three-dimensional point cloud and image data of the stadium are acquired through UAV aerial surveying or ground-based lidar scanning. These data are then processed to generate digital orthophotos and digital elevation models. Finally, image segmentation and vectorization techniques are used to extract the boundary data. This data is stored in a standard Geographic Information System (GIS) format and has a unified spatial reference system, providing an accurate foundation for subsequent distance calculations.
[0018] S102, based on the fairway boundary, the green boundary, the tee box position, and the obstacle boundary, determine a first distance from the tee box to the green of the golf course and a second distance from the tee box to the obstacle boundary.
[0019] Here, the first distance is the straight-line horizontal distance from the designated point on the tee (e.g., the center of the tee) to the designated point on the green (e.g., the center of the green), which is the standard length parameter of the hole. The second distance is the shortest distance from the designated point on the tee to the nearest point on the boundary of the hazard, used to quantify the risk of the shot.
[0020] In this embodiment, the computer program automatically extracts the coordinates of representative points of the tee box and the green from the boundary data, and calculates the straight-line distance between the two points using analytical geometry to obtain the first distance. Simultaneously, it calculates the shortest distance from the representative point of the tee box to the boundary of each obstacle, and takes the minimum value as the second distance. The entire process requires no manual intervention, avoiding errors caused by positioning, line-of-sight, etc., in traditional manual measurements.
[0021] S103, based on the fairway boundary, the green boundary, and the tee position, determine the tactical distance of the dogleg hole of the golf course; the tactical distance includes a third distance from the tee to the turning point of the dogleg hole and a fourth distance from the turning point to the green.
[0022] Here, a dogleg hole refers to a hole where the fairway has a significant bend, and its bend is a key location where the fairway turns. Tactical distances include the distance from the tee to the bend (first landing distance) and the distance from the bend to the green (remaining attack distance), which are the core basis for players to formulate phased shot strategies.
[0023] In this embodiment, a computer program automatically analyzes the shape of the fairway boundary to identify the inflection point of the dogleg hole. Then, it calculates the straight-line distances from the tee to the inflection point and from the inflection point to the green, obtaining a third distance and a fourth distance, which are used together as the tactical distance. This determination process is entirely automated by the algorithm, eliminating the need for manual plotting on the map or relying on experience, thus ensuring that the measurement results of the tactical distance are objective and repeatable.
[0024] S104, Based on the first distance, the second distance, and the tactical distance, determine the measurement data of the golf course.
[0025] Here, the measurement data is a structured dataset that includes the regular distances (first and second distances) and dogleg tactical distances (third and fourth distances) of all holes, which can be used for course yardage book creation, spatial database storage, or event management systems.
[0026] In this embodiment, the calculated first, second, third, and fourth distances are organized according to hole number and tee type to form standardized measurement records. For holes other than dogleg holes, the tactical distance field is left blank. All data is stored in a spatial database and can be exported as reports or map annotations as needed, providing comprehensive quantitative basis for course operation, difficulty assessment, and player decision-making.
[0027] Furthermore, the acquisition of the fairway boundaries, green boundaries, tee box positions, and hazard boundaries of the golf course includes: Step a1: Generate a digital orthophoto of the golf course using drone aerial surveying.
[0028] Here, digital orthophotos are image data with uniform geographic coordinates that eliminate geometric distortions caused by camera tilt and terrain undulations, and can be directly used for precise measurement and vector boundary extraction.
[0029] In this embodiment, aerial triangulation is performed using aerial imagery, POS data, and ground control points to accurately calculate the spatial position and attitude of each image. Subsequently, a dense point cloud is generated based on the aerial triangulation results, and a Digital Surface Model (DSM) is constructed. Finally, using the DSM as an elevation reference, digital differential correction technology is employed to eliminate image distortions caused by camera tilt and terrain undulations pixel by pixel. After color homogenization, stitching, and mosaicking, a final orthophoto map (DOM) with unified coordinates and precise measurability is output. This method can meet the accuracy requirements for detailed surveying of golf courses.
[0030] Step a2: The digital orthophoto is processed using a semantic segmentation model to obtain the classification results of fairways, greens, tees and obstacles.
[0031] Here, the semantic segmentation model can classify each pixel in the digital orthophoto, distinguishing land cover categories such as fairways, greens, tees, bunkers, water bodies, and forests, providing pixel-level classification basis for subsequent boundary extraction.
[0032] In this embodiment of the application, U is used. The Net model performs semantic segmentation on the images. First, it collects golf course images with pixel-level annotations as the training set. The annotation categories include fairways, greens, tees, bunkers, water features, trees, and background. The Net model extracts multi-scale features through an encoder-decoder structure and restores spatial resolution using skip connections. After training, the digital orthophoto generated in step a1 is input into the model, which outputs the classification probability of each pixel. After thresholding, a binary mask image is generated. The binary mask image is then refined through hole filling and noise reduction to obtain classification results for fairways, greens, tees, and various obstacles. For detailed areas such as green edges and bunker edges, the model maintains high boundary sharpness.
[0033] Step a3: Perform edge detection on the classification results to extract the outlines of the fairway, the green, the tee box, and the obstacles.
[0034] Here, the classification result is a binary mask image in pixels. We need to extract the contour lines of each element through edge detection algorithm, convert the pixel representation into a vector representation, and provide input for subsequent thinning and simplification.
[0035] In this embodiment, the Sobel edge detection algorithm is used to extract the contour boundaries of each element. The Sobel operator detects edges by calculating the gradients of pixels in the horizontal and vertical directions, effectively locating pixel positions on classification boundaries. For complex-shaped areas such as greens and sandpits, this algorithm can better preserve local curvature features while suppressing false edges caused by noise. The detection results are output as continuous, single-pixel-wide contour lines, each contour line consisting of a series of sequentially arranged pixel coordinates.
[0036] Step a4: The outline is thinned and simplified to obtain the fairway boundaries, green boundaries, tee box positions, and obstacle boundaries of the golf course.
[0037] Here, the contour lines obtained from edge detection contain a large number of dense pixels. Directly using them as vector boundaries would result in excessive data volume and be detrimental to subsequent spatial analysis and storage. Thinning simplification, while maintaining the overall shape of the contour, removes redundant vertices and retains only key feature points, thereby generating lightweight vector boundaries.
[0038] In this embodiment, the Douglas-Peucker (DP) algorithm is used to thin and simplify each contour line. The algorithm works as follows: given a curve consisting of a series of points and a preset threshold, first, the point on the curve furthest from the line connecting the beginning and end is identified. If the distance to this point is greater than the threshold, the point is retained, and the curve is divided into two segments for recursive processing; otherwise, all intermediate points between the beginning and end lines are discarded. After thinning, the boundaries of each feature are represented by a small number of key vertices, forming a structured vector layer. The output is in Shapefile or GeoJSON format, which can be directly used for storage and computation in a GIS spatial database. Specifically, the tee box position is represented by the centroid coordinates of its boundary polygons, obstacle boundaries are represented by polygons or line features, and fairway and green boundaries are represented by polygon features. Finally, the vector data is input into FME to achieve lossless conversion of vector data into library data, completing the fully automated production process from raw imagery to structured vector data.
[0039] Further, determining the first distance from the tee box to the green and the second distance from the tee box to the hazard boundary based on the fairway boundary, the green boundary, the tee box position, and the hazard boundary includes: Step b1: Calculate the centroid coordinates of the green based on the green boundary, and calculate the centroid coordinates of the tee based on the tee position.
[0040] Here, centroid coordinates refer to the coordinates of the geometric center of the polygon, representing the spatial location of the element. The centroid of the green is usually located near the center of the green area, while the centroid of the tee represents the center point of the tee. These two centroid coordinates are the basis for subsequent calculations of the straight-line distance from the tee to the green.
[0041] In this embodiment, polygonal vector layers of the greens and tees are extracted from the golf course GIS database, and then the geometric centroid of each polygon is directly calculated using the spatial calculation function ST_Centroid(). Alternatively, the centroid coordinates can be obtained by calculating the arithmetic mean of the polygon vertex coordinates. The calculated centroid coordinates are stored in planar coordinates (such as UTM coordinates) or latitude and longitude as representative points of the feature. This method ensures the mathematical accuracy and repeatability of the point definition and avoids the subjective bias of manual point selection.
[0042] Step b2: Calculate the straight-line distance from the tee to the green based on the centroid coordinates of the green and the tee, and use this distance as the first distance.
[0043] Here, the first distance refers to the straight-line horizontal distance from the center of the tee to the center of the green, which is the standard distance parameter marked on the golf scorecard.
[0044] In this embodiment, the centroid coordinates (usually WGS84 latitude and longitude) are first converted to coordinates (unit: meters) in the same Cartesian coordinate system using a map projection algorithm (such as UTM projection). Then, the distance between two points is calculated using the two-dimensional Euclidean distance formula: the sum of the squares of the differences between the x and y coordinates of the two points in the Cartesian coordinate system is taken, and then the square root is obtained. The calculated distance unit is converted to yards (1 yard = 0.9144 meters) and used as the first distance output. This process is entirely automated by computer, eliminating the cumulative errors of manual measurement with a measuring tape or stadia.
[0045] Step b3: Based on the coordinates of the center of mass of the serving table and the boundary of the obstacle, calculate the shortest distance from the center of mass of the serving table to the boundary of the obstacle as the second distance.
[0046] Here, the second distance refers to the shortest straight-line distance from the center of the tee to the nearest point on the boundary of the obstacle. It is used to quantify the proximity of the tee to the danger zone and is an important basis for players to assess the risk of hitting the ball.
[0047] In this embodiment, the shortest distance line segment from the centroid of the tee box to the boundary of the adjacent obstacle polygon is first calculated using the spatial query function ST_ClosestPoint(). The endpoint of this line segment is the nearest edge point of the obstacle. Then, the coordinates of the tee box centroid and the nearest edge point are converted to coordinates in the same Cartesian coordinate system using a map projection algorithm. The straight-line distance between the two points is then calculated using the Euclidean distance formula, which is the second distance. If there are multiple obstacles around the same tee box, the second distance for each obstacle is calculated separately. This method achieves automated positioning of the nearest edge point of the obstacle without the need for manual on-site surveying or map measurement, thus improving the efficiency and accuracy of distance measurement.
[0048] Furthermore, determining the tactical distance of the dogleg hole of the golf course based on the fairway boundary, the green boundary, and the tee position includes: Step c1: Generate the centerline of the fairway based on the fairway boundary, and extract multiple sampling points on the centerline.
[0049] Here, the centerline is a geometric line located in the center of the fairway, representing the ideal path for the ball. Generating the centerline is a prerequisite for identifying dogleg bends, as bends are typically located at the turning points of the centerline. Sampling points are a series of discrete points extracted at equal intervals along the centerline, used for subsequent geometric condition filtering.
[0050] In this embodiment, the left and right boundary lines are first separated from the fairway boundary polygon using a "geometric + statistical" method: the overall vector data of the course is decomposed into all constituent line segments, the length and orientation angle of each line segment are calculated, and the orientation angle is mapped to... For each interval, clustering is performed using an angle difference threshold of 5° to 10°. The cluster with the largest total line segment length is selected, and a main line is fitted using the least squares method. The two longest line segments parallel to the main line and reasonably spaced are retained, which are the left and right boundary lines. Then, the center line is fitted using the perpendicular center method: points are collected at equal intervals on the left boundary line, the foot of the perpendicular from each point to the right boundary line is found, the midpoint is taken, and all midpoints are connected sequentially to form the center line. Finally, multiple sampling points are extracted at fixed intervals on the center line for subsequent analysis.
[0051] Step c2: Each sampling point is filtered according to multiple preset geometric conditions, and the sampling point that satisfies all the geometric conditions is selected as the candidate inflection point of the dogleg hole.
[0052] Here, multiple preset geometric conditions include spatial location constraints, distance constraints, angle constraints, and ratio constraints. Only sampling points that simultaneously satisfy all conditions are considered candidate inflection points. These conditions are determined based on cluster analysis and ratio distribution fitting of a large amount of known dogleg hole geometric data.
[0053] In this embodiment, the following judgments are performed sequentially for each sampling point: First, it is determined whether the sampling point is located within the fairway boundary and outside the green boundary (excluding areas already on the green); second, it is determined whether the distance from the sampling point to the nearest tee is greater than 150 meters and the distance to the center of the green is greater than 70 meters (these two thresholds are obtained by K-means clustering of 349 dogleg holes, with cluster centers of 150.14 meters and 69.66 meters, respectively, rounded to 150 meters and 70 meters); then, it is determined whether the angle formed by the sampling point, the nearest tee, and the center of the green is greater than or equal to 47° and less than or equal to 180° (the cluster center is 47.15°, rounded to 47°); finally, it is determined whether the ratio of the distance from the sampling point to the nearest tee to the distance to the center of the green is greater than 0.4 and less than 2.5 (through ratio distribution fitting, most values are distributed between 0.417 and 2.511, rounded to 0.4 and 2.5). Sampling points that simultaneously meet all of the above conditions are selected as candidate inflection points.
[0054] Step c3: Calculate the vertical distance from each candidate inflection point to the line connecting the tee and the center of the green, and determine the candidate inflection point with the largest vertical distance as the target inflection point of the dogleg hole.
[0055] Here, the vertical distance refers to the length of the perpendicular segment from the candidate inflection point to the line connecting the tee and the center of the green. Among multiple candidate inflection points, the point with the largest vertical distance deviates the farthest from the initial aiming line and is the inflection point with the most significant geometric features, and is therefore selected as the final target inflection point.
[0056] In this embodiment, for each candidate inflection point selected in step c2, the straight line between the tee (the tee furthest from the tee) and the center of the green is first determined, and then the perpendicular distance from the candidate inflection point to this straight line is calculated. A spatial analytical geometry method is used, employing the formula for the distance from a point to a line. The perpendicular distances of all candidate inflection points are compared, and the candidate inflection point with the largest perpendicular distance is selected as the target inflection point for the dogleg hole. This maximum perpendicular distance decision rule ensures that the identified inflection point has the strongest tactical representativeness.
[0057] Step c4: Calculate the distance from the tee to the target inflection point as the third distance, calculate the distance from the target inflection point to the green as the fourth distance, and use the third distance and the fourth distance as the tactical distance of the dogleg hole of the golf course.
[0058] Here, the third distance refers to the straight-line horizontal distance from the center of the tee to the target bend, representing the recommended distance for the player's first landing point; the fourth distance refers to the straight-line horizontal distance from the target bend to the center of the green, representing the remaining attack distance. These two distances together constitute the tactical distance for the dogleg, which is the core basis for players to formulate phased shot strategies.
[0059] In this embodiment, the same distance calculation method as in step b2 is used: the coordinates of the tee box centroid, the target inflection point, and the green centroid are converted to the same Cartesian coordinate system via UTM projection. Then, the Euclidean distance formula is applied to calculate the distance from the tee box to the target inflection point (third distance) and the distance from the target inflection point to the green (fourth distance). The calculated distance unit is converted from meters to yards. For holes other than dogleg holes, the tactical distance is not output. This tactical distance data is stored in a GIS database, and together with the first and second distances, constitutes complete course measurement data, providing quantitative support for course difficulty assessment and player decision-making.
[0060] Furthermore, the preset geometric conditions include: the sampling point is located inside the fairway boundary and outside the green boundary; the distance from the sampling point to the tee is greater than a first preset distance, and the distance from the sampling point to the center of the green is greater than a second preset distance; the angle formed by the sampling point, the tee, and the center of the green is greater than or equal to a preset angle and less than or equal to a straight angle; the ratio of the distance from the sampling point to the tee to the distance from the sampling point to the center of the green is greater than a first preset ratio and less than a second preset ratio.
[0061] Here, the four geometric conditions mentioned above filter the sampling points from four dimensions: spatial attribution, distance constraint, angle constraint, and ratio constraint. The spatial attribution condition ensures that the sampling point is located in the valid hitting area (within the fairway) and has not entered the green; the distance condition focuses the candidate points on the middle section of the fairway (neither too close to the tee nor too close to the green); the angle condition ensures that the fairway turns significantly (greater than or equal to the preset angle); and the ratio condition further constrains the positional relationship of the inflection point relative to the tee and the green, making it tactically significant.
[0062] In this embodiment, the specific values of the aforementioned preset parameters are derived from statistical analysis of a large number of known dogleg holes. Specifically, geometric data of 349 recognized dogleg holes were collected. K-means clustering analysis was used to obtain a cluster center of 150.14 meters for the distance to the tee, which was rounded to 150 meters as the first preset distance; the cluster center for the distance to the green was 69.66 meters, which was rounded to 70 meters as the second preset distance. The angle data was clustered, and the cluster center was 47.15°, which was rounded to 47° as the preset angle, with an upper limit of a straight angle (180°). The distance ratio was plotted using a distribution fitting method to create a histogram. It was found that the ratio of most samples was distributed between 0.417 and 2.511. After rounding, the first preset ratio was 0.4, and the second preset ratio was 2.5. These thresholds ensure that the selected candidate inflection points can accurately reflect the geometric characteristics of the dogleg hole, avoiding misjudging minor curves of the fairway as dogleg holes. By combining the above four criteria, candidate inflection points can be efficiently and objectively identified from the sampling points of the centerline, providing accurate input for the subsequent determination of the target inflection point.
[0063] Further, generating the centerline of the fairway based on the fairway boundary includes: Step d1: Decompose the fairway boundary into a set of line segments.
[0064] Here, the fairway boundary is a polygon formed by connecting multiple line segments. In order to analyze the geometric characteristics of each line segment, it is necessary to decompose it into independent line segment units, and each line segment is defined by the coordinates of its two endpoints.
[0065] In this embodiment, the vertex coordinate sequence of the fairway boundary polygon is read from the vector layer. The entire boundary is then decomposed into a series of line segments by connecting adjacent vertices sequentially. Each line segment records its start-point coordinates, end-point coordinates, length, and orientation angle. The length is calculated based on the coordinates of the two endpoints of the line segment. Direction angle .
[0066] Step d2: Cluster the segments based on their length and orientation angle, and select the cluster with the largest total length of the segments.
[0067] Here, length and orientation angle are two key parameters describing the geometric properties of a line segment. Clustering can group line segments with similar orientations and longer lengths into one category, thereby identifying the group of line segments that constitute the main direction of the fairway.
[0068] In this embodiment of the application, the orientation angle is mapped to To eliminate positive and negative directional differences, clustering was performed using an angle difference threshold of 5° to 10°, selecting the cluster with the largest total line segment length. This cluster represents the main extension direction of the fairway.
[0069] Step d3: Fit the main direction line of the cluster, and retain the two longest line segments that are parallel to the main direction line and located on both sides of the main direction line, which are respectively used as the left boundary line and right boundary line of the fairway.
[0070] Here, the main direction line is the fitted straight line of the overall direction of the fairway, while the left and right boundary lines are the contour edges on both sides of the fairway.
[0071] In this embodiment of the application, for all line segments within the cluster selected in step d2, a main line is fitted using the least squares method, and the two longest line segments that are parallel to the main line and at a reasonable distance are retained, which are the left and right boundary lines.
[0072] Step d4: Collect multiple sampling points at equal intervals along the left boundary line, and calculate the perpendicular foot of each sampling point on the right boundary line.
[0073] Here, equidistant sampling on the left boundary line is to obtain a series of location points, and then the corresponding points on the right boundary line are found through perpendicular mapping, thereby determining the correspondence between the left and right boundaries.
[0074] In this embodiment, multiple points are collected at equal intervals along the left boundary line with a fixed step size. For each collected point, the perpendicular point corresponding to the shortest distance from that point to the right boundary line is calculated.
[0075] Step d5: Take the midpoint between each collection point and the corresponding perpendicular foot, and connect each midpoint in sequence to obtain the center line of the fairway.
[0076] Here, the midpoint is located between the left and right boundary lines. Connecting all the midpoints forms a continuous curve in the center of the fairway.
[0077] In this embodiment of the application, for each collection point and its corresponding foot Take the midpoint Connect all the midpoints in sequence and smooth the surface to obtain a continuous, smooth centerline that is geometrically located in the center of the fairway.
[0078] Furthermore, before determining the tactical distance of the dogleg hole of the golf course based on the fairway boundaries, the green boundaries, and the tee positions, the method further includes: Step e1: Obtain the par score of the current hole of the golf course.
[0079] Here, par is an inherent property of a golf hole, typically 3, 4, or 5 strokes, representing the standard number of shots a professional player needs to complete the hole. Holes with different pars vary in length and design; par 3 holes are shorter and usually do not have a dogleg configuration.
[0080] In this embodiment, the par value of the current hole is read from the golf course's GIS database or course attribute table. This data is typically stored in the course's basic information database along with information such as the hole number and tee location, and can be retrieved directly through a query.
[0081] Step e2: If the standard score is less than or equal to the preset score, then the step of determining the tactical distance of the dogleg of the current hole is not performed.
[0082] Here, the preset score is used to determine whether dogleg tactical distance determination is needed for the current hole. Since holes with a standard score of 3 are relatively short and usually do not have significant bends, dogleg identification is unnecessary. Skipping this step saves computational resources and improves overall processing efficiency.
[0083] In this embodiment, the preset par number is set to 3. After obtaining the par number for the current hole, it is determined whether it is less than or equal to 3. If so, the dogleg tactical distance determination process for that hole is skipped, and the process moves on to the next hole. If the par number is greater than 3 (e.g., 4 or 5), the subsequent dogleg tactical distance determination steps are continued. This judgment rule effectively excludes par-3 holes, avoids invalid calculations, and ensures the rationality of the data processing flow.
[0084] This application provides a method for measuring a golf course, comprising: acquiring the fairway boundaries, green boundaries, tee positions, and hazard boundaries of the golf course; determining a first distance from the tee to the green and a second distance from the tee to the hazard boundaries based on the fairway boundaries, green boundaries, tee positions, and hazard boundaries; determining the tactical distance of the dogleg hole based on the fairway boundaries, green boundaries, and tee positions; the tactical distance includes a third distance from the tee to the turning point of the dogleg hole and a fourth distance from the turning point to the green; and determining the measurement data of the golf course based on the first distance, the second distance, and the tactical distance. In this way, by automatically determining the regular distance and the dogleg tactical distance using geometric rules, the accuracy of golf course distance measurement is improved.
[0085] Based on the same concept, this application also provides a golf course measuring device corresponding to the golf course measuring method provided in the above embodiments. Since the principle of the device in this application is similar to the golf course measuring method in the above embodiments of this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0086] Please see Figure 2 , Figure 2 This is one of the functional block diagrams of a golf course measuring device provided in an embodiment of this application. For example... Figure 2 As shown, the golf course measuring device 200 provided in this application embodiment includes: The data acquisition module 210 is used to acquire the fairway boundaries, green boundaries, tee box positions, and hazard boundaries of the golf course.
[0087] The first determining module 220 is used to determine a first distance from the tee box to the green of the golf course and a second distance from the tee box to the boundary of the obstacle based on the fairway boundary, the green boundary, the tee box position and the obstacle boundary.
[0088] The second determining module 230 is used to determine the tactical distance of the dogleg hole of the golf course based on the fairway boundary, the green boundary and the tee position; the tactical distance includes a third distance from the tee to the turning point of the dogleg hole and a fourth distance from the turning point to the green.
[0089] The third determining module 240 is used to determine the measurement data of the golf course based on the first distance, the second distance and the tactical distance.
[0090] Furthermore, when acquiring the fairway boundaries, green boundaries, tee box positions, and hazard boundaries of a golf course, the data acquisition module 210 is specifically used for: Digital orthophotos of the golf course were generated using drone aerial surveying. The digital orthophoto is processed using a semantic segmentation model to obtain classification results for fairways, greens, tees, and obstacles; Edge detection is performed on the classification results to extract the outlines of the fairway, the green, the tee box, and the obstacles; The outline is thinned and simplified to obtain the fairway boundaries, green boundaries, tee box positions, and obstacle boundaries of the golf course.
[0091] Further, when the first determining module 220 determines the first distance from the tee box to the green and the second distance from the tee box to the hazard boundary based on the fairway boundary, the green boundary, the tee box position, and the hazard boundary, the first determining module 220 is specifically used for: The centroid coordinates of the green are calculated based on the green boundary, and the centroid coordinates of the tee are calculated based on the tee position. The straight-line distance from the tee to the green is calculated based on the centroid coordinates of the green and the tee and is taken as the first distance. Based on the coordinates of the center of mass of the tee and the boundary of the obstacle, the shortest distance from the center of mass of the tee to the boundary of the obstacle is calculated as the second distance.
[0092] Furthermore, when determining the tactical distance of the dogleg hole of the golf course based on the fairway boundary, the green boundary, and the tee position, the second determining module 230 is specifically used for: The centerline of the fairway is generated based on the fairway boundary, and multiple sampling points are extracted on the centerline; Each sampling point is filtered according to multiple preset geometric conditions, and the sampling point that satisfies all the geometric conditions at the same time is taken as the candidate inflection point of the dogleg hole. Calculate the vertical distance from each candidate inflection point to the line connecting the tee and the center of the green, and determine the candidate inflection point with the largest vertical distance as the target inflection point of the dogleg hole; The distance from the tee to the target inflection point is calculated as the third distance, and the distance from the target inflection point to the green is calculated as the fourth distance. The third distance and the fourth distance are then used as the tactical distances for the dogleg holes of the golf course.
[0093] Furthermore, when the second determining module 230 generates the centerline of the fairway based on the fairway boundary, the second determining module 230 is specifically used for: The fairway boundary is decomposed into a set of line segments; Clustering is performed based on the length and orientation angle of each line segment, and the cluster with the largest total line segment length is selected. Fit the main direction line of the cluster, and retain the two longest line segments that are parallel to the main direction line and located on both sides of the main direction line, which are respectively used as the left boundary line and right boundary line of the fairway; Multiple sampling points are collected at equal intervals along the left boundary line, and the perpendicular foot of each sampling point on the right boundary line is calculated. Take the midpoint between each collection point and the corresponding perpendicular foot, and connect each midpoint in sequence to obtain the center line of the fairway.
[0094] Further, please refer to Figure 3 , Figure 3 This is a second functional block diagram of a measuring device for a golf course provided in an embodiment of this application. Figure 3 As shown, the golf course measuring device 200 also includes a stroke determination module 250, which is used for: Obtain the par score for the current hole of the golf course; If the standard score is less than or equal to the preset score, the step of determining the tactical distance of the dogleg of the current hole will not be performed.
[0095] This application provides a golf course measurement device, comprising: a data acquisition module for acquiring the fairway boundaries, green boundaries, tee positions, and hazard boundaries of the golf course; a first determination module for determining a first distance from the tee to the green and a second distance from the tee to the hazard boundary based on the fairway boundaries, green boundaries, tee positions, and hazard boundaries; a second determination module for determining the tactical distance of the dogleg hole based on the fairway boundaries, green boundaries, and tee positions; the tactical distance includes a third distance from the tee to the turning point of the dogleg hole and a fourth distance from the turning point to the green; and a third determination module for determining the measurement data of the golf course based on the first distance, the second distance, and the tactical distance. Thus, by automatically determining the conventional distance and the dogleg tactical distance using geometric rules, the accuracy of golf course distance measurement is improved.
[0096] Based on the same application concept, please refer to Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4As shown, the electronic device 400 includes a processor 410, a memory 420, and a bus 430.
[0097] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 and the memory 420 communicate through the bus 430. When the machine-readable instructions are executed by the processor 410, they perform the steps of the golf course measurement method provided in the above embodiment. For specific implementation details, please refer to the method embodiment, which will not be repeated here.
[0098] Based on the same concept, this application also provides a computer-readable storage medium storing a computer program. When the computer program is run by a processor, it executes the steps of the golf course measurement method provided in the above embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0099] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and unit can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0100] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0101] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0102] In addition, the functional units in the embodiments provided in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0103] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0104] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0105] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A method for measuring a golf course, characterized in that, The method includes: Obtain the fairway boundaries, green boundaries, tee box locations, and hazard boundaries of a golf course; Based on the fairway boundary, the green boundary, the tee box location, and the hazard boundary, determine a first distance from the tee box to the green of the golf course and a second distance from the tee box to the hazard boundary. Based on the fairway boundaries, the green boundaries, and the tee positions, the tactical distance of the dogleg hole on the golf course is determined; the tactical distance includes a third distance from the tee to the turning point of the dogleg hole and a fourth distance from the turning point to the green; Measurement data for the golf course are determined based on the first distance, the second distance, and the tactical distance.
2. The method for measuring a golf course according to claim 1, characterized in that, The acquisition of the fairway boundaries, green boundaries, tee box positions, and hazard boundaries of the golf course includes: Digital orthophotos of the golf course were generated using drone aerial surveying. The digital orthophoto is processed using a semantic segmentation model to obtain classification results for fairways, greens, tees, and obstacles; Edge detection is performed on the classification results to extract the outlines of the fairway, the green, the tee box, and the obstacles; The outline is thinned and simplified to obtain the fairway boundaries, green boundaries, tee box positions, and obstacle boundaries of the golf course.
3. The method for measuring a golf course according to claim 1, characterized in that, The determination of a first distance from the tee box to the green and a second distance from the tee box to the hazard boundary, based on the fairway boundary, the green boundary, the tee box position, and the hazard boundary, includes: The centroid coordinates of the green are calculated based on the green boundary, and the centroid coordinates of the tee are calculated based on the tee position. The straight-line distance from the tee to the green is calculated based on the centroid coordinates of the green and the tee and is taken as the first distance. Based on the coordinates of the center of mass of the tee and the boundary of the obstacle, the shortest distance from the center of mass of the tee to the boundary of the obstacle is calculated as the second distance.
4. The method for measuring a golf course according to claim 1, characterized in that, Determining the tactical distance for the dogleg hole of the golf course based on the fairway boundaries, the green boundaries, and the tee positions includes: The centerline of the fairway is generated based on the fairway boundary, and multiple sampling points are extracted on the centerline; Each sampling point is filtered according to multiple preset geometric conditions, and the sampling point that satisfies all the geometric conditions at the same time is taken as the candidate inflection point of the dogleg hole. Calculate the vertical distance from each candidate inflection point to the line connecting the tee and the center of the green, and determine the candidate inflection point with the largest vertical distance as the target inflection point of the dogleg hole; The distance from the tee to the target inflection point is calculated as the third distance, and the distance from the target inflection point to the green is calculated as the fourth distance. The third distance and the fourth distance are then used as the tactical distances for the dogleg holes of the golf course.
5. The method for measuring a golf course according to claim 4, characterized in that, The preset geometric conditions include: the sampling point is located inside the fairway boundary and outside the green boundary; the distance from the sampling point to the tee is greater than a first preset distance, and the distance from the sampling point to the center of the green is greater than a second preset distance; the angle formed by the sampling point, the tee, and the center of the green is greater than or equal to a preset angle and less than or equal to a straight angle; the ratio of the distance from the sampling point to the tee to the distance from the sampling point to the center of the green is greater than a first preset ratio and less than a second preset ratio.
6. The method for measuring a golf course according to claim 4, characterized in that, The step of generating the centerline of the fairway based on the fairway boundary includes: The fairway boundary is decomposed into a set of line segments; Clustering is performed based on the length and orientation angle of each line segment, and the cluster with the largest total line segment length is selected. Fit the main direction line of the cluster, and retain the two longest line segments that are parallel to the main direction line and located on both sides of the main direction line, which are respectively used as the left boundary line and right boundary line of the fairway; Multiple sampling points are collected at equal intervals along the left boundary line, and the perpendicular foot of each sampling point on the right boundary line is calculated. Take the midpoint between each collection point and the corresponding perpendicular foot, and connect each midpoint in sequence to obtain the center line of the fairway.
7. The method for measuring a golf course according to claim 1, characterized in that, Before determining the tactical distance of the dogleg hole of the golf course based on the fairway boundaries, the green boundaries, and the tee positions, the method further includes: Obtain the par score for the current hole of the golf course; If the standard score is less than or equal to the preset score, the step of determining the tactical distance of the dogleg of the current hole will not be performed.
8. A measuring device for a golf course, characterized in that, The measuring device for the golf course includes: The data acquisition module is used to acquire the fairway boundaries, green boundaries, tee box positions, and hazard boundaries of the golf course; The first determining module is used to determine a first distance from the tee box to the green of the golf course and a second distance from the tee box to the boundary of the obstacle based on the fairway boundary, the green boundary, the tee box position and the obstacle boundary. The second determining module is used to determine the tactical distance of the dogleg hole of the golf course based on the fairway boundary, the green boundary and the tee position; the tactical distance includes a third distance from the tee to the turning point of the dogleg hole and a fourth distance from the turning point to the green; The third determining module is used to determine the measurement data of the golf course based on the first distance, the second distance, and the tactical distance.
9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the machine-readable instructions are executed by the processor to perform the steps of the golf course measurement method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the golf course measurement method as described in any one of claims 1 to 7.
