Unmanned aerial vehicle inspection parking path planning method and system based on machine learning
By employing a machine learning-based drone inspection path planning method, combined with image quality assessment and scene classification, the problem of poor path adaptability of drones in mixed environments is solved, achieving efficient high-quality image acquisition and enhanced autonomy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 广东科陆智泊信息科技有限公司
- Filing Date
- 2026-01-28
- Publication Date
- 2026-04-28
AI Technical Summary
Existing drone inspection solutions suffer from poor path adaptability and imaging performance in mixed indoor and outdoor scenarios. They also lack environmental adaptation and closed-loop image quality control, resulting in low efficiency.
Using a machine learning-based approach, the system performs image quality assessment and scene classification, employs an octree model and a keypoint set model for path planning, and adjusts the aerial photography path in real time to form a closed-loop optimization.
It achieves environmentally adaptive path planning, ensures high-quality inspection image acquisition, reduces repetitive tasks, and improves the autonomy and robustness of UAVs in complex environments.
Smart Images

Figure CN121934587A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of drone inspection and parking technology, and particularly relates to a drone inspection and parking path planning method and system based on machine learning. Background Technology
[0002] With the popularization of drone technology, its application in security patrol and facility inspection is becoming increasingly widespread. In intelligent parking management, drone patrols can efficiently cover a wide area and automatically identify problems such as parking space status, illegally parked vehicles, and facility damage.
[0003] Currently, existing drone inspection solutions have some shortcomings, such as fixed inspection paths and poor adaptability to different scenarios. Most solutions rely on preset GPS waypoints or fixed routes, and cannot adjust to dynamic changes in the inspection environment, such as differences in indoor and outdoor lighting or structural complexity. In mixed indoor and outdoor parking lots, fixed paths may result in drones collecting a large number of overexposed or underexposed useless images in areas with sudden changes in lighting.
[0004] In image processing, the lack of closed-loop control for image quality means that existing technologies typically treat path planning and image acquisition as two separate processes. The planning phase doesn't consider imaging performance, and the acquisition phase doesn't provide real-time evaluation and feedback on image quality. This leads to drones potentially flying along a theoretically optimal path but with extremely poor imaging quality, ultimately requiring manual re-flight, resulting in low efficiency.
[0005] Furthermore, there is a lack of scene recognition and differentiated planning capabilities. While path planning algorithms exist for single environments, such as purely indoor or outdoor path planning, there is a lack of an intelligent system capable of automatically identifying environment types and switching to appropriate planning strategies. This results in insufficient autonomy and robustness for drones in mixed environments. Summary of the Invention
[0006] To address the problems existing in the prior art, this invention provides a machine learning-based method and system for unmanned aerial vehicle (UAV) inspection and parking path planning. This method enables environmentally adaptive path planning and forms a closed-loop optimization through image quality feedback to ensure that high-quality inspection images are ultimately obtained.
[0007] The technical solution of this invention is implemented as follows: A machine learning-based method for drone-based parking inspection path planning includes the following steps: S1. The UAV collects target images, evaluates the collected target images, sets a standard image threshold, and saves target images whose clarity meets the standard image threshold. S2. Based on the saved target image, construct an image representation of the area to be inspected, and divide the image representation into several grids, and obtain the brightness data of each grid; S3. Based on the brightness data of different grids, classify the grids into scene areas and divide the area to be inspected into outdoor scene areas and indoor scene areas. S4. For the divided outdoor scene areas, an octree model based on spatial segmentation is used for path planning; for the divided indoor scene areas, a local optimum model based on key point sets is used for path planning; thus obtaining the initial drone aerial photography path. S5. Perform a comprehensive evaluation of the initial drone aerial photography path based on multiple indicators. If the evaluation result does not meet the preset flight score threshold, return to S4 to adjust the parameters and replan the path until the evaluation result meets the preset flight score threshold, thus obtaining a qualified aerial photography path. S6. The drone conducts inspection and photography along the qualified aerial photography path. The flight path images obtained at each waypoint of the aerial photography path are evaluated in real time. If the flight path image quality is unqualified, it is marked as a poor image and its shooting location is recorded. S7. Use the marked low-quality images and their shooting location information as feedback input to generate new subsequent aerial shooting paths; S8: The drone inspects and takes pictures along the new aerial photography path, and continues to execute S6 until the optimal aerial photography path that meets the image quality requirements of the flight path is obtained.
[0008] Furthermore, in step S1, the acquired single-frame image undergoes real-time quality assessment. If the target image's sharpness reaches a preset standard image threshold, the target image is saved; otherwise, it is discarded. The formula for calculating the target image's sharpness is: in, Represents points in the target image pixel values, and These represent the points at... x Positive direction and y Gradient change value in the positive direction; when the sharpness value Greater than or equal to the preset standard image threshold T s At that time, the image clarity is deemed acceptable.
[0009] Furthermore, in step S2, acquiring the brightness data for each grid specifically includes calculating the average brightness value and brightness standard deviation for each grid. Establish a Cartesian coordinate system with the first pixel from the left in the first row of the target image as the origin; divide the image representation horizontally and vertically. n Divide into equal parts, formingn × n A grid is formed, and the coordinates of the top-left pixel of each grid are defined as follows: Pi ,in i =1,2,..., n 2 ; Calculate each grid i average brightness value The calculation formula is: in, m This indicates the total number of valid pixels falling within the grid. Indicates the first i In the grid, the th k The brightness of each pixel; Calculate each grid i luminance standard deviation The calculation formula is: Furthermore, in step S3, scene classification is performed on the grids based on the average brightness value and brightness standard deviation of different grids, specifically including: If the brightness standard deviation of the grid The average brightness value is greater than the first preset threshold Θ1. Located in the first brightness range [ m a1 , m a2 If the grid is within the specified range, then the grid is classified as an outdoor scene. If the brightness standard deviation of the grid Less than the second preset threshold Θ2, and its average brightness value Located in the second brightness range [ m b1 , m b2 If the grid is within the specified range, then it is classified as an indoor scene. m a1 , m a2 , m b1 , m b2 All of these are set brightness thresholds.
[0010] Furthermore, in S4, an octree model is used to perform path planning for the outdoor scene area, specifically including: Use a rectangle to cover the entire outdoor scene area and use this rectangle as the root node of the octree model; Based on preset depth or segmentation conditions, the rectangular region represented by the current node is recursively divided into four sub-rectangles, forming the child nodes of the tree; The rectangular blocks represented by the final leaf nodes are marked as different flight sub-regions. R 1, R 2,..., R m ; Plan a shortest path that traverses all the flight sub-regions that need to be visited, so that when the drone completes the task in one sub-region, it automatically flies to the next adjacent sub-region on the path.
[0011] Furthermore, in S4, a local optimum model based on a set of key points is used to plan the path for the indoor scene area, specifically including: Select a set of key points within the indoor scene area to form a key point set. P ={ p 1, p 2,..., p n}; Solve an optimization problem with the objective of minimizing the total flight distance: make Y ={ y 1, y 2,..., y n Let} represent the shortest path segment length for accessing key points. Find the access sequence that minimizes the total path length to obtain the drone aerial photography path for the indoor scene area.
[0012] Furthermore, in S5, a comprehensive evaluation of the drone aerial photography path is performed using multiple indicators, specifically including: Each node on the computation path j Corresponding flight rating G j : G j = r j ( w 1 T 1 j + w 2 T 2 j + w 3 T 3 j + w 4 T 4 j); in, r j For nodes j The weighting coefficients, w 1, w 2, w 3, w 4 represents the weight of each indicator; T 1 j For nodes j The standard deviation of the brightness of the grid in question; T 2 j For nodes j The average brightness value of the grid in question; T 3 j For nodes j The rate of change of the standard deviation of brightness to the next node; T 4 j For nodes j The ratio of the standard deviation of the brightness of its next node; The overall route score is obtained by comprehensively weighting the flight scores of all nodes on the route. G total ;like G total If the score is greater than or equal to the preset flight score threshold Γ, the aerial photography path is deemed qualified.
[0013] Furthermore, in step S6, real-time quality assessment of the flight path imagery is performed, specifically including: Set the reference threshold for the first pixel value. V dark Second pixel value reference threshold V bright ; If the pixel value of any point in the image is less than V dark If the pixel value of any point in the image is greater than a certain value, then that point is determined to be an extremely dark pixel; if the pixel value of any point in the image is greater than a certain value, then the point is determined to be an extremely dark pixel. V bright If so, then the point is determined to be an extremely bright pixel; When the number or proportion of extremely dark or extremely bright pixels in an image exceeds the corresponding threshold, the image is deemed to be of substandard quality and is marked accordingly.
[0014] Furthermore, in step S7, the marked low-quality images and their shooting location information are used as feedback inputs to the improved octree model, specifically including: The labeled low-quality images and their shooting location information are added as negative sample location points to the octree model; The flight score of nodes containing negative sample locations and their spatial neighbors is penalized and reduced in the model. Based on the updated node flight score, the optimized flight path from the drone's current position to the mission endpoint, while avoiding low-score areas, is recalculated as the new aerial photography path for the current moment.
[0015] A machine learning-based drone inspection and parking path planning system applies any of the above-mentioned machine learning-based drone inspection and parking path planning methods.
[0016] Compared with the prior art, the present invention achieves the following beneficial effects: This invention provides a machine learning-based method and system for drone-based parking inspection path planning. It automatically and accurately distinguishes indoor and outdoor scenes using image features and invokes the optimal planning algorithm to achieve intelligent perception and adaptation in complex mixed environments. By using image quality assessment results as feedback input for path planning, the drone can autonomously learn from failed shooting experiences and dynamically avoid unfavorable conditions, fundamentally ensuring the usability of inspection data and reducing repetitive work. The system ensures input data quality through target image evaluation, filters unreasonable schemes through aerial path evaluation, and corrects execution deviations through closed-loop optimization, forming a multi-layered quality control and assurance mechanism. Attached Figure Description
[0017] Figure 1 This is a flowchart of a machine learning-based drone inspection and parking path planning method provided in an embodiment of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions in the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0019] Example like Figure 1 A machine learning-based method for drone-based parking inspection path planning includes the following steps: S1. The UAV collects target images, evaluates the collected target images, sets a standard image threshold, and saves target images whose clarity meets the standard image threshold. In step S1, the acquired single-frame image is evaluated in real time. If the clarity of the target image reaches a preset standard image threshold, the target image is saved; otherwise, it is discarded. The formula for calculating the clarity of the target image is: in, Represents points in the target image pixel values, and These represent the points at... x Positive direction and y Gradient change value in the positive direction; when the sharpness value Greater than or equal to the preset standard image threshold T s When the image sharpness is deemed acceptable, the gradient can be approximated by simple methods such as the Sobel operator. When the sharpness is not lower than the preset standard image threshold, the image is considered to have rich details and clear edges.
[0020] The drone performs a preliminary screening of the collected target images, and saves the target images that meet a certain quality.
[0021] S2. Based on the saved target image, construct an image representation of the area to be inspected, and divide the image representation into several grids, and obtain the brightness data of each grid; The brightness is calculated as follows: in, , This is an integer used to define the size of the neighborhood window used to calculate brightness. These are weighting coefficients; when brightness Within the preset reference range [ L min , L max If the image brightness is within a certain range, it is determined that the image brightness is acceptable.
[0022] In step S2, the brightness data of each grid is obtained, specifically including calculating the average brightness value and brightness standard deviation of each grid. Establish a Cartesian coordinate system with the first pixel from the left in the first row of the target image as the origin; divide the image representation horizontally and vertically. n Divide into equal parts, forming n × n A grid is formed, and the coordinates of the top-left pixel of each grid are defined as follows: Pi ,in i =1,2,..., n 2 ; Calculate each grid i average brightness value The calculation formula is: in, m This indicates the total number of valid pixels falling within the grid. Indicates the firsti In the grid, the th k The brightness of each pixel; Calculate each grid i luminance standard deviation The calculation formula is: The average luminance value reflects the overall illumination level of the area; the standard deviation of luminance reflects the uniformity of illumination or the complexity of texture in the area. Indoor environments are usually evenly illuminated and have regular textures, with a smaller standard deviation; outdoor environments are affected by natural light and shadows, resulting in a larger standard deviation.
[0023] These features form the quantitative basis for subsequent scene classification.
[0024] S3. Based on the brightness data of different grids, classify the grids into scene areas and divide the area to be inspected into outdoor scene areas and indoor scene areas. In step S3, scene classification is performed on the grids based on their average brightness value and brightness standard deviation, specifically including: If the brightness standard deviation of the grid The average brightness value is greater than the first preset threshold Θ1. Located in the first brightness range [ m a1 , m a2 If the grid is within the specified range, then the grid is classified as an outdoor scene. Where Θ1∈[20,40], m a1 =100, m a2 =255; If the brightness standard deviation of the grid Less than the second preset threshold Θ2, and its average brightness value Located in the second brightness range [ m b1 , m b2 If the grid is within the specified range, then it is classified as an indoor scene. m a1 , m a2 , m b1 , m b2 All of these are set brightness thresholds.
[0025] Where Θ2∈[0,30], m b1 =50, m b2 =200.
[0026] like >Θ1, for example, 30, and High values (e.g., [100, 255]) are directly classified as outdoor. like <Θ2, for example, 20, and If the value is moderate (e.g., [50, 200]), it is directly classified as indoors.
[0027] S4. For the divided outdoor scene areas, an octree model based on spatial segmentation is used for path planning; for the divided indoor scene areas, a local optimum model based on key point sets is used for path planning; thus obtaining the initial drone aerial photography path. In step S4, an octree model is used for path planning in the outdoor scene area, specifically including: Use a rectangle to cover the entire outdoor scene area and use this rectangle as the root node of the octree model; Based on preset depth or segmentation conditions, the rectangular region represented by the current node is recursively divided into four sub-rectangles, forming the child nodes of the tree; The rectangular blocks represented by the final leaf nodes are marked as different flight sub-regions. R 1, R 2,..., R m ; Plan a shortest path that traverses all the flight sub-regions that need to be visited, so that when the drone completes the task in one sub-region, it automatically flies to the next adjacent sub-region on the path.
[0028] In step S4, a local optimum model based on a set of key points is used to plan the path for the indoor scene area, specifically including: Select a set of key points within the indoor scene area to form a key point set. P ={ p 1, p 2,..., p n}; Solve an optimization problem with the objective of minimizing the total flight distance: make Y ={ y 1, y 2,..., y n Let} represent the shortest path segment length for accessing key points. Find the access sequence that minimizes the total path length to obtain the drone aerial photography path for the indoor scene area.
[0029] The total path length is expressed as: in, This represents the number of key points.
[0030] For open outdoor areas, an octree spatial partitioning model is adopted to form a hierarchical tree structure. Leaf nodes represent sub-regions to be inspected. The planning algorithm generates a shortest path traversing all relevant leaf nodes, achieving efficient full coverage. This method has a clear structure and is suitable for open spaces without many obstacles.
[0031] For complex indoor areas, a local optimum model based on key points is adopted. Key points are pre-defined or detected within the indoor area, such as the center of each parking space and the turning points of passageways. The problem is transformed into solving a traveling salesman problem, with the goal of finding the shortest loop or path to all key points. This ensures that all important locations can be accessed with the highest efficiency in space-constrained and structurally complex indoor environments.
[0032] S5. Perform a comprehensive evaluation of the initial drone aerial photography path based on multiple indicators. If the evaluation result does not meet the preset flight score threshold, return to S4 to adjust the parameters and replan the path until the evaluation result meets the preset flight score threshold, thus obtaining a qualified aerial photography path. In S5, a comprehensive evaluation of the drone aerial photography path is performed using multiple indicators, specifically including: Each node on the computation path j Corresponding flight rating G j : G j = r j ( w 1 T 1 j + w 2 T 2 j + w 3 T 3 j + w 4 T 4 j ); in, r j For nodes j The weighting coefficients, w 1, w 2, w 3, w 4 represents the weight of each indicator; T 1 j For nodes jThe standard deviation of the brightness of the grid in question; T 2 j For nodes j The average brightness value of the grid in question; T 3 j For nodes j The rate of change of the standard deviation of brightness to the next node; T 4 j For nodes j The ratio of the standard deviation of the brightness of its next node; The overall route score is obtained by comprehensively weighting the flight scores of all nodes on the route. G total ;like G total If the score is greater than or equal to the preset flight score threshold Γ, the aerial photography path is deemed qualified.
[0033] This step evaluates the effectiveness of the route and avoids executing poor-quality routes. A multi-dimensional flight score is calculated for each waypoint (corresponding to a grid) on the route.
[0034] Sum the scores for the entire path. If the total score is... G total If the threshold Γ is exceeded, it indicates that the path has passed the comprehensive evaluation in terms of imaging environment stability, lighting conditions, etc., and is approved for execution.
[0035] S6. The drone conducts inspection and photography along the qualified aerial photography path. The flight path images obtained at each waypoint of the aerial photography path are evaluated in real time. If the flight path image quality is unqualified, it is marked as a poor image and its shooting location is recorded. In step S6, real-time quality assessment of the flight path imagery is performed, specifically including: Set the reference threshold for the first pixel value. V dark Second pixel value reference threshold V bright ; If the pixel value of any point in the image is less than V dark If the pixel value of any point in the image is greater than a certain value, then that point is determined to be an extremely dark pixel; if the pixel value of any point in the image is greater than a certain value, then the point is determined to be an extremely dark pixel. V bright If so, then the point is determined to be an extremely bright pixel; When the number or proportion of extremely dark or extremely bright pixels in an image exceeds the corresponding threshold, the image is deemed to be of substandard quality and is marked accordingly.
[0036] S7. The marked low-quality images and their shooting location information are used as feedback inputs to the improved octree model to generate new subsequent aerial shooting paths. In step S7, the marked low-quality images and their shooting location information are added to the octree model as negative sample location points; The flight score of nodes containing negative sample locations and their spatial neighbors is penalized and reduced in the model. Based on the updated node flight score, the optimized flight path from the drone's current position to the mission endpoint, while avoiding low-score areas, is recalculated as the new aerial photography path for the current moment.
[0037] The drone flies along a planned path and takes pictures. For each photo, extreme pixel detection is performed; if the pixel value is <50 or >250, it quickly determines whether there is severe overexposure or underexposure. If so, the image and its location are immediately marked.
[0038] Image and location information is fed back in real time to an improved octree planning model. This model "penalizes" nodes in the original map, either by significantly lowering their scores or by performing finer-grained segmentation to avoid them. Then, based on the current drone position and the updated map, the model quickly replans the subsequent path to the destination. The new path avoids known imaging quality pitfalls.
[0039] S8: The drone inspects and takes pictures along the new aerial photography path, and continues to execute S6 until the optimal aerial photography path that meets the image quality requirements of the flight path is obtained.
[0040] The drone continues flying along the new path, repeating the monitoring and replanning process described above. This forms a continuous closed loop of execution, evaluation, feedback, and optimization. As the flight progresses, it iteratively updates and learns, effectively avoiding all identified poor-quality shooting areas. After actual flight verification and multiple optimizations, the optimal inspection path for high-quality images, i.e., the optimal aerial photography path, is finally obtained.
[0041] A machine learning-based drone inspection and parking path planning system applies the machine learning-based drone inspection and parking path planning method described above.
[0042] Imagine a large parking lot with two underground levels and a ground level, that is, a parking lot that includes both indoor and outdoor areas, where fully automated inspections are conducted.
[0043] Initialization and First Frame Screening: The drone takes off from the hangar. During takeoff, the camera begins operating, acquiring images of the target. The system calculates the sharpness and brightness of the initial captured images; images that meet the standards are saved for preliminary environmental awareness building.
[0044] Scene Mapping and Classification: A drone hovers or flies slowly at the entrance, capturing multiple frames of images and stitching them together to create a preliminary overhead view of the parking lot. This view is then divided into a 10x10 grid. The performance of each grid cell is calculated. and .
[0045] For the ground layer grid: due to the presence of sky, tree shadows, and vehicle reflections, Values are generally greater than 30. Values that are higher during the day, greater than 150, are classified as outdoor scene areas.
[0046] For the underground entrance and internal grid: due to uniform artificial lighting... The values are generally less than 15. The value is stable between 80 and 120, and it is classified as an indoor scene area.
[0047] Initial path planning: For the ground-level outdoor area, an octree model is used. The entire ground-level rectangular area is divided into three quad-tree sections, resulting in 64 smaller areas. A bow-shaped path is planned to traverse all areas with the shortest possible distance.
[0048] For the basement area, a local optimum model is used. Assuming there are 200 parking spaces, the center of each parking space is set as a key point. A greedy algorithm or genetic algorithm is used to find an approximately optimal path so that the drone can fly over all the parking spaces in sequence to take pictures.
[0049] Aerial Path Evaluation: The two aerial paths described above are scored. Suppose that a section of the outdoor path rapidly crosses the boundary between building shadows and direct sunlight, causing an abnormally high rate of brightness change at that point, thus lowering the score for that section. The system determines that the overall score for this path may be insufficient, triggering a replanning process. During replanning, waypoints may be added to that area, speed reduced, or the route fine-tuned to create a smooth transition, resulting in a path that meets the required score.
[0050] Execution and closed-loop optimization: The drone first executes a qualified path on the ground layer. When it flies over a place where there is strong glare caused by a glass curtain wall, the proportion of extremely bright pixels in the captured image exceeds the standard and is marked by the system. The coordinates of this point are recorded, which is the shooting location information.
[0051] The system immediately uses this location information as feedback, inputting it into the octree model to penalize the node corresponding to the shooting location and its surrounding nodes, such as multiplying the score by 0.1. Subsequently, the system replans a subsequent path for the drone to bypass the reflective area.
[0052] The drone enters the underground level. At one point, due to damaged lighting, the area is too dark. The captured images and locations are marked and fed back again. Since the indoor path is a sequence of key points, the optimization algorithm can choose to skip that point or adjust the flight altitude and angle to compensate.
[0053] After several such online adjustments, the drone's final flight path actively avoided all known reflective and dark areas, ensuring the quality of images acquired along this path.
[0054] Mission accomplished: When the drone completed its inspection and returned, it not only brought back high-quality images, but its flight control system also saved an optimized inspection path for the parking lot. This path can be directly used as the initial plan for future similar tasks, greatly improving efficiency.
[0055] Based on the disclosure and teachings of the foregoing specification, those skilled in the art can make changes and modifications to the above embodiments. Therefore, the present invention is not limited to the specific embodiments disclosed and described above, and some modifications and changes to the present invention should also fall within the protection scope of the claims of the present invention. Furthermore, although some specific terms are used in this specification, these terms are only for convenience of explanation and do not constitute any limitation on the present invention.
Claims
1. A machine learning-based method for unmanned aerial vehicle (UAV) inspection and parking path planning, characterized in that, Includes the following steps: S1. The UAV collects target images, evaluates the collected target images, sets a standard image threshold, and saves target images whose clarity meets the standard image threshold. S2. Based on the saved target image, construct an image representation of the area to be inspected, and divide the image representation into several grids, and obtain the brightness data of each grid; S3. Based on the brightness data of different grids, classify the grids into scene areas and divide the area to be inspected into outdoor scene areas and indoor scene areas. S4. For the divided outdoor scene areas, an octree model based on spatial segmentation is used for path planning; for the divided indoor scene areas, a local optimum model based on key point sets is used for path planning. Obtain the initial drone aerial photography path; S5. Perform a comprehensive evaluation of the initial drone aerial photography path based on multiple indicators. If the evaluation result does not meet the preset flight score threshold, return to S4 to adjust the parameters and replan the path until the evaluation result meets the preset flight score threshold, thus obtaining a qualified aerial photography path. S6. The drone takes inspection photos along the qualified aerial photography path. The flight path images taken at each waypoint of the aerial photography path are evaluated in real time. If the flight path image quality is unqualified, it is marked as a poor image and its shooting position is recorded. S7. Use the marked low-quality images and their shooting location information as feedback input to generate new subsequent aerial shooting paths; S8: The drone inspects and takes pictures along the new aerial photography path, and continues to execute S6 until the optimal aerial photography path that meets the image quality requirements of the flight path is obtained.
2. The machine learning-based unmanned aerial vehicle (UAV) inspection and parking path planning method according to claim 1, characterized in that, In step S1, the acquired single-frame image undergoes real-time quality assessment. If the target image's clarity reaches a preset standard image threshold, the target image is saved; otherwise, it is discarded. The formula for calculating the target image's clarity is: in, Represents points in the target image pixel values, and These represent the points at... x Positive direction and y Gradient change value in the positive direction; when the sharpness value Greater than or equal to the preset standard image threshold T s At that time, the image clarity is deemed acceptable.
3. The machine learning-based unmanned aerial vehicle (UAV) inspection and parking path planning method according to claim 1, characterized in that, In step S2, the brightness data of each grid is obtained, specifically including calculating the average brightness value and brightness standard deviation of each grid. Establish a Cartesian coordinate system with the first pixel from the left in the first row of the target image as the origin; The image is represented by horizontal and vertical divisions. n Divide into equal parts, forming n × n A grid is formed, and the coordinates of the top-left pixel of each grid are defined as follows: Pi ,in i =1,2,..., n 2 ; Calculate each grid i average brightness value The calculation formula is: in, m This indicates the total number of valid pixels falling within the grid. Indicates the first i In the grid, the th k The brightness of each pixel; Calculate each grid i luminance standard deviation The calculation formula is:
4. The machine learning-based unmanned aerial vehicle (UAV) inspection and parking path planning method according to claim 3, characterized in that, In step S3, scene classification is performed on the grids based on their average brightness value and brightness standard deviation, specifically including: If the brightness standard deviation of the grid The average brightness value is greater than the first preset threshold Θ1. Located in the first brightness range [ μ a1 , μ a2 If the grid is within the specified range, then the grid is classified as an outdoor scene. If the brightness standard deviation of the grid Less than the second preset threshold Θ2, and its average brightness value Located in the second brightness range [ μ b1 , μ b2 If the grid is within the specified range, then it is classified as an indoor scene. μ a1 , μ a2 , μ b1 , μ b2 All of these are set brightness thresholds.
5. The machine learning-based unmanned aerial vehicle (UAV) inspection and parking path planning method according to claim 1, characterized in that, In step S4, an octree model is used for path planning in the outdoor scene area, specifically including: Use a rectangle to cover the entire outdoor scene area and use this rectangle as the root node of the octree model; Based on preset depth or segmentation conditions, the rectangular region represented by the current node is recursively divided into four sub-rectangles, forming the child nodes of the tree; The rectangular blocks represented by the final leaf nodes are marked as different flight sub-regions. R 1, R 2,..., R m ; Plan a shortest path that traverses all the flight sub-regions that need to be visited, so that when the drone completes the task in one sub-region, it automatically flies to the next adjacent sub-region on the path.
6. The machine learning-based unmanned aerial vehicle (UAV) inspection and parking path planning method according to claim 1, characterized in that, In step S4, a local optimum model based on a set of key points is used to plan the path for the indoor scene area, specifically including: Select a set of key points within the indoor scene area to form a key point set. P ={ p 1, p 2,..., p n }; Solve an optimization problem with the objective of minimizing the total flight distance: make Y ={ y 1, y 2,..., y n Let} represent the shortest path segment length for accessing key points. Find the access sequence that minimizes the total path length to obtain the drone aerial photography path for the indoor scene area.
7. The machine learning-based unmanned aerial vehicle (UAV) inspection and parking path planning method according to claim 1, characterized in that, In S5, a comprehensive evaluation of the drone aerial photography path is performed using multiple indicators, specifically including: Each node on the computation path j Corresponding flight rating G j : G j = r j ( w 1 T 1 j + w 2 T 2 j + w 3 T 3 j + w 4 T 4 j ); in, r j For nodes j The weighting coefficients, w 1, w 2, w 3, w 4 represents the weight of each indicator; T 1 j For nodes j The standard deviation of the brightness of the grid in question; T 2 j For nodes j The average brightness value of the grid in question; T 3 j For nodes j The rate of change of the standard deviation of brightness to the next node; T 4 j For nodes j The ratio of the standard deviation of the brightness of its next node; The overall route score is obtained by comprehensively weighting the flight scores of all nodes on the route. G total ;like G total If the score is greater than or equal to the preset flight score threshold Γ, the aerial photography path is deemed qualified.
8. The machine learning-based unmanned aerial vehicle (UAV) inspection and parking path planning method according to claim 1, characterized in that, In step S6, real-time quality assessment of the flight path imagery is performed, specifically including: Set the reference threshold for the first pixel value. V dark Second pixel value reference threshold V bright ; If the pixel value of any point in the image is less than V dark If the pixel value of any point in the image is greater than a certain value, then that point is determined to be an extremely dark pixel; if the pixel value of any point in the image is greater than a certain value, then the point is determined to be an extremely dark pixel. V bright If so, then the point is determined to be an extremely bright pixel; When the number or proportion of extremely dark or extremely bright pixels in an image exceeds the corresponding threshold, the image is deemed to be of substandard quality and is marked accordingly.
9. The machine learning-based unmanned aerial vehicle (UAV) inspection and parking path planning method according to claim 1, characterized in that, In step S7, the marked low-quality images and their shooting location information are used as feedback inputs to the improved octree model, specifically including: The labeled low-quality images and their shooting location information are added as negative sample location points to the octree model; The flight score of nodes containing negative sample locations and their spatial neighbors is penalized and reduced in the model. Based on the updated node flight score, the optimized flight path from the drone's current position to the mission endpoint, while avoiding low-score areas, is recalculated as the new aerial photography path for the current moment.
10. A machine learning-based unmanned aerial vehicle (UAV) inspection and parking path planning system, characterized in that, The method for planning unmanned aerial vehicle (UAV) inspection parking routes, as described in any one of claims 1 to 9, is applied.