Blade counting method and device, electronic equipment and storage medium

By using optical flow feature calculation and a lightweight blade classification model, the rotation direction of the blades is automatically determined and counted, solving the problems of low blade counting accuracy and high resource dependence in existing technologies, and achieving efficient and accurate blade counting.

CN120726024BActive Publication Date: 2025-11-11SHENZHEN YATEKS OPTICAL ELECTRONICS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511150308.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-18
Publication Date
2025-11-11
Estimated Expiration
2045-08-18

AI Technical Summary

Technical Problem

Existing blade counting methods rely on manual operation, are susceptible to fatigue, have low accuracy, and are highly dependent on parameters and hardware resources, making them difficult to adapt to and promote in complex field environments.

Method used

By acquiring images of the blade rotation process and calculating optical flow features, the target motion area and initial rotation direction are automatically determined. This is then combined with a lightweight blade classification model for counting, reducing manual intervention and hardware resource requirements.

Benefits of technology

It achieves efficient and accurate blade counting, reduces dependence on manual operation and hardware resources, improves the robustness and adaptability of the method, and is suitable for complex field environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120726024B_ABST
    Figure CN120726024B_ABST
Patent Text Reader

Abstract

This application belongs to the field of blade counting technology, and relates to a blade counting method, device, electronic device, and storage medium. It accurately extracts the blade's motion region through optical flow analysis and automatically determines the initial rotation direction, avoiding manual setting. A lightweight blade classification model is constructed using feature clustering, requiring no complex training or large-scale data support. The optical flow direction and classification results are fused in continuous images to achieve stable and accurate blade counting. This method effectively reduces reliance on manual operation, parameter adjustment, and hardware computing power, improving the accuracy and adaptability of counting, and solving the problems of low accuracy and difficult deployment of existing methods in complex environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of blade counting technology, specifically relating to a blade counting method, device, electronic device, and storage medium. Background Technology

[0002] With the increasingly widespread application of industrial endoscopes in the field of aero-engine inspection, especially in the inspection of critical internal engine components such as blades, they play a crucial role. To improve the completeness and accuracy of the inspection process, blade counting is often necessary to avoid omissions or duplicate inspections. However, in current practical applications, blade counting mainly relies on manual operation, which is susceptible to factors such as fatigue and lack of focus, resulting in problems such as low accuracy and inefficiency.

[0003] In recent years, automated blade counting has become a research hotspot, and various automatic counting methods have emerged. However, existing technologies still have several common problems, such as: some methods rely on user input for edge labeling or orientation setting, which is complex to operate; some methods rely on image grayscale changes, are sensitive to parameter adjustment, and have poor adaptability; and some methods rely on deep learning models, which have high requirements for computing power and data resources, thus limiting practical deployment and promotion.

[0004] Therefore, how to improve the accuracy of blade counting while reducing reliance on manual intervention, parameter sensitivity, and hardware resources has become a pressing problem to be solved in this field. Summary of the Invention

[0005] The embodiments of this application mainly address the technical problem of how to improve the accuracy of blade counting while reducing dependence on manual intervention, parameter sensitivity, and hardware resources.

[0006] To address the aforementioned technical problems, one technical solution adopted in this application is: providing a blade counting method, the method comprising: acquiring a first target image of the blade rotation process, and performing optical flow feature calculation on the first target image to obtain a target optical flow feature map that meets preset conditions; obtaining an optical flow angle map and an optical flow amplitude accumulation map based on the target optical flow feature map, and determining a target motion region based on the optical flow amplitude accumulation map; obtaining a target bounding box based on the target motion region, and determining the initial rotation direction of the blade based on the target bounding box and the optical flow angle map; acquiring a second target image within the target bounding box during the blade rotation process, and performing cluster analysis and constructing a blade classification model based on the second target image; acquiring a third target image within the target bounding box during the blade rotation process, and determining whether the third target image is a blade based on the blade classification model and the initial rotation direction, and counting the blades.

[0007] In some embodiments, acquiring a first target image of the blade rotation process and performing optical flow feature calculation on the first target image to obtain a target optical flow feature map that meets preset conditions includes: S11: acquiring the first target image and determining whether the current frame of the first target image is the first frame; S12: if the current frame is the first frame, saving the first target image of the current frame and jumping to S11; if the current frame is not the first frame, jumping to S13; S13: performing optical flow feature calculation based on the first target image of the current frame to obtain the optical flow feature map of the first target image of the current frame, and incrementing the number of optical flow feature maps by one; S14: determining whether the number of optical flow feature maps meets preset conditions; if the number of optical flow feature maps meets preset conditions, using the number of optical flow feature maps as the target optical flow feature map; if the number of optical flow feature maps does not meet preset conditions, jumping to S11.

[0008] In some embodiments, an optical flow angle map and an optical flow amplitude accumulation map are obtained based on the target optical flow feature map, and the target motion region is determined based on the optical flow amplitude accumulation map, including: calculating the optical flow angle of the target optical flow feature map to obtain the optical flow angle map; calculating the optical flow amplitude of the target optical flow feature map to obtain the optical flow amplitude map; performing a pixel-position summation calculation on the optical flow amplitude map to obtain the optical flow amplitude accumulation map; inputting the optical flow amplitude accumulation map into a preset image segmentation model to obtain the segmentation result; and selecting the segmentation region with the largest average optical flow amplitude from the segmentation result as the target motion region.

[0009] In some embodiments, a target bounding box is obtained based on the target motion region, and the initial rotation direction of the blade is determined based on the target bounding box and the optical flow angle map, including: extracting the contour information of the target motion region and generating a target bounding box based on the contour information; calculating the optical flow angle histogram corresponding to the optical flow angle map of the region within the target bounding box; and selecting the angle with the highest frequency from the optical flow angle histogram as the initial rotation direction.

[0010] In some embodiments, cluster analysis is performed on the second target image to construct a leaf classification model, including: calculating the feature histogram of the second target image; inputting the feature histogram of the second target image into a preset clustering model to obtain clustering results; classifying the type of the second target image according to the clustering results to obtain classified second target images; and inputting the classified second target images into the leaf classification model for training to obtain trained leaf classification models.

