A visual positioning control method and system for a photovoltaic cleaning robot
By acquiring a set of grayscale images and analyzing feature vectors of the photovoltaic cleaning robot, the problem of inaccurate positioning caused by the low texture of the photovoltaic module surface was solved, achieving efficient positioning and status monitoring, and ensuring cleaning effect and system safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG TIANYI MACHINERY
- Filing Date
- 2026-04-20
- Publication Date
- 2026-07-14
AI Technical Summary
In existing technologies, photovoltaic cleaning robots suffer from insufficient positioning accuracy due to the large area of low texture and repetitive structural features on the surface of photovoltaic modules, which affects the cleaning effect and system safety.
By acquiring a set of grayscale images in real time, edge detection algorithms are used to obtain edge pixels and gradient directions, target clusters are obtained, feature vectors are acquired, and the orientation matching and offset of consecutive frame images are analyzed for localization and state control.
This improves the positioning accuracy of photovoltaic cleaning robots, enables timely detection of abnormal operating conditions, and ensures cleaning effectiveness and system safety.
Smart Images

Figure CN122391358A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a visual positioning control method and system for photovoltaic cleaning robots. Background Technology
[0002] A photovoltaic (PV) cleaning robot is a mobile robot that integrates motion, cleaning, sensing, and control systems to automatically clean the surface of PV modules. During use, PV panels may be affected by dust, water stains, and other factors, leading to localized hotspots and reduced power generation efficiency. Therefore, timely cleaning of the PV panel surface is crucial for ensuring its normal operation. During operation, the PV cleaning robot needs to move along a predetermined path along the PV module surface to achieve full coverage cleaning of the target area. Therefore, how to accurately position the PV cleaning robot and achieve stable motion control becomes a key technical issue affecting cleaning effectiveness and system safety.
[0003] Existing technologies typically use visual positioning methods to control the stable operation of photovoltaic cleaning robots. The direction of motion is determined by extracting key pixels and detecting edges in a single frame image. However, the surface of photovoltaic modules often exhibits large areas of low texture and repetitive structures, which makes existing technologies prone to feature matching errors (i.e., different locations are identified as the same location due to similar texture structures), resulting in insufficient positioning accuracy and thus affecting the accuracy of the photovoltaic cleaning robot's running path.
[0004] Therefore, how to effectively improve the positioning accuracy of photovoltaic cleaning robots has become an urgent problem to be solved. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide a visual positioning control method and system for photovoltaic cleaning robots, in order to solve the problem of how to effectively improve the positioning accuracy of photovoltaic cleaning robots.
[0006] In a first aspect, embodiments of the present invention provide a visual positioning control method for a photovoltaic cleaning robot, the method comprising the following steps:
[0007] During the operation of the photovoltaic cleaning robot, grayscale images at each sampling moment are acquired in real time, and grayscale images at each sampling moment within a preset time period are combined into a grayscale image set.
[0008] For any grayscale image in the grayscale image set, edge detection algorithm is used to obtain edge pixels and the gradient direction of each edge pixel. The gradient directions of all edge pixels are clustered to obtain at least two clusters. All clusters are sorted in descending order according to the number of pixels in the cluster. The first two clusters are recorded as target clusters. The feature vector of any grayscale image is obtained according to the grayscale distribution characteristics and texture representation characteristics of the pixels in each target cluster.
[0009] The feature vector of each grayscale image in the grayscale image set is obtained. Based on the difference in feature vectors between two adjacent grayscale images, the direction matching result of each two adjacent grayscale images is obtained. Based on the direction matching result of each two adjacent grayscale images and the changing trend of the feature vectors of grayscale images in the grayscale image set, the displacement offset and running deviation feature vector of the photovoltaic cleaning robot within a preset time period are obtained.
[0010] Based on the displacement and deviation feature vector of the photovoltaic cleaning robot within a preset time period, the photovoltaic cleaning robot is located and its operating status is controlled.
[0011] Preferably, obtaining the feature vector of any grayscale image based on the grayscale distribution features and texture representation features of pixels in each target cluster includes:
[0012] For any target cluster, obtain the average gradient direction of all edge pixels in the target cluster, and substitute the sum of the average gradient direction and 90 degrees into the modulo function of 180 degrees to obtain the preliminary direction value of the target cluster.
[0013] Based on the grayscale distribution characteristics and texture representation characteristics of pixels in each target cluster, as well as the preliminary direction value of each target cluster, the gradient direction of the mesh texture represented by each target cluster is obtained.
[0014] Based on the grid texture gradient direction represented by each target cluster, the grid line angle of any grayscale image is obtained, as well as the final direction value of each target cluster. The final direction value of a target cluster represents a grid line direction in any grayscale image, which includes a horizontal grid line direction and a vertical grid line direction.
[0015] For any target cluster, obtain the normal vector of the final direction value of the target cluster, perform normal projection on the edge pixels in the target cluster based on the normal vector to obtain a one-dimensional point sequence, cluster the one-dimensional point sequence to obtain at least two clusters, obtain the interval distance between each pair of adjacent clusters, obtain the median of the interval distance, and use it as the grid line spacing of the grid line direction represented by the final direction value of the target cluster. Obtain the grid line spacing of the grid line direction represented by the final direction value of each target cluster.
[0016] The final direction value of each target cluster in the grayscale image, the grid line spacing of the grid line direction represented by the final direction value of each target cluster, and the grid line angle of the grayscale image are used as feature values of the grayscale image to form the feature vector of the grayscale image.
[0017] Preferably, the step of obtaining the mesh texture gradient direction represented by each target cluster based on the grayscale distribution characteristics and texture representation characteristics of pixels in each target cluster, and the preliminary direction value of each target cluster, includes:
[0018] For any target cluster, adjacent edge pixels in the target cluster are grouped into an edge segment to be analyzed. For any edge segment to be analyzed, a reference edge segment is obtained in the target cluster based on the preliminary direction value of each target cluster. The edge segment to be analyzed and the reference edge segment are combined to form an edge segment sequence. Based on the length difference and distance features between the edge segments in the edge segment sequence, the mesh texture probability of the edge segment to be analyzed is obtained.
[0019] Obtain the mesh texture probability of each edge segment to be analyzed, and based on the mesh texture probability of each edge segment to be analyzed, obtain the mesh texture gradient direction represented by any target cluster.
[0020] Preferably, obtaining the probability of mesh texture for any edge segment to be analyzed based on the length difference and distance features between edge segments in the edge segment sequence includes:
[0021] The number of pixels contained in each edge segment in the edge segment sequence is obtained. For any two adjacent edge segments, the interval distance between them is obtained. The formula for calculating the referenceability of the interval distance between any two adjacent edge segments is as follows:
[0022] ;
[0023] in, For any of the edge segments to be analyzed, Let be any two adjacent edge segments; u is the u-th edge segment in the edge segment sequence; This refers to the (u+1)th edge segment in the edge segment sequence. The reference value of the interval distance between any two adjacent edge segments; The number of pixels contained in any edge segment to be analyzed; The number of pixels contained in the u-th edge segment in the edge segment sequence; The number of pixels contained in the (u+1)th edge segment in the edge segment sequence; It is the absolute value symbol; This is the normalization function; This is a preset constant;
[0024] Obtain the interval distance between every two adjacent edge segments and the referenceability of the interval distance between every two adjacent edge segments. Use the referenceability of the interval distance between every two adjacent edge segments as the weighting coefficient of the interval distance between every two adjacent edge segments. Calculate the weighted variance of the interval distance between every two adjacent edge segments. Substitute the negative of the weighted variance into the natural exponential function to obtain the mesh texture probability of any edge segment to be analyzed.
[0025] Preferably, obtaining the mesh texture gradient direction represented by any target cluster based on the mesh texture probability of each edge segment to be analyzed includes:
[0026] Obtain the cumulative value of the mesh texture probability of each edge segment to be analyzed, and record it as the cumulative value of mesh texture probability. For any edge segment to be analyzed, obtain the ratio of the mesh texture probability of the any edge segment to be analyzed to the cumulative value of mesh texture probability, and obtain the influence weight of the any edge segment to be analyzed.
[0027] The average gradient direction of the edge pixels in any edge segment to be analyzed is obtained and denoted as the average gradient direction of any edge segment to be analyzed.
[0028] Obtain the influence weight and average gradient direction of each edge segment to be analyzed. Use the influence weight of each edge segment to be analyzed as the weight coefficient of the average gradient direction of each edge segment to be analyzed. Perform a weighted summation of the average gradient directions of each edge segment to be analyzed to obtain the mesh texture gradient direction represented by any target cluster.
[0029] Preferably, obtaining the grid line angle of any grayscale image and the final direction value of each target cluster based on the grid texture gradient direction represented by each target cluster includes:
[0030] Obtain the grid texture gradient direction represented by each target cluster in any grayscale image, obtain the absolute value of the difference between the grid texture gradient directions represented by two target clusters in any grayscale image, and record it as the first angle, obtain the difference between 180 degrees and the first angle, and record it as the second angle, and obtain the minimum value between the first angle and the second angle as the grid line angle of any grayscale image;
[0031] For any target cluster in any grayscale image, the sum of the grid texture gradient direction represented by the target cluster and 90 degrees is substituted into the modulo function with 180 degrees to obtain the final direction value of the target cluster.
[0032] Preferably, the step of obtaining the orientation matching result of each pair of adjacent grayscale images based on the feature vector difference of each pair of adjacent grayscale images includes:
[0033] For any two adjacent grayscale images, the formulas for calculating the first direction matching value and the second direction matching value of the two adjacent grayscale images are as follows:
[0034] ;
[0035] in, For any two adjacent grayscale images; Let be the a-th grayscale image; b is the b-th grayscale image. The first direction matching value for any two adjacent grayscale images; The second direction matching value is the value between any two adjacent grayscale images. This represents the final orientation value of the first target cluster in the a-th grayscale image; This represents the final orientation value of the first target cluster in the b-th grayscale image; This represents the final orientation value of the second target cluster in the a-th grayscale image; This represents the final orientation value of the second target cluster in the b-th grayscale image; It is the absolute value symbol; This is a preset constant;
[0036] If the first direction matching value of any two adjacent grayscale images is greater than the second direction matching value of any two adjacent grayscale images, then the direction matching result of any two adjacent grayscale images is confirmed as the first direction matching result. The first direction matching result is that the grid line direction corresponding to the first target cluster of the first grayscale image in any two adjacent grayscale images is the same as the grid line direction corresponding to the first target cluster of the second grayscale image.
[0037] If the first direction matching value of any two adjacent grayscale images is less than the second direction matching value of any two adjacent grayscale images, then the direction matching result of any two adjacent grayscale images is confirmed as the second direction matching result. The second direction matching result is that the grid line direction corresponding to the first target cluster of the first grayscale image in any two adjacent grayscale images is the same as the grid line direction corresponding to the second target cluster of the second grayscale image.
[0038] Preferably, the step of obtaining the displacement offset and operational deviation feature vector of the photovoltaic cleaning robot within a preset time period based on the direction matching results of every two adjacent grayscale images and the changing trend of the feature vectors of the grayscale images in the grayscale image set includes:
[0039] For any grid line direction, target clusters belonging to any grid line direction in each grayscale image are formed into a target cluster sequence. Normal projection is performed on the edge segments to be analyzed contained in each target cluster in the target cluster sequence, and a target cluster obtains a one-dimensional distribution structure.
[0040] For any two adjacent target clusters in the target cluster sequence, the maximum matching offset of the one-dimensional distribution structure of the two adjacent target clusters is obtained by using a cross-correlation algorithm.
[0041] The sum of the maximum matching offsets of the one-dimensional distribution structure of every two adjacent target clusters in the target cluster sequence is obtained as the displacement offset of the photovoltaic cleaning robot in any grid direction within a preset time period.
[0042] Preferably, the step of obtaining the displacement offset and operational deviation feature vector of the photovoltaic cleaning robot within a preset time period based on the direction matching results of every two adjacent grayscale images and the changing trend of the feature vectors of the grayscale images in the grayscale image set further includes:
[0043] The feature values of all grayscale images are combined into a feature value set. The feature values of the same type in the feature value set are respectively combined into feature value sequences. For any feature value sequence, the feature value sequence is fitted to obtain a fitted line. The absolute value of the slope of the fitted line is obtained as the overall rate of change of any feature value sequence.
[0044] Obtain the fitted line corresponding to each feature value sequence, obtain the root mean square error of the fitted line corresponding to each feature value sequence, and obtain the maximum root mean square error.
[0045] The fluctuation level of any feature value sequence is obtained by normalizing the ratio of the root mean square error to the maximum root mean square error.
[0046] The overall rate of change and degree of fluctuation of each feature value sequence are obtained to form the operational deviation feature vector of the photovoltaic cleaning robot within a preset time period.
[0047] Secondly, embodiments of the present invention also provide a visual positioning control system for a photovoltaic cleaning robot, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements a visual positioning control method for a photovoltaic cleaning robot as described in the first aspect.
[0048] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows:
[0049] In this invention, grayscale images at each sampling moment within a preset time period are grouped into a grayscale image set. This set is used to subsequently combine the changes in texture structure features in multiple consecutive frames of images for the localization and motion state estimation of the photovoltaic cleaning robot, thereby improving the localization accuracy of the photovoltaic cleaning robot. Two target clusters are obtained to reflect the direction of the grid texture (horizontal and vertical grid lines) in the grayscale images. The feature vectors of the grayscale images and the direction matching results of every two adjacent grayscale images are obtained. Based on the feature change trends of consecutive frames of images, the displacement offset and running deviation feature vector of the photovoltaic cleaning robot within the preset time period are obtained. The current running deviation of the photovoltaic cleaning robot is analyzed, and the changes in the images are converted into the actual displacement of the robot. This is beneficial to improving the localization efficiency of the photovoltaic cleaning robot and can also reflect the dynamic changes of the photovoltaic cleaning robot during operation. This is beneficial to timely detection of abnormal operating states of the photovoltaic cleaning robot and facilitates timely implementation of targeted control measures for photovoltaic cleaning robots with abnormalities. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a flowchart of a visual positioning control method for a photovoltaic cleaning robot provided in Embodiment 1 of the present invention. Detailed Implementation
[0052] Embodiments of this disclosure are described in detail below, with examples of these embodiments illustrated in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting it.
[0053] It should be noted that the terms "first," "second," etc., used in this disclosure and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure.
[0054] To illustrate the technical solution of the present invention, specific embodiments are described below.
[0055] See Figure 1 This is a flowchart of a visual positioning control method for a photovoltaic cleaning robot provided in Embodiment 1 of the present invention. Figure 1 As shown, the method may include:
[0056] Step S101: During the operation of the photovoltaic cleaning robot, grayscale images at each sampling time are acquired in real time, and grayscale images at each sampling time within a preset time period are combined into a grayscale image set.
[0057] A photovoltaic (PV) cleaning robot is a mobile robot that integrates motion, cleaning, sensing, and control systems to automatically clean the surface of PV modules. During operation, the PV cleaning robot needs to move along a predetermined path along the surface of the PV module to achieve full coverage cleaning of the target area. Existing technologies typically use visual positioning methods to control the stable operation of PV cleaning robots, determining the direction of movement by extracting key pixels and detecting edges from single-frame images. However, the surface of PV modules often exhibits large areas of low texture and repetitive structures, making existing technologies prone to feature matching errors (i.e., different locations are identified as the same location due to similar texture structures), resulting in insufficient positioning accuracy and affecting the accuracy of the PV cleaning robot's operating path.
[0058] Therefore, after acquiring images of the photovoltaic cleaning robot during its operation, this embodiment of the invention first extracts feature values from the images. Then, by comparing the continuity of feature values in multiple consecutive frames, it matches the grid line directions in the multiple frames to analyze the displacement and operating status of the photovoltaic cleaning robot. This allows it to obtain the current movement direction and position of the photovoltaic cleaning robot and make adjustments based on the deviation between the actual position and the preset path. This effectively improves the positioning accuracy of the photovoltaic cleaning robot, facilitates the timely detection of abnormal robot operation, and enables timely and targeted control measures to be taken for robots with abnormalities.
[0059] First, images are acquired during the operation of the photovoltaic cleaning robot: A camera is installed below the photovoltaic cleaning robot to acquire real-time images of the photovoltaic module surface during its operation. In this embodiment, the image acquisition frequency is 20 FPS, which is not limited and can be adjusted according to the movement speed of the photovoltaic cleaning robot. To facilitate the extraction of image features, the acquired surface images need to be converted to grayscale to obtain grayscale images. Grayscale conversion is an existing technology and will not be described in detail here.
[0060] To analyze the motion state of the photovoltaic cleaning robot based on changes in multiple consecutive frames, grayscale images from each sampling moment within a preset time period are grouped into a grayscale image set. In this embodiment, the preset time period is set to 1 second, but this is not limited and can be set according to the specific implementation scenario. That is, the motion state of the photovoltaic cleaning robot is analyzed once every 1 second, and every 20 frames constitute a grayscale image set. The photovoltaic cleaning robot needs to maintain a fixed speed during operation to ensure consistent robot displacement within the interval between adjacent frames.
[0061] Thus, a set of grayscale images within the preset time period is obtained.
[0062] Step S102: For any grayscale image in the grayscale image set, use an edge detection algorithm to obtain edge pixels and the gradient direction of each edge pixel, cluster all edge pixels' gradient directions to obtain at least two clusters, sort all clusters in descending order according to the number of pixels in each cluster, and record the first two clusters as target clusters. Based on the grayscale distribution characteristics and texture representation characteristics of pixels in each target cluster, obtain the feature vector of any grayscale image.
[0063] After obtaining the set of grayscale images, it is necessary to extract the feature values from each grayscale image for subsequent analysis of the changes in texture structure features in multiple consecutive frames, and to perform position localization and motion state estimation of the photovoltaic cleaning robot.
[0064] Because the surface color of photovoltaic modules is relatively uniform and the texture is regular, extracting only representative pixels from a single image (such as pixels at grid edges or corners) may lead to matching errors due to the high similarity of features between different pixels. However, since the shape of the photovoltaic panel grid in the image and the spacing between grid lines are affected by factors such as the shooting angle of the photovoltaic cleaning robot, the texture features of the photovoltaic panel grid can be analyzed as feature values for each image.
[0065] Since mesh textures are typically straight lines, meaning the gradient directions of edges within the same texture segment are similar, for any grayscale image in the grayscale image set, the Sobel edge detection algorithm is first used to obtain the edge pixels and the gradient direction of each edge pixel (in this embodiment, the gradient direction is uniformly within the range of [0°, 180°]). The Sobel edge detection algorithm is existing technology and will not be elaborated here. Then, the k-means clustering method is used to cluster the gradient directions of all edge pixels, obtaining at least two clusters, where the value of k is determined using the elbow rule. The class method and elbow rule are existing technologies and will not be elaborated here. Since the mesh texture on the surface of photovoltaic panels is usually regular and repetitive, the gradient directions of different mesh texture edge segments have high similarity. However, the edge directions generated by stains are relatively random. Therefore, the pixels in the two clusters with the most pixels in the clustering results are more likely to be mesh texture edge pixels. Thus, all clusters are sorted in descending order according to the number of pixels in each cluster, and the top two clusters are designated as target clusters. The gradient directions of the pixels in the target clusters are closer to the two directions of the mesh texture (horizontal and vertical mesh line directions). Furthermore, based on the grayscale distribution characteristics and texture characteristics of the pixels in each target cluster, feature values of any grayscale image are extracted to obtain the feature vector of any grayscale image.
[0066] The method for extracting the feature value of any grayscale image and obtaining the feature vector of any grayscale image based on the grayscale distribution characteristics and texture representation characteristics of pixels in each target cluster is as follows:
[0067] Because the captured images are affected by factors such as the angle between the photovoltaic panel and the camera, the horizontal and vertical grid lines in the grayscale image may not be perfectly perpendicular. However, when the photovoltaic cleaning robot runs in a fixed direction, the angle between the horizontal and vertical grid lines should be relatively fixed in multiple consecutive frames because the shooting angle is fixed. Therefore, it is necessary to determine the direction of the horizontal and vertical grid lines in the grayscale image to obtain the angle between them.
[0068] (1) Obtain the initial direction value for each target cluster.
[0069] Since the gradient direction of the grid line is always perpendicular to the grid line, for any target cluster, the average gradient direction of all edge pixels in the target cluster is obtained. The result of adding the average gradient direction to 90 degrees is substituted into the modulo function with 180 degrees as the modulus to obtain the preliminary direction value of the target cluster.
[0070] In one embodiment, the formula for calculating the preliminary direction value of any target cluster is:
[0071]
[0072] in, This represents the initial direction value for any of the target clusters; The average gradient direction of all edge pixels in any target cluster; It is a remainder function used to ensure that the obtained initial direction value is within the range of [0°, 180°).
[0073] Similarly, the preliminary orientation value of each target cluster in any grayscale image is obtained.
[0074] (2) Based on the grayscale distribution characteristics and texture representation characteristics of pixels in each target cluster, and the preliminary direction value of each target cluster, obtain the mesh texture gradient direction represented by each target cluster.
[0075] a. For any target cluster, combine adjacent edge pixels in the target cluster into an edge segment to be analyzed, and for any edge segment to be analyzed, obtain the probability of the mesh texture of the edge segment to be analyzed.
[0076] Since the edges of abnormal textures such as stains on the surface of photovoltaic panels may have similar gradient directions to the edges of mesh textures due to their randomness, it is necessary to analyze the possibility that the edge segments composed of edge pixels in the target cluster are mesh texture edges in order to reduce the interference of these edges. Therefore, for any target cluster, adjacent edge pixels in the target cluster (i.e., edge pixels that are consecutive in the grayscale image; in this embodiment, pixels within the eight-neighborhood of a pixel are defined as consecutive pixels) are grouped into an edge segment to be analyzed.
[0077] Since the intervals between mesh texture edge segments are usually relatively consistent, i.e., the mesh texture edge segments have a periodic repetition pattern, for any edge segment to be analyzed, in the target cluster to which the edge segment to be analyzed belongs, the preliminary direction value of the target cluster to which the edge segment to be analyzed belongs is recorded as the first direction, and the preliminary direction value of another target cluster in any grayscale image is recorded as the second direction. Using the second direction as the horizontal line direction, all edge segments to be analyzed that are on the same horizontal line as the center of the edge segment to be analyzed are obtained and recorded as the reference edge segments of the edge segment to be analyzed. The edge segment sequence is formed by the edge segment to be analyzed and the reference edge segments of the edge segment to be analyzed. Based on the length difference and distance characteristics between the edge segments in the edge segment sequence, the mesh texture probability of the edge segment to be analyzed is obtained.
[0078] The method for obtaining the probability of mesh texture for any edge segment to be analyzed is as follows:
[0079] The more consistent the interval length between edge segments in an edge segment sequence, the more likely these edge segments are to be mesh texture edges. Furthermore, parallel edge segments within a mesh texture sequence generally have consistent lengths, while edges caused by stains or other contaminants exhibit greater randomness. Therefore, reference edge segments whose lengths are most consistent with any edge segment to be analyzed are more meaningful. Thus, for any two adjacent edge segments, the interval distance between them is obtained, and the number of pixels contained in each edge segment in the edge segment sequence is obtained. The specific formula for calculating the reference value of the interval distance between any two adjacent edge segments is as follows:
[0080]
[0081] in, For any of the edge segments to be analyzed, Let be any two adjacent edge segments; u is the u-th edge segment in the edge segment sequence; This refers to the (u+1)th edge segment in the edge segment sequence. The reference value of the interval distance between any two adjacent edge segments; The number of pixels contained in any edge segment to be analyzed; The number of pixels contained in the u-th edge segment in the edge segment sequence; The number of pixels contained in the (u+1)th edge segment in the edge segment sequence; It is the absolute value symbol; This is the normalization function; As a preset constant, this embodiment sets This is used to ensure that the fraction is meaningful. There are no restrictions here, and it can be set according to the specific implementation scenario.
[0082] It should be noted that, Indicates the first The absolute value of the difference in length between the edge segment to be analyzed and the u-th edge segment on its corresponding horizontal line. Show the first The absolute value of the length difference between the edge segment to be analyzed and the (u+1)th edge segment on the corresponding horizontal line. The smaller the value, meaning the smaller the absolute difference in length, the more consistent the lengths of any two adjacent edge segments are with the length of any edge segment being analyzed, and the higher the reliability of the comparison. The larger it is;
[0083] Similarly, the referenceability of the interval distance between any two adjacent edge segments is obtained, and the referenceability of the interval distance between any two adjacent edge segments is used as a weighting coefficient for the interval distance between any two adjacent edge segments. The weighted variance of the interval distance between any two adjacent edge segments is calculated, and the negative of the weighted variance is substituted into the natural exponential function to obtain the probability of mesh texture for any edge segment to be analyzed. Taking the first edge segment to be analyzed as an example, the first... The probability of mesh texture in each edge segment to be analyzed is denoted as . ,but ,in, This refers to the reliability of the distance between the u-th edge segment and the (u+1)-th edge segment in the edge segment sequence. This represents the number of edge segments in the edge segment sequence. Let be the distance between the u-th edge segment and the (u+1)-th edge segment in the edge segment sequence. For the first The average length of the interval between any two adjacent edge segments in the edge segment sequence corresponding to the edge segment to be analyzed. The weighted variance is the distance between any two adjacent edge segments. The calculation of the weighted variance is existing technology and will not be elaborated here. The natural exponential function is used for normalization. The smaller the weighted variance, the more consistent the interval lengths between the edge segments of the vectors in the edge segment sequence. The more likely an edge segment to be analyzed is to be a mesh texture edge segment, the more likely it is to be an edge segment. The larger it is.
[0084] Similarly, obtain the possible mesh texture of each edge segment to be analyzed.
[0085] b. Based on the probability of mesh texture in each edge segment to be analyzed, obtain the mesh texture gradient direction represented by any target cluster.
[0086] Specifically, the cumulative value of the mesh texture probability of each edge segment to be analyzed is obtained, denoted as the cumulative mesh texture probability value. For any edge segment to be analyzed, the ratio of the mesh texture probability of that edge segment to the cumulative mesh texture probability value is obtained to obtain the influence weight of that edge segment. Taking the first edge segment to be analyzed as an example, the first... The influence weight of each edge segment to be analyzed is denoted as . ,but ,in, For the first The degree of mesh texture possible for each edge segment to be analyzed. For the first The number of edge segments to be analyzed contained in the target cluster to which each edge segment to be analyzed belongs. The larger, the more The more likely the edge segment to be analyzed is a mesh texture edge segment, the better when obtaining the first edge segment. The larger the proportion of the gradient direction in the mesh texture corresponding to the target cluster to which the edge segment to be analyzed belongs, the better. The larger it is;
[0087] The average gradient direction of the edge pixels in any edge segment to be analyzed is obtained and denoted as the average gradient direction of any edge segment to be analyzed.
[0088] Obtain the influence weight and average gradient direction of each edge segment to be analyzed. Use the influence weight of each edge segment to be analyzed as the weight coefficient of the average gradient direction of each edge segment to be analyzed. Perform a weighted summation of the average gradient directions of each edge segment to be analyzed to obtain the mesh texture gradient direction represented by any target cluster.
[0089] In one embodiment, the formula for calculating the mesh texture gradient direction represented by any target cluster is:
[0090]
[0091] Wherein, F is the gradient direction of the mesh texture represented by any of the target clusters; For any of the target clusters, the first The average gradient direction of each edge segment to be analyzed; For any of the target clusters, the first The influence weight of each edge segment to be analyzed; The number of edge segments to be analyzed contained in any of the target clusters.
[0092] It should be noted that, The larger, the more The larger the proportion of the average gradient direction of each edge segment to be analyzed in the gradient direction of the mesh texture corresponding to any target cluster, the better. The larger the value, the larger F becomes.
[0093] Similarly, the gradient direction of the mesh texture represented by each target cluster in any grayscale image is obtained.
[0094] (3) Based on the grid texture gradient direction represented by each target cluster in any grayscale image, obtain the grid line angle of any grayscale image and the final direction value of each target cluster.
[0095] a. Obtain the grid line angle of any grayscale image.
[0096] Specifically, the absolute value of the difference between the grid texture gradient directions represented by two target clusters in any grayscale image is obtained and recorded as the first included angle. The difference between 180 degrees and the first included angle is obtained and recorded as the second included angle. The minimum value between the first included angle and the second included angle is obtained and used as the grid line included angle of any grayscale image.
[0097] In one embodiment, the formula for calculating the grid line angle of any grayscale image is:
[0098]
[0099] in, The angle between the grid lines of any grayscale image; The direction of the mesh texture gradient represents the first target cluster in any grayscale image; The direction of the grid texture gradient represented by the second target cluster in any grayscale image; It is the absolute value symbol; This is a minimum value function used to ensure that the obtained grid line angles are all the smaller angles formed by the intersection of grid lines in two directions.
[0100] b. Obtain the final direction value for each target cluster.
[0101] Specifically, for any target cluster in any grayscale image, the sum of the grid texture gradient direction represented by the target cluster and 90 degrees is substituted into the modulo function with 180 degrees to obtain the final direction value of the target cluster.
[0102] Similarly, the final direction value of each target cluster is obtained. The final direction value of a target cluster represents the direction of a grid line in any grayscale image, which includes the horizontal grid line direction and the vertical grid line direction.
[0103] (4) Obtain the grid spacing of the grid line direction represented by the final direction value of each target cluster.
[0104] Specifically, for any target cluster, the normal vector of the final direction value of the target cluster is obtained. Based on the normal vector, the edge pixels in the target cluster are projected onto the normal vector to obtain a one-dimensional point sequence. The one-dimensional point sequence is then subjected to k-means clustering to obtain at least two clusters. The distance between each pair of adjacent clusters is obtained. To avoid interference from non-mesh edges such as stains, the median of all distances is obtained and used as the grid line spacing for the grid line direction represented by the final direction value of the target cluster. The acquisition of the normal vector, the normal projection to obtain the one-dimensional point sequence, and the k-means clustering are existing technologies and will not be elaborated upon here.
[0105] (5) The final direction value of each target cluster in any grayscale image, the grid line spacing of the grid line direction represented by the final direction value of each target cluster, and the grid line angle of any grayscale image are used as feature values of any grayscale image to form the feature vector of any grayscale image.
[0106] For example, the final direction values of two target clusters in any grayscale image are denoted as follows: and The grid spacing of the grid lines representing the grid line directions of the two target clusters in any grayscale image is denoted as follows: and Let the included angle of the grid lines of any grayscale image be denoted as . ,in and For the same target class cluster, and For the same target class cluster, the feature vector of any grayscale image .
[0107] Thus, the feature vector of any grayscale image is obtained.
[0108] Step S103: Obtain the feature vector of each grayscale image in the grayscale image set; based on the difference in feature vectors between two adjacent grayscale images, obtain the direction matching result of each two adjacent grayscale images; based on the direction matching result of each two adjacent grayscale images and the changing trend of the feature vectors of grayscale images in the grayscale image set, obtain the displacement offset and running deviation feature vector of the photovoltaic cleaning robot within a preset time period.
[0109] According to the method for obtaining the feature vector of any grayscale image described above, the feature vector of each grayscale image in the grayscale image set is obtained.
[0110] Because the photovoltaic cleaning robot may turn during operation, causing the horizontal and vertical directions of the grid lines on the photovoltaic panel to not always align with the horizontal and vertical directions of the image, it is first necessary to match the grid texture direction in consecutive frames of images. Since the grid on the photovoltaic panel is typically rectangular, meaning the horizontal and vertical spacing are inconsistent, although the image shooting angle affects the spacing length, the relative size relationship between the horizontal and vertical spacing remains unchanged. Therefore, for any two adjacent grayscale images, the first and second direction matching values can be obtained based on the difference in feature vectors between the two adjacent grayscale images, thereby obtaining the direction matching result of the two adjacent grayscale images.
[0111] The formulas for calculating the first-direction matching value and the second-direction matching value of any two adjacent grayscale images are as follows:
[0112]
[0113] in, For any two adjacent grayscale images; Let be the a-th grayscale image; b is the b-th grayscale image. The first direction matching value for any two adjacent grayscale images; The second direction matching value is the value between any two adjacent grayscale images. This represents the final orientation value of the first target cluster in the a-th grayscale image; This represents the final orientation value of the first target cluster in the b-th grayscale image; This represents the final orientation value of the second target cluster in the a-th grayscale image; This represents the final orientation value of the second target cluster in the b-th grayscale image; It is the absolute value symbol; As a preset constant, this embodiment sets This is used to ensure that the fraction is meaningful, and there are no restrictions on its placement. It can be set according to the specific implementation scenario.
[0114] It should be noted that, The smaller the value, the smaller the difference between the final orientation value of the first target cluster in the a-th grayscale image and the final orientation value of the first target cluster in the b-th grayscale image, the smaller the difference between the final orientation value of the second target cluster in the a-th grayscale image and the final orientation value of the second target cluster in the b-th grayscale image, the more likely the first target cluster in the a-th grayscale image and the first target cluster in the b-th grayscale image are to share the same grid line orientation, and the more likely the second target cluster in the a-th grayscale image and the second target cluster in the b-th grayscale image are to share the same grid line orientation.
[0115] The smaller the value, the smaller the difference between the final orientation value of the second target cluster in the a-th grayscale image and the final orientation value of the first target cluster in the b-th grayscale image. The smaller the difference between the final orientation values of the first target cluster in the a-th grayscale image and the second target cluster in the b-th grayscale image, the more likely the second target cluster in the a-th grayscale image and the first target cluster in the b-th grayscale image are to share the same grid line orientation.
[0116] Therefore, if the first direction matching value of any two adjacent grayscale images is greater than the second direction matching value of any two adjacent grayscale images, then the direction matching result of any two adjacent grayscale images is confirmed as the first direction matching result, that is, the grid line direction corresponding to the first target cluster of the first grayscale image in any two adjacent grayscale images is the same as the grid line direction corresponding to the first target cluster of the second grayscale image.
[0117] If the first direction matching value of any two adjacent grayscale images is less than the second direction matching value of any two adjacent grayscale images, then the direction matching result of any two adjacent grayscale images is confirmed as the second direction matching result, that is, the grid line direction corresponding to the first target cluster of the first grayscale image in any two adjacent grayscale images is the same as the grid line direction corresponding to the second target cluster of the second grayscale image.
[0118] For example, taking any two adjacent grayscale images a and b as an example, if If so, it is confirmed that the first target cluster in grayscale image a and the first target cluster in grayscale image b are in the same grid line direction, and the second target cluster in grayscale image a and the second target cluster in grayscale image b are in the same grid line direction; if If so, it is confirmed that the second target cluster in grayscale image a and the first target cluster in grayscale image b are in the same grid line direction, and the first target cluster in grayscale image a and the second target cluster in grayscale image b are in the same grid line direction.
[0119] Similarly, the orientation matching results of every two adjacent grayscale images are obtained, and the grid line orientations corresponding to the target clusters in each grayscale image are matched. To facilitate subsequent processing, the matched grid line orientations are unified, for example, for each image... All angles are in the direction of the horizontal grid lines.
[0120] Furthermore, based on the orientation matching results of every two adjacent grayscale images and the changing trend of the feature vectors of the grayscale images in the grayscale image set, the displacement offset of the photovoltaic cleaning robot within a preset time period is obtained.
[0121] The method for obtaining the displacement of the photovoltaic cleaning robot within a preset time period is as follows:
[0122] For any grid line direction, the target clusters belonging to that grid line direction in each grayscale image are grouped into a target cluster sequence (taking the horizontal grid line direction as an example, according to the acquisition order of the grayscale images, the target clusters in each grayscale image are grouped into a target cluster sequence). The corresponding target clusters form a target cluster sequence. The normal vector of any grid line direction is obtained. The normal projection is performed on the edge segment to be analyzed contained in each target cluster in the target cluster sequence. A target cluster obtains a one-dimensional distribution structure. The acquisition of normal vectors and normal projection are existing technologies and will not be described in detail here.
[0123] For any two adjacent target clusters in the target cluster sequence, the maximum matching offset of the one-dimensional distribution structure of the two adjacent target clusters is obtained by using the cross-correlation algorithm. The cross-correlation algorithm is an existing technology and will not be described in detail here.
[0124] The sum of the maximum matching offsets of the one-dimensional distribution structure of every two adjacent target clusters in the target cluster sequence is obtained as the displacement offset of the photovoltaic cleaning robot in any grid direction within a preset time period. Similarly, the displacement offset of the photovoltaic cleaning robot in each grid direction within the preset time period is obtained and denoted as follows: and .
[0125] The position of the photovoltaic cleaning robot can only be determined by the displacement of the photovoltaic cleaning robot in each grid direction within a preset time period, but it cannot fully describe the robot's operating status. In order to facilitate the timely detection of abnormal operating status of the photovoltaic cleaning robot and to make targeted adjustments, it is also necessary to obtain the operating deviation feature vector of the photovoltaic cleaning robot within the preset time period and analyze the abnormal performance of each feature value in the grayscale image.
[0126] The method for obtaining the feature vector of the photovoltaic cleaning robot's operation deviation within a preset time period is as follows:
[0127] The feature values of all grayscale images are grouped into a feature value set, and the feature values of the same type in the feature value set are grouped into feature value sequences (for example, each grayscale image...). (Forming a horizontal grid line direction sequence), for any feature value sequence, the least squares method is used to linearly fit the any feature value sequence to obtain a fitted line. The least squares method is an existing technology and will not be elaborated here. The closer the slope of the fitted line is to 0, the more stable the photovoltaic cleaning operation is. Therefore, the absolute value of the slope of the fitted line is obtained as the overall rate of change of any feature value sequence.
[0128] Obtain the fitted line corresponding to each feature value sequence, obtain the root mean square error of the fitted line corresponding to each feature value sequence, and obtain the maximum root mean square error.
[0129] The fluctuation level of any feature value sequence is obtained by normalizing the ratio of the root mean square error to the maximum root mean square error.
[0130] In one embodiment, taking the d-th eigenvalue sequence as an example, the formula for calculating the fluctuation degree of the d-th eigenvalue sequence is:
[0131]
[0132] in, The degree of fluctuation of the d-th feature value sequence; Let be the root mean square error of the d-th eigenvalue sequence; The maximum root mean square error; This is the normalization function.
[0133] It should be noted that, This represents the relative magnitude of the root mean square error (RMSE) of the fitted line corresponding to the d-th eigenvalue sequence. A larger RMSE corresponds to a greater degree of eigenvalue fluctuation. The larger it is.
[0134] Similarly, the overall rate of change and degree of fluctuation of each feature value sequence are obtained to form the operational deviation feature vector of the photovoltaic cleaning robot within a preset time period.
[0135] For example, the overall rate of change of the horizontal grid line direction sequence is denoted as... The overall rate of change of the vertical grid line direction sequence is denoted as The degree of fluctuation in the horizontal grid line direction sequence is denoted as The degree of fluctuation in the vertical grid line direction sequence is denoted as The overall rate of change of the grid line angle sequence is denoted as... The degree of fluctuation in the grid line angle sequence is denoted as... The overall rate of change of the horizontal grid line interval sequence is denoted as The degree of fluctuation of the horizontal grid line interval sequence is denoted as The overall rate of change of the vertical grid line interval sequence is denoted as The degree of fluctuation in the longitudinal grid line interval sequence is denoted as The photovoltaic cleaning robot deviates from the feature vector during the preset time period. .
[0136] Step S104: Based on the displacement offset and operational deviation feature vector of the photovoltaic cleaning robot within a preset time period, the photovoltaic cleaning robot is positioned and its operating status is regulated.
[0137] The rate of change of different eigenvalues typically reflects different problems in the operating status of photovoltaic cleaning robots. For example, when and Corresponding rate of change and A larger value indicates that the photovoltaic cleaning robot has veered off course; when Corresponding rate of change A larger value indicates that the photovoltaic cleaning robot has tilted or rotated; when and Corresponding rate of change and A larger value indicates a change in the angle or height of the photovoltaic cleaning robot relative to the photovoltaic panel. Conversely, if the fluctuation of the characteristic value is... If the vibration is too large, the photovoltaic cleaning robot may be shaking or slipping.
[0138] Therefore, after obtaining the displacement offset and operational deviation feature vector of the photovoltaic cleaning robot within a preset time period, the photovoltaic cleaning robot is located and its operating status is controlled based on the displacement offset and operational deviation feature vector of the photovoltaic cleaning robot within the preset time period.
[0139] The existing technology is to locate the photovoltaic cleaning robot and regulate its operation based on the displacement offset and running deviation feature vector of the photovoltaic cleaning robot within a preset time period. Here it is briefly described: (1) Based on the displacement offset of the photovoltaic cleaning robot in the horizontal grid direction and the vertical grid direction obtained above and By combining the previous location of the photovoltaic cleaning robot, we can obtain the robot's current position on the photovoltaic panel.
[0140] (2) For each deviation feature value (i.e., run the deviation feature vector) Each deviation feature value is combined with the corresponding feature values from historical photovoltaic cleaning robot operations (in this embodiment, the feature values corresponding to images collected by the photovoltaic cleaning robot within one day are used as historical data; this is not limited here and can be set according to the specific implementation scenario). Clustering is performed using the DBSCAN clustering method. Because the consistency of the corresponding deviation feature values is high under stable operating conditions, the range of data points in the cluster containing the most data points is taken as the normal range of the corresponding deviation feature values. When any deviation feature value is outside the normal range, the abnormal type and abnormal behavior of the photovoltaic cleaning robot are reported. For example, when… If the direction of operation of the photovoltaic cleaning robot deviates from the normal range, it will be indicated that the deviation is manifested as a change in the lateral direction of the grid lines. Deviations were detected. Based on feedback regarding abnormal robot operation, targeted adjustments were made.
[0141] In summary, in this embodiment of the invention, grayscale images at each sampling time within a preset time period are grouped into a grayscale image set. This set is then used to combine the changes in texture structure features in consecutive frames of images for the localization and motion state estimation of the photovoltaic cleaning robot, thereby improving the localization accuracy of the photovoltaic cleaning robot. Two target clusters are obtained to reflect the direction of the grid texture (horizontal and vertical grid lines) in the grayscale images. The feature vectors of the grayscale images and the direction matching results of every two adjacent grayscale images are obtained. Based on the feature change trends of consecutive frames of images, the displacement offset and running deviation feature vector of the photovoltaic cleaning robot within the preset time period are obtained. This allows for the analysis of the current running deviation of the photovoltaic cleaning robot, converting image changes into the actual displacement of the robot. This improves the localization efficiency of the photovoltaic cleaning robot and reflects its dynamic changes during operation, facilitating the timely detection of abnormal operating states and enabling targeted control measures to be taken for abnormal photovoltaic cleaning robots.
[0142] Based on the same inventive concept as the above method, this embodiment of the invention also provides a visual positioning control system for a photovoltaic cleaning robot, including a memory and a processor, wherein the processor executes a computer program stored in the memory to implement the above-described visual positioning control method for a photovoltaic cleaning robot.
[0143] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A visual positioning control method for a photovoltaic cleaning robot, characterized in that, The visual positioning control method for a photovoltaic cleaning robot includes: During the operation of the photovoltaic cleaning robot, grayscale images at each sampling moment are acquired in real time, and grayscale images at each sampling moment within a preset time period are combined into a grayscale image set. For any grayscale image in the grayscale image set, edge detection algorithm is used to obtain edge pixels and the gradient direction of each edge pixel. The gradient directions of all edge pixels are clustered to obtain at least two clusters. All clusters are sorted in descending order according to the number of pixels in the cluster. The first two clusters are recorded as target clusters. The feature vector of any grayscale image is obtained according to the grayscale distribution characteristics and texture representation characteristics of the pixels in each target cluster. The feature vector of each grayscale image in the grayscale image set is obtained. Based on the difference in feature vectors between two adjacent grayscale images, the direction matching result of each two adjacent grayscale images is obtained. Based on the direction matching result of each two adjacent grayscale images and the changing trend of the feature vectors of grayscale images in the grayscale image set, the displacement offset and running deviation feature vector of the photovoltaic cleaning robot within a preset time period are obtained. Based on the displacement and deviation feature vector of the photovoltaic cleaning robot within a preset time period, the photovoltaic cleaning robot is located and its operating status is controlled.
2. The visual positioning control method for a photovoltaic cleaning robot according to claim 1, characterized in that, The step of obtaining the feature vector of any grayscale image based on the grayscale distribution features and texture representation features of pixels in each target cluster includes: For any target cluster, obtain the average gradient direction of all edge pixels in the target cluster, and substitute the sum of the average gradient direction and 90 degrees into the modulo function of 180 degrees to obtain the preliminary direction value of the target cluster. Based on the grayscale distribution characteristics and texture representation characteristics of pixels in each target cluster, as well as the preliminary direction value of each target cluster, the gradient direction of the mesh texture represented by each target cluster is obtained. Based on the grid texture gradient direction represented by each target cluster, the grid line angle of any grayscale image is obtained, as well as the final direction value of each target cluster. The final direction value of a target cluster represents a grid line direction in any grayscale image, which includes a horizontal grid line direction and a vertical grid line direction. For any target cluster, obtain the normal vector of the final direction value of the target cluster, perform normal projection on the edge pixels in the target cluster based on the normal vector to obtain a one-dimensional point sequence, cluster the one-dimensional point sequence to obtain at least two clusters, obtain the interval distance between each pair of adjacent clusters, obtain the median of the interval distance, and use it as the grid line spacing of the grid line direction represented by the final direction value of the target cluster. Obtain the grid line spacing of the grid line direction represented by the final direction value of each target cluster. The final direction value of each target cluster in the grayscale image, the grid line spacing of the grid line direction represented by the final direction value of each target cluster, and the grid line angle of the grayscale image are used as feature values of the grayscale image to form the feature vector of the grayscale image.
3. The visual positioning control method for a photovoltaic cleaning robot according to claim 2, characterized in that, The step of obtaining the mesh texture gradient direction represented by each target cluster based on the grayscale distribution characteristics and texture representation characteristics of pixels in each target cluster, as well as the preliminary direction value of each target cluster, includes: For any target cluster, adjacent edge pixels in the target cluster are grouped into an edge segment to be analyzed. For any edge segment to be analyzed, a reference edge segment is obtained in the target cluster based on the preliminary direction value of each target cluster. The edge segment to be analyzed and the reference edge segment are combined to form an edge segment sequence. Based on the length difference and distance features between the edge segments in the edge segment sequence, the mesh texture probability of the edge segment to be analyzed is obtained. Obtain the mesh texture probability of each edge segment to be analyzed, and based on the mesh texture probability of each edge segment to be analyzed, obtain the mesh texture gradient direction represented by any target cluster.
4. The visual positioning control method for a photovoltaic cleaning robot according to claim 3, characterized in that, The step of obtaining the probability of mesh texture for any edge segment to be analyzed based on the length difference and distance features between edge segments in the edge segment sequence includes: The number of pixels contained in each edge segment in the edge segment sequence is obtained. For any two adjacent edge segments, the interval distance between them is obtained. The formula for calculating the referenceability of the interval distance between any two adjacent edge segments is as follows: ; in, For any of the edge segments to be analyzed, Let be any two adjacent edge segments; u is the u-th edge segment in the edge segment sequence; This refers to the (u+1)th edge segment in the edge segment sequence. The reference value of the interval distance between any two adjacent edge segments; The number of pixels contained in any edge segment to be analyzed; The number of pixels contained in the u-th edge segment in the edge segment sequence; The number of pixels contained in the (u+1)th edge segment in the edge segment sequence; It is the absolute value symbol; This is the normalization function; This is a preset constant; Obtain the interval distance between every two adjacent edge segments and the referenceability of the interval distance between every two adjacent edge segments. Use the referenceability of the interval distance between every two adjacent edge segments as the weighting coefficient of the interval distance between every two adjacent edge segments. Calculate the weighted variance of the interval distance between every two adjacent edge segments. Substitute the negative of the weighted variance into the natural exponential function to obtain the mesh texture probability of any edge segment to be analyzed.
5. The visual positioning control method for a photovoltaic cleaning robot according to claim 3, characterized in that, The step of obtaining the mesh texture gradient direction represented by any target cluster based on the mesh texture probability of each edge segment to be analyzed includes: Obtain the cumulative value of the mesh texture probability of each edge segment to be analyzed, and record it as the cumulative value of mesh texture probability. For any edge segment to be analyzed, obtain the ratio of the mesh texture probability of the any edge segment to be analyzed to the cumulative value of mesh texture probability, and obtain the influence weight of the any edge segment to be analyzed. The average gradient direction of the edge pixels in any edge segment to be analyzed is obtained and denoted as the average gradient direction of any edge segment to be analyzed. Obtain the influence weight and average gradient direction of each edge segment to be analyzed. Use the influence weight of each edge segment to be analyzed as the weight coefficient of the average gradient direction of each edge segment to be analyzed. Perform a weighted summation of the average gradient directions of each edge segment to be analyzed to obtain the mesh texture gradient direction represented by any target cluster.
6. The visual positioning control method for a photovoltaic cleaning robot according to claim 2, characterized in that, The step of obtaining the grid line angle of any grayscale image and the final direction value of each target cluster based on the grid texture gradient direction represented by each target cluster includes: Obtain the grid texture gradient direction represented by each target cluster in any grayscale image, obtain the absolute value of the difference between the grid texture gradient directions represented by two target clusters in any grayscale image, and record it as the first angle, obtain the difference between 180 degrees and the first angle, and record it as the second angle, and obtain the minimum value between the first angle and the second angle as the grid line angle of any grayscale image; For any target cluster in any grayscale image, the sum of the grid texture gradient direction represented by the target cluster and 90 degrees is substituted into the modulo function with 180 degrees to obtain the final direction value of the target cluster.
7. The visual positioning control method for a photovoltaic cleaning robot according to claim 2, characterized in that, The step of obtaining the orientation matching result of each pair of adjacent grayscale images based on the feature vector difference of each pair of adjacent grayscale images includes: For any two adjacent grayscale images, the formulas for calculating the first direction matching value and the second direction matching value of the two adjacent grayscale images are as follows: ; in, For any two adjacent grayscale images; Let be the a-th grayscale image; b is the b-th grayscale image. The first direction matching value for any two adjacent grayscale images; The second direction matching value is the value between any two adjacent grayscale images. This represents the final orientation value of the first target cluster in the a-th grayscale image; This represents the final orientation value of the first target cluster in the b-th grayscale image; This represents the final orientation value of the second target cluster in the a-th grayscale image; This represents the final orientation value of the second target cluster in the b-th grayscale image; It is the absolute value symbol; This is a preset constant; If the first direction matching value of any two adjacent grayscale images is greater than the second direction matching value of any two adjacent grayscale images, then the direction matching result of any two adjacent grayscale images is confirmed as the first direction matching result. The first direction matching result is that the grid line direction corresponding to the first target cluster of the first grayscale image in any two adjacent grayscale images is the same as the grid line direction corresponding to the first target cluster of the second grayscale image. If the first direction matching value of any two adjacent grayscale images is less than the second direction matching value of any two adjacent grayscale images, then the direction matching result of any two adjacent grayscale images is confirmed as the second direction matching result. The second direction matching result is that the grid line direction corresponding to the first target cluster of the first grayscale image in any two adjacent grayscale images is the same as the grid line direction corresponding to the second target cluster of the second grayscale image.
8. The visual positioning control method for a photovoltaic cleaning robot according to claim 1, characterized in that, The step of obtaining the displacement offset and operational deviation feature vector of the photovoltaic cleaning robot within a preset time period based on the orientation matching results of every two adjacent grayscale images and the changing trend of the feature vectors of the grayscale images in the grayscale image set includes: For any grid line direction, target clusters belonging to any grid line direction in each grayscale image are formed into a target cluster sequence. Normal projection is performed on the edge segments to be analyzed contained in each target cluster in the target cluster sequence, and a target cluster obtains a one-dimensional distribution structure. For any two adjacent target clusters in the target cluster sequence, the maximum matching offset of the one-dimensional distribution structure of the two adjacent target clusters is obtained by using a cross-correlation algorithm. The sum of the maximum matching offsets of the one-dimensional distribution structure of every two adjacent target clusters in the target cluster sequence is obtained as the displacement offset of the photovoltaic cleaning robot in any grid direction within a preset time period.
9. A visual positioning control method for a photovoltaic cleaning robot according to claim 8, characterized in that, The step of obtaining the displacement offset and operational deviation feature vector of the photovoltaic cleaning robot within a preset time period based on the orientation matching results of every two adjacent grayscale images and the changing trend of the feature vectors of the grayscale images in the grayscale image set further includes: The feature values of all grayscale images are combined into a feature value set. The feature values of the same type in the feature value set are respectively combined into feature value sequences. For any feature value sequence, the feature value sequence is fitted to obtain a fitted line. The absolute value of the slope of the fitted line is obtained as the overall rate of change of any feature value sequence. Obtain the fitted line corresponding to each feature value sequence, obtain the root mean square error of the fitted line corresponding to each feature value sequence, and obtain the maximum root mean square error. The fluctuation level of any feature value sequence is obtained by normalizing the ratio of the root mean square error to the maximum root mean square error. The overall rate of change and degree of fluctuation of each feature value sequence are obtained to form the operational deviation feature vector of the photovoltaic cleaning robot within a preset time period.
10. A visual positioning control system for a photovoltaic cleaning robot, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the visual positioning control method for a photovoltaic cleaning robot as described in any one of claims 1-9.