Playground linear runway calibration method, device and equipment based on visual technology and medium
By arranging markers and cameras on the linear runway of the playground, using visual technology and least squares algorithms to calculate the precise coordinate sequence of the runway line, the problems of low efficiency, low accuracy and high cost of traditional manual calibration methods are solved, and efficient and accurate automatic calibration is achieved.
Patent Information
- Application Number
- CN202411630708.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-15
AI Technical Summary
The traditional manual calibration method is inefficient, low accuracy and high cost during the track calibration process, making it difficult to meet the needs of large-scale competitions.
The method of linear runway calibration in the playground based on vision technology is used, and the precise coordinate sequence of the runway line is calculated by arranging markers and cameras on the runway, and image object detection technology and least squares fitting algorithm are used.
It significantly improves calibration efficiency and accuracy, reduces labor costs, realizes automated calibration, and reduces manual intervention.
Smart Images

Figure CN119540353A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communication, and in particular to a method, device, equipment and medium for calibrating a playground straight track based on vision technology. Background Art
[0002] AI visual timing technology has been widely used in top events. For example, in sprint events, the technology can record key data such as the athlete's starting reaction time, mid-run speed, and sprint time. These data provide coaches with valuable training references to help them better formulate and adjust training plans. At the same time, the audience can also understand the athlete's competition situation and performance ranking in real time through the big screen.
[0003] Therefore, in short-distance races such as 50 meters or 100 meters in track and field sports, it is crucial to accurately calibrate the track lines and lanes when using AI visual timing technology. This calibration information can be used to detect whether athletes have false starts, crossed the line, or accurately determine the time of arrival at the finish line. However, the traditional calibration process relies on manual operation. Staff members watch the images captured by the camera through handheld devices (such as PADs) and manually mark the coordinate points of the track lines; this process is time-consuming and error-prone, and the calibration results of different personnel may also vary.
[0004] The existing manual calibration method has the following shortcomings: First, the efficiency is low and the manual calibration process is time-consuming, which is difficult to meet the needs of large-scale competitions; second, the accuracy is not high, and human subjective factors will lead to inconsistency in the calibration results, affecting the accuracy of subsequent data analysis; third, the cost is high: professional personnel are required to operate, which increases labor costs. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a method, device, equipment and medium for calibrating a straight runway on a playground based on vision technology, arrange markers at key positions of the runway, detect and identify the markers using image target detection technology, and then calculate the precise runway line coordinate sequence through an algorithm, thereby solving the problems of low efficiency, low precision and high cost in the traditional manual calibration process.
[0006] In a first aspect, the present invention provides a method for calibrating a playground straight track based on visual technology, comprising:
[0007] Step 1: Place markers and cameras on the runway. The camera takes real-time video of the entire runway and captures the video stream.
[0008] Step 2: Preprocess the video and detect the position of the marker;
[0009] Step 3: Use the trained target detection algorithm model to detect and locate the marker in the video image in real time, and obtain the coordinates (x, y) of the marker, which are recorded as (x1, y1), (x2, y2), ..., (x n ,y n ), n is a positive integer;
[0010] Step 4: Calculate the runway line coordinate sequence based on the detected marker positions;
[0011] The method for calculating the runway line coordinate sequence is specifically as follows: using the least squares method to fit the straight line equation of the runway line, and improving the fitting accuracy through an iterative optimization algorithm;
[0012] The least square method is as follows: for the marker coordinates, a straight line equation is fitted; an error function of the vertical distance from the marker coordinates to the fitted straight line is defined, and the optimal straight line equation parameters of the runway line are fitted;
[0013] The iterative optimization algorithm is as follows: using the least squares method to preliminarily fit the straight line equation; performing residual calculation, that is, calculating the distance of each coordinate point relative to the straight line equation, and removing abnormal points, that is, setting a convergence threshold according to the residual value, and removing abnormal points whose residual values are greater than the convergence threshold; refitting the coordinate points after removing the abnormal points using the least squares method to obtain a refitted straight line equation;
[0014] Repeat the residual calculation, outlier elimination and refitting, set an upper limit of the number of iterations, and terminate the iterative optimization algorithm when the residual change of the refitted straight line is less than the set convergence threshold within the upper limit of the number of iterations, or terminate the iterative optimization algorithm when the set upper limit of the number of iterations is reached.
[0015] Furthermore, the markers and cameras are arranged on the runway, specifically: a triangular cone is placed as a marker at the required calibration point, and a camera is placed in front of the middle of the runway. When shooting, the camera looks down from top to bottom, and moves the camera back and forth on the runway to capture all the runways to be captured, and the runway occupies the largest part of the captured image.
[0016] Furthermore, the step 4 is specifically as follows:
[0017] The least square method is specifically as follows: for the marker coordinates (x, y), a straight line equation y=ax+b is fitted, where a is the slope and b is the intercept.
[0018] Define the error function, for each marker coordinate (x i ,y i ), the error is defined as the vertical distance from the point to the fitted line, i is any positive integer from 1 to n:
[0019] ∈ i =y i -(ax i +b)
[0020] The total error is expressed as: Find a set of a that minimizes the total error E(a, b) n and b n After that, to a n and b n Take the derivatives and make them equal to 0, and we get the linear equation system:
[0021]
[0022] Solve these two equations and fit the optimal straight line equation parameters a0 and b0 of the runway line:
[0023]
[0024] The iterative optimization algorithm is specifically:
[0025] The least square method is used to preliminarily fit the linear equation y=a0x+b0; residual calculation is performed, that is, the distance of each coordinate point relative to the linear equation is calculated. Assume that the coordinates of each marker (x i ,y i ) is:
[0026] r i =|y i -(a0x i +b0)|
[0027] Perform outlier elimination, that is, set a convergence threshold according to the residual value, and eliminate outliers whose residual values are greater than the convergence threshold;
[0028] The coordinate points after the outliers are removed are refitted using the least square method to obtain a refitted straight line equation y=a1x+b1;
[0029] Repeat the residual calculation, outlier elimination and refitting, set an upper limit of the number of iterations, and terminate the iterative optimization algorithm when the residual change of the refitted straight line is less than the set convergence threshold within the upper limit of the number of iterations, or terminate the iterative optimization algorithm when the set upper limit of the number of iterations is reached.
[0030] Furthermore, it also includes step 5 and step 6;
[0031] The step 5 is specifically as follows: mapping the runway line coordinate sequence to the user terminal, the user terminal can display the real-time image of the camera, and display the video stream captured by the camera. After the coordinate sequence is calculated, the picture corresponding to each coordinate is mapped to the user terminal in the form of a video stream, and the user can confirm the coordinate sequence through the user terminal, or adjust the coordinate sequence;
[0032] The step 6 specifically includes: sending the determined coordinate sequence to the business processing system.
[0033] In a second aspect, the present invention provides a device for calibrating a straight track of a playground based on visual technology, comprising:
[0034] Image acquisition module, image processing module, target detection module, coordinate calculation module;
[0035] Image acquisition module: markers and cameras are placed on the runway. The camera takes real-time video of the entire runway and captures the video stream.
[0036] Image processing module: pre-process the video and detect the position of the marker;
[0037] Target detection module: uses a trained target detection algorithm model for identifying markers to detect and locate markers in the video image in real time through the target detection algorithm model to obtain the marker coordinates (x, y), which are recorded as (x1, y1), (x2, y2), ..., (x n ,y n ), n is a positive integer;
[0038] Coordinate calculation module: calculates the runway line coordinate sequence based on the detected marker positions;
[0039] The method for calculating the runway line coordinate sequence is specifically as follows: using the least squares method to fit the straight line equation of the runway line and combining iterative optimization algorithm for calculation;
[0040] The least square method is as follows: for the marker coordinates, a straight line equation is fitted; an error function of the vertical distance from the marker coordinates to the fitted straight line is defined, and the optimal straight line equation parameters of the runway line are fitted;
[0041] The iterative optimization algorithm is as follows: using the least squares method to preliminarily fit the straight line equation; performing residual calculation, that is, calculating the distance of each coordinate point relative to the straight line equation, and removing abnormal points, that is, setting a convergence threshold according to the residual value, and removing abnormal points whose residual values are greater than the convergence threshold; refitting the coordinate points after removing the abnormal points using the least squares method to obtain a refitted straight line equation;
[0042] Repeat the residual calculation, outlier elimination and refitting, set an upper limit of the number of iterations, and terminate the iterative optimization algorithm when the residual change of the refitted straight line is less than the set convergence threshold within the upper limit of the number of iterations, or terminate the iterative optimization algorithm when the set upper limit of the number of iterations is reached.
[0043] Furthermore, the markers and cameras are arranged on the runway, specifically: a triangular cone is placed as a marker at the required calibration point, and a camera is placed in front of the middle of the runway. When shooting, the camera looks down from top to bottom, and moves the camera back and forth on the runway to capture all the runways to be captured, and the runway occupies the largest part of the captured image.
[0044] Furthermore, the coordinate calculation module is specifically:
[0045] The least square method is specifically as follows: for the marker coordinates (x, y), a straight line equation y=ax+b is fitted, where a is the slope and b is the intercept.
[0046] Define the error function, for each marker coordinate (x i ,y i ), the error is defined as the vertical distance from the point to the fitted line, i is any positive integer from 1 to n:
[0047] ∈ i =y i -(ax i +b)
[0048] The total error is expressed as: Find a set of a that minimizes the total error E(a, b) n and b n After that, to a n and b n Take the derivatives and make them equal to 0, and we get the linear equation system:
[0049]
[0050] Solve these two equations and fit the optimal straight line equation parameters a0 and b0 of the runway line:
[0051]
[0052] The iterative optimization algorithm is specifically:
[0053] The least square method is used to preliminarily fit the linear equation y=a0x+b0; residual calculation is performed, that is, the distance of each coordinate point relative to the linear equation is calculated. Assume that the coordinates of each marker (x i ,y i ) is:
[0054] ri =|y i -(a0x i +b0)|
[0055] Perform outlier elimination, that is, set a convergence threshold according to the residual value, and eliminate outliers whose residual values are greater than the convergence threshold;
[0056] The coordinate points after the outliers are removed are refitted using the least square method to obtain a refitted straight line equation y=a1x+b1;
[0057] Repeat the residual calculation, outlier elimination and refitting, set an upper limit of the number of iterations, and terminate the iterative optimization algorithm when the residual change of the refitted straight line is less than the set convergence threshold within the upper limit of the number of iterations, or terminate the iterative optimization algorithm when the set upper limit of the number of iterations is reached.
[0058] Furthermore, it also includes a user interface module and a data transmission module;
[0059] The user interface module specifically maps the runway line coordinate sequence to the user terminal, which can display the real-time camera image and the video stream captured by the camera. After the coordinate sequence is calculated, the image corresponding to each coordinate is mapped to the user terminal in the form of a video stream, and the user can confirm the coordinate sequence or adjust the coordinate sequence through the user terminal;
[0060] The data transmission module specifically sends the determined coordinate sequence to the business processing system.
[0061] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect when executing the program.
[0062] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0063] One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
[0064] The embodiments of the present application provide a method, device, equipment and medium for calibrating a straight runway on a playground based on vision technology. Computer vision technology is introduced to set specific visual markers on the runway, and these markers are detected and identified using computer vision technology. In combination with image processing and computer graphics algorithms, accurate and automatic calibration of the runway line is achieved, which significantly improves the calibration efficiency and accuracy and reduces labor costs.
[0065] The present invention adopts high-precision image target detection technology and intelligent coordinate calculation algorithm to ensure accurate identification of markers and quickly calculate the runway line coordinate sequence based on the marker positions; the user-friendly interface design facilitates users to confirm and fine-tune coordinate points; the present invention also has real-time data transmission capabilities to ensure that the calibration results can be applied to business processing in a timely manner.
[0066] The present invention arranges identifiable image markers at key positions of the runway, uses image target detection technology to automatically detect and identify these markers, and then calculates the precise runway line coordinate sequence through an algorithm. Finally, the calculation results are mapped to the user interface for user confirmation or fine-tuning, ultimately achieving fast and accurate runway line calibration.
[0067] The present invention adopts the least squares method to fit the straight line equation of the runway line, and improves the fitting accuracy through an iterative optimization algorithm. Through this iterative optimization process, the influence of noise points can be significantly reduced, thereby improving the accuracy of straight line fitting. Especially when the camera angle is not ideal or the marker arrangement is not completely accurate, the iterative optimization algorithm can effectively improve the final calibration accuracy.
[0068] After adopting the technical solution of the present invention, first, efficiency can be improved: automated calibration greatly improves work efficiency and reduces manual intervention; second, accuracy can be improved: compared with manual calibration, the calibration accuracy of the present invention is higher and the error is smaller; third, reliability can be improved: the present invention has strong robustness and can adapt to complex and changeable outdoor environments; fourth, user experience can be improved: the user-friendly interface design makes the calibration process more convenient and efficient; fifth, cost can be reduced: manual calibration requires professional personnel to operate, and the technical solution of the present invention saves the labor cost during calibration. Experimental results show that compared with the traditional manual calibration method, the present invention shortens the calibration time by 80% and improves the calibration accuracy by 50%.
[0069] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.
[0071] Figure 1 is a flow chart of the method of the present invention;
[0072] Figure 2 It is a structural schematic diagram of the device of the present invention;
[0073] Figure 3This is a structural diagram of embodiment 5 of the present invention. DETAILED DESCRIPTION
[0074] The embodiments of the present application solve the problems of low efficiency, low precision and high cost in the traditional manual calibration process by providing a method, device, equipment and medium for calibrating a playground straight track based on vision technology.
[0075] Embodiment 1
[0076] like Figure 1 As shown in the figure, the method of calibrating the straight track of the playground based on visual technology:
[0077] Step 1: Place markers and cameras on the runway. The camera takes real-time video of the entire runway and captures the video stream.
[0078] The markers and cameras are arranged on the runway, specifically: a triangular cone is placed as a marker at the required calibration point, and a camera is placed 3 meters high in front of the middle of the runway to capture the real-time video stream of the playground runway;
[0079] When shooting, the camera looks down from above and moves forward and backward on the runway to capture all the runways to be captured, and the runway occupies the largest part of the screen;
[0080] Step 2: Preprocess the video and detect the position of the marker;
[0081] The video preprocessing specifically includes performing denoising, enhancement, geometric correction and other preprocessing on the collected video images to improve the image quality;
[0082] Step 3: Place a marker (triangular pyramid) at the required calibration point, train a target detection algorithm model to identify the marker (triangular pyramid), and use the target detection algorithm model to detect and locate the marker in the video image in real time to obtain the marker coordinates, which are recorded as (x1, y1), (x2, y2), ..., (x n ,y n );
[0083] The target detection is performed using the YOLOv5 algorithm, which has the characteristics of fast detection speed and high accuracy;
[0084] Step 4: Calculate the runway line coordinate sequence based on the detected marker positions;
[0085] The method for calculating the runway line coordinate sequence is specifically to use the least squares method to fit the straight line equation of the runway line and to perform calculations in conjunction with an iterative optimization algorithm;
[0086] The least square method is specifically to fit a straight line equation y=ax+b for the marker coordinates (x, y), where a is the slope and b is the intercept.
[0087] Define the error function, for each marker coordinate (x i ,y i ), the error is defined as the vertical distance from the point to the fitted line, i is any positive integer from 1 to n:
[0088] ∈ i =y i -(ax i +b)
[0089] The total error is expressed as:
[0090] After finding a set of a and b that minimizes the total error E(a, b), n and b n Take the derivatives and make them equal to 0, and we get the linear equation system:
[0091] Solve these two equations and fit the optimal straight line equation parameters a0 and b0 of the runway line:
[0092]
[0093] The iterative optimization algorithm is specifically:
[0094] The least square method is used to preliminarily fit the straight line equation y=a0x+b0; residual calculation is performed, that is, the distance of each coordinate point relative to the straight line equation is calculated, and each coordinate point (x i ,y i ) is:
[0095] r i =|y i -(a0x i +b0)|
[0096] The residual represents the degree of deviation of each marker point from the fitted straight line;
[0097] Perform outlier elimination, that is, set a convergence threshold according to the residual value, and eliminate outliers whose residual values are greater than the convergence threshold;
[0098] The coordinate points after the outliers are removed are refitted using the least square method to obtain a refitted straight line equation y=a1x+b1;
[0099] Repeat the residual calculation, outlier elimination and refitting, set an upper limit of the number of iterations, and terminate the iterative optimization algorithm when the residual change of the refitted straight line is less than the set convergence threshold within the upper limit of the number of iterations, or terminate the iterative optimization algorithm when the set upper limit of the number of iterations is reached;
[0100] That is, the termination condition of the algorithm is:
[0101] The iteration process will stop in one of the following two situations: 1. The residual change of all points is less than the set threshold, indicating that the fitting result has stabilized; 2. The maximum number of iterations is reached to ensure that the algorithm does not fall into an infinite loop;
[0102] Step 5: Map the runway line coordinate sequence to the user terminal, and the user confirms or adjusts the coordinate sequence on the user terminal;
[0103] Specifically, the runway line coordinate sequence is mapped to the user terminal, and the user terminal can display the real-time image of the camera and the video stream captured by the camera. After the coordinate sequence is calculated, the pictures corresponding to each coordinate are mapped to the user terminal in the form of a video stream, and the user can confirm the coordinate sequence through the user terminal, or adjust the coordinate sequence;
[0104] The coordinate points on the user-side screen are presented as circles, and the user can adjust the runway line coordinate sequence by dragging the circles;
[0105] Step 6: Send the determined coordinate sequence to the business processing system for subsequent timing and data analysis.
[0106] Based on the same inventive concept, the present application also provides a device corresponding to the method in Example 1, see Example 2 for details.
[0107] Embodiment 2
[0108] In this embodiment, a device is provided, such as Figure 2 As shown, including:
[0109] Image acquisition module, image processing module, target detection module, coordinate calculation module, user interface module and data transmission module;
[0110] Image acquisition module: markers and cameras are placed on the runway. The camera takes real-time video of the entire runway and captures the video stream.
[0111] Image processing module: pre-process the video and detect the position of the marker;
[0112] Target detection module: uses a trained target detection algorithm model for identifying markers to detect and locate markers in the video image in real time through the target detection algorithm model to obtain the marker coordinates (x, y), which are recorded as (x1, y1), (x2, y2), ..., (x n ,y n ), n is a positive integer;
[0113] Coordinate calculation module: calculates the runway line coordinate sequence based on the detected marker positions;
[0114] The method for calculating the runway line coordinate sequence is specifically as follows: using the least squares method to fit the straight line equation of the runway line and combining iterative optimization algorithm for calculation;
[0115] The least square method is as follows: for the marker coordinates, a straight line equation is fitted; an error function of the vertical distance from the marker coordinates to the fitted straight line is defined, and the optimal straight line equation parameters of the runway line are fitted;
[0116] The iterative optimization algorithm is as follows: using the least squares method to preliminarily fit the straight line equation; performing residual calculation, that is, calculating the distance of each coordinate point relative to the straight line equation, and removing abnormal points, that is, setting a convergence threshold according to the residual value, and removing abnormal points whose residual values are greater than the convergence threshold; refitting the coordinate points after removing the abnormal points using the least squares method to obtain a refitted straight line equation;
[0117] Repeat the residual calculation, outlier elimination and refitting, set an upper limit of the number of iterations, and terminate the iterative optimization algorithm when the residual change of the refitted straight line is less than the set convergence threshold within the upper limit of the number of iterations, or terminate the iterative optimization algorithm when the set upper limit of the number of iterations is reached;
[0118] User interface module: maps the runway line coordinate sequence to the user terminal, which can display the real-time camera image and the video stream captured by the camera. After the coordinate sequence is calculated, the image corresponding to each coordinate is mapped to the user terminal in the form of a video stream. The user can confirm the coordinate sequence or adjust the coordinate sequence through the user terminal;
[0119] Data transmission module: sends the determined coordinate sequence to the business processing system.
[0120] Since the device introduced in the second embodiment of the present invention is a device used to implement the method of the first embodiment of the present invention, those skilled in the art can understand the specific structure and deformation of the device based on the method introduced in the first embodiment of the present invention, so it is not described here in detail. All devices used in the method of the first embodiment of the present invention belong to the scope of protection of the present invention.
[0121] Based on the same inventive concept, the present application provides an electronic device embodiment corresponding to the first embodiment, see the third embodiment for details.
[0122] Embodiment 3
[0123] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any implementation method in the first embodiment can be implemented.
[0124] Since the electronic device introduced in this embodiment is a device used to implement the method in the first embodiment of the present application, based on the method introduced in the first embodiment of the present application, a person skilled in the art can understand the specific implementation of the electronic device of the present embodiment and its various variations, so how the electronic device implements the method in the embodiment of the present application is not described in detail here. As long as a person skilled in the art implements the device used by the method in the embodiment of the present application, it belongs to the scope of protection of the present application.
[0125] Based on the same inventive concept, the present application provides a storage medium corresponding to the first embodiment, see the fourth embodiment for details.
[0126] Embodiment 4
[0127] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any implementation method in the first embodiment can be implemented.
[0128] Based on the same inventive concept, the present application also provides a side computing box, see Example 5 for details.
[0129] Embodiment 5
[0130] In this embodiment, the modules in the second embodiment and a hardware edge computing box are included, such as Figure 3 As shown, that is, including:
[0131] Image acquisition module, image processing module, target detection module, coordinate calculation module, user interface module and data transmission module, edge computing box;
[0132] The modules are connected via data interfaces to form a closed-loop automated calibration process.
[0133] The image acquisition module transmits the video stream to the image processing module, and then to the target detection module. The processed data is calculated by the coordinate calculation module to calculate the coordinate sequence, and then displayed to the user through the user interface module for confirmation or fine-tuning. Finally, the data transmission module sends the result to the business processing system. Among them, the image processing module, target detection module, and coordinate calculation module are set in the edge computing power box. The coordinate data adjusted by the user will be transmitted back to the edge computing power box for calculation.
[0134] The technical solution provided in the embodiments of the present application has at least the following technical effects or advantages: the embodiments of the present application provide a method, device, equipment and medium for automatic housekeeping management of an internal training base of a commercial bank, which comprehensively considers factors such as the number of trainees, training type, training time, training class and personnel level, and intelligently and automatically allocates accommodation rooms, thereby solving the problem of time-consuming and labor-intensive manual room allocation, and can greatly improve the efficiency of housekeeping management.
[0135] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0136] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0137] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0138] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0139] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A method for calibrating a straight track on a playground based on visual technology, characterized in that: include: Step 1: Place markers and cameras on the runway. The camera takes real-time video of the entire runway and captures the video stream. Step 2: Preprocess the video and detect the position of the marker; Step 3: Use the trained target detection algorithm model to detect and locate the marker in the video image in real time, and obtain the coordinates (x, y) of the marker, which are recorded as (x1, y1), (x2, y2), ..., (x n ,y n ), n is a positive integer; Step 4: Calculate the runway line coordinate sequence based on the detected marker positions; The method for calculating the runway line coordinate sequence is specifically as follows: using the least squares method to fit the straight line equation of the runway line and combining iterative optimization algorithm for calculation; The least square method is as follows: for the marker coordinates, a straight line equation is fitted; an error function of the vertical distance from the marker coordinates to the fitted straight line is defined, and the optimal straight line equation parameters of the runway line are fitted; The iterative optimization algorithm is as follows: using the least squares method to preliminarily fit and obtain a straight line equation; performing residual calculation, i.e. calculating the distance of each coordinate point relative to the straight line equation, and performing outlier elimination, i.e. setting a convergence threshold value according to the residual value, and eliminating outlier points whose residual value is greater than the convergence threshold value; The coordinate points after the outliers are removed are refitted using the least square method to obtain a refitted straight line equation; Repeat the residual calculation, outlier elimination and refitting, set an upper limit of the number of iterations, and terminate the iterative optimization algorithm when the residual change of the refitted straight line is less than the set convergence threshold within the upper limit of the number of iterations, or terminate the iterative optimization algorithm when the set upper limit of the number of iterations is reached.
2. The method for calibrating a playground straight track based on visual technology according to claim 1, characterized in that: The markers and cameras are arranged on the runway, specifically: a triangular cone is placed as a marker at the required calibration point, and a camera is placed in front of the middle of the runway. When shooting, the camera looks down from top to bottom, and moves the camera back and forth on the runway to capture all the runways to be captured, and the runway occupies the largest screen in the shooting picture.
3. The method for calibrating a playground straight track based on visual technology according to claim 1, characterized in that: The step 4 is specifically as follows: The least square method is specifically as follows: for the marker coordinates (x, y), a straight line equation y=ax+b is fitted, where a is the slope and b is the intercept. Define the error function, for each marker coordinate (x i ,y i ), the error is defined as the vertical distance from the point to the fitted line, i is any positive integer from 1 to n: ∈ i =y i -(ax i +b) The total error is expressed as: Find a set of a that minimizes the total error E(a, b) n and b n After that, to a n and b n Take the derivatives and make them equal to 0, and we get the linear equation system: Solve these two equations and fit the optimal straight line equation parameters a0 and b0 of the runway line: The iterative optimization algorithm is specifically: The least square method is used to preliminarily fit the linear equation y=a0x+b0; residual calculation is performed, that is, the distance of each coordinate point relative to the linear equation is calculated. Assume that the coordinates of each marker (x i ,y i ) is: r i =|y i -(a0x i +b0)| Perform outlier elimination, that is, set a convergence threshold according to the residual value, and eliminate outliers whose residual values are greater than the convergence threshold; The coordinate points after the outliers are removed are refitted using the least square method to obtain a refitted straight line equation y=a1x+b1; Repeat the residual calculation, outlier elimination and refitting, set an upper limit of the number of iterations, and terminate the iterative optimization algorithm when the residual change of the refitted straight line is less than the set convergence threshold within the upper limit of the number of iterations, or terminate the iterative optimization algorithm when the set upper limit of the number of iterations is reached.
4. The method for calibrating a playground straight track based on visual technology according to claim 1, characterized in that: Also includes steps 5 and 6; The step 5 is specifically as follows: mapping the runway line coordinate sequence to the user terminal, the user terminal can display the real-time image of the camera, and display the video stream captured by the camera. After the coordinate sequence is calculated, the picture corresponding to each coordinate is mapped to the user terminal in the form of a video stream, and the user can confirm the coordinate sequence through the user terminal, or adjust the coordinate sequence; The step 6 specifically includes: sending the determined coordinate sequence to the business processing system.
5. A device for calibrating a playground straight track based on visual technology, characterized in that: include: Image acquisition module, image processing module, target detection module, coordinate calculation module; Image acquisition module: markers and cameras are placed on the runway. The camera takes real-time video of the entire runway and captures the video stream. Image processing module: pre-process the video and detect the position of the marker; Target detection module: uses a trained target detection algorithm model for identifying markers to detect and locate markers in the video image in real time through the target detection algorithm model to obtain the marker coordinates (x, y), which are recorded as (x1, y1), (x2, y2), ..., (x n ,y n ), n is a positive integer; Coordinate calculation module: calculates the runway line coordinate sequence based on the detected marker positions; The method for calculating the runway line coordinate sequence is specifically as follows: using the least squares method to fit the straight line equation of the runway line and combining iterative optimization algorithm for calculation; The least square method is as follows: for the marker coordinates, a straight line equation is fitted; an error function of the vertical distance from the marker coordinates to the fitted straight line is defined, and the optimal straight line equation parameters of the runway line are fitted; The iterative optimization algorithm is as follows: using the least squares method to preliminarily fit and obtain a straight line equation; performing residual calculation, i.e. calculating the distance of each coordinate point relative to the straight line equation, and performing outlier elimination, i.e. setting a convergence threshold value according to the residual value, and eliminating outlier points whose residual value is greater than the convergence threshold value; The coordinate points after the outliers are removed are refitted using the least square method to obtain a refitted straight line equation; Repeat the residual calculation, outlier elimination and refitting, set an upper limit of the number of iterations, and terminate the iterative optimization algorithm when the residual change of the refitted straight line is less than the set convergence threshold within the upper limit of the number of iterations, or terminate the iterative optimization algorithm when the set upper limit of the number of iterations is reached.
6. The device for calibrating a playground straight track based on visual technology according to claim 5, characterized in that: The markers and cameras are arranged on the runway, specifically: a triangular cone is placed as a marker at the required calibration point, and a camera is placed in front of the middle of the runway. When shooting, the camera looks down from top to bottom, and moves the camera back and forth on the runway to capture all the runways to be captured, and the runway occupies the largest screen in the shooting picture.
7. The device for calibrating a playground straight track based on visual technology according to claim 5, characterized in that: The coordinate calculation module is specifically: The least square method is specifically as follows: for the marker coordinates (x, y), a straight line equation y=ax+b is fitted, where a is the slope and b is the intercept. Define the error function, for each marker coordinate (x i ,y i ), the error is defined as the vertical distance from the point to the fitted line, i is any positive integer from 1 to n: ∈ i =y i -(ax i +b) The total error is expressed as: Find a set of a that minimizes the total error E(a, b) n and b n After that, to a n and b n Take the derivatives and make them equal to 0, and we get the linear equation system: Solve these two equations and fit the optimal straight line equation parameters a0 and b0 of the runway line: The iterative optimization algorithm is specifically: The least square method is used to preliminarily fit the linear equation y=a0x+b0; residual calculation is performed, that is, the distance of each coordinate point relative to the linear equation is calculated. Assume that the coordinates of each marker (x i ,y i ) is: r i =|y i -(a0x i +b0)| Perform outlier elimination, that is, set a convergence threshold according to the residual value, and eliminate outliers whose residual values are greater than the convergence threshold; The coordinate points after the outliers are removed are refitted using the least square method to obtain a refitted straight line equation y=a1x+b1; Repeat the residual calculation, outlier elimination and refitting, set an upper limit of the number of iterations, and terminate the iterative optimization algorithm when the residual change of the refitted straight line is less than the set convergence threshold within the upper limit of the number of iterations, or terminate the iterative optimization algorithm when the set upper limit of the number of iterations is reached.
8. The device for calibrating a playground straight track based on visual technology according to claim 5, characterized in that: Also includes a user interface module and a data transmission module; The user interface module specifically maps the runway line coordinate sequence to the user terminal, which can display the real-time camera image and the video stream captured by the camera. After the coordinate sequence is calculated, the image corresponding to each coordinate is mapped to the user terminal in the form of a video stream, and the user can confirm the coordinate sequence or adjust the coordinate sequence through the user terminal; The data transmission module specifically sends the determined coordinate sequence to the business processing system.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 4 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Airport runway foreign matter detection method and system
CN116434142A
Automatic listing method based on moving target in panoramic video and related device
CN116824457A
Linear running test method and system based on visual technology
CN117197885A
Intelligent running test method and device based on computer vision and medium
CN118286664A