Competition field edge contour vertex extraction method for antagonistic competitive sports

By pre-setting inner and outer contour regions and using multi-level fitting methods, combined with target detection and instance segmentation models, the edge contour vertices of competitive sports fields are automatically extracted, solving the error problem introduced by manual annotation in existing technologies and achieving high-precision, real-time field analysis.

CN121661084APending Publication Date: 2026-03-13CHONGQING TELECOM SYST INTEGRATION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-04
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies rely on manual annotation for extracting the vertices of the contours of competitive sports fields, resulting in low efficiency, low accuracy, and easy introduction of errors, as well as insufficient real-time performance and anti-interference capabilities.

Method used

By using preset inner and outer contour regions, combined with YOLOv1 object detection and a general instance segmentation model, human interference is eliminated through multi-frame video processing, and Suzuki algorithm and multi-level fitting method are used to automatically extract the vertices of the site edge contour, achieving high-precision and real-time vertex extraction.

Benefits of technology

It achieves highly automated extraction of field edge contour vertices, reduces human intervention, improves extraction accuracy and analysis efficiency, and ensures the continuity and stability of competition analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121661084A_ABST
    Figure CN121661084A_ABST
Patent Text Reader

Abstract

The invention discloses a competition field edge contour vertex extraction method for antagonistic competitive sports, and relates to the technical field of artificial intelligence and computer vision. Aiming at the defects of dependence on manual calibration, low real-time performance and weak anti-interference performance in the prior art, the method comprises the following steps of: presetting inner and outer contours of a site, erecting camera equipment, extracting frames of a real-time video stream, removing human body shielding interference based on target detection, identifying a site instance by utilizing a general instance segmentation model, and performing multi-stage geometric fitting and error correction. And full-automatic high-precision extraction of the vertex of the field edge contour is realized. The method does not need manual intervention, supports real-time processing, is high in anti-interference performance and extraction precision, effectively improves the perspective transformation reliability, and provides a solid foundation for sports event video analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence, computer vision, and sports event video analysis, specifically to a method for extracting the vertex contours of the edge of a competition field in competitive sports. Background Technology

[0002] With the development of artificial intelligence technology, automated video analysis of sports events has become an important means of assisting in competition analysis. In combat sports such as taekwondo, boxing, and judo, athletes and coaching teams often use video analysis to formulate training or competition strategies. To analyze the offensive and defensive movement trajectories of athletes, it is usually necessary to set up camera equipment directly above the field to obtain an overhead view, or to set up camera equipment at the edge of the field to obtain an oblique view, and then convert the oblique view into an overhead view through perspective transformation.

[0003] For example, Figure 1 The footage shown is of a Taekwondo competition scene filmed outside the venue using a camera device mounted at an angle (the footage has been privacy-protected). Figure 1 The two red dots in the image indicate the positions of the two players on the playing field. Figure 2 The demonstration shows how perspective transformation can be used to... Figure 1 The positions of the Chinese and Chinese players are mapped onto a top-down view of the playing field.

[0004] The key to perspective transformation lies in accurately constructing the homography matrix, which requires determining multiple sets of corresponding coordinate points in two planes. The required homography matrix can be calculated by mapping the vertices of the playing field outline in a video shot from a tilted perspective to the vertices of the playing field outline in a pre-drawn planar image of the playing field from an overhead view. In this process, accurately determining the vertices of the playing field outline in the video shot is the core problem to be solved.

[0005] Current technologies (such as object detection and tracking based on deep learning and traditional machine learning) can effectively identify the category and location information of multiple objects in a video. However, when performing perspective transformation and constructing the coordinate mapping relationship between tilted and overhead views, existing methods still rely on manually annotating the coordinates of the corner points of the competition field to construct the homography matrix.

[0006] This process has significant drawbacks: it typically requires the development of a dedicated interactive interface for manual annotation; and manual field contour re-annotation is required at the start of each match and after each accidental camera movement. This not only consumes a large amount of manpower and time, but manual operation is also prone to introducing errors, making it difficult to guarantee the accuracy and consistency of the results, seriously affecting analysis efficiency and match continuity.

[0007] Although researchers in this field have continuously proposed new technical solutions in an attempt to completely solve the technical problems of automatic, robust, and high-precision extraction of site contour vertices, long-term use has revealed that while these solutions address some of the aforementioned issues to a certain extent, they also introduce new technical problems while solving old ones, and thus still have many shortcomings. For example:

[0008] CN118154728A discloses a method for real-time generation of dynamic perspective aerial views of sports event venues. This method captures real-time scenes using a camera, identifies straight lines through grayscale processing to determine the positions of key points within the venue, and then uses a dimensionality transformation algorithm to map the scene from the original image onto the aerial view. However, this method still has shortcomings in terms of real-time analysis smoothness and stability, making it difficult to ensure that users can obtain a clear and stable dynamic aerial view.

[0009] CN119963966A proposes a method for generating a top-down view of a match based on multi-camera information fusion. This method deploys cameras at the four corners of the stadium to cover the entire field and form overlapping areas. It uses the HSV color space to extract lines and intersections from the images, calculates and constructs a rectangular feature point set for the field, and maps the local viewpoints to a unified top-down coordinate system based on geometric features and coordinate transformation matrices. However, this method still needs improvement in terms of the accuracy and real-time performance of information fusion.

[0010] How to effectively avoid the aforementioned problems in the construction process of homography matrix without introducing new technical issues has always been a matter of great concern in this field. Summary of the Invention

[0011] To address the shortcomings of existing technologies, such as reliance on manual calibration, low real-time performance, and weak anti-interference capabilities, this invention provides a highly automated, highly anti-interference, and high-precision method for extracting vertex contours of the competition field edge. This method can achieve real-time processing without manual intervention and provides reliable vertex coordinate support for perspective transformation.

[0012] The objective of this invention is achieved through the following approach:

[0013] A method for extracting the vertex contours of the edge of a competition field for competitive sports includes the following steps:

[0014] 1) Based on the regular geometric shape of the competition venue for competitive sports, the theoretical inner and outer contours of the venue are preset, and the double contour area formed by the inner and outer contours is drawn on the display device.

[0015] 2) Set up the camera equipment and adjust its position and angle according to the drawn double outline area to ensure that the actual edge of the competition field is located between the double outline areas;

[0016] 3) After acquiring the real-time video stream of the competition venue, extract frames at preset time intervals and encode the extracted images into a preset color format;

[0017] 4) By eliminating human targets from multiple video frames, a basic image without human occlusion is obtained;

[0018] 5) Use a general instance segmentation model to segment the base image, and combine the inner and outer contour vertex region constraints to filter out the competition venue instances;

[0019] 6) Extract the initial edge contour point set from the competition venue instance and complete the discontinuous parts;

[0020] 7) The initial edge contour point set after completion is corrected by a multi-level fitting method, and the coordinate set of the vertex of the site edge contour is output.

[0021] Preferably, in step 4), the basic image without human occlusion is obtained by eliminating human target interference based on multiple frames of video footage, including:

[0022] Using the first frame of the video stream as the base image, a target detection model is used to detect human targets in the image. The cross product method is used to determine whether there is an intersection between the human target and the preset outer contour. The areas with intersection are marked. Then, the unmarked area pixels in the corresponding position in the subsequent frame images are used to replace the marked area pixels in the base image. The above process is repeated until there are no human occlusion marks in the base image, resulting in an image without human occlusion, which is used as the base image without human occlusion.