[0011] In some embodiments, a third target image within the target box during the blade rotation process is acquired, and based on the blade classification model and the initial rotation direction, it is determined whether the third target image is a blade, and blade counting is performed, including: S51: Acquiring the third target image; S52: Calculating optical flow features based on the third target image of the current frame to obtain the optical flow feature map of the third target image of the current frame; S53: Obtaining the optical flow angle map and average optical flow amplitude of the region within the target box based on the optical flow feature map; S54: Determining whether the average optical flow amplitude is greater than a preset threshold; if the average optical flow amplitude is not greater than the preset threshold, then jumping to S51; if the average optical flow amplitude is greater than the preset threshold, then jumping to S55; S55: Calculating the optical flow angle histogram of the region within the target box based on the optical flow angle map of the region within the target box, and selecting the angle with the highest frequency from the optical flow angle histogram as the current movement direction of the blade; S56: Inputting the third target image of the current frame into the blade classification model to obtain the classification probability value; S57: Counting blades based on the current movement direction of the blade and the classification probability value.

[0012] In some embodiments, S57 includes: if the classification probability value is not less than a preset probability value, and the current movement direction and the initial rotation direction are consistent; increment the number of blades by one; if the classification probability value is not less than the preset probability value, but the current movement direction and the initial rotation direction are inconsistent or opposite; decrement the number of blades by one; wherein, if the number of blades becomes zero after decrementing by one, the current movement direction is taken as the initial rotation direction; if the classification probability is less than the preset probability value; keep the number of blades unchanged, and jump to S51.

[0013] To solve the above-mentioned technical problems, another technical solution adopted in this application is: providing a blade counting device, the device comprising: a target optical flow feature map acquisition module, which acquires a first target image during the blade rotation process and performs optical flow feature calculation on the first target image to obtain a target optical flow feature map that meets preset conditions; a target motion region acquisition module, which obtains an optical flow angle map and an optical flow amplitude accumulation map based on the target optical flow feature map, and determines the target motion region based on the optical flow amplitude accumulation map; a target frame and initial rotation direction acquisition module, which obtains a target frame based on the target motion region and determines the initial rotation direction of the blade based on the target frame and the optical flow angle map; a blade classification model construction module, which acquires a second target image within the target frame during the blade rotation process, performs cluster analysis based on the second target image, and constructs a blade classification model; and a blade counting module, which acquires a third target image within the target frame during the blade rotation process, determines whether the third target image is a blade based on the blade classification model and the initial rotation direction, and counts the blades.

[0014] To solve the above-mentioned technical problems, another technical solution adopted in the embodiments of this application is: to provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the above-mentioned method.

[0015] To solve the above-mentioned technical problems, another technical solution adopted in the embodiments of this application is: to provide a non-volatile computer-readable storage medium that stores computer-executable instructions, which, when executed by an electronic device, cause the electronic device to perform the above-mentioned method.

[0016] Unlike related technologies, this application provides a blade counting method, apparatus, electronic device, and storage medium. By acquiring a first target image and calculating optical flow features during blade rotation, it can actively perceive regions with obvious motion features in the image, thereby accurately extracting the blade's motion information and determining its initial rotation direction. This effectively avoids the cumbersome operation of manually setting the rotation direction by the user in traditional methods. Furthermore, the target motion region is determined and a target bounding box is set based on the accumulated optical flow amplitude map, ensuring that subsequent processing focuses on stable and significant motion regions, reducing the sensitivity to background interference and parameter adjustment, and improving the robustness of the method. After acquiring a second target image within the target bounding box, the blade image and non-blade image are effectively distinguished by calculating feature histograms and performing cluster analysis. Based on this, a lightweight blade classification model is trained, achieving effective image discrimination capabilities without relying on large-scale labeled data or complex deep learning networks, significantly reducing dependence on hardware computing power and data resources. Ultimately, by combining the optical flow angle information and classification model results with the third target image for discrimination, and dynamically updating the count value based on the consistency of the motion direction, efficient, continuous, and automatic counting of the number of blades is achieved, avoiding the problems of missed detections and misjudgments caused by fatigue or negligence in traditional manual counting. Based on this, by constructing a multi-stage blade recognition and counting process based on the fusion of optical flow and image features, the system achieves the effects of improving counting accuracy, reducing dependence on user operation, improving adaptability to different scenarios, and significantly reducing computational resource consumption. It provides a practical, stable, and easily promoted solution to address the problems of complex operation, poor robustness, and difficult deployment in existing technologies. Attached Figure Description

[0017] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0018] Figure 1 This is a flowchart of a blade counting method provided in an embodiment of this application;

[0019] Figure 2 This is a flowchart of the target optical flow feature map acquisition process provided in the embodiments of this application;

[0020] Figure 3 This is a flowchart of the blade counting process provided in the embodiments of this application;

[0021] Figure 4 This is a schematic diagram of the structure of a blade counting device provided in an embodiment of this application;

[0022] Figure 5 This is a schematic diagram of the hardware structure of an electronic device for executing a blade counting method provided in an embodiment of this application. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0024] It should be noted that, unless otherwise specified, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device schematic diagram or the order in the flowchart.

[0025] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and are not limited in number; for example, a first object can be one or more.

[0026] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application.

[0027] With the continuous advancement of industrial endoscope imaging and video image processing technologies, video inspection methods based on industrial endoscopes have been widely applied in the maintenance and fault diagnosis of aero-engines. As one of the core operating components, the integrity of aero-engine blades directly affects engine performance and flight safety. During blade inspection, to ensure the comprehensiveness and accuracy of the inspection work, it is often necessary to combine real-time blade counting to prevent duplicate or missed inspections.

[0028] Traditional inspection procedures often rely on manual counting, typically involving inspectors simultaneously recording the number of blades while observing endoscopic images. This method is not only physically demanding but also susceptible to visual fatigue and subjective judgment, easily leading to errors such as missed or repeated counts. Furthermore, the experience level of the inspectors significantly impacts counting accuracy, resulting in inconsistent operational quality.

[0029] To automate blade counting, existing research has incorporated image processing and artificial intelligence technologies as aids or alternatives. Some solutions utilize traditional image processing methods such as grayscale changes and edge detection to determine the presence and disappearance of blades. However, due to the uniform material and color of aero-engine blade surfaces, and the wear variations caused by scratches, corrosion, and carbon buildup after long-term operation, the stability of image grayscale features is poor, leading to sensitive threshold settings and insufficient adaptability. To adapt to different lighting conditions and blade variations, users often need to continuously adjust parameters to obtain stable results, significantly increasing the barrier to entry.

