CN116309275A - Method and device for detecting edges of sub-pixels of battery piece image and storage medium - Google Patents

Method and device for detecting edges of sub-pixels of battery piece image and storage medium Download PDF

Info

Publication number
CN116309275A
CN116309275A CN202211593764.7A CN202211593764A CN116309275A CN 116309275 A CN116309275 A CN 116309275A CN 202211593764 A CN202211593764 A CN 202211593764A CN 116309275 A CN116309275 A CN 116309275A
Authority
CN
China
Prior art keywords
pixel
edge
sub
battery piece
zernike
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211593764.7A
Other languages
Chinese (zh)
Inventor
朱栋
赵腾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changzhou University
Original Assignee
Changzhou University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Changzhou University filed Critical Changzhou University
Priority to CN202211593764.7A priority Critical patent/CN116309275A/en
Publication of CN116309275A publication Critical patent/CN116309275A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a method, a device and a storage medium for detecting the sub-pixel edge of a battery piece image, which comprise the steps of obtaining a preprocessed battery piece image; edge positioning processing is carried out based on a Canny operator to obtain a pixel-level edge point image; obtaining an optimal threshold value based on a maximum entropy multi-threshold segmentation algorithm of a firefly algorithm; calculating Zernike parameters of pixel-level edge points based on a Zernike moment sub-pixel edge detection algorithm; separating out a contour edge point, a fine grid edge point and a main grid edge point according to the Zernike parameters of the pixel-level edge points and the optimal threshold; and respectively carrying out least square fitting treatment on the two edges to obtain the contour line, the thin grid edge line and the main grid edge line of the battery piece. According to the invention, the edge detection precision is reduced to be within one pixel by the Zernike moment sub-pixel edge detection algorithm, and the influence of noise on the detection precision is reduced.

Description