[0023] Preferably, the target detection model is a YOLOv12 model with an input size of 640×640, filtering detection results with a confidence level lower than 0.6.

[0024] Preferably, the YOLOv12 model is trained based on an open-source dataset and a self-annotated competition image dataset.

[0025] Preferably, in step 5), the general instance segmentation model is a SAM-2, FastSAM, or MobileSAM model.

[0026] Preferably, in step 6), the Suzuki algorithm is used to extract the initial edge contour point set of the competition venue instance, and the discontinuous parts are completed by smooth prediction.

[0027] Preferably, in step 7), the multi-level fitting method includes:

[0028] 7-1) Calculate the geometric center of the completed initial edge contour point set and the polar angle of each coordinate point, and reorder all coordinate points in the initial edge contour point set clockwise according to the polar angle to obtain the site contour point set;

[0029] 7-2) Determine the leftmost and rightmost point indices based on the x-coordinate of each coordinate point in the site outline point set, select multiple subsets of the site outline point set to fit several straight lines, and find the intersection points between the straight lines. Use these intersection points as approximate vertices of the site edge outline.

[0030] 7-3) Based on the approximate vertex selection of the neighboring point set, multiple straight lines are fitted according to the number of site edges. Multiple optimized vertex coordinates are obtained through the intersection of each straight line, and these optimized vertex coordinates are used as the vertices of the site edge contour.

[0031] Preferably, in step 7-2), selecting multiple subsets of the site outline point set specifically includes:

[0032] 7-2-1) Determine the effective point quantity control parameter k of the subset in the site outline point set based on the total number of points in the site outline point set and the pixel length of the target outline segment;

[0033] 7-2-2) Determine the edge outlier exclusion parameter m of the subset of the site outline point set based on the estimated number of outliers on the outline edge, the density of the site outline point set, and the smoothness of the outline.

[0034] 7-2-3) The effective point quantity control parameter k and the edge anomaly point exclusion parameter m are used as index range control parameters for selecting subsets in the site contour line point set. The leftmost and rightmost point indices are used as reference benchmarks for subset selection. In the site contour line point set, subsets that can be used to fit "end contour edge line", "right side contour edge line of the rightmost point", "transition contour edge line", "left and right main contour edge lines", and "multiple middle main contour edge lines" are selected respectively.

[0035] Preferably, the competitive sports include taekwondo, judo, karate, and boxing, and the corresponding competition venues are polygonal in shape.

[0036] Preferably, in step 5), the criteria for selecting the competition venue instance by combining the inner and outer contour vertex region constraints are: the coordinates of all vertices of the inner contour are located within the instance, and the coordinates of all vertices of the outer contour are located outside the instance.

[0037] The beneficial effects of this invention are as follows:

[0038] Compared to existing technologies, this invention provides a highly automated method for extracting vertex coordinates of the edge contour of a competition venue. Based on a small amount of pre-defined information (inner / outer contour references), it can process real-time video streams during the competition. This method has the following significant advantages:

[0039] ① High degree of automation, cost reduction and efficiency improvement: By pre-setting inner / outer contours, the tedious manual coordinate drawing operation is eliminated, realizing fully automatic extraction of edge contour vertices. This not only significantly reduces human intervention and improves processing efficiency, but also effectively avoids human error and ensures the accuracy and consistency of coordinate drawing results;

[0040] ② Strong anti-interference capability and accurate recognition: Utilizing an interval video stream frame extraction strategy, combined with target detection and pixel overlap analysis, it can efficiently eliminate occlusion interference from human targets during the competition, obtaining clear and unobstructed images of the competition venue. This design ensures high accuracy in venue edge contour recognition and extraction, laying a reliable foundation for subsequent competition analysis;

[0041] ③ Supports real-time analysis and has good robustness: This method is suitable for real-time video stream processing and has good environmental adaptability. When the acquisition equipment is moved due to an accident (such as a collision), the analysis process can be quickly restored simply by resetting it according to the preset parameters, which effectively ensures the continuity of competition analysis and the stability of system operation;

[0042] ④ Multi-level fitting for high accuracy: After obtaining the initial set of field edge contour points (including noise) through instance segmentation model and contour extraction algorithm, an innovative multi-level fitting strategy is adopted to iteratively optimize the set of field edge contour points. This method can significantly correct the initial prediction deviation and achieve fine fitting of the contour polygon by referring to the actual shape of the competition field, greatly improving the extraction accuracy of vertex coordinates.

[0043] Glossary

[0044] Homography Matrix: A homography matrix is ​​a 3×3 transformation matrix used to describe the projection mapping relationship between two planes. Based on the homography matrix, it is possible to map points from a source plane to a target plane.

[0045] Perspective Transformation: Perspective transformation is a geometric transformation based on the principle of perspective projection. It is implemented through a homography matrix and aims to map points from a source plane to a target plane.

[0046] Instance segmentation is a computer vision task that requires simultaneous object detection and pixel-level segmentation. That is, it needs to distinguish different individuals within the same category and output the mask and category label for each object.

[0047] Universal Instance Segmentation: Universal instance segmentation is an advanced technique that breaks through the category limitations of traditional instance segmentation. It can achieve accurate segmentation of any unknown object without the need for additional training for specific targets. Attached Figure Description

[0048] Figure 1 This is a schematic diagram of a Taekwondo competition scene captured by a camera mounted at an angle outside the arena; the two red dots under the athletes' feet indicate the positions of the two competitors in the competition area.

[0049] Figure 2 To use perspective transformation Figure 1 A schematic diagram of the positions of the Chinese and Chinese players mapped onto a planar image of the playing field from an overhead perspective;

[0050] Figure 3 This is a schematic diagram of the process of the present invention;

[0051] Figure 4 This is a schematic diagram showing the positional relationship between the inner contour (red), the outer contour (green), and the edge of the site in an embodiment of the present invention;

[0052] Figure 5 This is a schematic diagram of the process for obtaining an image without human body obstruction in an embodiment of the present invention;

[0053] Figure 6 This is a schematic diagram of "wiping away obstructing personnel" in an embodiment of the present invention;

[0054] Figure 7 This is a rough outline diagram of the edge of the competition field obtained in an embodiment of the present invention;

[0055] Figure 8 This is a schematic diagram of the eight edge contour vertices of the competition field finally obtained in an embodiment of the present invention. Detailed Implementation

[0056] like Figure 3 As shown, a method for extracting the vertex contours of the edge of a competition field for competitive sports includes the following steps:

[0057] 1) Based on the regular geometric shape of the competition venue for competitive sports, the theoretical inner and outer contours of the competition venue are preset (i.e., the coordinates of each vertex of the theoretical inner and outer contours are determined and these coordinate information are stored in the display device), forming a double contour area, which is then temporarily drawn on the display device.

[0058] In this invention, the preset inner / outer contour vertex coordinates will be used as the "validity criterion" for subsequent instance segmentation. That is, only when the segmented instance satisfies the condition that "all inner contour vertices are inside the mask and all outer contour vertices are outside the mask" will it be determined as a target site instance, accurately eliminating interfering instances such as surrounding equipment and background, and solving the target misidentification problem of general segmentation models (such as SAM-2).