[0030] Another approach employs deep learning methods for blade detection and counting, such as frame-by-frame recognition based on object detection models like YOLO. While these methods can achieve high accuracy in some controlled environments, they heavily rely on high-performance computing hardware, making them difficult to deploy on resource-constrained field inspection equipment. Furthermore, training an effective recognition model requires constructing image datasets for different blade models. Considering the numerous engine models, significant differences in blade morphology, and especially factors like wear and coating peeling during use, these methods face high data acquisition and training costs, and the model's generalization ability also faces practical challenges.

[0031] Based on this, existing blade counting technologies still face three common challenges in practical applications: first, operation relies on manual intervention, resulting in low ease of use; second, the methods are sensitive to threshold and parameter settings, leading to insufficient stability and adaptability; and third, the technologies depend on high-performance hardware and large-scale data, resulting in high deployment costs and limited applicability. These problems severely restrict the promotion and application of automatic blade counting functions in complex field environments.

[0032] To address the aforementioned issues, this application proposes a blade counting method combining traditional image processing and lightweight machine learning. Its core objective is to "improve blade counting accuracy while reducing reliance on manual intervention, parameter sensitivity, and hardware resources." The method features a systematic design in its operation process, data acquisition, and model training. The technical concepts include: automatically determining the blade's rotation direction and target bounding box by analyzing the optical flow characteristics of inter-frame images, avoiding manual marking; constructing feature histograms of the blade and background, and combining this with small-sample clustering for online learning to improve adaptability to brightness variations and blade wear differences; and employing lightweight models such as Extreme Learning Machines to replace complex detection networks, significantly reducing computational burden and supporting operation on conventional endoscopic equipment. These designs collectively support the advantages of this solution in terms of practicality, stability, and economy, meeting the multiple requirements of accuracy, convenience, and deployment cost in aero-engine blade inspection.

[0033] The blade counting method provided in this application will be described below with reference to specific embodiments.

[0034] Please see Figure 1 , Figure 1 This is a flowchart of a blade counting method provided in an embodiment of this application. Figure 1 As shown, the method includes steps S1-S5:

[0035] S1: Obtain the first target image during the blade rotation process, and perform optical flow feature calculation on the first target image to obtain a target optical flow feature map that meets the preset conditions.

[0036] This step aims to automatically acquire image sequences during the blade rotation process and extract a set of optical flow feature maps that reflect the blade's motion trend, providing a data foundation for subsequent motion region detection and rotation direction determination.

[0037] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating the target optical flow feature map acquisition process provided in an embodiment of this application. For example... Figure 2 As shown, S1 includes:

[0038] S11: Obtain the first target image and determine whether the current frame of the first target image is the first frame.

[0039] S12: If the current frame is the first frame, save the first target image of the current frame and jump to S11; if the current frame is not the first frame, jump to S13.

[0040] After system initialization, the image acquisition module is activated to receive video images from the endoscope or camera device in real time. Each frame of the image is called the current frame image, where: the first frame is the first image received after the system starts; the current frame is any image in the image sequence that is being processed; the current frame number can be recorded by a frame counter.

[0041] Understandably, the system acquires the current frame input image, called the "current frame image," which is typically a blade view taken with an aero-engine endoscope. Since aero-engine blades are monochromatic and have smooth surfaces, their visual features are relatively simple. Therefore, the acquired color image is converted into a grayscale image as the basic feature map to simplify subsequent calculations.

[0042] To enhance the distinction between the blades and the background, the system performs contrast enhancement processing on the grayscale image, improving the saliency of blade edges and textures. In addition to the grayscale image, the feature map can also employ Local Binary Pattern (LBP) features or Histogram of Gradients (HOG) to enhance the description of blade details and improve the accuracy of optical flow calculation. It can be understood that a "feature map" is an image representation of the original input image after transformation and enhancement, primarily aimed at highlighting the structural features of the blades to facilitate optical flow estimation for inter-frame motion.

[0043] The system determines whether the current frame is the first frame in the sequence: if it is the first frame, it means that optical flow calculation cannot be performed yet (due to the lack of a reference frame). The feature map of this frame is used as a reference baseline and saved to the cache as the starting reference frame for optical flow calculation. Then, it returns to S11 to continue acquiring the next frame image, accumulating subsequent image data for optical flow calculation. If it is not the first frame, it means that the system has cached a historical image frame and proceeds to the subsequent optical flow calculation steps.

[0044] S13: Based on the first target image of the current frame, perform optical flow feature calculation to obtain the optical flow feature map of the first target image of the current frame, and increment the number of optical flow feature maps by one.

[0045] After acquiring the feature map of the current frame, the system performs inter-frame optical flow estimation by comparing it with the saved feature map of the previous frame. The optical flow algorithm calculates a motion vector (u, v) for each pixel, representing the horizontal (u) and vertical (v) displacement of that pixel between two frames. The set of motion vectors constitutes the optical flow feature map, reflecting the motion of the blade and background regions. The feature map of the current frame is saved for use in the next inter-frame optical flow calculation. Subsequently, the optical flow feature map obtained in this calculation is added to the optical flow feature map sequence, accumulating to prepare for subsequent motion region determination. In essence, the "optical flow feature map" represents the motion state of all pixels in an image between two consecutive frames, revealing the overall motion trend of a region and serving as the core basis for determining the rotation region and direction of the blade.

[0046] S14: Determine whether the number of optical flow feature maps meets a preset condition; if the number of optical flow feature maps meets the preset condition, use the optical flow feature maps of that number as the target optical flow feature maps; if the number of optical flow feature maps does not meet the preset condition, jump to S11.

[0047] Due to the possible random perturbations or transient interferences in single-frame optical flow features, the system needs to accumulate a sufficient number of optical flow feature maps to obtain a robust judgment of the motion trend. The specific implementation is as follows:

[0048] Set a preset quantity threshold N (e.g., N = 10) (i.e., the preset condition), indicating that at least N frames of optical flow feature maps need to be calculated; if the number of optical flow feature maps in the current optical flow sequence < N, it means the motion trend is still unstable, and the system returns to S11 to continue collecting images; if the number of optical flow feature maps ≥ N, the system outputs all the current optical flow feature maps as "target optical flow feature maps" for subsequent target area and direction judgment (step S2). It can be understood that the "target optical flow feature maps" refer to a sequence of optical flow feature maps that meet the frame number requirements, containing motion information within a sufficient time span for subsequent steady-state statistical processing.