Method and device for detecting edges of sub-pixels of battery piece image and storage medium
Technical Field
The invention relates to a method and a device for detecting a sub-pixel edge of a battery piece image and a storage medium, and belongs to the technical field of digital images.
Background
The automatic production and processing process of the solar cell is complicated, the texture of the silicon wafer is extremely fragile, and defects such as unfilled corners, broken edges, scratches, cracks, broken grids, dirt and the like are easily caused on the surface of the cell due to the influence of certain process defects or production environment, so that the yield of finished cells is reduced, and the conversion efficiency of the cells is further influenced without removing the solar cell. Therefore, it is important to detect the appearance defects of the solar cells and remove the defective cells before series welding. Appearance defect detection based on machine vision technology is gradually replacing traditional manual visual inspection due to the advantages of rapidness, high efficiency, low cost, no contact and the like. Appearance defect detection typically requires edge detection of the battery cells in the image to extract the grid lines and contours. In addition, in the links of series welding, scribing and the like, grid lines printed on the front surface of the battery piece are used for positioning the battery piece so as to guide the grabbing of the manipulator.
The appearance gray value of the solar cell is low under visible light, the grid line is often only tens to hundreds of micrometers, the traditional image edge detection algorithm (such as Prewitt, sobel, canny and the like) aims at the pixel-level edge, and the highest precision can only be positioned to one pixel, so that the high precision requirements of appearance detection and visual positioning of the cell are difficult to meet in actual production.
The information disclosed in this background section is only for enhancement of understanding of the general background of the invention and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art already known to a person of ordinary skill in the art.
Disclosure of Invention
The invention aims to overcome the defects in the prior art and provides a method, a device and a storage medium for detecting the edges of sub-pixels of a battery piece image, wherein on one hand, the edge detection precision is reduced to be within one pixel by a Zernike moment sub-pixel edge detection algorithm, and the influence of noise on the detection precision is reduced; on the other hand, the maximum entropy multi-threshold segmentation algorithm based on the firefly algorithm solves the problem that the traditional maximum entropy multi-threshold segmentation algorithm is low in running speed.
In order to achieve the above purpose, the invention is realized by adopting the following technical scheme:
in a first aspect, the invention discloses a method for detecting a sub-pixel edge of a battery piece image, which comprises the steps of,
acquiring a preprocessed battery piece image;
according to the battery piece image, edge positioning processing based on a Canny operator is carried out to obtain a pixel-level edge point image;
obtaining an optimal threshold value according to the pixel-level edge point image based on a maximum entropy multi-threshold segmentation algorithm of a firefly algorithm;
according to the pixel-level edge point image, calculating Zernike parameters of pixel-level edge points based on a Zernike moment sub-pixel edge detection algorithm;
separating out a contour edge point, a fine grid edge point and a main grid edge point according to the Zernike parameters of the pixel-level edge points and the optimal threshold;
performing least square fitting treatment on the contour edge points, the fine grid edge points and the main grid edge points respectively to obtain contour lines, fine grid edge lines and main grid edge lines of the battery piece;
and outputting a sub-pixel edge detection result of the battery piece image according to the contour line, the fine grid edge line and the main grid edge line.
Further, the preprocessing of the battery piece image comprises the following steps:
acquiring an original battery piece image;
and carrying out graying and Gaussian filtering treatment on the original battery piece image to obtain a battery piece image after pretreatment.
Further, the maximum entropy multi-threshold segmentation algorithm based on the firefly algorithm comprises the following steps:
initializing firefly algorithm parameters according to the pixel-level edge point image;
calculating entropy function values of each firefly as brightness, and arranging to obtain a position corresponding to the firefly with the maximum brightness;
updating the firefly position and returning to the previous step for re-iterative computation in response to the fact that the maximum iterative times are not reached;
and outputting three thresholds of fireflies with the maximum brightness as optimal thresholds in response to the maximum iteration times.
Further, the expression of the entropy function value of firefly is:
Figure BDA0003996041510000031
wherein k is 1 ,k 2 ,k 3 Three thresholds of the divided image respectively; p is p A1 、p A2 、p A3 、p A4 Probabilities of occurrence for the four divided areas A1, A2, A3, A4, respectively; p is p i Is the probability of occurrence of the i-th pixel level edge point.
Further, the Zernike moment sub-pixel edge detection algorithm includes:
convolving the pixel-level edge point image based on a preset Zernike moment template to obtain a Zernike moment of a corresponding order;
according to the Zernike moment, combining a three-gray transition model, and calculating the Zernike parameters of the pixel-level edge points;
the calculation formula of the Zernike moment is as follows:
Z nm =P*M nm
wherein Z is nm Zernike moments representing order n m; p represents a convolution window matrix centered at a pixel level edge point; * Representing a convolution; m is M nm Represents the n-order m-th order Zernike moment template matrix.
Further, the Zernike parameters of the pixel level edge points comprise the vertical distance between the pixel level edge points and the actual edge line, the included angle between the vertical line of the actual edge line and the x-axis and the step gray threshold,
the expression is as follows:
Figure BDA0003996041510000041
wherein l represents the vertical distance from the pixel level edge point to the actual edge line;
Figure BDA0003996041510000042
representing the realityAn included angle between the vertical line of the edge line and the x-axis; k represents a step gray threshold; re [ Z ] 11 ]Representing the Zernike moment Z of order 1 and order 1 11 The real part of (2); im [ Z ] 11 ]Representing the Zernike moment Z of order 1 and order 1 11 Is the imaginary part of (2); Δk represents the transition zone step gray; l (L) 1 Representing the distance between the center and the left limit of the transition zone; l (L) 2 Representing the distance of the center from the right limit of the transition zone.
Further, the optimal threshold value comprises a first optimal threshold value, a second optimal threshold value and a third optimal threshold value;
obtaining sub-pixel level edge points according to the step gray threshold value and the first optimal threshold value of the Zernike parameters;
obtaining contour edge points of the sub-pixel level edge points according to the step gray threshold value and the second optimal threshold value of the Zernike parameters;
and separating a fine grid edge point and a main grid edge point of the sub-pixel level edge point according to the step gray threshold value and the third optimal threshold value of the Zernike parameter.
Further, the expression of the sub-pixel level edge point is as follows:
Figure BDA0003996041510000051
the constraint conditions are as follows:
k≥k 1 ∩l≤l b
wherein, (x, y) is the pixel level edge point coordinates to be detected; (x) s ,y s ) Coordinate values of sub-pixel level edge points corresponding to the pixel level edge points; n is the size of a Zernike moment template; k (k) 1 Is a first optimal threshold; l (L) b Is a distance threshold.
In a second aspect, the invention discloses a battery piece image sub-pixel edge detection device, which comprises a processor and a storage medium;
the storage medium is used for storing instructions;
the processor is operative according to the instructions to perform the steps of the method according to any one of the first aspects.
In a third aspect, the present invention discloses a storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method according to any of the first aspects.
Compared with the prior art, the invention has the beneficial effects that:
according to the battery piece image sub-pixel edge detection method, device and storage medium, on one hand, edge detection accuracy is reduced to be within one pixel through a Zernike moment sub-pixel edge detection algorithm, and influence of noise on detection accuracy is reduced; on the other hand, the maximum entropy multi-threshold segmentation algorithm based on the firefly algorithm solves the problem that the traditional maximum entropy multi-threshold segmentation algorithm is low in running speed.
The three-gray transition model is introduced into the edge detection algorithm based on the Zernike moment sub-pixel, and the three-gray transition model has practicability compared with the traditional ideal step edge model.
According to the invention, the self-adaptive multi-threshold segmentation is realized through the maximum entropy multi-threshold algorithm, and meanwhile, a plurality of target edges of the battery slice contour, the fine grid and the main grid can be respectively identified and extracted.
The invention has the advantages of high precision, high speed, robustness and the like, and can be effectively applied to the positioning and defect detection of the solar cell in the photovoltaic module production equipment.
Drawings
FIG. 1 is a flow chart of a method for detecting a sub-pixel edge of a battery slice image;
FIG. 2 is an original battery slice image taken by a camera;
FIG. 3 is a flow chart of a maximum entropy multi-threshold segmentation algorithm based on a firefly algorithm;
FIG. 4 is a schematic diagram of a subpixel edge detection three-gray transition model;
FIG. 5 is an extracted battery slice contour image;
FIG. 6 is an extracted cell primary grid image;
fig. 7 is an extracted cell fine grid image.
Detailed Description
The invention is further described below with reference to the accompanying drawings. The following examples are only for more clearly illustrating the technical aspects of the present invention, and are not intended to limit the scope of the present invention.
Example 1
The embodiment 1 discloses a method for detecting the edge of a sub-pixel of a battery piece image, as shown in fig. 1, which comprises,
acquiring a preprocessed battery piece image;
according to the battery piece image, edge positioning processing based on a Canny operator is carried out to obtain a pixel-level edge point image;
obtaining an optimal threshold value according to the pixel-level edge point image based on a maximum entropy multi-threshold segmentation algorithm of a firefly algorithm;
according to the pixel-level edge point image, calculating Zernike parameters of pixel-level edge points based on a Zernike moment sub-pixel edge detection algorithm;
separating out a contour edge point, a fine grid edge point and a main grid edge point according to the Zernike parameters of the pixel-level edge points and the optimal threshold;
performing least square fitting treatment on the contour edge points, the fine grid edge points and the main grid edge points respectively to obtain contour lines, fine grid edge lines and main grid edge lines of the battery piece;
and outputting a sub-pixel edge detection result of the battery piece image according to the contour line, the fine grid edge line and the main grid edge line.
The technical conception of the invention is as follows: on one hand, the edge detection precision is reduced to be within one pixel by a Zernike moment sub-pixel edge detection algorithm, and the influence of noise on the detection precision is reduced; on the other hand, the maximum entropy multi-threshold segmentation algorithm based on the firefly algorithm solves the problem that the traditional maximum entropy multi-threshold segmentation algorithm is low in running speed.
As shown in fig. 1, the specific steps are as follows:
1. obtaining a battery piece image;
and shooting and taking a picture of the solar cell by using an area array or linear array industrial camera under the condition of shining right above a surface light source, wherein the shot original cell image is shown in fig. 2.
2. Graying and denoising pretreatment of the image;
the image preprocessing comprises the following steps: the original battery piece image R, G, B three channels are weighted and averaged into one channel to realize image graying; and then carrying out image denoising by using 3X 3 Gaussian check image convolution to obtain a preprocessed battery piece image.
3. Coarsely positioning edges by using a Canny operator;
and coarsely positioning the pixel-level edge of the preprocessed image by using a Canny operator to obtain pixel-level edge points, and obtaining a pixel-level edge point image.
4. Obtaining optimal threshold k based on maximum entropy algorithm 1 、k 2 、k 3
Because the traditional Zernike moment sub-pixel edge detection needs manual setting for judging the step gray threshold value of boundary selection, the method for manually selecting the threshold value is not easy to obtain the optimal edge position, noise information redundancy is caused by too small threshold value, loss of edge information is caused by too large threshold value, and the error of the final sub-pixel edge detection point is larger because the step gray threshold value of the actual shot picture is difficult to be consistent due to the influence of shooting environment, so that the introduction of self-adaptive threshold segmentation in the traditional Zernike moment sub-pixel edge detection is necessary.
In addition, the grid lines of the battery piece are divided into a main grid and a fine grid, the invention hopes to identify and distinguish the main grid and the fine grid, so that multi-target edge detection needs multi-threshold to be distinguished, and the invention adopts a maximum entropy multi-threshold segmentation algorithm.
However, the traditional maximum entropy threshold segmentation algorithm has slower running speed, so the invention improves the maximum entropy algorithm based on the firefly algorithm in the group intelligent optimization algorithm, and finally obtains the optimal threshold k 1 、k 2 、k 3 . The algorithm flow chart is shown in fig. 3, and the specific steps are as follows:
4.1, inputting a pixel-level edge point image;
4.2, initializing firefly algorithm parameters;
initializing the number n of fireflies and initial position of firefliesPut X (k) 1 ,k 2 ,k 3 ) Initial attraction degree beta 0 Light intensity absorption gamma, step factor alpha, maximum number of iterations T.
Initializing the number n of fireflies: according to the actual situation, the more the number is, the more the accuracy is, but the longer the optimizing time is, and the experiment is set to be 50; setting initial position Xi (k) 1 ,k 2 ,k 3 ): the initial position is the coordinate axes are k respectively 1 、k 2 、k 3 The initial position of each firefly is randomly arranged; setting an initial maximum attraction degree beta 0 : set to 1 here; setting a light intensity absorption coefficient gamma: set to 1 here; setting a step factor alpha: an internal constant of 0 to 1, here set to 0.02; setting the maximum iteration number T: here set to 100.
4.3 calculating the entropy function value H (k) 1 ,k 2 ,k 3 ) As brightness l 0
In the single-threshold segmentation, for an image with a gray level of L, a threshold k is set to divide the image into two types of background (A) and target (B), and the probabilities of the background and target areas are respectively:
Figure BDA0003996041510000091
Figure BDA0003996041510000092
wherein p is i For the probability of occurrence of the ith pixel, p A And p is as follows B The sum of the probabilities is 1. The entropy of the information corresponding to the background and the target is expressed as:
Figure BDA0003996041510000093
Figure BDA0003996041510000094
the information entropy of the whole image is:
Figure BDA0003996041510000095
generalizing to three-threshold segmentation, then the total entropy of the image at this time is:
Figure BDA0003996041510000096
wherein k is 1 ,k 2 ,k 3 Three thresholds of the divided image are respectively, and A1, A2, A3 and A4 are respectively divided into four areas; p is p A1 、p A2 、p A3 、p A4 Probabilities of occurrence for the four divided areas A1, A2, A3, A4, respectively; p is p i Is the probability of occurrence of the i-th pixel level edge point. Threshold at which total entropy takes maximum
Figure BDA0003996041510000097
Figure BDA0003996041510000098
Is the optimal threshold, namely:
Figure BDA0003996041510000099
therefore, in the firefly algorithm, the information entropy function value H (k) of each firefly is calculated 1 ,k 2 ,k 3 ) And takes it as brightness l 0
4.4, sequencing to obtain the position corresponding to the firefly with the maximum brightness;
the relative brightness of fireflies in the population is:
Figure BDA0003996041510000101
wherein, I 0 Namely, the information entropy function value H (k) of each firefly 1 ,k 2 ,k 3 ) Gamma is the light intensity absorption coefficient, r ij Is the spatial distance between firefly i and firefly j.
4.5, judging whether the maximum iteration times T are reached, if yes, carrying out step 4.6, and if no, updating the position of the firefly and returning to step 4.3;
updating the position corresponding to firefly by:
X i =X i +β(X j -X i )+α(rand-0.5),
wherein X is i And X j Respectively representing the spatial positions of firefly i and firefly j; alpha is a step factor; rand is [0,1]Applying random factors subject to uniform distribution; (rand-0.5) is a perturbation term for avoiding premature trapping into local optima; beta is the attraction degree of firefly j to firefly i, and the calculation formula is as follows:
Figure BDA0003996041510000102
wherein beta is 0 The maximum suction degree can be set according to the situation.
4.6 three threshold k of firefly when the output luminance is maximum 1 ,k 2 ,k 3 As three optimal thresholds; wherein k is 1 Is a first optimal threshold; k (k) 2 Is a second optimal threshold; k (k) 3 Is the third optimal threshold.
5. Calculating Zernike moments using a 7 x 7 convolution kernel;
5.1, constructing a Zernike moment template;
selecting 7×7 template, dividing unit circle with 7×7 uniform grid, and marking ith row and jth column square region as S ij C is a unit circle region, and the template coefficient M corresponding to the square region nm (i, j) is:
Figure BDA0003996041510000103
in the method, in the process of the invention,
Figure BDA0003996041510000111
for an nth order m th order Zernike polynomial V nm Conjugated polynomials of (ρ, θ), V nm (ρ, θ) is defined as follows:
V nm (ρ,θ)=R nm (ρ)e jmθ
wherein R is nm (ρ) is a real radial polynomial defined as:
Figure BDA0003996041510000112
the invention calculates the Zernike parameters to be used in Z 00 、Z 11 、Z 20 And Z 31 Four Zernike moments, so that the corresponding 7X 7 template M needs to be constructed 00 、M 11 、M 20 、M 31 . And convolving the roughly positioned pixel-level edge point image by using a template to obtain the Zernike moment of the required order.
5.2, obtaining Zernike moments of corresponding orders;
the Zernike moments of the corresponding order are obtained according to the following equation:
Z nm =P*M nm
wherein P is a convolution window matrix taking pixel-level edge points as centers, M nm Template matrix, which is the nth order m order Zernike moment, represents convolution.
The above formula is expressed in convolution as:
Figure BDA0003996041510000113
where N represents the size of the Zernike rectangular template, here 7.
It is necessary to convolve the coarsely positioned pixel-level edge point images with a constructed template to obtain Zernike moments of the corresponding order.
6. Calculating parameters by Zernike moments
Figure BDA0003996041510000114
k、l;
In the Zernike parameters, l is the vertical distance from the pixel-level edge point to the actual edge line, i.e. the distance from the center pixel of the convolution window matrix P to the boundary tangent,
Figure BDA0003996041510000115
and k is the difference value between the background and the target gray level, namely the step gray level threshold value, which is the included angle between the vertical line of the actual edge line and the x axis. The edge rotation-theta is carried out, and the corresponding image part Zernike moment before and after rotation has the following formula relation:
Z' nm =Z nm e -jθ
the Zernike has rotational invariance, i.e. only the phase angle changes before and after rotation, and the corresponding amplitude remains unchanged. Because the moment after rotation is symmetrical about the x-axis, Z 1 ' 1 The imaginary part is 0, and the angle θ can be solved by using the imaginary part and the real part of the first-order Zernike moment:
Figure BDA0003996041510000121
in Re [ Z ] 11 ]And Im [ Z ] 11 ]Respectively represent Z 11 Real and imaginary parts of (a) are provided.
The conventional Zernike moment edge detection algorithm is based on an ideal step model of the edge, and in practice, a transition region is usually present near the edge in the image due to non-ideal discrete sampling and the influence of diffraction effects of the optical system. In order to describe the gray level matching with the actual transition region so as to make detection more accurate, the invention uses a three-gray level transition model of the edge as shown in fig. 4, wherein h represents background gray level, h+Δk represents transition region gray level value, h+k represents target gray level value, l 1 And l 2 The distance between the center and the left and right limits of the transition zone are shown, respectively.
According to the subpixel edge detection three-gray transition model shown in fig. 4, the edge parameter l 1 、l 2 Δk and k are as follows:
Figure BDA0003996041510000122
through the geometric relationship of the three-gray transition model of FIG. 4, the subpixel distances l and l 1 、l 2 The relationship of Δk, k can be expressed as:
Figure BDA0003996041510000131
7. acquiring accurate sub-pixel level edge points according to the Zernike parameters;
the exact sub-pixel level edge point coordinates are obtained as follows:
Figure BDA0003996041510000132
wherein (x, y) is the pixel level edge point coordinates to be detected, (x) s ,y s ) The coordinate values of the sub-pixel level edge points corresponding to the pixel level edge points are obtained. For the acquisition of accurate sub-pixel level edge points, the selection of parameters l and k is an important basis for judgment, and the points on the boundary should meet the constraint condition that k is greater than or equal to k b ∩l≤l b Wherein k is b And l b The gray threshold and the distance threshold, respectively. l (L) b The value range of (2) is smaller, and is generally taken according to the template effect
Figure BDA0003996041510000133
Where N is the template number 7; for k b Is to select the threshold k when the information entropy optimized based on firefly algorithm is maximum 1 As k b
8. And obtaining the contour line and the grid line by utilizing least square fitting.
Respectively selecting the first optimal threshold k obtained in the step 4 1 The method comprises the steps of extracting the outline of a battery piece; selecting a second optimal threshold k 2 A fine grid for extracting the battery piece; selecting a third optimal threshold k 3 And the main grid is used for extracting the battery piece.
For the battery piece image, the gray value of the outline part of the battery piece is minimum, the gray value of the main grid is maximum in a fine grid.
In response to k.gtoreq.k 1 ∩l≤l b When the method is used, sub-pixel level edge points can be obtained, and background points can be removed;
in response to k.gtoreq.k 2 In the process, the contour points can be further separated;
in response to k.gtoreq.k 2 In this case, the fine gate edge points can be further separated, leaving the main gate edge points.
And finally, fitting each partial sub-pixel level edge point by using a least square method to respectively obtain an accurate battery piece contour line, a fine grid edge line and a main grid edge line.
Fig. 5-7 show the battery slice outline, main grid and fine grid images extracted by the sub-pixel edge detection method of the invention. As can be seen from the figure, the battery piece image sub-pixel edge detection method based on the Zernike moment provided by the invention can accurately detect the edge, the detection error is lower than 0.1 pixel, and the image detection operation time of 4000×3000 pixels in the embodiment is about 500 milliseconds. The detection precision is higher than that of a pixel-level edge detection method, and the detection precision is within one pixel; compared with sub-pixel edge detection based on difference and fitting, the anti-noise capability is stronger and the positioning accuracy is higher because the moment is obtained based on integration and can reflect the local characteristics of the image; compared with the gray moment and space moment sub-pixel edge detection algorithm based on the moment method, the method based on the Zernike moment has lower calculation complexity and orthogonality, so that the detection precision is higher and the detection time is faster. The method introduces a three-gray transition model into a traditional subpixel edge detection algorithm based on Zernike moment; meanwhile, a maximum entropy multi-threshold segmentation algorithm is utilized to realize self-adaptive threshold segmentation; respectively identifying and extracting a plurality of target edges of the battery slice outline, the fine grid and the main grid; in addition, the firefly algorithm in the intelligent optimization algorithm based on the group is utilized to improve the maximum entropy algorithm with slower running speed. The invention has the advantages of high precision, high speed, robustness and the like, and can be effectively applied to the positioning and defect detection of the solar cell in the photovoltaic module production equipment.
Example 2
The embodiment 2 discloses a battery piece image sub-pixel edge detection device, which comprises a processor and a storage medium;
the storage medium is used for storing instructions;
the processor is operative according to instructions to perform the steps of the method according to any one of embodiment 1.
Example 3
Embodiment 3 discloses a storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of any of the methods of embodiment 1.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing is only a preferred embodiment of the invention, it being noted that: it will be apparent to those skilled in the art that various modifications and adaptations can be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the invention.