[0059] 2) Set up the camera equipment and adjust the position and angle of the camera equipment according to the temporary double contour (i.e., the theoretical inner contour and the outer contour) to ensure that the actual edge of the competition field is located between the double contour areas;

[0060] In step 2) of this invention, the shooting position and angle are adjusted by combining the preset double contour area (such as avoiding perspective distortion caused by close shooting with a wide-angle lens), which can make the geometric proportion of the site in the image match the theoretical contour, reduce contour deformation caused by improper shooting parameters (such as edge line segment distortion), and ensure the accuracy of subsequent geometric calculations such as polar angle sorting and straight line fitting (in order to meet the requirements of homography matrix construction for image perspective consistency).

[0061] 3) After acquiring the real-time video stream of the competition venue through the installed camera equipment, the video stream parameters are set and pushed to the cloud server through a preset protocol (i.e., setting parameters such as resolution, frame rate, and bit rate, and pushing to the cloud server through the RTSP protocol). The video stream is decoded in the cloud and frames are extracted at preset time intervals (for example, considering the balance between "data volume" and "key information retention", the preset time interval can be set to 0.2 seconds), and the images obtained by extracting frames are encoded into a preset color format.

[0062] In other words, this invention can ensure that the image accuracy meets the requirements for key information recognition while avoiding data overload and processing delay by setting video stream parameters such as "resolution 1920×1080, frame rate 60fps, bit rate 10Mbps".

[0063] Moreover, this invention pushes the video stream to the cloud server via the RTSP protocol, rather than relying on local devices (such as mobile phones or cameras) for processing. This can meet the computing power requirements of complex algorithms and support the storage and retrieval of multiple frames, avoiding subsequent problems caused by insufficient local storage capacity.

[0064] 4) Based on multiple frames of video footage, human targets are eliminated to obtain a basic image without human occlusion, specifically including:

[0065] Using the first frame of the video stream as the base image, a target detection model is used to detect human targets in the image. The cross product method is used to determine whether there is an intersection between the human target and the preset outer contour. The areas with intersection are marked. Then, the unmarked area pixels in the corresponding position in the subsequent frame images are used to replace the marked area pixels in the base image. The above process is repeated until the base image has no human occlusion markers, resulting in an image without human occlusion, which is used as the base image without human occlusion (i.e., an image without human occlusion).

[0066] This invention uses the YOLOv12 model as the object detection model, and the object detection model is trained based on open source datasets and self-annotated competition image datasets. The model input size is 640×640, and the detection results with a confidence level of less than 0.6 are filtered.

[0067] This is because, in practical applications, human occlusion can cause segmentation models such as SAM-2 to mistakenly include human body regions in the field instance mask (e.g., when an athlete's body occludes the edge of the field, the model may identify "human body + field" as a single instance). This invention, by accurately marking and replacing the occluded area, ensures that subsequent segmentation outputs only binary images of the clean field region, avoiding interference from non-field instances.

[0068] Furthermore, subsequent steps 6) involving contour extraction using the Suzuki algorithm and 7) involving multi-level line fitting rely on continuous and complete field edge pixels. For example, human occlusion can cause breakage of the contour point set or introduce false pixels (such as human edge points being misidentified as field contours), leading to disordered polar angle sorting and line fitting deviations. This necessitates manually labeling occluded areas again, deviating from the initial goal of "no human intervention required." This invention achieves automatic identification and repair of occluded areas through high-precision YOLOv12 detection (0.6 confidence threshold filtering for false detections) and intersection judgment using the cross product method. This ensures the geometric integrity of the initial contour point set and provides a reliable data foundation for subsequent vertex calculations.

[0069] 5) Use a general instance segmentation model (such as SAM-2, FastSAM or MobileSAM model, etc.) to perform instance segmentation on the base image, and combine the inner and outer contour vertex region constraints to filter out the competition field instances (i.e., binary images containing only 0 and 1, where 1 corresponds to a clean field region).

[0070] The purpose of this step is to apply a general instance segmentation model to the image that does not contain human occlusion to perform instance segmentation and extract all instance targets in the image. Then, based on the constraint that all vertices of the inner contour are located within the instance and all vertices of the outer contour are located outside the instance, the competition venue instances are selected. That is to say, in step 5), the criteria for selecting the competition venue instances based on the inner and outer contour vertex region constraints are: all vertex coordinates of the inner contour are located within the instance and all vertex coordinates of the outer contour are located outside the instance.

[0071] This is because while general instance segmentation models (such as SAM-2 and FastSAM) can extract all instances in an image (such as the field, surrounding equipment, ground markings, background clutter, etc.), they cannot autonomously distinguish the "competition field" from other interfering instances—for example, the referee's chair next to the field or stains on the ground may be misidentified as instances similar to the field. This invention can only establish strict geometric selection criteria through "inner and outer contour vertex region constraints" (all vertices of the inner contour are inside the instance + all vertices of the outer contour are outside the instance). That is, an instance is only determined to be a competition field instance when its spatial extent completely matches the preset geometric relationship of "inner contour inside, outer contour outside." For example, equipment instances around a taekwondo field cannot cover all vertices of the inner contour, or the vertices of the outer contour may fall inside, and are therefore naturally excluded; while real field instances, because they completely conform to the "double contour inclusion relationship," can be accurately selected, completely eliminating the interference of non-field instances on subsequent contour extraction.

[0072] Furthermore, this invention utilizes a universal segmentation model to automatically output the masks and coordinate ranges of all instances, automatically calls preset inner and outer contour vertex coordinates, and batch verifies whether each instance satisfies the constraint that "inner vertices are inside the instance and outer vertices are outside the instance." It automatically outputs the unique site instance that meets the constraint. This process is entirely algorithm-driven, completely eliminating manual dependence and is the core of achieving fully automatic vertex extraction in this invention. This allows for direct connection to subsequent Suzuki contour extraction steps, providing a correct object basis for subsequent high-precision contour extraction and vertex fitting.

[0073] 6) Extract the initial edge contour point set from the competition venue instance and complete the discontinuous parts;

[0074] In step 6), the Suzuki algorithm is used to extract the initial edge contour point set of the competition venue instance, and the discontinuous parts are filled in by the smooth prediction method.

[0075] In other words, if step 5) yields a binary field instance containing only 0s and 1s, then step 6) requires applying a contour extraction algorithm (such as the Suzuki algorithm) to extract the field contour point set (but at this point, the field contour point set is merely the initial edge contour point set of the competition field instance). A smoothing prediction method is then used to complete the discontinuous parts of this point set, eliminating data defects and ensuring subsequent fitting accuracy, resulting in a rough competition field edge contour. This rough competition field edge contour already possesses the core feature of "fully reflecting the field geometry" (e.g., the 8 sides of an octagon can be distinguished through the trend of the point set), but it still has defects such as "unsharp corners and uneven edges" (e.g., right angles of an octagon are extracted as rounded corners, and straight edges are extracted as wrinkled edges). The vertex coordinates obtained using this competition field edge contour are not highly accurate and require further correction.

[0076] The core function of this step is to transform the binarized site instance into a "geometrically computable discrete contour point set," building a data bridge that can be used for fitting and providing a continuous and complete initial contour data foundation for subsequent multi-level fitting corrections.

[0077] 7) The initial edge contour point set after completion is corrected by a multi-level fitting method, and the final field edge contour vertex coordinate set is output (this coordinate set includes all edge contour vertices of the competition field).