[0049] In step S1, by continuously acquiring image frames during the rotation of the blade and calculating the inter-frame optical flow features, it provides a basis for subsequent accurate positioning and preliminary direction judgment of the blade motion area. This step uses image features such as grayscale images with enhanced contrast as the basis for optical flow calculation, improving the quality and stability of the optical flow feature maps, reducing the interference of light changes and blade surface wear on motion detection. By accumulating multiple frames of optical flow feature maps and performing statistical judgments, it avoids misjudgments caused by single-frame image noise. At the same time, this step has a high degree of automation, without the need for users to perform complex operations and markings, effectively reducing the dependence on manual participation and simplifying the user's operation process. Therefore, step S1 provides a stable and reliable basis for the accurate identification and counting of the subsequent blade target area, significantly improving the accuracy and practicality of the entire blade counting method.

[0050] S2: Based on the target optical flow feature maps, obtain the optical flow angle map and the accumulated optical flow amplitude map, and determine the target motion area according to the accumulated optical flow amplitude map.

[0051] Among them, based on the target optical flow feature maps, obtaining the optical flow angle map and the accumulated optical flow amplitude map, and determining the target motion area according to the accumulated optical flow amplitude map includes: performing optical flow angle calculation on the target optical flow feature maps to obtain the optical flow angle map; performing optical flow amplitude calculation on the target optical flow feature maps to obtain the optical flow amplitude map; performing pixel-position summation calculation on the optical flow amplitude map to obtain the accumulated optical flow amplitude map; inputting the accumulated optical flow amplitude map into a preset image segmentation model to obtain the segmentation result; selecting the segmentation area with the largest average optical flow amplitude from the segmentation result as the target motion area.

[0052] Based on the target optical flow feature map obtained in step S1 (each image contains the horizontal and vertical motion vectors of each pixel), the optical flow angle map and the optical flow amplitude accumulation map are calculated. Then, the target region with the most significant motion during blade rotation is identified using image segmentation methods, serving as the basis for locating the subsequent observation window. The specific implementation process is as follows:

[0053] (1) Calculate the optical flow angle diagram:

[0054] For each pixel in each optical flow feature map, the optical flow angle (i.e., direction of motion) at that point is calculated using the following formula:

[0055]

[0056] This angle value represents the direction of movement of the pixel, and is typically between 0 and 360 degrees. This indicates the horizontal speed of the pixel. This indicates the vertical speed of the pixel.

[0057] (2) Calculate the optical flow amplitude diagram:

[0058] Similarly, for each pixel in each optical flow feature map, the amplitude of the motion (i.e., the magnitude of the motion speed) is calculated:

[0059]

[0060] The amplitude map represents the motion intensity of a pixel; a larger amplitude indicates more pronounced motion, while a smaller amplitude may indicate a static background or noise. This amplitude map helps to highlight areas of blade movement and filter out insignificant or interfering motion information.

[0061] (3) Construction of optical flow amplitude accumulation map:

[0062] For all accumulated optical flow amplitude maps, perform point-by-point accumulation at the corresponding pixel positions:

[0063]

[0064] Where N is the number of optical flow feature maps.

[0065] The cumulative image reflects the cumulative motion intensity of a pixel over the entire sampling time window, which can smooth out random noise in a single frame and improve the stability of motion region detection. For example, the pixel area passed through by a rotating blade will accumulate a higher amplitude, while the background pixel amplitude will be lower.

[0066] (4) Image segmentation of moving regions:

[0067] Using the accumulated optical flow amplitude image as input, an image segmentation algorithm is applied to divide the image into several regions to identify the leaf regions with the most significant motion. Common image segmentation models include: Binary segmentation: A threshold is set, and pixels in the accumulated optical flow amplitude image above the threshold are classified as foreground (moving regions), while pixels below the threshold are classified as background. Otsu's method: This method automatically calculates the optimal threshold to divide the image into foreground and background, minimizing intra-class variance and maximizing inter-class variance. Other adaptive thresholding and region growing methods can also be used, the key being to accurately segment the significantly moving regions. Finally, the segmentation results generate several non-overlapping regions, each representing a possible moving target.

[0068] (5) Selection of target motion area:

[0069] For each segmented region, calculate the average optical flow amplitude within that region:

[0070]

[0071] in, Indicates the first Each segmented region This represents the number of pixels in that area.

[0072] The region with the largest average optical flow amplitude was selected as the target motion region, which corresponds to the part where the blade's rotation is most pronounced. This region exhibits significant optical flow changes and represents the main area of ​​actual blade motion, thus avoiding interference from background noise and irrelevant motion.

[0073] Step S2, by decomposing and calculating the optical flow angle and amplitude of the target optical flow feature map and constructing an optical flow amplitude accumulation map, significantly enhances the temporal consistency representation of the moving region, effectively suppresses local errors caused by single-frame noise, background disturbances, or transient occlusion, and improves the stability and robustness of target region detection. Furthermore, by employing an image segmentation-based approach to extract the region with the largest average optical flow amplitude from the accumulation map as the target moving region, it not only accurately locates the most active spatial region of blade rotation but also avoids reliance on prior window settings and human experience adjustments, significantly reducing parameter sensitivity and the degree of human intervention. This method possesses good versatility and transferability, applicable to blade counting tasks in different scenarios, providing a solid foundation for subsequent adaptive positioning of the observation window and reliable estimation of the rotation direction, thereby comprehensively improving the accuracy and intelligence level of the entire blade counting process.

[0074] S3: Based on the target motion area, obtain the target bounding box, and based on the target bounding box and the optical flow angle diagram, determine the initial rotation direction of the blade.

[0075] The process involves obtaining a target bounding box based on the target motion region, and determining the initial rotation direction of the blade based on the target bounding box and the optical flow angle map. This includes: extracting the contour information of the target motion region and generating a target bounding box based on the contour information; calculating the optical flow angle histogram corresponding to the optical flow angle map of the region within the target bounding box; and selecting the angle with the highest frequency from the optical flow angle histogram as the initial rotation direction.

[0076] In step S2, the target motion region where the blade rotates has been identified using the optical flow amplitude accumulation map and image segmentation model. To further accurately locate the main motion trajectory of the blade and determine its rotation direction, the following steps are performed:

[0077] (1) Extract the contour information of the target motion region:

[0078] Based on the segmented target motion region image, the system extracts the outer contour of the region using edge detection and connected component analysis algorithms (such as the Canny edge detection and contour extraction algorithm findContours). The contour information is a set of continuous pixel boundary points, representing the outer boundary of the blade with significant motion during its rotation.

[0079] (2) Fit the inscribed rectangle based on the contour information to obtain the target box:

[0080] Using a minimum bounding rectangle fitting algorithm (such as the minAreaRect function in OpenCV), the above contour point set is geometrically fitted to obtain a minimum bounding rectangle that can cover the contour. This bounding rectangle may have a rotation angle and has parameters such as center point coordinates, width, height, and orientation angle.

[0081] To improve the accuracy of subsequent image analysis, the system adaptively adjusts the rectangular bounding box based on its size ratio and image resolution (e.g., keeping the center point unchanged while increasing the width and height by 10%-20%, or limiting the minimum / maximum side length) to form a more stable target bounding box region and reduce background interference.

[0082] (3) Calculate the histogram of the optical flow angle within the target bounding box region:

[0083] Iterate through each frame of optical flow angle map obtained in step S2, and extract the angle values ​​(usually in radians or angles) located inside the target box (i.e., the pixel positions covered by the target box). Compile these angle values ​​into an optical flow angle histogram. This histogram, with angle as the horizontal axis and pixel count as the vertical axis, reflects the frequency distribution of motion in different directions within the target box. For example, the angle range [-π, π] can be divided into 36 equal 10-degree intervals (or finer granularity), and the number of pixels in each angle interval can be counted.

[0084] (4) Determine the angle range with the highest frequency as the initial rotation direction:

[0085] The system selects the angle interval with the most pixels from the optical flow angle histogram, which is the direction in which the blade movement direction is most concentrated within the target frame, and uses this direction as the initial rotation direction of the blade. This direction is usually a clockwise or counterclockwise angle in image space, and serves as the direction reference benchmark for subsequent blade counting.

[0086] Finally, the system overlays the target bounding boxes onto the current image frame in a visual manner and prompts the user on the interface to "move a small number of leaves into the target bounding boxes." This operation aims to ensure that the subsequent training samples for the classification model are sufficiently representative and that the direction of movement is consistent with the initialization direction, thereby enhancing the robustness of the classification model.

[0087] Step S3 involves extracting the contour of the target motion region and generating an inscribed rectangular target box. The initial rotation direction of the blade is then calculated using the optical flow angle map, achieving precise localization of the blade's main motion trajectory and automated direction initialization. First, this step abandons the traditional method of manually selecting windows or specifying rotation directions. Through image contour fitting and angle histogram statistics, it adaptively determines the spatial range of the target box and the main rotation direction, effectively reducing manual intervention. Second, the target box defines the area for subsequent feature extraction and counting, avoiding background interference and improving processing efficiency and blade recognition accuracy. Third, by statistically analyzing the optical flow angle histogram and extracting the most frequently occurring direction value as the main rotation direction of the blade, it can adaptively adapt to different shooting angles and rotation states, enhancing the system's adaptability to complex working conditions. Finally, this step automatically completes the initial configuration of the spatial window and rotation direction without requiring preset hardware parameters or specialized background knowledge, providing a stable and accurate spatial and directional reference for subsequent feature learning and counting model construction.

[0088] S4: Obtain the second target image within the target box during the blade rotation process, and perform cluster analysis and construct a blade classification model based on the second target image.

[0089] The process of performing cluster analysis and constructing a leaf classification model based on the second target image includes: calculating the feature histogram of the second target image; inputting the feature histogram of the second target image into a preset clustering model to obtain clustering results; classifying the type of the second target image based on the clustering results to obtain classified second target images; and inputting the classified second target images into the leaf classification model for training to obtain the trained leaf classification model.

[0090] After generating the target bounding box and determining the initial rotation direction, a leaf classification model is needed to distinguish between "blades" and "non-blades" for accurate leaf identification and counting. Therefore, after the user initially rotates a small number of leaves into the target bounding box and clicks the "OK" button, the system immediately enters the image clustering and model training phase of this step, as follows:

[0091] (1) User triggers image acquisition:

[0092] The system prompts the user to slowly rotate a small number of blades through the target frame area. After the user clicks the "Confirm" button, one or more frames are immediately captured as the second target image. These images should contain information about the blades or background in different states.

[0093] (2) Extract the feature histogram of the region within the target bounding box:

[0094] For each frame of the second target image, the system performs image feature extraction within the target bounding box region, generating a corresponding feature histogram. Feature options include, but are not limited to: grayscale histogram (binary statistical analysis of grayscale value distribution); Local Binary Pattern (LBP) histogram (reflecting texture features); Histogram of Gradient Orientation (HOG) (suitable for leaves with obvious edge structures); and optional image enhancement (such as high-pass filtering and edge detection) to improve feature stability. Finally, the output is a set of feature vectors per frame.

[0095] (3) Constructing a training sample pool:

[0096] The feature histogram of the current second target image is merged with the feature histograms of the target bounding box historical images cached by the system to form a training sample pool containing multiple samples. This sample pool should contain multiple states: with blades, without blades, edge transition, etc.

[0097] (4) Perform unsupervised cluster analysis:

[0098] Unsupervised clustering algorithms (such as K-means, spectral clustering, and DBSCAN) are used on the above sample pool to divide the feature vectors into several clusters. The clustering goal is to distinguish between patterns in the image that contain leaves and those that do not. This step mainly includes: selecting an appropriate number of clusters (which can be preset or automatically determined using silhouette coefficients); finding the clustering results with the maximum inter-class distance and the minimum intra-class distance in the feature space; and ensuring that each cluster represents a class of image appearance patterns.

[0099] (5) Clustering result labeling and filtering:

[0100] The clustering results are analyzed: the frame time position and brightness / texture features of the images in each cluster are examined to preliminarily determine which clusters mainly contain leaves and which are background; based on the distance between the cluster center vector and the target frame feature vector, the two subsets most likely to represent "leaves" and "non-leaves" are selected; representative samples are selected to form a binary classification training set, where: positive samples are the image histograms of "with leaves"; negative samples are the image histograms of "without leaves".

[0101] (6) Construct a lightweight blade classification model:

[0102] The selected samples are input into the preset leaf discrimination model structure for training. The model can be: Extreme Learning Machine (ELM): the default choice because it does not require a lot of parameter tuning and has a fast training speed; or alternative models such as: Logistic Regression, Linear SVM, Small-scale Random Forest and other lightweight structures.

[0103] The model is saved after training and used to determine whether the image within the target bounding box of each frame belongs to the "leaf state".

[0104] Step S4 involves acquiring images within the target bounding box during the slow rotation of the blades, and performing clustering analysis and model training based on image feature histograms to construct a blade classification model capable of automatically identifying "blade states" and "non-blade states." First, user-guided acquisition of a small number of images avoids reliance on large-scale sample sets, enabling the system to quickly adapt to real-world deployments and significantly reducing the requirements for pre-training data. Second, unsupervised clustering automatically categorizes image states, replacing the high-cost traditional manual image labeling process, further reducing human intervention and reliance on domain knowledge. Third, the constructed blade classification model employs lightweight discriminators such as Extreme Learning Machines, achieving both good classification accuracy and rapid response in computationally limited industrial environments, demonstrating strong deployment friendliness and resource adaptability. Furthermore, the established classification model provides frame-level state discrimination capabilities for subsequent dynamic blade counting, fundamentally improving the robustness and counting accuracy of blade recognition. Therefore, it not only enhances the intelligence level of blade recognition but also considers system adaptability, engineering feasibility, and efficient utilization of computing resources.

[0105] S5: Obtain the third target image within the target box during the blade rotation process, and determine whether the third target image is a blade based on the blade classification model and the initial rotation direction, and count the blades.

[0106] To achieve high-precision determination of the number of times the blade rotates, this step performs optical flow motion analysis and blade state determination on the third target image within the target bounding box, realizing frame-level dynamic counting. Please refer to [link / reference]. Figure 3 , Figure 3This is a flowchart of the blade counting process provided in an embodiment of this application. For example... Figure 3 As shown, step S5 includes:

[0107] S51: Obtain the third target image.

[0108] The system extracts a frame of image from a video stream or image sequence in real time, and selects the image region corresponding to the target bounding box as the third target image to be processed, denoted as... The location information of the target bounding box comes from the inscribed rectangle extracted in step S3 above.

[0109] S52: Based on the third target image of the current frame, perform optical flow feature calculation to obtain the optical flow feature map of the third target image of the current frame.

[0110] With the current frame image Compared to the previous frame image As input, dense optical flow algorithms (such as Farneback, PWC-Net, or RAFT) are used to compute the optical flow vector field of each pixel between images, resulting in a two-dimensional optical flow feature map. .in, It is the displacement of that pixel in the X direction. It is the displacement of the pixel in the Y direction.

[0111] S53: Based on the optical flow feature map, obtain the optical flow angle map and average optical flow amplitude of the region within the target box.

[0112] From the optical flow vector field, the optical flow angle map of all pixels within the target box is further calculated. The calculation formula is as shown in step S2 for calculating the optical flow angle. Wherein, the angle value... It is discretized into 16 equally spaced intervals to reduce error sensitivity.

[0113] From the optical flow vector field, the average optical flow amplitude of all pixels within the target box is further calculated. The calculation formula is as shown in step S2 for the average optical flow amplitude.

[0114] S54: Determine whether the average optical flow amplitude is greater than the preset threshold; if the average optical flow amplitude is not greater than the preset threshold, then jump to S51; if the average optical flow amplitude is greater than the preset threshold, then jump to S55.

[0115] The current average optical flow amplitude Compared with the experience preset threshold (Can be adaptively set according to actual conditions) Comparison is used to determine whether the current blade is in a state of significant movement:

[0116] like If the state is considered static or ineffective motion, jump to S51 to obtain the next frame image; if If a frame is considered a valid motion frame, it will continue to be processed.

[0117] S55: Based on the optical flow angle map of the region within the target frame, calculate the optical flow angle histogram of the region within the target frame, and select the angle with the highest frequency from the optical flow angle histogram as the current movement direction of the blade.

[0118] Extract all optical flow angle values ​​within the target bounding box. Construct an angle histogram: map all angle values ​​to the [0, 15] interval according to a set discretization rule; count the frequency of each interval; and take the angle interval with the highest frequency as the current motion direction of the current frame. This is used as an estimate of the current rotation direction of the blade. This direction will be compared with the initial rotation direction to support subsequent counting decisions.

[0119] S56: Input the third target image of the current frame into the leaf classification model to obtain the classification probability value.

[0120] The third target image of the current frame Input the image features into the leaf classification model trained in the previous step S4, extract the image features, and output the classification probability value of the leaf. , which represents the confidence level that the image within the target bounding box of the current frame is a leaf.

[0121] S57: Count the blades based on their current direction of movement and classification probability value.

[0122] S57 includes: if the classification probability value is not less than the preset probability value, and the current movement direction and the initial rotation direction are consistent; increment the number of blades by one; if the classification probability value is not less than the preset probability value, but the current movement direction and the initial rotation direction are inconsistent or opposite; decrement the number of blades by one; if the number of blades becomes zero after decrementing by one, the current movement direction is taken as the initial rotation direction; if the classification probability is less than the preset probability value; keep the number of blades unchanged and jump to S51.

[0123] Based on classification probability values Current direction of motion and the initial rotation direction (for ease of comparison, let's assume it's named as follows) This implements conditional blade count updates. The process is as follows:

[0124] like That is, the image is highly likely to be a leaf: if The counter increments by one, indicating that the blade has passed; if... Decrementing the counter by one is considered a reverse interference or position reset; if the number of blades is zero after decrementing, the current direction will be automatically changed. Set as the new initial rotation direction This enables adaptive adjustment of direction.

[0125] like Keep the number of blades unchanged, ignore this frame, and jump to S51.

[0126] In addition, to prevent the same leaf from being counted repeatedly in multiple frames, a minimum frame interval or state locking mechanism can be introduced to update the count only when a complete cycle of "pass-leave-pass again" occurs.