Claims (10)

1. A method for detecting the edge of a sub-pixel of a battery piece image is characterized by comprising the following steps of,
acquiring a preprocessed battery piece image;
according to the battery piece image, edge positioning processing based on a Canny operator is carried out to obtain a pixel-level edge point image;
obtaining an optimal threshold value according to the pixel-level edge point image based on a maximum entropy multi-threshold segmentation algorithm of a firefly algorithm;
according to the pixel-level edge point image, calculating Zernike parameters of pixel-level edge points based on a Zernike moment sub-pixel edge detection algorithm;
separating out a contour edge point, a fine grid edge point and a main grid edge point according to the Zernike parameters of the pixel-level edge points and the optimal threshold;
performing least square fitting treatment on the contour edge points, the fine grid edge points and the main grid edge points respectively to obtain contour lines, fine grid edge lines and main grid edge lines of the battery piece;
and outputting a sub-pixel edge detection result of the battery piece image according to the contour line, the fine grid edge line and the main grid edge line.
2. The battery piece image sub-pixel edge detection method according to claim 1, wherein the preprocessing of the battery piece image comprises the following steps:
acquiring an original battery piece image;
and carrying out graying and Gaussian filtering treatment on the original battery piece image to obtain a battery piece image after pretreatment.
3. The battery piece image sub-pixel edge detection method according to claim 1, wherein the maximum entropy multi-threshold segmentation algorithm based on the firefly algorithm comprises the following steps:
initializing firefly algorithm parameters according to the pixel-level edge point image;
calculating entropy function values of each firefly as brightness, and arranging to obtain a position corresponding to the firefly with the maximum brightness;
updating the firefly position and returning to the previous step for re-iterative computation in response to the fact that the maximum iterative times are not reached;
and outputting three thresholds of fireflies with the maximum brightness as optimal thresholds in response to the maximum iteration times.
4. The battery piece image sub-pixel edge detection method according to claim 3, wherein the expression of the entropy function value of firefly is:
Figure FDA0003996041500000021
wherein k is 1 ,k 2 ,k 3 Three thresholds of the divided image respectively; p is p A1 、p A2 、p A3 、p A4 Probabilities of occurrence for the four divided areas A1, A2, A3, A4, respectively; p is p i Is the probability of occurrence of the i-th pixel level edge point.
5. The battery piece image sub-pixel edge detection method according to claim 1, wherein the Zernike moment sub-pixel edge detection algorithm comprises:
convolving the pixel-level edge point image based on a preset Zernike moment template to obtain a Zernike moment of a corresponding order;
according to the Zernike moment, combining a three-gray transition model, and calculating the Zernike parameters of the pixel-level edge points;
the calculation formula of the Zernike moment is as follows:
Z nm =P*M nm
wherein Z is nm Zernike moments representing order n m; p represents a convolution window matrix centered at a pixel level edge point; * Representing a convolution; m is M nm Represents the n-order m-th order Zernike moment template matrix.
6. The battery piece image sub-pixel edge detection method according to claim 5, wherein the Zernike parameters of the pixel level edge points comprise a vertical distance from the pixel level edge points to an actual edge line, an included angle between a vertical line of the actual edge line and an x-axis, and a step gray threshold, and the expression is as follows:
Figure FDA0003996041500000031
wherein l represents the vertical distance from the pixel level edge point to the actual edge line; θ represents the angle between the perpendicular to the actual edge line and the x-axis; k represents a step gray threshold; re [ Z ] 11 ]Representing the Zernike moment Z of order 1 and order 1 11 The real part of (2); im [ Z ] 11 ]Representing the Zernike moment Z of order 1 and order 1 11 Is the imaginary part of (2); Δk represents the transition zone step gray; l (L) 1 Representing the distance between the center and the left limit of the transition zone; l (L) 2 Representing the distance of the center from the right limit of the transition zone.
7. The battery piece image sub-pixel edge detection method according to claim 6, wherein the optimal threshold value comprises a first optimal threshold value, a second optimal threshold value and a third optimal threshold value;
obtaining sub-pixel level edge points according to the step gray threshold value and the first optimal threshold value of the Zernike parameters;
obtaining contour edge points of the sub-pixel level edge points according to the step gray threshold value and the second optimal threshold value of the Zernike parameters;
and separating a fine grid edge point and a main grid edge point of the sub-pixel level edge point according to the step gray threshold value and the third optimal threshold value of the Zernike parameter.
8. The battery piece image sub-pixel edge detection method according to claim 7, wherein the expression of the sub-pixel level edge point is as follows:
Figure FDA0003996041500000041
the constraint conditions are as follows:
k≥k 1 ∩l≤l b
wherein, (x, y) is the pixel level edge point coordinates to be detected; (x) s ,y s ) Coordinate values of sub-pixel level edge points corresponding to the pixel level edge points; n is the size of a Zernike moment template; k (k) 1 Is a first optimal threshold; l (L) b Is a distance threshold.
9. The device for detecting the edges of the sub-pixels of the battery piece image is characterized by comprising a processor and a storage medium;
the storage medium is used for storing instructions;
the processor being operative according to the instructions to perform the steps of the method according to any one of claims 1 to 8.
10. A storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the method according to any of claims 1 to 8.
CN202211593764.7A 2022-12-13 2022-12-13 Method and device for detecting edges of sub-pixels of battery piece image and storage medium Pending CN116309275A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211593764.7A CN116309275A (en) 2022-12-13 2022-12-13 Method and device for detecting edges of sub-pixels of battery piece image and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211593764.7A CN116309275A (en) 2022-12-13 2022-12-13 Method and device for detecting edges of sub-pixels of battery piece image and storage medium

