Surface forming accuracy detection method of power-assisted bicycle battery box based on machine vision
By using machine vision technology, image processing, and clustering algorithms, abnormal welding areas on the surface of the battery box of the electric bicycle were detected, which solved the problem of molding accuracy error and improved the molding accuracy and reliability of the battery box.
Patent Information
- Application Number
- CN202410520218.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-04-28
AI Technical Summary
Improper parameter settings during the molding process of the battery box for electric bicycles can lead to significant errors in surface processing precision, causing battery malfunctions.
Using machine vision technology, the surface image of the battery box is acquired and preprocessed to be converted into a grayscale image. The hue deviation coefficient of the local color feature region is calculated, the welding extension window and deviation sequence are obtained, and the abnormal region is identified by K-means clustering algorithm. The forming accuracy is calculated and detected.
Accurately identifying abnormal welding areas on the battery box surface improves the accuracy of molding precision detection and reduces the possibility of battery malfunctions.
Smart Images

Figure CN118411342B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image data processing, and in particular to a method for detecting the surface forming accuracy of a battery box of a power-assisted bicycle based on machine vision. Background Art
[0002] Compared with traditional energy-driven vehicles, electric new energy-driven vehicles can effectively improve energy utilization and reduce polluting tail gas emissions. It is an efficient and clean energy-driven travel mode. Therefore, the travel mode mainly driven by electric new energy has a very broad application market. As the key "heart" of electric new energy drive mode, power batteries directly affect the performance of new energy travel tools.
[0003] The forming process of the power-assisted bicycle battery box requires multiple different processing steps. At this time, due to improper setting of the relevant parameters of the power-assisted bicycle battery box processing and forming, there will be a large error in the surface processing and forming accuracy of the power-assisted bicycle battery box, resulting in defects on the surface of the power-assisted bicycle battery box, thereby causing problems related to the operation of the power-assisted bicycle battery. Summary of the invention
[0004] The present invention provides a method for detecting the surface forming accuracy of a power-assisted bicycle battery box based on machine vision to solve the problem. The technical solution adopted is as follows:
[0005] An embodiment of the present invention provides a method for detecting the surface forming accuracy of a power-assisted bicycle battery box based on machine vision, the method comprising the following steps:
[0006] Acquire the surface image of the battery box of the power-assisted bicycle and perform preprocessing to obtain a grayscale image of the battery box surface;
[0007] The color space of the surface image of the power-assisted bicycle battery box is converted, the local color feature area is obtained based on the converted image, and the molding hue deviation coefficient of the battery box surface is calculated according to the local color feature area;
[0008] Based on the grayscale image of the battery box surface, a battery box welding extension window is obtained, and a welding defect extension direction is obtained according to the battery box welding extension window. According to the welding defect extension direction, a battery box surface welding extension deviation sequence is obtained, and the main direction hue deviation characteristics at different pixel positions are calculated according to the battery box surface welding extension deviation sequence. According to the main direction hue deviation characteristics, the deviation distance between different pixel points is calculated, and an optimized clustering function is calculated according to the deviation distance between different pixel points. According to the optimized clustering function, an abnormal area on the battery box surface is obtained;
[0009] The surface forming accuracy of the power-assisted bicycle battery box is calculated based on the abnormal area on the battery box surface, and the accuracy detection is performed based on the surface forming accuracy of the power-assisted bicycle battery box.
[0010] Preferably, the mathematical expression of the battery box surface molding hue deviation coefficient calculated according to the local color feature area is:
[0011]
[0012] In the above formula, Norm() represents the normalization function, σ i represents the variance of the pixel H channel in the local color feature area at the center of the pixel i in the HSV image of the battery box surface, μ i represents the mean value of the H channel of the pixel point in the local color feature area centered at the pixel point i in the HSV image of the battery box surface, r represents the position of the rth pixel point in the local color feature area, W represents the size of the local color feature area, HM r , H.M. i They represent the values of the second-order moment of the H channel at the r-th pixel and the i-th pixel respectively. i It represents the color tone deviation coefficient of the battery box surface at the i-th pixel position.
[0013] Preferably, the method for obtaining the extension direction of the welding defect according to the battery box welding extension window is:
[0014] The Hessian matrix of the battery box welding extension window in the grayscale image of the battery box surface is obtained, and the eigenvector direction corresponding to the minimum eigenvalue of the Hessian matrix is taken as the extension direction of the welding defect.
[0015] Preferably, the method for obtaining the battery box surface welding extension deviation sequence according to the welding defect extension direction is:
[0016] The battery box surface molding hue deviation coefficients of all pixels in the extension direction of each pixel welding defect are recorded as the battery box surface welding extension deviation sequence.
[0017] Preferably, the method for calculating the main direction color tone deviation characteristics at different pixel positions according to the battery box surface welding extension deviation sequence is:
[0018] The difference between the maximum and minimum values of the welding extension deviation sequence on the battery box surface in the local window area centered on each pixel point is recorded as the first difference, the difference between the maximum and minimum value sequence index positions is recorded as the second difference, the ratio of the first difference to the second difference is recorded as the first ratio, the first ratio is used as the input of the negative exponential function, and the output is recorded as the main direction hue deviation feature.
[0019] Preferably, the mathematical expression for calculating the deviation distance between different pixel points according to the main direction hue deviation feature is:
[0020]
[0021] In the above formula, vus i ,vus j They represent the main direction hue deviation characteristics of the battery box surface welding extension deviation sequence in the local window area centered on pixel i and pixel j, respectively. Norm[] represents the normalization function. DTW() represents the DTW distance between two different sequences. SeqR i , SeqR j They represent the battery box surface welding extension deviation sequence of the local window centered at pixel i and j, dist i,j It represents the deviation distance between two different pixel points on the surface of the battery box.
[0022] Preferably, the mathematical expression for calculating the optimized clustering function according to the deviation distance between different pixel points is:
[0023]
[0024] In the above formula, Ks represents the total number of pixel categories of the grayscale image of the battery box surface, N c represents the total number of pixels of the cth class in the grayscale image of the battery box surface, pc and pk represent the class center pixel of the cth class center and the pixel at the kth position in the grayscale image of the battery box surface, respectively, and dist pc,pk It represents the numerical value of the deviation distance between the kth pixel point in the grayscale image of the battery box surface and the center pixel point of the cth class, and Cs represents the optimized clustering function.
[0025] Preferably, the method for obtaining the abnormal area on the surface of the battery box according to the optimized clustering function is:
[0026] The category with the smallest grayscale mean among all different pixel categories of the grayscale image of the battery box surface is recorded as the abnormal area of the battery box surface.
[0027] Preferably, the mathematical expression for calculating the surface forming accuracy of the power-assisted bicycle battery box according to the abnormal area on the battery box surface is:
[0028]
[0029] In the above formula, Nφ dc It represents the total number of pixels in the abnormal area of the grayscale image of the surface of the power-assisted bicycle battery box, N represents the total number of pixels in the grayscale image of the surface of the power-assisted bicycle battery box, and Ps represents the surface forming accuracy of the power-assisted bicycle battery box.
[0030] Preferably, the method for performing precision detection according to the surface molding precision of the power-assisted bicycle battery box is:
[0031] Let the empirical accuracy threshold be a first preset value. When the surface forming accuracy of the power-assisted bicycle battery box is greater than or equal to the first preset value, it is normal accuracy; otherwise, when the surface forming accuracy of the power-assisted bicycle battery box is less than the first preset value, it is abnormal accuracy.
[0032] The beneficial effects of the present invention are as follows: the present invention first calculates the battery box surface molding hue deviation coefficient based on the color difference changes of different pixels in the surface image of the power-assisted bicycle battery box, and calculates and characterizes the abnormal color changes that occur during the battery box surface molding process. At the same time, the present invention uses the extension change direction of abnormal pixels during the battery box surface molding process to construct a battery box surface welding extension deviation sequence, and uses the battery box surface welding extension deviation sequence to obtain the deviation distance, so as to more accurately calculate and characterize the abnormal extension direction of different pixels during the battery box surface molding process. Furthermore, the present invention uses the deviation distance to optimize the K-means clustering function, accurately obtains the abnormal welding area on the battery box surface, and improves the precision detection of power-assisted bicycle surface molding. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0034] Figure 1 A schematic flow chart of a method for detecting the surface forming accuracy of a power-assisted bicycle battery box based on machine vision provided by one embodiment of the present invention;
[0035] Figure 2 Schematic diagram of welding extension window for battery box. DETAILED DESCRIPTION
[0036] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0037] See also Figure 1 , which shows a flow chart of a method for detecting the surface forming accuracy of a power-assisted bicycle battery box based on machine vision according to an embodiment of the present invention, the method comprising the following steps:
[0038] Step S001, obtaining a surface image of a battery box of a power-assisted bicycle and performing preprocessing to obtain a grayscale image of the battery box surface.
[0039] It should be noted that the power-assisted bicycle battery box is an important component of the battery and usually needs to undergo welding during the battery box molding process. Therefore, during the battery box molding process, due to improper welding-related equipment parameter settings or improper processing operations, there will be large errors in the battery box surface molding accuracy. First, it is necessary to obtain the surface image of the power-assisted bicycle battery box.
[0040] Specifically, an LED light source and an image acquisition device are arranged vertically above the battery box of the power-assisted bicycle to be inspected. Since the CCD camera has the characteristics of relatively clear imaging details and no ghosting compared to the CMOS camera, this example uses the CCD camera as the main equipment in the battery box surface graphics acquisition process, and the acquired image is recorded as the battery box surface image, and the total number of pixels in the image is recorded as Nm.
[0041] In order to minimize or even eliminate the influence of external environmental noise on the details of the battery box surface image in the RGB color space during the shooting and collection process, the battery box surface image in the RGB color space is used as the input of the Gaussian filtering algorithm to eliminate the interference noise of the battery box surface image, and the processed image is recorded as the low-noise image of the battery box surface. At the same time, in order to avoid the repeated calculation of the three different channels of the battery box surface image in the RGB color space during the subsequent battery box surface molding accuracy detection and analysis process, the weighted average grayscale algorithm is used to convert the low-noise image of the battery box surface in the RGB color space to obtain the grayscale image of the battery box surface.
[0042] Step S002, converting the color space of the surface image of the power-assisted bicycle battery box, obtaining a local color feature area based on the converted image, and calculating the battery box surface molding hue deviation coefficient based on the local color feature area.
[0043] It is understandable that if there are defects in the welding area during the surface forming process of the power-assisted bicycle battery box, the grayscale value of the corresponding pixel area should be significantly different from the grayscale value and color characteristics of other normal pixel areas. Therefore, the low-noise image of the battery box surface in the RGB color space is first converted to the HSV color space and recorded as the HSV image of the battery box surface. In order to better calculate and characterize the pixel value characteristics at the welding defect position on the surface of the power-assisted bicycle battery box, each different pixel in the image can be divided into a local color feature area of size W×W, where W takes an empirical value of 5. In practical applications, the implementer can set it according to the specific situation.
[0044]
[0045] In the above formula, Norm() represents the normalization function, σ i represents the variance of the pixel H channel in the local color feature area at the center of the pixel i in the HSV image of the battery box surface, μ i represents the mean value of the H channel of the pixel point in the local color feature area centered at the pixel point i in the HSV image of the battery box surface, r represents the position of the rth pixel point in the local color feature area, W represents the size of the local color feature area, HM r , H.M. i They represent the values of the second-order moment of the H channel at the r-th pixel and the i-th pixel respectively. i It represents the color tone deviation coefficient of the battery box surface at the i-th pixel position.
[0046] The above formula can be used to calculate the deviation coefficient of the molding hue of the battery box surface at different pixel positions. Since the total number of pixels in the image is Nm, the value of i ranges from 1 to Nm. If the value of the H channel second-order moment calculated at the pixel i on the surface of the battery box and other pixel positions in its local color feature area is greatly different, and at the same time, if the ratio of the variance of the H channel pixel at the current pixel i position to the mean is larger, it means that in the local color feature area centered on pixel i, the change of the H channel value at different pixel positions is also relatively large. At this time, the deviation coefficient of the molding hue of the battery box surface calculated at the pixel i position will also be relatively large, indicating that the possibility that the pixel i on the surface of the battery box is a welding defect pixel is greater.
[0047] Step S003, obtaining a battery box welding extension window based on the grayscale image of the battery box surface, obtaining a welding defect extension direction according to the battery box welding extension window, obtaining a battery box surface welding extension deviation sequence according to the welding defect extension direction, calculating the main direction hue deviation characteristics at different pixel positions according to the battery box surface welding extension deviation sequence, calculating the deviation distance between different pixel points according to the main direction hue deviation characteristics, calculating an optimized clustering function according to the deviation distance between different pixel points, and obtaining the abnormal area on the battery box surface according to the optimized clustering function.
[0048] It is understandable that if there are welding defects on the surface of the battery box of the power-assisted bicycle, the value of the deviation coefficient of the molding tone of the battery box surface calculated at the corresponding defect area will be relatively large. If the value of the molding tone deviation coefficient calculated at any pixel position on the surface of the power-assisted bicycle battery box is relatively large, then other pixels relatively close to the pixel are more likely to be welding abnormal pixels, while the possibility of pixels at other positions relatively far away being welding abnormal pixels is relatively small. Therefore, it is necessary to further calculate and analyze the spatial distribution of different pixels in the grayscale image of the battery box surface.
[0049] Therefore, if Figure 2 As shown in the figure, in the grayscale image of the battery box surface, a battery box welding extension window of size R×R can be obtained with pixel i as the center, where R takes an empirical value of 11. In practical applications, the implementer can set it according to the specific situation. The local window area centered on each different pixel can obtain the corresponding Hessian matrix, solve the eigenvalue of the Hessian matrix, and record the direction of the eigenvector corresponding to the minimum eigenvalue as the extension direction of the welding defect. The battery box surface molding hue deviation coefficient of all pixels in the extension direction of the welding defect corresponding to each pixel is recorded as the battery box surface welding extension deviation sequence.
[0050]
[0051]
[0052] In the above formula, exp() represents an exponential function with a natural constant as the base, MaxSe i ,MinSe i They represent the maximum and minimum values of the battery box surface welding extension deviation sequence in the local window area centered on pixel i, dt i,max , dt i,min They represent the difference between the maximum and minimum sequence index positions of the battery box surface welding extension deviation sequence of the local window centered on pixel point i and the sequence index position of the local window center pixel point i, respectively. i ,vus j They represent the main direction hue deviation characteristics of the battery box surface welding extension deviation sequence in the local window area centered on pixel i and pixel j, respectively. Norm[] represents the normalization function. DTW() represents the DTW distance between two different sequences. SeqR i , SeqR j They represent the battery box surface welding extension deviation sequence of the local window centered at pixel i and j, dist i,j It represents the deviation distance between two different pixel points on the surface of the battery box.
[0053] The above formula can be used to calculate the deviation distance between two different pixels on the surface of the battery box of the power-assisted bicycle. Since the total number of pixels in the image is Nm, the values of i and j are 1 to Nm. If pixel i is an abnormal pixel of the welding defect on the surface of the battery box of the power-assisted bicycle, the difference in the value of the battery box surface welding extension deviation sequence obtained with the pixel i as the center should be small. If the sequence index positions corresponding to the maximum and minimum values in the sequence are closer, it is considered that the welding defect on the battery box surface centered on pixel i is more obvious at this time, and the main direction hue deviation feature value calculated at the corresponding pixel position will also be relatively small, indicating that the pixel value changes in the extension direction of the welding defect are small at this time, and the possibility of being a welding abnormal pixel is relatively high. At this time, for the DTW distance between the battery box surface welding extension deviation sequences in the local window area centered on pixel i and pixel j is relatively small, and the value of the main direction hue deviation feature is relatively close, it is considered that pixel j and pixel i are likely to be both welding defect pixels on the surface of the power-assisted bicycle battery box, and the deviation distance between two different pixels on the battery box surface calculated will be relatively small.
[0054] It should be noted that if a welding abnormality area appears on the surface of the power-assisted bicycle battery box, the surface feature values of all different welding abnormality pixels should be relatively close, and the spatial distribution positions of the welding abnormality pixels should also be relatively close. Therefore, the pixel values and their spatial distribution in the welding abnormality area on the surface of the power-assisted bicycle battery box can be used to cluster the welding abnormality pixels on the surface of the power-assisted bicycle battery box.
[0055] Therefore, we first use the grayscale image of the battery box surface as the input of the Canopy clustering algorithm, obtain the total number of different pixel categories in the grayscale image of the battery box surface and record it as Ks, and use the total number of battery box surface categories Ks as the input of the K-means algorithm, and further calculate and optimize the K-means clustering function to perform clustering analysis on the abnormal welding areas on the battery box surface.
[0056]
[0057] In the above formula, Ks represents the total number of pixel categories of the grayscale image of the battery box surface, N c represents the total number of pixels of the cth class in the grayscale image of the battery box surface, pc and pk represent the class center pixel of the cth class center and the pixel at the kth position in the grayscale image of the battery box surface, respectively, and dist pc,pk It represents the numerical value of the deviation distance between the kth pixel point in the grayscale image of the battery box surface and the center pixel point of the cth class, and Cs represents the optimized clustering function.
[0058] The optimized clustering function is used as the clustering function of the K-means algorithm, and when the optimized clustering function takes the minimum value, it is considered that the K-means algorithm converges clustering at this time, and the grayscale image of the battery box surface is divided into Ks different pixel point categories. The specific clustering process of the K-means algorithm is a well-known technology and will not be repeated here. In the grayscale image of the battery box surface, the corresponding area of the battery box surface is darker in color and has a smaller grayscale value due to abnormal welding. Therefore, the category with a smaller grayscale mean value among all Ks different pixel point categories of the grayscale image of the battery box surface is recorded as the abnormal area of the battery box surface.
[0059] Step S004, calculating the surface forming accuracy of the power-assisted bicycle battery box according to the abnormal area on the battery box surface, and performing accuracy detection according to the surface forming accuracy of the power-assisted bicycle battery box.
[0060] It is understandable that if there are abnormal welding areas in the surface forming process of the power-assisted bicycle battery box due to improper welding operation, the corresponding pixel area will cause a large precision error in the surface forming process of the power-assisted bicycle battery box. Therefore, the battery welding abnormal area is further calculated and analyzed based on the clustering results of the grayscale image of the battery box surface.
[0061]
[0062] In the above formula, Nφ dc It represents the total number of pixels in the abnormal area of the grayscale image of the surface of the power-assisted bicycle battery box, N represents the total number of pixels in the grayscale image of the surface of the power-assisted bicycle battery box, and Ps represents the surface forming accuracy of the power-assisted bicycle battery box.
[0063] If an abnormal welding area appears on the surface of the power-assisted bicycle, the more obvious the abnormal welding area is, the greater the impact on the surface forming accuracy of the power-assisted bicycle battery box. Therefore, if the calculated surface forming accuracy value of the power-assisted bicycle battery box is larger, it is considered that the abnormal welding area on the surface of the power-assisted bicycle battery box is smaller and the surface forming accuracy is higher. Taking the empirical accuracy threshold T as 0.92, it is considered that when the surface forming accuracy Ps of the power-assisted bicycle battery box is greater than or equal to the empirical accuracy threshold, the surface accuracy of the power-assisted bicycle battery box is normal; conversely, if the surface forming accuracy Ps of the power-assisted bicycle battery box is less than the empirical accuracy threshold, it is considered that the surface accuracy of the power-assisted bicycle battery box is abnormal, and the detection of the surface accuracy of the power-assisted bicycle battery box is completed.
[0064] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for detecting the surface forming accuracy of a power-assisted bicycle battery box based on machine vision, characterized in that: The method comprises the following steps: Acquire the surface image of the battery box of the power-assisted bicycle and perform preprocessing to obtain a grayscale image of the battery box surface; The color space of the surface image of the power-assisted bicycle battery box is converted, the local color feature area is obtained based on the converted image, and the molding hue deviation coefficient of the battery box surface is calculated according to the local color feature area; Based on the grayscale image of the battery box surface, a battery box welding extension window is obtained, and a welding defect extension direction is obtained according to the battery box welding extension window. According to the welding defect extension direction, a battery box surface welding extension deviation sequence is obtained, and the main direction hue deviation characteristics at different pixel positions are calculated according to the battery box surface welding extension deviation sequence. According to the main direction hue deviation characteristics, the deviation distance between different pixel points is calculated, and an optimized clustering function is calculated according to the deviation distance between different pixel points. According to the optimized clustering function, an abnormal area on the battery box surface is obtained; The surface forming accuracy of the power-assisted bicycle battery box is calculated based on the abnormal area on the battery box surface, and the accuracy detection is performed based on the surface forming accuracy of the power-assisted bicycle battery box.
2. The method for detecting the surface forming accuracy of a power-assisted bicycle battery box based on machine vision according to claim 1 is characterized in that: The mathematical expression of the battery box surface molding hue deviation coefficient calculated based on the local color feature area is: In the above formula, Norm() represents the normalization function, σ i represents the variance of the pixel H channel in the local color feature area centered at the pixel i in the HSV image of the battery box surface, μ i represents the mean value of the H channel of the pixel point in the local color feature area centered at the pixel point i in the HSV image of the battery box surface, r represents the position of the rth pixel point in the local color feature area, W represents the size of the local color feature area, HM r , H.M. i They represent the values of the second-order moment of the H channel at the r-th pixel and the i-th pixel respectively. i It represents the color tone deviation coefficient of the battery box surface at the i-th pixel position.
3. The method for detecting the surface forming accuracy of a power-assisted bicycle battery box based on machine vision according to claim 1 is characterized in that: The method for obtaining the extension direction of the welding defect according to the battery box welding extension window is: The Hessian matrix of the battery box welding extension window in the grayscale image of the battery box surface is obtained, and the eigenvector direction corresponding to the minimum eigenvalue of the Hessian matrix is taken as the extension direction of the welding defect.
4. The method for detecting the surface forming accuracy of a power-assisted bicycle battery box based on machine vision according to claim 3 is characterized in that: The method for obtaining the battery box surface welding extension deviation sequence according to the welding defect extension direction is: The battery box surface molding hue deviation coefficients of all pixels in the extension direction of each pixel welding defect are recorded as the battery box surface welding extension deviation sequence.
5. The method for detecting the surface forming accuracy of a power-assisted bicycle battery box based on machine vision according to claim 4 is characterized in that: The method for calculating the main direction color tone deviation characteristics at different pixel positions according to the battery box surface welding extension deviation sequence is: The difference between the maximum and minimum values of the welding extension deviation sequence on the battery box surface in the local window area centered on each pixel point is recorded as the first difference, the difference between the maximum and minimum value sequence index positions is recorded as the second difference, the ratio of the first difference to the second difference is recorded as the first ratio, the first ratio is used as the input of the negative exponential function, and the output is recorded as the main direction hue deviation feature.
6. The method for detecting the surface forming accuracy of a power-assisted bicycle battery box based on machine vision according to claim 5 is characterized in that: The mathematical expression for calculating the deviation distance between different pixel points according to the main direction hue deviation feature is: In the above formula, vus i ,vus j The main direction hue deviation characteristics of the battery box surface welding extension deviation sequence in the local window area centered on pixel i and pixel j are respectively represented. represents the normalization function, DTW() represents the DTW distance between two different sequences, SeqR i , SeqR j They represent the battery box surface welding extension deviation sequence of the local window centered at pixel i and j, dist i,j It represents the deviation distance between two different pixel points on the surface of the battery box.
7. The method for detecting the surface forming accuracy of a power-assisted bicycle battery box based on machine vision according to claim 1 is characterized in that: The mathematical expression for calculating and optimizing the clustering function based on the deviation distance between different pixel points is: In the above formula, Ks represents the total number of pixel categories of the grayscale image of the battery box surface, N c represents the total number of pixels of the cth class in the grayscale image of the battery box surface, pc and pk represent the class center pixel of the cth class center and the pixel at the kth position in the grayscale image of the battery box surface, respectively, and dist pc,pk It represents the numerical value of the deviation distance between the kth pixel point in the grayscale image of the battery box surface and the center pixel point of the cth class, and Cs represents the optimized clustering function.
8. The method for detecting the surface forming accuracy of a power-assisted bicycle battery box based on machine vision according to claim 7 is characterized in that: The method for obtaining the abnormal area on the surface of the battery box according to the optimized clustering function is: The category with the smallest grayscale mean among all different pixel categories of the grayscale image of the battery box surface is recorded as the abnormal area on the battery box surface.
9. The method for detecting the surface forming accuracy of a power-assisted bicycle battery box based on machine vision according to claim 1 is characterized in that: The mathematical expression for calculating the surface forming accuracy of the power-assisted bicycle battery box according to the abnormal area on the battery box surface is: In the above formula, Nφ dc It represents the total number of pixels in the abnormal area of the grayscale image of the surface of the power-assisted bicycle battery box, N represents the total number of pixels in the grayscale image of the surface of the power-assisted bicycle battery box, and Ps represents the surface forming accuracy of the power-assisted bicycle battery box.
10. The method for detecting the surface forming accuracy of a power-assisted bicycle battery box based on machine vision according to claim 1, characterized in that: The method for performing precision detection according to the surface forming precision of the power-assisted bicycle battery box is as follows: Let the empirical accuracy threshold be a first preset value. When the surface forming accuracy of the power-assisted bicycle battery box is greater than or equal to the first preset value, it is normal accuracy; otherwise, when the surface forming accuracy of the power-assisted bicycle battery box is less than the first preset value, it is abnormal accuracy.
Citation Information
Patent Citations
Method and apparatus for detecting defects on the surface of tyres
CN107750371A
Multi-color-block packaging film defect detection method
CN115147410A