[0127] Step S5, by combining optical flow motion features with a lightweight blade classification model, achieves highly robust identification of whether the target area is a blade during rotation and further performs accurate counting, with the following effects: First, by calculating the average optical flow amplitude of the image within the target box and setting a preset threshold, stationary or low-speed motion frames are effectively eliminated, reducing the probability of false detection and duplicate counting; Second, the current main motion direction of the blade is extracted based on the optical flow angle histogram and compared with the initial rotation direction, enabling the algorithm to identify abnormal directions or blade reverse interference, improving the robustness and direction perception of the counting process; Furthermore, by introducing a pre-trained blade classification model and setting a preset probability value, counting is only conducted when the target area height is likely to be a blade, effectively enhancing the ability to identify non-blade areas such as foreign objects and noise; In addition, to address the problem of false counts caused by sudden changes in rotation direction, the system also introduces an adaptive direction update mechanism when the count is zero, avoiding long-term false counts due to incorrect initial direction settings. Therefore, by integrating motion analysis and semantic discrimination, an adaptive, feedback-enabled, and fault-tolerant dynamic counting mechanism was constructed, which significantly improved the accuracy, robustness, and engineering practicality of the blade counting system under various complex working conditions.

[0128] This application provides a blade counting method that significantly reduces reliance on manual intervention, parameter sensitivity, and hardware resources while improving blade counting accuracy. It features the following characteristics: First, by calculating inter-frame optical flow from consecutive image frames and extracting target optical flow feature maps containing the target motion region, a stable and structured motion information foundation is provided for subsequent analysis, effectively avoiding errors caused by image noise or environmental disturbances. Then, by constructing optical flow angle maps and optical flow amplitude accumulation maps, combined with image segmentation algorithms, the significant rotational regions of the blades are accurately located, enabling the system to automatically determine suitable target areas for observation and counting, eliminating tedious manual selection and parameter adjustment. Based on this, the contour of the rotational region is extracted and a target bounding box is generated. Analysis of the optical flow angle histogram within the bounding box determines the initial rotation direction of the blade, establishing a unified direction reference for the subsequent counting process and effectively addressing counting deviations caused by direction switching or interference rotation. Furthermore, feature histograms are constructed using images within the target bounding box, and clustering and model training are performed. Without relying on large-scale labeled samples, a lightweight blade classification model adapted to the field environment is quickly built, achieving effective differentiation between blade and non-blade regions. Finally, optical flow analysis and classification models are jointly applied to the actual counting process. By setting an optical flow amplitude threshold to filter still frames, the current rotation direction is determined, and the count is updated based on classification confidence and direction consistency. Furthermore, an adaptive direction mechanism is introduced to ensure the robustness of counting in direction-drift scenarios. Based on this, this method, with dynamic optical flow analysis as the main thread, integrates contour extraction, feature clustering, lightweight discriminative modeling, and counting strategy optimization to form a blade counting solution that requires no high computing power, has low human dependence, high adaptability, and high accuracy. It is particularly suitable for deployment in industrial scenarios with complex backgrounds, limited resources, and human-machine hybrid environments.

[0129] Based on the blade counting method provided in the above embodiments, this application further provides a blade counting device. Please refer to... Figure 4 , Figure 4 This is a schematic diagram of the blade counting device. Figure 4 As shown, the device 200 includes: a target optical flow feature map acquisition module 210, a target motion region acquisition module 220, a target bounding box and initial rotation direction acquisition module 230, a blade classification model construction module 240, and a blade counting module 250.

[0130] The target optical flow feature map acquisition module 210 is used to acquire a first target image during the blade rotation process and perform optical flow feature calculation on the first target image to obtain a target optical flow feature map that meets preset conditions; the target motion region acquisition module 220 is used to obtain an optical flow angle map and an optical flow amplitude accumulation map based on the target optical flow feature map, and determine the target motion region based on the optical flow amplitude accumulation map; the target box and initial rotation direction acquisition module 230 is used to obtain a target box based on the target motion region, and determine the initial rotation direction of the blade based on the target box and the optical flow angle map; the blade classification model construction module 240 is used to acquire a second target image within the target box during the blade rotation process, and perform cluster analysis and construct a blade classification model based on the second target image; the blade counting module 250 is used to acquire a third target image within the target box during the blade rotation process, and determine whether the third target image is a blade based on the blade classification model and the initial rotation direction, and count the blades.

[0131] It should be noted that the above-described blade counting device can execute the blade counting method provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in the blade counting device embodiments can be found in the blade counting method provided in the embodiments of this application.

[0132] This application also provides an electronic device 300, please refer to... Figure 5 This diagram illustrates the hardware structure of an electronic device 300 capable of performing the methods described in the above embodiments. The electronic device 300 includes: at least one processor 310; and a memory 320 communicatively connected to the at least one processor 310. Figure 5 Taking a processor 310 as an example, the memory 320 stores instructions executable by the at least one processor 310. These instructions, when executed by the at least one processor 310, enable the at least one processor 310 to perform the blade counting method described in the above embodiment. The processor 310 and the memory 320 can be connected via a bus or other means. Figure 5 Taking the example of a connection between China and Israel via a bus.

[0133] The memory 320, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the blade counting method in the embodiments of this application. The processor 310 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions, and modules stored in the memory 320, thereby implementing the blade counting method described in the above embodiments.

[0134] The memory 320 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computing device. Furthermore, the memory 320 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 320 may optionally include memory remotely located relative to the processor 310, and these remote memories may be connected to the computing device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0135] The one or more modules are stored in the memory 320, and when executed by the one or more processors 310, they perform the blade counting method described in the above embodiments.

[0136] It should be noted that the electronic device 300 in this embodiment includes, but is not limited to, industrial testing terminal equipment, embedded controllers / testing devices, portable smart terminals, servers or cloud processing equipment, etc.

[0137] The above-described product can execute the method provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the blade counting method described in the embodiments of this application.

[0138] This application provides a non-volatile computer-readable storage medium storing computer-executable instructions that are executed by one or more processors to enable the at least one processor to perform the blade counting method described in the above embodiments. For example, the non-volatile computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CDROM), magnetic tape, floppy disk, or optical data storage device, etc.

[0139] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0140] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0141] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and not to limit them; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of this application as described above, which are not provided in detail for the sake of brevity; although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for counting leaves, characterized in that, The method includes: A first target image of the blade rotation process is acquired, and optical flow features are calculated on the first target image to obtain a target optical flow feature map that meets preset conditions. Based on the target optical flow feature map, an optical flow angle map and an optical flow amplitude accumulation map are obtained, and the target motion region is determined based on the optical flow amplitude accumulation map; Based on the target motion area, a target frame is obtained, and based on the target frame and the optical flow angle diagram, the initial rotation direction of the blade is determined; Acquire a second target image within the target box during the blade rotation process, and perform cluster analysis and construct a blade classification model based on the second target image; Acquire a third target image within the target box during the rotation of the blade, and based on the blade classification model and the initial rotation direction, determine whether the third target image is a blade, and count the blades. The step of obtaining an optical flow angle map and an optical flow amplitude accumulation map based on the target optical flow feature map, and determining the target motion region based on the optical flow amplitude accumulation map, includes: calculating the optical flow angle of the target optical flow feature map to obtain the optical flow angle map; calculating the optical flow amplitude of the target optical flow feature map to obtain the optical flow amplitude map; summing the optical flow amplitude map by pixel position to obtain the optical flow amplitude accumulation map; inputting the optical flow amplitude accumulation map into a preset image segmentation model to obtain a segmentation result; and selecting the segmentation region with the largest average optical flow amplitude from the segmentation result as the target motion region. The step of obtaining a target bounding box based on the target motion region and determining the initial rotation direction of the blade based on the target bounding box and the optical flow angle map includes: extracting the contour information of the target motion region and generating the target bounding box based on the contour information; calculating the optical flow angle histogram corresponding to the optical flow angle map of the region within the target bounding box; and selecting the angle with the highest frequency from the optical flow angle histogram as the initial rotation direction.

2. The blade counting method according to claim 1, characterized in that, The process of acquiring a first target image of the blade rotation process and performing optical flow feature calculation on the first target image to obtain a target optical flow feature map that meets preset conditions includes: S11: Obtain the first target image and determine whether the current frame of the first target image is the first frame; S12: If the current frame is the first frame, save the first target image of the current frame and jump to S11; if the current frame is not the first frame, jump to S13. S13: Based on the first target image of the current frame, perform optical flow feature calculation to obtain the optical flow feature map of the first target image of the current frame, and increment the number of optical flow feature maps by one; S14: Determine whether the number of optical flow feature maps meets the preset condition; if the number of optical flow feature maps meets the preset condition, then use the number of optical flow feature maps as the target optical flow feature map; if the number of optical flow feature maps does not meet the preset condition, then jump to S11.

3. The blade counting method according to claim 1, characterized in that, The step of performing cluster analysis and constructing a leaf classification model based on the second target image includes: Calculate the feature histogram of the second target image; The feature histogram of the second target image is input into a preset clustering model to obtain the clustering result; Based on the clustering results, the type of the second target image is classified to obtain the classified second target image; The classified second target image is input into the leaf classification model for training to obtain the trained leaf classification model.

4. The blade counting method according to claim 1, characterized in that, The step of acquiring a third target image within the target bounding box during the leaf rotation process, and determining whether the third target image is a leaf based on the leaf classification model and the initial rotation direction, and performing leaf counting, includes: S51: Obtain the third target image; S52: Based on the third target image of the current frame, perform optical flow feature calculation to obtain the optical flow feature map of the third target image of the current frame; S53: Based on the optical flow feature map, obtain the optical flow angle map and average optical flow amplitude of the region within the target box; S54: Determine whether the average optical flow amplitude is greater than a preset threshold; if the average optical flow amplitude is not greater than the preset threshold, then proceed to S51; if the average optical flow amplitude is greater than the preset threshold, then proceed to S55. S55: Based on the optical flow angle map of the region within the target frame, calculate the optical flow angle histogram of the region within the target frame, and select the angle with the highest frequency from the optical flow angle histogram as the current movement direction of the blade; S56: Input the third target image of the current frame into the leaf classification model to obtain the classification probability value; S57: Count the blades based on the current direction of movement of the blades and the classification probability value.

5. The blade counting method according to claim 4, characterized in that, S57 includes: If the classification probability value is not less than the preset probability value, and the current motion direction and the initial rotation direction are consistent, the number of blades is incremented by one. If the classification probability value is not less than the preset probability value, and the current direction of motion is inconsistent with or opposite to the initial rotation direction, the number of blades is reduced by one; wherein, if the number of blades becomes zero after being reduced by one, the current direction of motion is taken as the initial rotation direction. If the classification probability is less than the preset probability value, keep the number of leaves unchanged and jump to S51.

6. A blade counting device, characterized in that, The device includes: The target optical flow feature map acquisition module is used to acquire a first target image during the blade rotation process and perform optical flow feature calculation on the first target image to obtain a target optical flow feature map that meets preset conditions. A target motion region acquisition module is used to obtain an optical flow angle map and an optical flow amplitude accumulation map based on the target optical flow feature map, and to determine the target motion region based on the optical flow amplitude accumulation map. The steps of obtaining the optical flow angle map and the optical flow amplitude accumulation map based on the target optical flow feature map and determining the target motion region based on the optical flow amplitude accumulation map include: calculating the optical flow angle of the target optical flow feature map to obtain the optical flow angle map; calculating the optical flow amplitude of the target optical flow feature map to obtain the optical flow amplitude map; performing pixel-wise summation calculation on the optical flow amplitude map to obtain the optical flow amplitude accumulation map; inputting the optical flow amplitude accumulation map into a preset image segmentation model to obtain a segmentation result; and selecting the segmentation region with the largest average optical flow amplitude from the segmentation result as the target motion region. A target bounding box and initial rotation direction acquisition module is used to obtain a target bounding box based on the target motion region, and determine the initial rotation direction of the blade based on the target bounding box and the optical flow angle map. The step of obtaining the target bounding box based on the target motion region and determining the initial rotation direction of the blade based on the target bounding box and the optical flow angle map includes: extracting the contour information of the target motion region and generating the target bounding box based on the contour information; calculating the optical flow angle histogram corresponding to the optical flow angle map of the region within the target bounding box; and selecting the angle with the highest frequency from the optical flow angle histogram as the initial rotation direction. A leaf classification model construction module is used to acquire a second target image within the target box during the rotation of the leaf, and to perform cluster analysis and construct a leaf classification model based on the second target image. The blade counting module is used to acquire a third target image within the target box during the rotation of the blade, and based on the blade classification model and the initial rotation direction, determine whether the third target image is a blade, and count the blades.

7. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1-5.

8. A non-volatile computer-readable storage medium, characterized in that, The non-volatile computer-readable storage medium stores computer-executable instructions that, when executed by an electronic device, cause the electronic device to perform the method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Aero-engine blade counting method and device and electronic equipment

    CN117315549A

  • Autonomous unmanned aerial vehicle based intelligent inspection system for equipment, facilities, and the environment along railway lines and method thereof

    US20250187637A1