Publications (1)

Publication Number Publication Date
CN116309275A true CN116309275A (en) 2023-06-23

Family

ID=86796605

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211593764.7A Pending CN116309275A (en) 2022-12-13 2022-12-13 Method and device for detecting edges of sub-pixels of battery piece image and storage medium

Country Status (1)

Country Link
CN (1) CN116309275A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116823925A (en) * 2023-08-30 2023-09-29 苏州聚视兴华智能装备有限公司 High-precision O-shaped rubber ring inner diameter and outer diameter measuring method and device and electronic equipment
CN117237441A (en) * 2023-11-10 2023-12-15 湖南科天健光电技术有限公司 Sub-pixel positioning method, sub-pixel positioning system, electronic equipment and medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116823925A (en) * 2023-08-30 2023-09-29 苏州聚视兴华智能装备有限公司 High-precision O-shaped rubber ring inner diameter and outer diameter measuring method and device and electronic equipment
CN116823925B (en) * 2023-08-30 2023-11-17 苏州聚视兴华智能装备有限公司 High-precision O-shaped rubber ring inner diameter and outer diameter measuring method and device and electronic equipment
CN117237441A (en) * 2023-11-10 2023-12-15 湖南科天健光电技术有限公司 Sub-pixel positioning method, sub-pixel positioning system, electronic equipment and medium
CN117237441B (en) * 2023-11-10 2024-01-30 湖南科天健光电技术有限公司 Sub-pixel positioning method, sub-pixel positioning system, electronic equipment and medium