[0078] In this step of the invention, for the rough edge contour of the competition field obtained in step 6), the centroid of the contour line point set and the polar angle of each point can be calculated and sorted according to the polar angle. Then, based on the characteristics of the point set, the index is determined, a subset is selected to fit a straight line to obtain the number of approximate vertices corresponding to the geometry of the field. Finally, based on the approximate vertices, the adjacent point set is selected to fit a straight line, and the optimized field edge contour vertex coordinate set is obtained through the intersection of the straight lines.

[0079] Specifically, in step 7), the multi-level fitting method includes:

[0080] 7-1) Calculate the geometric center (centroid) of the completed initial edge contour point set and the polar angle of each coordinate point (i.e., the angle of each coordinate point relative to the centroid), and reorder all coordinate points in the initial edge contour point set clockwise according to the polar angle to obtain the field contour point set. All coordinate points in the field contour point set are arranged clockwise in order according to the actual geometric contour of the competition field.

[0081] In other words, this invention sorts the points by centroid and polar angle, and based on the azimuth angle (polar angle) of each point relative to the centroid, rearranges the point set in a clockwise direction, so that the coordinate points in the point set strictly follow the geometric order of the site outline (e.g., the clockwise direction of "left → upper left → upper right → right → lower right → lower left → left" for an octagonal site).

[0082] 7-2) Determine the leftmost and rightmost point indices based on the x-coordinate of each coordinate point in the site outline point set, select multiple subsets of the site outline point set to fit several straight lines, and find the intersection points between the straight lines. Use these intersection points as approximate vertices of the site edge outline.

[0083] In this automatic image processing process of the present invention, each point of the site outline point set is represented by "two-dimensional pixel coordinates (x, y)", where the "horizontal coordinate" is the x-axis component of the coordinate, which corresponds to the horizontal position of the image (image coordinate systems are usually agreed to be: the x-axis increases from left to right along the horizontal direction, and the y-axis increases from top to bottom along the vertical direction).

[0084] For example, if the coordinates of a contour point are (200, 350), its x-coordinate is 200, which means that the point is located in the 200th column of pixels in the horizontal direction of the image; the "leftmost point" refers to the point with the smallest x-axis coordinate value among all contour points (leftmost in the horizontal direction), and the "rightmost point" refers to the point with the largest x-axis coordinate value (rightmost in the horizontal direction).

[0085] The site contour point set processed in step 7-2) is an ordered array (denoted as Points after further rotation) sorted clockwise by polar angle in step 7-1). Each point in the array corresponds to a unique position number, i.e., an index (e.g., the index of the first point in the array is 0, the index of the second point is 1, and so on). The indices of the leftmost and rightmost points refer to the position numbers of the leftmost and rightmost points in the ordered contour point set array.

[0086] The x-axis coordinate reflects the horizontal position of the image; the smaller the x-value, the further to the left. Therefore, the leftmost point index is the position number of the point with the smallest x-coordinate in the sorted array (for example, after finding this index, the array is rotated to place the point at index 0, ensuring the starting position of the point set is the leftmost point). In the sorted point set array, find the point with the smallest x-coordinate, i.e., the leftmost point. The "position number" of this point in the array is the "leftmost point index".

[0087] Rotating the array places the leftmost point at index 0, meaning that the index of the leftmost point is fixed at 0 after rotation. The purpose is to provide a unified starting reference for subsequent selection of a subset of points (such as Points[m:k], i.e., points from index m to k).

[0088] This invention finds the point with the largest x-coordinate in an ordered point set array, i.e., the rightmost point. The "position number" of this point in the array is the "rightmost point index". In other words, the rightmost point index is the position number of the point with the largest x-coordinate in the point set within the ordered array (denoted as R; subsequent selection of point set subsets and fitting of lines are all based on this index for positioning, ensuring that the subset focuses on the effective contour points around the rightmost point). For example, when selecting a "point set subset near the rightmost point", R is used as the reference for positioning, and Points[R+m:R+k] represents the point set subset from m indices to R+k indices to the right of the rightmost point.

[0089] It is worth noting that in step 7-2), multiple subsets of the site outline point set are selected, specifically including:

[0090] 7-2-1) Determine the effective point quantity control parameter k of the subset in the site outline point set based on the total number of points in the site outline point set and the pixel length of the target outline segment;

[0091] In this invention, the core function of "k" is to ensure that the selected subset of points contains a sufficient number of "effective points" of the site contour, avoiding deviations in straight-line fitting due to an insufficient number of points (such as local noise points affecting the overall trend). Therefore, k should be a "large positive integer". For example, taking a large value in the "hundreds" range allows the subset to cover "continuous effective points" of a certain segment of the contour. By fitting a straight line with a sufficient number of discrete points, the true direction of that segment of the contour can be more accurately reflected (reducing the impact of a single noise point on the fitting result).

[0092] In other words, the specific value of k should take into account the following points:

[0093] First, the total number of points in the site outline point set, i.e., the value of k, must match the total number of points in the initial edge outline point set after completion:

[0094] If the total number of points is large (e.g., the point set of an octagonal site outline in a 1920×1080 image contains about 2000-5000 points), k needs to be a larger value (e.g., 500-800) to ensure that the subset accounts for a reasonable proportion of the total point set (about one-fifth to one-tenth) and covers the complete direction of a certain segment of the outline;

[0095] If the total number of points is small (e.g., the contour point set in a low-resolution image contains only 500-1000 points), k needs to be reduced accordingly (e.g., 200-300) to avoid the subset covering too many overlapping areas or points that cross edges.

[0096] Second, the pixel length of the target contour segment, i.e., k, needs to match the pixel length of the contour segment to be fitted in the image:

[0097] For example, if the "upper side" of an octagonal field occupies 800 pixels in a 1920×1080 image, k needs to be around 500 (to ensure that the subset covers more than 70% of the pixels on the side) in order to fit a straight line that reflects the true direction of the side using enough discrete points; if the contour segment occupies only 300 pixels, k needs to be reduced to around 200 to avoid the subset exceeding the range of the side.

[0098] Furthermore, the balance between the accuracy requirements of the final result and real-time performance should be considered. For example, if high fitting accuracy is required (such as sub-pixel accuracy for subsequent homography matrix calculations), k should be a larger value (e.g., 600-800) to offset the influence of local noise points through the "averaging effect" of more points. If real-time processing is required (e.g., frame-by-frame analysis of competition videos at 60fps), k should be appropriately reduced (e.g., 300-400) to avoid increased fitting calculation time due to an excessive number of points (e.g., the fitting time may be twice that of k=500 when k=1000), ensuring the real-time performance of the process.

[0099] 7-2-2) Determine the edge outlier exclusion parameter m of the subset of the site outline point set based on the estimated number of outliers on the outline edge, the density of the site outline point set, and the smoothness of the outline.

[0100] In this invention, the core function of "m" is to exclude "potential outliers at both ends of the subset" (such as noise points at the contour edges or cross-edge points at contour junctions), ensuring that the subset contains only "purely valid contour points". Therefore, m should be a small value in the "single digits" range, with the aim of accurately removing a small number of outliers at both ends of the subset without losing a large number of valid points, thereby further ensuring the stability of the straight line fitting.

[0101] In other words, the specific value of m should take into account the following points:

[0102] First, the number of outliers on the edge of the competition venue outline (such as human body occlusion residues, image noise points, and outline completion connection points) is usually in the "single digits" (generally 3-10). Therefore, m needs to be a small value that matches the number of outliers (i.e., the estimated number of outliers on the outline edge).

[0103] If the image has little noise and the contour completion effect is good (about 3-5 outliers), an m of about 5 is sufficient to completely remove them; if the image has a lot of noise and the contour edges are rough (about 8-10 outliers), m can be appropriately increased to 8-10, but it should be avoided to make it too large (otherwise too many valid points will be removed).

[0104] Second, the point set density (the number of contour points per unit pixel length) determines "the actual pixel range corresponding to m points." Therefore, the specific value of m also needs to consider the density of the site contour point set:

[0105] If the point set density is high (e.g., 1 contour point per 10 pixels), when m is 5, only points within a range of 50 pixels will be removed, which will not affect the valid points. If the point set density is low (e.g., 1 contour point per 20 pixels), m needs to be reduced to 3-4 to avoid removing "valid points within a range of tens of pixels" due to m being too large, resulting in an insufficient number of valid points in the subset.

[0106] Third, the smoothness of the contour. For example, if the extracted rough contour is relatively smooth (with no obvious wrinkles at the edges) and there are few edge outliers, m can be set to 3-5; if the contour is relatively rough (such as with local protrusions or wrinkles at the edges), edge outliers may be concentrated at both ends of the subset, and m needs to be appropriately increased to 5-8 to ensure that cross-edge outliers at the wrinkles are completely removed.

[0107] 7-2-3) The effective point quantity control parameter k and the edge anomaly point exclusion parameter m are used as index range control parameters for selecting subsets in the site contour line point set. The leftmost and rightmost point indices are used as reference benchmarks for subset selection. In the site contour line point set, subsets that can be used to fit "end contour edge line", "right side contour edge line of the rightmost point", "transition contour edge line", "left and right main contour edge lines", and "multiple middle main contour edge lines" are selected respectively.

[0108] In other words, when selecting a subset of the contour line point set, this invention sets k to a value much greater than m (e.g., k is in the hundreds and m is in the single digits) to ensure that the point set used to fit the straight line contains a sufficient number of effective points of the site contour and to reduce the impact of local noise or small contour fluctuations on the fitting accuracy. At the same time, m is used to exclude abnormal edge points that may exist at both ends of the point set, further ensuring the stability and accuracy of the straight line fitting and laying the foundation for obtaining reliable site contour vertices in the future.

[0109] Finally, the point set selected in this step includes Points[-k:-m], Points[R+m:R+k], Points[R+k:-k], Points[m:k], Points[Rk:Rm], and Points[k:Rk].

[0110] For example, first calculate the centroid of the initial contour point set and the polar angle of each point, sort them clockwise according to the polar angle and determine the leftmost point (serial number 0, denoted as Points[0]) and the rightmost point (index R, denoted as Points[R]); then select Points[-k:-m] (valid point at the end of the contour) and Points[R+m:R+k] (valid point to the right of the rightmost point) to fit Line1 and Line2, and select Points[m:k] (valid point to the right of the leftmost point) and Points[Rk:Rm] (valid point to the left of the rightmost point) to fit Line4 and Line5.

[0111] Then, by using the intersection point X1 of Line1 and Line2, and combining Points[R+k:-k] (valid points near X1) to fit Line3, we obtain two approximate vertices, T1 and T2; by using the intersection point X2 of Line4 and Line5, and combining Points[k:Rk] (valid points near X2) to fit Line6, Line7, and Line8, we obtain four approximate vertices, T3, T4, T5, and T6; finally, by combining Points[0] (leftmost point) and Points[R] (rightmost point), we gather approximate vertices that match the number of sides of the site geometry (such as 8 approximate vertices of an octagon).

[0112] 7-3) Based on the approximate vertex, filter the neighboring point set, fit N straight lines (N is the number of site edges), obtain multiple optimized vertex coordinates through the intersection of each straight line, and use these optimized vertex coordinates as the vertices of the site edge contour.

[0113] In this step, the points selected include Points[n:t1], Points[t2:t3], Points[t4:t5], Points[t6:t7], Points[t8:Rn], Points[R+n:t9], Points[t10:t11], and Points[t12:-n]. Note that these point sets are all different neighboring point sets selected based on approximate vertices, and are independent subsets.

[0114] After selecting these neighboring point sets, local point set localization is performed. For each approximate vertex (such as T3 and T4), its distance to all points in Points is calculated, and the 2n closest points are selected to determine the point set index range on both sides of the approximate vertex (such as indexes t1 and t2 corresponding to T3). At this point, n is a value that ensures the subset only contains key contour points near the approximate vertex, thereby avoiding interference from irrelevant points in the refinement.

[0115] Finally, a fine-fit of the straight lines and the calculation of the final vertices are performed. Based on the above index range, eight local subsets are selected, such as Points[n:t1] (local points on the left side of T3) and Points[t2:t3] (local points between T3 and T4). Straight lines with the same number of sides as the site are fitted respectively (such as octagonal fitting of NewLine1-NewLine8). Finally, the intersection points of adjacent straight lines are calculated (such as the intersection point V1 of NewLine8 and NewLine1, and the intersection point V2 of NewLine1 and NewLine2), to obtain the optimized final set of vertex coordinates of the site edge contour (such as V1-V8).

[0116] In fact, in this invention, the competitive sports include Taekwondo, Judo, Karate, and Boxing, and the corresponding competition venues are polygonal in shape.

[0117] like Figures 4 to 8 As shown, the following is an example of extracting the vertex coordinates of the edge contour of the octagonal competition arena of Taekwondo, following the above method:

[0118] 1. Pre-determine the site outline and set up the camera equipment.

[0119] 1.1 Based on the octagonal geometry of the Taekwondo competition venue, the geometric parameters of the theoretical inner and outer contours are preset: the inner contour is a regular octagon with a side length of 1.8m, and the outer contour is a regular octagon concentric with the inner contour and with a side length 0.3m larger than the inner contour. The coordinate information of 8 vertices of the inner and outer contours is pre-calculated and stored (based on the image pixel coordinate system, the x-axis increases from left to right in the horizontal direction, and the y-axis increases from top to bottom in the vertical direction).

[0120] 1.2 The stored inner and outer contour vertex coordinate information is temporarily drawn on the display device (such as a laptop screen). The inner contour is displayed as a red line and the outer contour is displayed as a green line, forming a double contour area.

[0121] 1.3 A smartphone with a 1920×1080 resolution shooting capability was selected as the camera device and set up at a height of 1.5m outside the field. The position and shooting angle of the device were adjusted according to the double contour area on the display device to ensure that the edge of the actual competition field was completely located between the double contour area formed by the inner and outer contours, and that the entire field was included in the shooting frame.

[0122] 2. Video stream acquisition and frame extraction processing

[0123] 2.1 Configure video stream parameters: Set the mobile phone shooting resolution to 1920×1080, frame rate to 60fps, and bit rate to 10Mbps, and push the real-time video stream to the cloud server via the RTSP protocol;

[0124] 2.2 The cloud server decodes the received video stream using a video decoder, extracts video frames at preset time intervals (0.2 seconds / frame), and encodes the extracted images into RGB format for subsequent processing.

[0125] 3. Elimination of interference caused by human body obstruction

[0126] 3.1 Select the first RGB format image obtained by extracting frames from the video stream as the initial "base image";

[0127] 3.2 The YOLOv12 model is used to detect human targets in the base image. The model is trained based on the COCO open source dataset and a dataset of 5,000 self-annotated Taekwondo competition scene images. The model input size is set to 640×640. Detection results with confidence scores below 0.6 are filtered out, and only high-confidence human target detection boxes are retained.

[0128] 3.3 Determine whether there is an intersection between the human target detection box and the preset outer contour based on the cross product method: Calculate the positional relationship between the four vertices of the human target detection box and each side of the outer contour. If any vertex is located inside the outer contour, it is determined that there is an intersection.

[0129] 3.4 If an intersection exists, set the pixel values ​​of the intersection region in the base image to -1, and keep the pixel values ​​of the other regions unchanged; if no intersection exists, proceed directly to the next step.

[0130] 3.5 Continue to extract subsequent video frames and repeat the detection and judgment process in steps 2-3. If there is no human target in the region of the corresponding base image pixel value of -1 in the new video frame (i.e. the pixel value of the region is not -1), then replace the -1 pixel value in the base image with the pixel value of that position in the new video frame.

[0131] 3.6 Repeat step 3.5 until the base image no longer contains areas with a pixel value of -1, thus obtaining a base image without human occlusion.

[0132] 4. Competition Venue Instance Segmentation and Recognition

[0133] 4.1 The SAM-2 model is used to perform general instance segmentation on the base image without human occlusion, extract all instance targets in the image (including the venue, surrounding equipment, etc.), and output the mask and pixel coordinate range of each instance.

[0134] 4.2 Filtering competition venue instances based on preset inner and outer contour vertex region constraints: Verify each segmented instance one by one. When an instance satisfies "the coordinates of all 8 vertices of the inner contour are within the mask range of the instance, and the coordinates of all 8 vertices of the outer contour are outside the mask range of the instance", the instance is determined to be the target competition venue instance. The output is a binary image containing only 0 and 1, where 1 corresponds to the venue area and 0 corresponds to the non-venue area.

[0135] 4.3 If a balance between processing speed and accuracy is required in practical applications, FastSAM or MobileSAM models can be used for instance segmentation. After segmentation, site instances should still be selected according to the above constraints.

[0136] 5. Initial edge contour point set extraction and completion

[0137] 5.1 The Suzuki algorithm is used to extract the contours of the binarized field instance image to obtain a rough set of points representing the edge contours of the competition field. This set of points contains the discrete pixel coordinates of the field edge.

[0138] 5.2 Since the rough outline may have local discontinuities, a smooth prediction method (based on the coordinate trend interpolation of adjacent pixels) is used to complete the discontinuous parts of the outline point set, so as to obtain a complete initial edge outline point set.

[0139] 6. Multi-level fitting correction and vertex coordinate output

[0140] 6.1 Sorting of Contour Point Sets

[0141] Calculate the coordinates of the geometric center (centroid) of the initial edge contour point set after completion. Calculate the polar angle of each coordinate point relative to the centroid using the polar angle calculation formula (with the centroid as the pole and the positive x-axis as the polar axis). Sort all coordinate points clockwise according to the polar angle to obtain an ordered set of site contour points.

[0142] 6.2 Determine the reference point index

[0143] In this embodiment, based on the image abscissa of the coordinate points (x-axis coordinate, horizontal position, the smaller the x value, the more to the left, and the larger the x value, the more to the right), the indices of two key reference points (the leftmost point index and the rightmost point index) are determined as the positioning reference for subsequent subset selection.

[0144] 6.2.1 Traverse the ordered set of points along the site outline, select the point with the smallest x-coordinate (leftmost point), rotate the point set array so that the leftmost point is fixed at position 0 of the point set array, and denote the rotated ordered set of points as Points. Points is a set of discrete coordinate points of the site outline arranged in clockwise order. Each point contains two-dimensional pixel coordinates (x, y), and the arrangement order of the points strictly follows the rule of "distributed clockwise around the site center" (e.g., the points of an octagonal site are arranged in the order of "left → top left → top right → right → bottom right → bottom left").

[0145] 6.2.2 Traverse the Points set, select the point with the largest x-coordinate (the rightmost point), and record its position index in the Points array, denoted as R, as the index of the rightmost point.

[0146] 6.3 Select a subset of points and fit a straight line to obtain approximate vertices

[0147] 6.3.1 Set the index range control parameters for the subset of points: Based on the total number of points in the site outline point set (approximately 3000) and the pixel length of the target outline segment (approximately 200 pixels), determine the effective point quantity control parameter k=500; based on the estimated number of outlier points on the outline edge (approximately 5), the point set density (1 outline point per 10 pixels), and the smoothness of the outline, determine the edge outlier point exclusion parameter m=5, satisfying the constraint condition k>>m (i.e., k is much greater than m).

[0148] It is worth noting that "k>>m" in this embodiment is a commonly used symbol in the fields of mathematics and engineering. Its core meaning is "the value of k is much greater than the value of m", emphasizing that there is a significant difference between the two in terms of order of magnitude or specific value, rather than a simple "greater than" relationship.

[0149] After the values ​​of k and m are determined, subsets are selected in the following manner:

[0150] (1) For the end region of the site contour in Points, select a subset for fitting the "end contour edge line":

[0151] In the index segment at the end of the ordered point set Points (stored as an array in the computer) (i.e., from the kth point to the mth point from the end of the array), obtain the continuous valid points at the end of the contour. Use -m to remove the last m possible abnormal points at the end of the array (such as residual noise points after contour completion, and cross-edge points for edge connection). Use k to select a sufficient number (approximately km) of valid points as the subset Points[-k:-m] at the end of the contour.

[0152] (2) For the region to the right of the rightmost point (index R) in Points, select a subset to fit the "straight line of the contour edge to the right of the rightmost point":

[0153] Using the rightmost point index R as the benchmark, select the index segment from “R+m” to “R+k” of the ordered point set Points (i.e., the m-th point to the k-th point to the right of the rightmost point), obtain the continuous valid points to the right of the rightmost point, and remove the first m possible local fluctuation points near the rightmost point (such as contour wrinkle points around the rightmost point) through “R+m”, and ensure that a sufficient number of valid points are selected through k, as the rightmost point right-side subset Points[R+m:R+k], which is used to reflect the true direction of the contour edge to the right of the rightmost point.

[0154] (3) For the transition region between the rightmost point in Points and the end of the contour, select a subset for fitting the "transition contour edge line":

[0155] Using the rightmost point index R and the end of the contour as a reference, the index segment from "R+k" to "-k" of the ordered point set Points (i.e., the kth point to the right of the rightmost point to the kth point from the end of the array) is selected to obtain continuous valid points in the transition region, which are used as the transition subset Points[R+k:-k] between the rightmost point and the end. This region has no edge outliers (no need for m to remove them). In this embodiment, k is used to obtain a complete contour segment that can cover the transition region, which is used to support the subsequent need to derive approximate vertices based on the intersection of straight lines.

[0156] (4) For the region to the right of the leftmost point in Points, select a subset to fit the "left main contour line":

[0157] Using the leftmost point index 0 as the baseline, select the index segment from “m” to “k” of the ordered point set Points (i.e., the m-th point to the k-th point to the right of the leftmost point), obtain the continuous valid points to the right of the leftmost point, remove the first m abnormal points near the leftmost point through “m”, and obtain a sufficient number of valid points through k, as the right subset Points[m:k] of the leftmost point, which is used to reflect the direction of the main contour edge to the right of the leftmost point.

[0158] (5) For the region to the left of the rightmost point in Points, select a subset for fitting the "right and right main contour lines":

[0159] Using the rightmost point index R as the reference, select the index segment from “Rk” to “Rm” of the ordered point set Points (i.e., the kth point to the mth point to the left of the rightmost point), obtain the continuous valid points to the left of the rightmost point, remove the m abnormal points near the rightmost point through “Rm”, and obtain a sufficient number of valid points through k, as the subset Points[Rk:Rm] to the left of the rightmost point, which is used to reflect the direction of the main contour edge to the left of the rightmost point.

[0160] (6) For the main area in the middle of the site contour in Points (from k points to the right of the leftmost point to k points to the left of the rightmost point), select a subset to fit the "straight lines of the middle main contour edges":

[0161] Using the leftmost point index 0 and the rightmost point index R as a reference, the index segment from “k” to “Rk” of the ordered point set Points is selected to obtain continuous valid points in the middle main region, which are used as the subset Points[k:Rk] of the middle main contour area. Since this region is the core segment of the site contour (such as the upper and lower main edges of an octagon) and has no edge outliers (no need for m to remove), this embodiment ensures that the subset covers the complete middle main contour segment through k, which is used to support subsequent multi-segment straight line fitting and approximate vertex derivation.

[0162] 6.3.2 Select a subset of points and fit a straight line (k=500, m=5):

[0163] (1) Select Points[-500:-5] (pixels indexed from -500 to -5 at the end of the point set), and fit the line Line1, i.e. the end contour edge line, based on this subset using the least squares method. The corresponding contour region includes the end of the point set → the end edge of the field.

[0164] In other words, the subset Points[-500:-5] is the last region of the ordered point set Points (from the 500th point to the 5th point from the end), corresponding to the "end edge segment" of the site contour. The straight line Line1 is used to capture the direction of the end contour.

[0165] (2) Select Points[R+5:R+500] (the pixels from R+5 to R+500 to the right of the rightmost point index R), fit the line Line2, which is the outline line to the right of the rightmost point, and the corresponding outline area includes the right side of the rightmost point → the right edge of the rightmost point;

[0166] In other words, the subset Points[R+5:R+500] is a series of points to the right of the rightmost point in the ordered point set Points (the 500th point to the right of the rightmost point), specifically capturing the direction of the outline edge to the right of the rightmost point.

[0167] (3) Select Points[R+500:-500] (the pixel index from 500 to the right of the rightmost point to -500 at the end of the point set), fit the line Line3, which is the transition contour line, and the corresponding contour area includes the transition area between the right side of the rightmost point and the end.

[0168] In other words, the subset Points[R+500:-500] is the transition region from the rightmost 500 points to the left of the rightmost point in the ordered point set Points to the -500 points at the end of the point set. It is used to connect the "rightmost point's right contour edge" and the "end contour edge", and undertakes the function of transition and connection.

[0169] (4) Select Points[5:500] (pixels indexed from 5 to 500 to the right of the leftmost point), fit the straight line Line4, which is the straight line of the main outline on both sides of the left, and the corresponding outline area includes the right side of the leftmost point → the left main edge;

[0170] In other words, the subset Points[5:500] is the continuous points to the right of the leftmost point of the ordered point set Points (the 5th to the 500th point to the right of the leftmost point), corresponding to the core main outline edge on the left side of the site.

[0171] (5) Select Points[R-500:R-5] (the pixels indexed from R-500 to R-5 to the left of the rightmost point), fit the line Line5, which is the main outline line on both sides of the right, and the corresponding outline area includes the main edge to the right of the left of the rightmost point;

[0172] In other words, the subset Points[R-500:R-5] consists of consecutive points to the left of the rightmost point in the ordered point set Points (points 500 to 5 to the left of the rightmost point), corresponding to the core main outline edge on the right side of the site.

[0173] ⑹ Select Points[500:R-500] (the pixel index from 500 to the right of the leftmost point to R-500 to the left of the rightmost point), and fit the lines Line6, Line7, and Line8 respectively. The corresponding contour area includes the central core area → the central main edge.

[0174] The subset Points[500:R-500] is the central core region from the 500 points to the right of the leftmost point to the 500 points to the left of the rightmost point. It is the main component of the site outline (i.e., the central core region of the site) and is used to fit the main outline edge of the central segment. If we consider line 6 as the central multi-segment main outline edge line, then line 7 should belong to the subdivision fitting line of the central multi-segment main outline edge line, used to further refine the direction of the central main outline. Line 8 is from the same origin as lines 6 and 7, and also belongs to the category of central multi-segment main outline edge lines, used to complete the complete fitting of the central multi-segment main outline edge.

[0175] 6.3.3 Calculate the intersection of lines to obtain an approximate vertex:

[0176] (1) Calculate the intersection of Line 1 and Line 3, and denote it as T1;

[0177] (2) Calculate the intersection of Line 2 and Line 3, and denote it as T2;

[0178] (3) Calculate the intersection of Line 4 and Line 7, and denote it as T3;

[0179] (4) Calculate the intersection of Line 6 and Line 7, and denote it as T4;

[0180] (5) Calculate the intersection of Line 6 and Line 8, and denote it as T5;

[0181] (6) Calculate the intersection of Line 5 and Line 8, and denote it as T6;

[0182] Combining Points[0] (leftmost point) and Points[R] (rightmost point), we obtain 8 approximate vertices arranged in clockwise order: Points[0], T3, T4, T5, T6, Points[R], T2, T1.

[0183] 6.4 Optimization and fitting yield the final vertex coordinates

[0184] 6.4.1 Using the Euclidean distance formula, the distances between T3, T4, T5, T6, T2, T1 and all points in the Points point set are calculated through matrix operations;

[0185] 6.4.2 For each approximate vertex, select the 2n points in Points that are closest to it.

[0186] For example, obtain the 2n points in Points that are closest to T3, and denote the point with the smallest index as P_t1 and the point with the largest index as Pt_2, where ti is the index of P_ti in Points, for example, t1 is the index of P_t1 in Points;

[0187] In this embodiment, when n=10, the 20 points closest to T3 in Points are obtained, and the point with the smallest index P_t1 and the point with the largest index P_t2 are recorded. Similarly, the index boundaries corresponding to the 20 points closest to T4, T5, T6, T2, and T1 are obtained respectively.

[0188] (1) Obtain the 20 points in Points that are closest to T4, and denote the point with the smallest index as P_t3 and the point with the largest index as Pt_4;

[0189] (2) Obtain the 20 points in Points that are closest to T5, and denote the point with the smallest index as P_t5 and the point with the largest index as Pt_6;

[0190] (3) Obtain the 20 points in Points that are closest to T6, and denote the point with the smallest index as P_t7 and the point with the largest index as Pt_8;

[0191] (4) Obtain the 20 points in Points that are closest to T2, and denote the point with the smallest index as P_t9 and the point with the largest index as Pt_10;

[0192] (5) Obtain the 20 points in Points that are closest to T1, and denote the point with the smallest index as P_t11 and the point with the largest index as Pt_12.

[0193] 6.4.3 Selecting a subset of points based on index boundaries and fitting a straight line:

[0194] (1) Fit the straight line NewLine1 based on Points[10:t1];

[0195] (2) Fit the straight line NewLine2 based on Points[t2:t3];

[0196] (3) Fit the straight line NewLine3 based on Points[t4:t5];

[0197] (4) Fit the straight line NewLine4 based on Points[t6:t7];

[0198] (5) Fit the straight line NewLine5 based on Points[t8:R-10];

[0199] (6) Fit the straight line NewLine6 based on Points[R+10:t9];

[0200] (7) Fit the straight line NewLine7 based on Points[t10:t11];

[0201] (8) Fit the straight line NewLine8 based on Points[t12:-10].

[0202] 6.4.4 Calculate the intersection points of adjacent lines to obtain the coordinates of 8 optimized vertices, i.e.

[0203] (1) The intersection point V1 of NewLine8 and NewLine1;

[0204] (2) The intersection point V2 of NewLine1 and NewLine2;

[0205] (3) The intersection point V3 of NewLine2 and NewLine3;

[0206] (4) The intersection point V4 of NewLine3 and NewLine4;

[0207] (5) The intersection point V5 of NewLine4 and NewLine5;

[0208] ⑹ The intersection point V6 of NewLine5 and NewLine6;

[0209] (7) The intersection point V7 of NewLine6 and NewLine7;

[0210] (8) The intersection of NewLine7 and NewLine8, V8.

[0211] In this embodiment, the vertex coordinates V1 to V8 are the final vertex coordinate set of the edge contour (octagon) of the Taekwondo competition venue. This coordinate set can be directly used to construct the homography matrix, supporting the subsequent perspective transformation to convert the tilted view into an overhead view.

[0212] In summary, this embodiment achieves fully automated extraction of the coordinates of eight vertices of the Taekwondo competition venue's edge contour through the aforementioned steps, without requiring manual intervention. Furthermore, experimental verification shows that the total time from acquiring vertex output from the video stream using this method is no more than 0.5 seconds, and the accuracy error of the extracted vertex coordinates is no more than 2 pixels. This not only fully meets the requirements of real-time processing but also ensures the accuracy of subsequent homography matrix construction, thereby guaranteeing the clarity and stability of the overhead view after perspective transformation. This effectively supports downstream video analysis tasks such as analyzing athletes' offensive and defensive movement trajectories.

[0213] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications made to the present invention by those skilled in the art without departing from the spirit of the present invention shall fall within the protection scope of the present invention.

Claims

1. A method for extracting vertices of the edge contour of a competition field in competitive sports, characterized in that, Includes the following steps: 1) Based on the regular geometric shape of the competition venue for competitive sports, the theoretical inner and outer contours of the venue are preset, and the double contour area formed by the inner and outer contours is drawn on the display device. 2) Set up the camera equipment and adjust its position and angle according to the drawn double outline area to ensure that the actual edge of the competition field is located between the double outline areas; 3) After acquiring the real-time video stream of the competition venue, extract frames at preset time intervals and encode the extracted images into a preset color format; 4) By eliminating human targets from multiple video frames, a basic image without human occlusion is obtained; 5) Use a general instance segmentation model to segment the base image, and combine the inner and outer contour vertex region constraints to filter out the competition venue instances; 6) Extract the initial edge contour point set from the competition venue instance and complete the discontinuous parts; 7) The initial edge contour point set after completion is corrected by a multi-level fitting method, and the coordinate set of the vertex of the site edge contour is output.

2. The method for extracting the vertex contour of the competition venue edge according to claim 1, characterized in that, In step 4), human target interference is eliminated based on multiple frames of video footage to obtain a basic image without human occlusion, including: Using the first frame of the video stream as the base image, a target detection model is used to detect human targets in the image. The cross product method is used to determine whether there is an intersection between the human target and the preset outer contour. The areas with intersection are marked. Then, the unmarked area pixels in the corresponding position in the subsequent frame images are used to replace the marked area pixels in the base image. The above process is repeated until there are no human occlusion marks in the base image, resulting in an image without human occlusion, which is used as the base image without human occlusion.

3. The method for extracting the vertex contour of the competition venue edge according to claim 2, characterized in that, The target detection model is the YOLOv12 model, with an input size of 640×640, and filters out detection results with a confidence level lower than 0.

6.

4. The method for extracting vertices of the edge contour of a competition venue according to claim 3, characterized in that, The YOLOv12 model was trained on an open-source dataset and a self-annotated competition image dataset.

5. The method for extracting the vertex contour of the competition venue edge according to claim 1, characterized in that, In step 5), the general instance segmentation model is SAM-2, FastSAM, or MobileSAM model.

6. The method for extracting the vertex contour of the competition venue edge according to claim 1, characterized in that, In step 6), the Suzuki algorithm is used to extract the initial edge contour point set of the competition venue instance, and the discontinuous parts are completed by smooth prediction.

7. The method for extracting vertices of the edge contour of a competition venue according to claim 1, characterized in that, In step 7), the multi-level fitting method includes: 7-1) Calculate the geometric center of the completed initial edge contour point set and the polar angle of each coordinate point, and reorder all coordinate points in the initial edge contour point set clockwise according to the polar angle to obtain the site contour point set; 7-2) Determine the leftmost and rightmost point indices based on the x-coordinate of each coordinate point in the site outline point set, select multiple subsets of the site outline point set to fit several straight lines, and find the intersection points between the straight lines. Use these intersection points as approximate vertices of the site edge outline. 7-3) Based on the approximate vertex selection of the neighboring point set, multiple straight lines are fitted according to the number of site edges. Multiple optimized vertex coordinates are obtained through the intersection of each straight line, and these optimized vertex coordinates are used as the vertices of the site edge contour.

8. The method for extracting vertices of the edge contour of a competition venue according to claim 7, characterized in that, In step 7-2), multiple subsets of the site outline point set are selected, specifically including: 7-2-1) Determine the effective point quantity control parameter k of the subset in the site outline point set based on the total number of points in the site outline point set and the pixel length of the target outline segment; 7-2-2) Determine the edge outlier exclusion parameter m of the subset of the site outline point set based on the estimated number of outliers on the outline edge, the density of the site outline point set, and the smoothness of the outline. 7-2-3) The effective point quantity control parameter k and the edge outlier point exclusion parameter m are used as the index range control parameters for selecting subsets in the site contour line point set. The leftmost and rightmost point indices are used as reference benchmarks for subset selection. In the site contour line point set, subsets that can be used to fit the "end contour edge line", "right side contour edge line", "transition contour edge line", "left and right main contour edge lines", and "multiple middle main contour edge lines" are selected respectively.

9. The method for extracting vertices of the edge contour of a competition venue according to claim 1, characterized in that, The competitive sports include Taekwondo, Judo, Karate, and Boxing, and the corresponding competition venues are polygonal in shape.

10. The method for extracting the vertex contour of the competition venue edge according to claim 1, characterized in that, In step 5), the criteria for selecting the competition venue instance are: all vertex coordinates of the inner contour are located within the instance, and all vertex coordinates of the outer contour are located outside the instance, based on the constraints of the inner and outer contour vertex regions.

Citation Information

Patent Citations

  • Dynamic-view-angle aerial view real-time generation method for sports event site condition

    CN118154728A

  • Method and system for generating match condition top view based on multi-camera information fusion

    CN119963966A