Similar Documents

Publication Publication Date Title
CN116309275A (en) Method and device for detecting edges of sub-pixels of battery piece image and storage medium
CN110135503B (en) Deep learning identification method for parts of assembly robot
CN109635806B (en) Ammeter value identification method based on residual error network
KR20190028794A (en) GPU-based TFT-LCD Mura Defect Detection Method
CN114494045B (en) Large spur gear geometric parameter measurement system and method based on machine vision
CN107590512B (en) The adaptive approach and system of parameter in a kind of template matching
CN112819772A (en) High-precision rapid pattern detection and identification method
CN109540925B (en) Complex ceramic tile surface defect detection method based on difference method and local variance measurement operator
CN115063409A (en) Method and system for detecting surface material of mechanical cutter
Sovetkin et al. Automatic processing and solar cell detection in photovoltaic electroluminescence images
CN111754538A (en) Threshold segmentation method for USB surface defect detection
CN115082477B (en) Semiconductor wafer processing quality detection method based on light reflection removing effect
CN114612406A (en) Photovoltaic panel defect detection method based on visible light and infrared vision
CN114627089A (en) Defect identification method, defect identification device, computer equipment and computer readable storage medium
CN110334775B (en) Unmanned aerial vehicle line fault identification method and device based on width learning
CN113808104B (en) Metal surface defect detection method and system based on blocking
CN111047559A (en) Method for rapidly detecting abnormal area of digital pathological section
CN113705564A (en) Pointer type instrument identification reading method
CN116934752B (en) Glass detection method and system based on artificial intelligence
CN112184723B (en) Image processing method and device, electronic equipment and storage medium
CN111161228B (en) Button surface defect detection method based on transfer learning
CN110766675B (en) Solar cell panel defect detection method
CN117169247A (en) Metal surface defect multi-dimensional detection method and system based on machine vision
CN115753791B (en) Defect detection method, device and system based on machine vision
CN111707672A (en) Method for detecting surface defects of wind power rotary supporting piece

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination