A defect type determination method, device, electronic device and storage medium
By acquiring images of the target object surfaces acquired by different image acquisition devices, determining defect areas and converting them, the problem of difficult to distinguish transparent or translucent target object surfaces from internal defects in the prior art is solved, and high-accurate defect type determination is achieved.
Patent Information
- Application Number
- CN202510063176.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-15
AI Technical Summary
The prior art is difficult to determine the surface defects and the internal defects of transparent or translucent target objects, and it is impossible to distinguish between the two.
By acquiring at least two images of the target object surfaces collected by different image acquisition devices, a target defect area that characterizes the same defect is determined, and using the conversion parameters between the image acquisition devices, the second defect area is converted to the image plane where the first defect area is located, and a mapped defect area is obtained. The defect type is determined based on the position difference between the first defect area and the mapped defect area.
Accurately distinguish the surface and internal defects of transparent or translucent target objects, and improve the accuracy and accuracy of defect type determination.
Smart Images

Figure CN119477917B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of optical detection technology, and in particular to a defect type determination method, device, electronic device and storage medium. Background Art
[0002] For defect detection of target objects (such as battery cells), since the surface of the target object is transparent or translucent, it is impossible to determine whether the defect is on the surface of the target object or inside the target object by performing defect detection based on the image acquired by a single image acquisition device on the surface of the target object, that is, it is impossible to determine whether the target object has a surface defect or an internal defect. Summary of the invention
[0003] The present application at least provides a defect type determination method, device, electronic device and storage medium.
[0004] A first aspect of the present application provides a defect type determination method, which includes: acquiring at least two target images obtained by capturing the surface of a target object; wherein the at least two target images are respectively captured by at least two image capture devices at different positions; determining target defect areas representing the same defect from each target image; wherein the defect area of one target image is a first defect area, and the defect areas of other target images are second defect areas; using conversion parameters between at least two image capture devices, converting the second defect area to an image plane where the first defect area is located to obtain a mapped defect area; based on the position difference between the first defect area and the mapped defect area, obtaining a defect type determination result; wherein the defect type determination result is used to characterize whether the target object has a surface defect or an internal defect.
[0005] Therefore, by using the conversion parameters between at least two image acquisition devices, the second defect area is converted to the image plane where the first defect area is located to obtain a mapped defect area, and based on the position difference between the first defect area and the mapped defect area, a defect type determination result is obtained. Therefore, by comparing the position difference between the first defect area and the mapped defect area, the defect type existing on the target object can be determined, whether it is a surface defect or an internal defect.
[0006] In addition, since the second defect area is converted to the image plane where the first defect area is located, the first defect area does not need to be converted, and only the second defect area needs to be converted. However, when the defect area is converted using the conversion parameters between at least two image acquisition devices, there will inevitably be a conversion error problem. Therefore, compared to converting all defect areas to an additionally set image plane, that is, compared to converting all defect areas, the present application only converts the second defect area, which can reduce the error problem of converting the defect area, improve the conversion accuracy of the defect area, and thus improve the accuracy of the subsequent determination of the defect type.
[0007] Among them, before obtaining the defect type determination result based on the position difference between the first defect area and the mapped defect area, the defect type determination method also includes: determining a first position reference point in the first defect area and a second position reference point in the mapped defect area; obtaining the position difference between the first position reference point and the second position reference point as the position difference between the first defect area and the mapped defect area.
[0008] Therefore, the position difference between the corresponding position points in the first defect area and the mapped defect area can be used as the position difference between the first defect area and the mapped defect area.
[0009] The first position reference point and the second position reference point are center points of corresponding defect areas.
[0010] Therefore, the center point of the corresponding defect area can be flexibly selected as the position reference point.
[0011] The center point of the defect area is the center point of the smallest circumscribed rectangular frame of the defect area.
[0012] Therefore, since the defect area may be irregular, the center point of the defect area may be the center point of the minimum circumscribed rectangular frame of the defect area.
[0013] Among them, there is one mapped defect area; based on the position difference between the first defect area and the mapped defect area, a defect type determination result is obtained, including: in response to the position difference between the first defect area and the mapped defect area being greater than or equal to a difference threshold, determining that the target object has an internal defect; in response to the position difference between the first defect area and the mapped defect area being less than the difference threshold, determining that the target object has a surface defect.
[0014] Therefore, a card control threshold is set. When the position difference between the first defect area and the mapped defect area is greater than the card control threshold, it indicates that the position difference between the first defect area and the mapped defect area is too large, indicating that the target object has internal defects; and when the position difference between the first defect area and the mapped defect area is less than the card control threshold, it indicates that there is basically no position difference between the first defect area and the mapped defect area, indicating that the target object has surface defects.
[0015] Among them, the conversion parameter is a conversion matrix, and the second defect area is converted to the image plane where the first defect area is located by using the conversion parameters between at least two image acquisition devices to obtain a mapped defect area, including: obtaining the first coordinates of several first contour points of the second defect area in the first target image; converting the first coordinates of each first contour point into a first homogeneous coordinate; performing matrix multiplication of the first homogeneous coordinates of each first contour point with the conversion matrix to obtain the second coordinates of each second contour point of the mapped defect area.
[0016] Therefore, the first homogeneous coordinates of each first contour point can be multiplied by the transformation matrix to obtain the coordinates of each second contour point that maps the defect area.
[0017] Wherein, before using the conversion parameters between at least two image acquisition devices to convert the second defect area to the image plane where the first defect area is located to obtain the mapped defect area, the defect type determination method also includes: acquiring a first calibration image and a second calibration image acquired from the calibration plate; wherein the first calibration image and the second calibration image are acquired by two image acquisition devices respectively; performing calibration point detection on the first calibration image and the second calibration image respectively to obtain the third coordinates of several first calibration points in the first calibration image and the third coordinates of several second calibration points in the second calibration image; wherein the first calibration points and the second calibration points represent points on the calibration plate; matching the several first calibration points with the several second calibration points to obtain several matching point pairs; and determining the conversion parameters between the acquisition device corresponding to a target image and the acquisition device corresponding to other target images using the third coordinates of the several matching point pairs.
[0018] Therefore, a series of calibration point coordinates corresponding to the two image acquisition devices are captured, and the conversion parameters between the two image acquisition devices are determined. The determined conversion parameters are highly accurate, so that the subsequent conversion of the defect area is more accurate, and thus the subsequent defect type determination result is more accurate, so as to accurately determine whether the target object has surface defects or internal defects.
[0019] Among them, before performing calibration point detection on the first calibration image and the second calibration image respectively to obtain the third coordinates of several first calibration points in the first calibration image and the third coordinates of several second calibration points in the second calibration image, the defect type determination method also includes: binarizing the first calibration image and the second calibration image.
[0020] Therefore, the first calibration image and the second calibration image are binarized to simplify the complex grayscale image (the first calibration image and the second calibration image) into an image containing only black and white colors, so that the calibration points and edges in the binarized first calibration image and the second calibration image are clearer and the sharpness of the calibration points and the edges is increased, so that the coordinates of the calibration points can be accurately determined, and then the conversion parameters between the image acquisition devices can be accurately determined based on the accurate coordinates of the calibration points. Subsequently, the defect area conversion can be accurately performed based on the conversion parameters between the image acquisition devices, thereby improving the accuracy of the defect area conversion; further, based on the high-precision defect area conversion, the accuracy of the defect type determination result can be improved, so as to accurately determine whether the target object has surface defects or internal defects.
[0021] Among them, the third coordinate obtained by the calibration point detection is the coordinate of a pixel point in the corresponding calibration image, and the corresponding calibration image is the first calibration image or the second calibration image. Before matching a number of first calibration points and a number of second calibration points to obtain a number of matching point pairs, the defect type determination method also includes: taking each first calibration point and the second calibration point as a target calibration point, respectively; for each target calibration point, performing sub-pixel point detection on the corresponding calibration image based on the third coordinate of the target calibration point to obtain the optimized coordinate of the target calibration point, and updating the optimized coordinate of the target calibration point to the third coordinate of the target calibration point.
[0022] Therefore, the coordinates of each first calibration point in the first calibration image and each second calibration point in the second calibration image are slightly adjusted to obtain more accurate coordinates of each first calibration point in the first calibration image and each second calibration point in the second calibration image.
[0023] Among them, the calibration points are corner points of the calibration plate; and / or, using the third coordinates of several matching point pairs, determining the conversion parameters between the acquisition device corresponding to a target image and the acquisition devices corresponding to other target images, including: for each matching point pair, converting the third coordinate of the first calibration point in the matching point pair into a second homogeneous coordinate; using the second homogeneous coordinate of the first calibration point in each matching point pair and the third coordinate of the second calibration point to determine the conversion parameters between the image acquisition device corresponding to a target image and the image acquisition devices corresponding to other target images.
[0024] Therefore, the calibration points in the calibration plate can be flexibly selected; and / or, the second homogeneous coordinates of the first calibration point and the third coordinates of the second calibration point in the matching point pair can be used to determine the conversion parameters between the two image acquisition devices.
[0025] Wherein, target defect areas representing the same defect are determined from each target image respectively, including: for each target image, defect detection is performed on the target image to obtain several initial defect areas in the target image; from the several initial defect areas, an initial defect area whose defect area meets the area requirement is selected as the target defect area.
[0026] Therefore, during the defect detection process, due to the limitations of sensors, environmental factors (such as light, temperature, etc.) or the algorithm itself, some false detections or noise points may occur. These false detection points often appear as "pseudo defects" with small areas and unclear features; they can only be considered as real defects when the area meets certain requirements. From multiple initial defect areas, select the initial defect area whose defect area meets the requirements as the target defect area to remove the false detection points and only retain the initial defect area corresponding to the real defect. On the one hand, the accuracy of defect detection is improved; on the other hand, only the real defect type of the target object needs to be determined later, which reduces the workload of determining the defect type of the target object, thereby improving the efficiency of defect type determination.
[0027] Among them, the target object is the battery cell, which is equipped with an explosion-proof valve inside, and the internal defect is the defect on the explosion-proof valve.
[0028] Therefore, when the target object is a battery cell and an explosion-proof valve is provided inside the battery cell, it is possible to accurately determine whether there is a defect on the surface of the battery cell or on the explosion-proof valve provided inside the battery cell by comparing the position difference between the first defect area corresponding to the surface of the battery cell and the mapped defect area.
[0029] According to a second aspect of the present application, there is provided a defect type determination device, which includes an acquisition module, a first determination module, a conversion module, and a second acquisition module; the acquisition module is used to acquire at least two target images acquired from the surface of the target object; wherein the at least two target images are acquired by at least two image acquisition devices at different positions, and the transparency of the surface is greater than 0; the first determination module is used to determine the target defect area representing the same defect from each target image; wherein the defect area of one target image is the first defect area, and the defect area of other target images is the second defect area; the conversion module is used to use the conversion parameters between the at least two image acquisition devices to convert the second defect area to the image plane where the first defect area is located, so as to obtain a mapped defect area; the second determination module is used to obtain a defect type determination result based on the position difference between the first defect area and the mapped defect area; wherein the defect type determination result is used to characterize whether the target object has a surface defect or an internal defect.
[0030] A third aspect of the present application provides an electronic device, which includes a memory and a processor, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the above-mentioned defect type determination method.
[0031] A fourth aspect of the present application provides a computer-readable storage medium, which is used to store program instructions, and the program instructions can be executed to implement the above-mentioned defect type determination method.
[0032] The above technical solution uses the conversion parameters between at least two image acquisition devices to convert the second defect area to the image plane where the first defect area is located to obtain a mapped defect area, and obtains a defect type determination result based on the position difference between the first defect area and the mapped defect area. Therefore, by comparing the position difference between the first defect area and the mapped defect area, it is possible to determine the type of defect on the target object, whether it is a surface defect or an internal defect.
[0033] In addition, since the second defect area is converted to the image plane where the first defect area is located, the first defect area does not need to be converted, and only the second defect area needs to be converted. However, when the defect area is converted using the conversion parameters between at least two image acquisition devices, there will inevitably be a conversion error problem. Therefore, compared to converting all defect areas to an additionally set image plane, that is, compared to converting all defect areas, the present application only converts the second defect area, which can reduce the error problem of converting the defect area, improve the conversion accuracy of the defect area, and thus improve the accuracy of the subsequent determination of the defect type. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1It is a flowchart of an embodiment of a defect type determination method provided by the present application;
[0035] Figure 2 is a schematic diagram of an embodiment of a left target image provided by the present application;
[0036] Figure 3 is a schematic diagram of another embodiment of the left target image provided by the present application;
[0037] Figure 4 yes Figure 1 The flowchart of step S12 is shown as an embodiment;
[0038] Figure 5 yes Figure 1 The flowchart of step S13 is shown as an embodiment;
[0039] Figure 6 is a flowchart of an embodiment of determining conversion parameters provided by the present application;
[0040] Figure 7 is a schematic diagram of an embodiment of a calibration image provided by the present application;
[0041] Figure 8 is a schematic diagram of another embodiment of the calibration image provided by the present application;
[0042] Fig. 9 is a flow chart of an embodiment of determining the position difference between the first defect area and the mapped defect area provided by the present application;
[0043] Fig.10 It is a structural schematic diagram of an embodiment of a defect type determination device provided by the present application;
[0044] Fig.11 It is a structural schematic diagram of an embodiment of an electronic device provided by the present application;
[0045] Fig.12 It is a structural schematic diagram of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION
[0046] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0047] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0048] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.
[0049] See also Figure 1 , Figure 1 1 is a flow chart of an embodiment of a defect type determination method provided in the present application. It should be noted that if there are substantially the same results, this embodiment does not necessarily Figure 1 The process sequence shown is limited. Figure 1 As shown, this embodiment includes:
[0050] Step S11: Acquire at least two target images acquired by capturing the surface of the target object.
[0051] Since the transparency of the surface of the target object is greater than 0, it is possible to determine whether the surface of the target object is translucent or transparent based on the transparency of the surface of the target object. However, based on the image captured by a single image acquisition device on a translucent or transparent surface, it is impossible to determine whether the target object has surface defects or internal defects.
[0052] Taking the target object as a battery cell as an example, the surface of the battery cell is covered with a protective film or an isolation film to protect the battery cell from physical damage, chemical corrosion or electrical interference, etc., to increase the service life of the battery cell. Since the transparency of the film covering the outside of the battery cell is greater than 0, the film covering the outside of the battery cell is translucent or transparent; based on the image captured by a single image acquisition device on the surface of the battery cell, it is impossible to determine whether the defect of the battery cell is on the film covering the outside of the battery cell, or inside the battery cell, or in other words, under the film covering the outside of the battery cell. Therefore, when the target object is a battery cell, it is to determine whether the battery cell has a defect on the film or a defect under the film.
[0053] For another example, take the case where the target object is a battery cell with an explosion-proof valve inside the battery cell: since the transparency of the film covering the outside of the battery cell is greater than 0, the film covering the outside of the battery cell is translucent or transparent; based on the image captured by a single image acquisition device on the surface of the battery cell, it is impossible to determine whether the defect of the battery cell is on the film covering the outside of the battery cell, or on the explosion-proof valve inside the battery cell, or in other words, under the film covering the outside of the battery cell (defect under the membrane). Therefore, when the target object is a battery cell with an explosion-proof valve inside the battery cell, the purpose is to determine whether the battery cell has a defect on the membrane or a defect on the explosion-proof valve (defect under the membrane).
[0054] In this embodiment, at least two target images acquired by capturing the surface of the target object are obtained, wherein the at least two target images are acquired by at least two image acquisition devices at different positions, and the transparency of the surface is greater than 0. Specifically, at least two image acquisition devices at different positions are used to respectively capture images of the surface of the target object, so as to capture images of the surface of the target object from different angles; the at least two image acquisition devices at different positions constitute a stereoscopic vision setting of the surface of the target object, which can more comprehensively acquire the surface information of the target object, facilitate the subsequent determination of whether the target object has surface defects or internal defects, and improve the accuracy of defect type determination.
[0055] The number of image acquisition devices is not limited and can be set according to actual use needs. For example, two image acquisition devices at different positions are used to respectively acquire images of the surface of the target object to capture images of the surface of the target object from two angles; for another example, three, four, or five image acquisition devices at different positions are used to respectively acquire images of the surface of the target object.
[0056] In addition, there is no limitation on the position of the image acquisition device and the transparency of the surface of the target object, and they can be set according to actual use needs.
[0057] Step S12: determining target defect regions representing the same defect from each target image respectively.
[0058] In this embodiment, target defect regions representing the same defect are determined from each target image, wherein the defect region of one target image is the first defect region, and the defect regions of other target images are the second defect regions. In other words, defect detection is performed on each target image to determine the target defect regions representing the same defect in each target image.
[0059] It should be noted that there may be multiple defects on the surface of the target object, so there may be multiple target defect areas determined from each target image.
[0060] In addition, the target image corresponding to the first defect area can be any one of the at least two target images, and the defect areas corresponding to the remaining target images in the at least two target images are respectively used as the second defect area. For example, taking the case where there is defect A in the target object, including the left image acquisition device and the right image acquisition device, and the corresponding target images acquired are the left target image and the right target image as an example: the defect area belonging to defect A in the right target image is taken as the second defect area, and the defect area belonging to defect A in the left target image is taken as the first defect area. For another example, taking the case where there is defect B in the target object, including the image acquisition device a, the image acquisition device b and the image acquisition device c, and the corresponding target images α, β and γ are acquired as an example: the defect area belonging to defect B in the target image γ is taken as the first defect area, and the defect area belonging to defect B in the target image α and the defect area belonging to defect B in the target image β are taken as the second defect area.
[0061] In one embodiment, each target image is processed using a defect segmentation model to segment a target defect region representing the same defect in each target image. The defect segmentation model is not limited and can be specifically set according to actual use needs.
[0062] For each target image, defect detection is performed on the target image, and multiple initial defect areas may be detected. In one implementation, each initial detection area can be directly used as a target defect area of the corresponding defect.
[0063] During the defect detection process, due to the limitations of sensors, environmental factors (such as light, temperature, etc.) or the algorithm itself, some false detections or noise points may be generated. These false detection points often appear as "pseudo defects" with small areas and unclear features; therefore, they can only be considered as real defects when the area reaches a certain requirement. Therefore, in other implementations, multiple initial defect areas can be screened according to the size of the defect area to eliminate false detection points and only retain the initial defect areas corresponding to the real defects. On the one hand, the accuracy of defect detection is improved; on the other hand, only the real defect type existing on the target object needs to be determined later, which reduces the workload of determining the defect type existing on the target object later, thereby improving the efficiency of defect type determination.
[0064] Step S13: using the conversion parameters between at least two image acquisition devices, convert the second defect area to the image plane where the first defect area is located, to obtain a mapped defect area.
[0065] Since the surface defects and internal defects of the target object are at different distances from the image acquisition device. When calibrating at least two image acquisition devices, the calibration is performed based on the calibration plate, and the calibration plate and the surface of the target object are at the same horizontal position. Therefore, there is basically no height difference between the surface defects of the target object and the calibration plate, while there is a certain height difference between the internal defects of the target object and the calibration plate. Therefore, according to the conversion parameters obtained by calibrating at least two image acquisition devices, the defect areas corresponding to the same defect are converted to the same plane, and the defects corresponding to the position differences of the defect areas on the same plane are internal defects, and the defects corresponding to the substantially no position differences of the defect areas on the same plane are surface defects.
[0066] Therefore, in this embodiment, the second defect area is converted to the image plane where the first defect area is located by using the conversion parameters between at least two image acquisition devices to obtain a mapped defect area, and then it can be determined whether the target object has a surface defect or an internal defect by the position difference between the mapped defect area and the first defect area. In other words, the second defect area is converted to the image plane where the first defect area is located by using the spatial conversion relationship between the image acquisition device corresponding to the first defect area and the image acquisition device corresponding to the second defect area.
[0067] Since the second defect area is converted to the image plane where the first defect area is located, the first defect area does not need to be converted, and only the second defect area needs to be converted. However, when the defect area is converted using the conversion parameters between at least two image acquisition devices, there will inevitably be a conversion error problem. Therefore, compared to converting all defect areas to an additionally set image plane, that is, compared to converting all defect areas, the present application only converts the second defect area, which can reduce the error problem of converting the defect area, improve the conversion accuracy of the defect area, and thus improve the accuracy of the subsequent determination of the defect type.
[0068] For example, the target object is a battery cell with defect A, including a left image acquisition device and a right image acquisition device, and the corresponding target images acquired are a left target image and a right target image. Figure 2 As shown, Figure 2 is a schematic diagram of an embodiment of a left target image provided by the present application, wherein the defect region belonging to defect A in the right target image is taken as the second defect region, and the defect region belonging to defect A in the left target image is taken as the first defect region; Figure 3 As shown, Figure 3It is a schematic diagram of another embodiment of the left target image provided by the present application. By utilizing the conversion parameters between the left and right image acquisition devices, the second defect area belonging to defect A in the right target image is converted to the image plane where the first defect area belonging to defect A in the left target image is located, thereby obtaining a mapped defect area.
[0069] It should be noted that before using the conversion parameters between at least two image acquisition devices to convert the second defect area to the image plane where the first defect area is located, the conversion parameters between the two image acquisition devices can be obtained, so that the defect area in the target image acquired by any image acquisition device can be designated as the first defect area later, and it will not affect the conversion of the defect area in the target image acquired by other image acquisition devices. Of course, the defect area in the target image acquired by one image acquisition device can also be designated as the first defect area by default. In this case, it is only necessary to obtain the conversion parameters between other image acquisition devices and the default designated image acquisition device, so as to improve the efficiency of determining the conversion parameters and reduce the time of determining the conversion parameters.
[0070] In one implementation, the conversion parameter is a conversion matrix. Specifically, the second defect region may be multiplied by the conversion matrix to obtain a mapped defect region corresponding to the second defect region.
[0071] Step S14: obtaining a defect type determination result based on the position difference between the first defect area and the mapped defect area.
[0072] In this embodiment, the defect type determination result is obtained based on the position difference between the first defect area and the mapped defect area; wherein the defect type determination result is used to characterize whether the target object has a surface defect or an internal defect. As described above, the second defect area corresponding to the same defect is converted according to the conversion parameters obtained by calibrating at least two image acquisition devices, so that each defect area corresponding to the same defect is converted to the same plane (the image plane where the first defect area is located), and the defect corresponding to the position difference between each defect area on the same plane is an internal defect, and the defect corresponding to the substantially non-position difference between each defect area on the same plane is a surface defect. Therefore, the type of defect existing on the target object can be determined by the position difference between the first defect area and the mapped defect area, whether it is a surface defect or an internal defect.
[0073] It should be noted that, in the case where there are multiple defects, steps S12 to S14 need to be executed separately to determine whether each defect is a surface defect or an internal defect on the target object; therefore, in the case where there are multiple defects on the target object, both surface defects and internal defects may exist on the target object at the same time.
[0074] In one embodiment, when only two target images are included, the defect area of one target object is the first defect area, and the defect area of the other target image is the second defect area. There is only one second defect area, so the mapped defect area is also one; therefore, it is determined whether the target object has surface defects or internal defects directly based on the position difference between the first defect area and the second defect area.
[0075] In other embodiments, when three or more target images are included, a defect area of a target object is a first defect area, and the defect areas of the remaining target images are second defect areas. If there are two or more second defect areas, then there are also two or more mapped defect areas. Therefore, the defect type determination result can be obtained based on the position difference between the first defect area and each mapped defect area, or based on the position difference between the first defect area and a mapped defect area or part of the mapped defect area, or based on the position difference between two or more mapped defect areas.
[0076] In one embodiment, the position difference between the corresponding position points in the first defect area and the mapped defect area can be used as the position difference between the first defect area and the mapped defect area. Of course, in other embodiments, the overlap between the first defect area and the mapped defect area can also be used as the position difference between the first defect area and the mapped defect area, which is not limited here.
[0077] In one embodiment, there is one mapped defect area; at this time, based on the position difference between the first defect area and the mapped defect area, a defect type determination result is obtained, specifically: in response to the position difference between the first defect area and the mapped defect area being greater than or equal to the difference threshold, it is determined that the target object has an internal defect; in response to the position difference between the first defect area and the mapped defect area being less than the difference threshold, it is determined that the target object has a surface defect. In other words, a card control threshold is set, and when the position difference between the first defect area and the mapped defect area is greater than the card control threshold, it indicates that the position difference between the first defect area and the mapped defect area is too large, indicating that the target object has an internal defect; and when the position difference between the first defect area and the mapped defect area is less than the card control threshold, it indicates that there is basically no position difference between the first defect area and the mapped defect area, indicating that the target object has a surface defect.
[0078] In other embodiments, there are at least two mapped defect areas; at this time, based on the position difference between the first defect area and the mapped defect area, a defect type determination result is obtained, specifically: the position difference between each mapped defect area and the first defect area is obtained respectively, and the first mean of each position difference is obtained; in response to the first mean being greater than or equal to the difference threshold, it is determined that the target object has an internal defect; in response to the first mean being less than the difference threshold, it is determined that the target object has a surface defect.
[0079] In other embodiments, there are at least two mapped defect areas; at this time, based on the position difference between the first defect area and the mapped defect area, a defect type determination result is obtained, specifically: the position differences between some of the mapped defect areas and the first defect area are obtained respectively, and the second mean of each position difference is obtained; in response to the second mean being greater than or equal to the difference threshold, it is determined that the target object has an internal defect; in response to the second mean being less than the difference threshold, it is determined that the target object has a surface defect.
[0080] In other embodiments, there are at least two mapped defect areas; at this time, based on the position difference between the first defect area and the mapped defect area, a defect type determination result is obtained, specifically: obtaining the position difference between any two mapped defect areas; in response to the position difference being greater than or equal to a difference threshold, determining that the target object has an internal defect; in response to the position difference being less than the difference threshold, determining that the target object has a surface defect.
[0081] See also Figure 4 , Figure 4 yes Figure 1 FIG. 1 is a flow chart of an embodiment of step S12. It should be noted that if there is substantially the same result, this embodiment does not necessarily use Figure 4 The process sequence shown is limited. Figure 4 As shown, this embodiment includes:
[0082] Step S41: for each target image, perform defect detection on the target image to obtain a number of initial defect areas in the target image.
[0083] In this implementation, for each target image, defect detection is performed on the target image to obtain a number of initial defect regions in the target image.
[0084] For example, if Figure 2 As shown, Figure 2 The target image A is acquired by acquiring the surface of the battery cell using the image acquisition device A; defect detection is performed on the target image A to obtain an initial defect area A, an initial defect area B, an initial defect area C and an initial defect area D.
[0085] Step S42: Select an initial defect region whose defect area meets the area requirement from among the initial defect regions as a target defect region.
[0086] In this embodiment, an initial defect area whose defect area meets the area requirements is selected from a number of initial defect areas as the target defect area. During the defect detection process, due to the limitations of sensors, environmental factors (such as light, temperature, etc.) or the algorithm itself, some false detections or noise points may occur. These false detection points often appear as "pseudo defects" with small areas and unclear features. Therefore, they can only be considered as real defects when the area meets certain requirements. Therefore, from multiple initial defect areas, an initial defect area whose defect area meets the requirements is selected as the target defect area to eliminate the false detection points and retain only the initial defect area corresponding to the real defect. On the one hand, the accuracy of defect detection is improved; on the other hand, only the real defect type of the target object needs to be determined later, which reduces the workload of determining the defect type of the target object later, thereby improving the efficiency of defect type determination.
[0087] In one implementation, the area requirement is greater than or equal to an area threshold, wherein the size of the area threshold is not limited and can be specifically set according to actual use needs.
[0088] For example, take the area requirement as being greater than or equal to the area threshold: Figure 2 Show, Figure 2 The target image A is obtained by capturing the surface of the battery cell using the image acquisition device A; defect detection is performed on the target image A to obtain initial defect region A, initial defect region B, initial defect region C and initial defect region D; since the defect region area of the initial defect region A is greater than the area threshold, and the defect region areas of the initial defect region B, initial defect region C and initial defect region D are all less than the area threshold, the initial defect region A is taken as the target defect region.
[0089] For another example, taking the area requirement as being greater than or equal to the area threshold: use image acquisition device B to acquire the surface of the battery cell to obtain target image B; perform defect detection on target image B to obtain initial defect region A, initial defect region B, and initial defect region C; since the defect region areas of initial defect region A and initial defect region C are both greater than the area threshold, and the defect region area of initial defect region B is less than the area threshold, initial defect region A and initial defect region C are respectively used as target defect regions.
[0090] See also Figure 5 , Figure 5 yes Figure 1 It should be noted that if there is substantially the same result, this embodiment does not use Figure 5 The process sequence shown is limited. Figure 5 As shown, the conversion parameter is a conversion matrix, and this embodiment includes:
[0091] Step S51: obtaining first coordinates of a plurality of first contour points of a second defect area in a first target image.
[0092] In this implementation manner, first coordinates of a plurality of first contour points of the second defect area in the first target image are acquired.
[0093] Among them, the first coordinates of all the first contour points of the second defect area in the first target image can be extracted, and then the first coordinates corresponding to all the first contour points of the second defect area are converted; by converting the first coordinates of all the first contour points of the second defect area, the positions of all the first contour points of the second defect area on the image plane where the first defect area is located can be obtained, and a more accurate mapping defect area can be described based on this. Of course, the first coordinates of some of the first contour points of the second defect area in the first target image can also be extracted, and then only the first coordinates corresponding to some of the first contour points of the second defect area are converted; by converting only the first coordinates of some of the first contour points of the second defect area, the positions of some of the first contour points of the second defect area on the image plane where the first defect area is located can be obtained more quickly, and the mapping defect area can be determined more quickly based on this, thereby improving the efficiency of subsequent determination of defect types.
[0094] Step S52: Convert the first coordinates of each first contour point into first homogeneous coordinates.
[0095] In this embodiment, the first coordinates of each first contour point are converted into first homogeneous coordinates. Convert to first homogeneous coordinates .
[0096] Step S53: performing matrix multiplication on the first homogeneous coordinates of each first contour point and the transformation matrix to obtain the second coordinates of each second contour point mapping the defect area.
[0097] In this implementation manner, the first homogeneous coordinates of each first contour point are matrix multiplied with the transformation matrix to obtain the second coordinates of each second contour point that maps the defect area.
[0098] For example, the first homogeneous coordinates of each first contour point are as follows:
[0099] (525, 537, 1), (524, 538, 1), ..., (529, 538, 1), (528, 537, 1)
[0100] The transformation matrix X is shown below:
[0101]
[0102] Furthermore, the first homogeneous coordinates of each first contour point are matrix multiplied with the transformation matrix to obtain the second coordinates of each second contour point mapping the defect area, as shown below:
[0103]
[0104] Wherein, L represents the second coordinates of each second contour point of the mapped defect area.
[0105] It should be noted that when there are two or more second defect regions, each second defect region needs to execute steps S51 to S53 respectively, so as to convert each second defect region to the image plane where the first defect region is located.
[0106] See also Figure 6 , Figure 6 is a flow chart of an embodiment of determining conversion parameters provided by the present application. It should be noted that if there are substantially the same results, this embodiment does not use Figure 6 The process sequence shown is limited. Figure 6 As shown, before using the conversion parameters between at least two image acquisition devices to convert the second defect area to the image plane where the first defect area is located to obtain the mapped defect area, this embodiment includes:
[0107] Step S61: Acquire a first calibration image and a second calibration image acquired from the calibration plate.
[0108] In this embodiment, a first calibration image and a second calibration image acquired from the calibration plate are acquired, wherein the first calibration image and the second calibration image are acquired by two image acquisition devices, respectively. Specifically, two image acquisition devices at different positions are used to acquire images of the calibration plate, respectively, so as to capture images of the calibration plate from different angles.
[0109] The type of the calibration plate is not limited and can be set according to actual use needs. For example, the calibration plate can be a checkerboard calibration plate, a dot calibration plate, a solid circle array pattern calibration plate, or a Halcon calibration plate.
[0110] For example, if Figure 7 As shown, Figure 7 It is a schematic diagram of an embodiment of a calibration image provided by the present application, wherein the calibration plate is a checkerboard calibration plate; an image acquisition device is used to acquire an image of the checkerboard calibration plate to obtain a calibration image.
[0111] Step S62: performing calibration point detection on the first calibration image and the second calibration image respectively to obtain third coordinates of a plurality of first calibration points in the first calibration image and third coordinates of a plurality of second calibration points in the second calibration image.
[0112] In this embodiment, calibration point detection is performed on the first calibration image and the second calibration image respectively to obtain the third coordinates of several first calibration points in the first calibration image and the third coordinates of several second calibration points in the second calibration image; wherein the first calibration points and the second calibration points represent points on the calibration plate.
[0113] The algorithm for detecting calibration points on the first calibration image and the second calibration image is not limited and can be specifically set according to actual use needs. For example, the opencv operator findChessboardCorners can be used to detect calibration points on the first calibration image and the second calibration image to obtain the third coordinates of several first calibration points in the first calibration image and the third coordinates of several second calibration points in the second calibration image.
[0114] In one embodiment, the calibration point is a corner point of the calibration plate. Of course, in other embodiments, the calibration point may also be the center point of the calibration plate, the center point of the circle of the calibration plate, the edge point of the calibration plate, the intersection point of the calibration plate, etc., which is not limited here.
[0115] In one embodiment, before performing calibration point detection on the first calibration image and the second calibration image respectively to obtain the third coordinates of several first calibration points in the first calibration image and the third coordinates of several second calibration points in the second calibration image, the first calibration image and the second calibration image are binarized. The first calibration image and the second calibration image are binarized to simplify the complex grayscale image (the first calibration image and the second calibration image) into an image containing only black and white colors, so that the calibration points and edges in the binarized first calibration image and the second calibration image are clearer and the sharpness of the calibration points and edges is increased, so that the coordinates of the calibration points can be accurately determined, and then the conversion parameters between the image acquisition devices can be accurately determined based on the accurate coordinates of the calibration points. Subsequently, the defect area conversion can be accurately performed based on the conversion parameters between the image acquisition devices, thereby improving the accuracy of the defect area conversion; further, based on the high-precision defect area conversion, the accuracy of the defect type determination result can be improved, so as to accurately determine whether the target object has a surface defect or an internal defect.
[0116] For example, if Figure 8 As shown, Figure 8 is a schematic diagram of another embodiment of the calibration image provided by the present application, wherein the calibration plate is a checkerboard calibration plate; Figure 7As shown, an image acquisition device is used to acquire images of the chessboard calibration plate to obtain a calibration image; Figure 7 The calibration image shown in the figure is binarized to obtain Figure 8 The binary calibration image shown in Figure 1 is Figure 8 The calibration image (binarized) shown is relative to Figure 7 In the calibration image shown (without binarization), the calibration points and edges are clearer and sharper.
[0117] Step S63: Matching a plurality of first calibration points with a plurality of second calibration points to obtain a plurality of matching point pairs.
[0118] In this embodiment, a plurality of first calibration points and a plurality of second calibration points are matched to obtain a plurality of matching point pairs. In other words, a series of calibration point coordinates corresponding to two image acquisition devices are captured, and the conversion parameters between the two image acquisition devices are determined. The determined conversion parameters are highly accurate, so that the subsequent conversion of the defect area is more accurate, and thus the subsequent defect type determination result is more accurate, so as to accurately determine whether the target object has a surface defect or an internal defect.
[0119] In one embodiment, the third coordinates obtained by the calibration point detection are the coordinates of a pixel point in the corresponding calibration image, and the corresponding calibration image is the first calibration image or the second calibration image. Before matching a plurality of first calibration points and a plurality of second calibration points to obtain a plurality of matching point pairs, each first calibration point and each second calibration point will be used as a target calibration point respectively; for each target calibration point, the corresponding calibration image is subjected to sub-pixel point detection based on the third coordinate of the target calibration point to obtain the optimized coordinates of the target calibration point, and the optimized coordinates of the target calibration point are updated as the third coordinates of the target calibration point. In other words, the coordinates of each first calibration point in the first calibration image and each second calibration point in the second calibration image are slightly adjusted to obtain more accurate coordinates of each first calibration point in the first calibration image and each second calibration point in the second calibration image.
[0120] In a specific implementation, the algorithm for sub-pixel detection is not limited and can be specifically set according to actual use needs. For example, cornerSubPix can be used for sub-pixel detection.
[0121] Step S64: using the third coordinates of the plurality of matching point pairs, determining the conversion parameters between the image acquisition device corresponding to a target image and the image acquisition devices corresponding to other target images.
[0122] In this embodiment, the third coordinates of a plurality of matching point pairs are used to determine the conversion parameters between the image acquisition device corresponding to a target image and the image acquisition devices corresponding to other target images.
[0123] In one implementation, the third coordinates of a plurality of matching point pairs may be directly used to determine the conversion parameters between an image acquisition device corresponding to a target image and image acquisition devices corresponding to other target images.
[0124] In other embodiments, the third coordinates of a plurality of matching point pairs are used to determine the conversion parameters between the image acquisition device corresponding to a target image and the image acquisition devices corresponding to other target images, specifically: for each matching point pair, the third coordinate of the first calibration point in the matching point pair is converted into the second homogeneous coordinate; the second homogeneous coordinate of the first calibration point in each matching point pair and the third coordinate of the second calibration point are used to determine the conversion parameters between the image acquisition device corresponding to a target image and the image acquisition devices corresponding to other target images. That is, after the third coordinate of a calibration point in the matching point pair is converted into the homogeneous coordinate, the conversion parameters between the image acquisition device corresponding to a target image and the image acquisition devices corresponding to other target images are determined.
[0125] In a specific embodiment, in the matching point pair, the third coordinate of the second calibration point is , the third coordinate of the first calibration point is , the third coordinate of the first calibration point The second homogeneous coordinates obtained by transformation are .
[0126] The conversion parameter between the two image acquisition devices is the conversion matrix X, and the conversion matrix X is specifically as follows:
[0127]
[0128] Furthermore, A=X•B, A represents the third coordinate of the second calibration point, and B represents the second homogeneous coordinate of the first calibration point. That is:
[0129]
[0130] Substitute the third coordinates of the second calibration point in the matching point pairs and the second homogeneous coordinates corresponding to the first calibration point into the above formula to obtain the transformation matrix X, that is, to obtain a1, a2, a3, b1, b2 and b3.
[0131] It should be noted that when there are only two image acquisition devices, steps S61 to S64 are performed to determine the conversion parameters between the two image acquisition devices. When there are three or more image acquisition devices, steps S61 to S64 are performed to determine the conversion parameters between the two image acquisition devices or the conversion parameters between the image acquisition devices corresponding to each second defect area and the image acquisition device corresponding to the first defect area; the conversion parameters between the two image acquisition devices or the conversion parameters between the image acquisition devices corresponding to each second defect area and the image acquisition device corresponding to the first defect area need to be obtained by performing steps S61 to S64 respectively.
[0132] See also Fig. 9 , Fig. 9 FIG. 1 is a flow chart of an embodiment of determining the position difference between the first defect area and the mapped defect area provided by the present application. It should be noted that if there are substantially the same results, this embodiment does not necessarily refer to Fig. 9 The process sequence shown is limited. Fig. 9 As shown, this embodiment includes:
[0133] Step S91: Determine a first position reference point in the first defect area and a second position reference point in the mapped defect area.
[0134] In this embodiment, a first position reference point in the first defect area and a second position reference point in the mapped defect area are determined.
[0135] In one embodiment, the first position reference point and the second position reference point may be center points of corresponding defect regions.
[0136] Since the defect area may be irregular, in a specific implementation, the center point of the defect area may be the center point of the minimum circumscribed rectangular frame of the defect area.
[0137] Of course, in other implementations, the first position reference point and the second position reference point may also be any point on the corresponding defect area, which is not limited here.
[0138] Step S92: obtaining a position difference between the first position reference point and the second position reference point as a position difference between the first defect area and the mapped defect area.
[0139] In this embodiment, the position difference between the first position reference point and the second position reference point is obtained as the position difference between the first defect area and the mapped defect area. That is, the position difference between the first position reference point representing the first defect area and the second position reference point representing the second defect area is taken as the position difference between the first defect area and the mapped defect area.
[0140] See also Fig.10 , Fig.10 It is a structural schematic diagram of an embodiment of a defect type determination device provided by the present application. The defect type determination device 100 includes an acquisition module 101, a first determination module 102, a conversion module 103 and a second determination module 104. The acquisition module 101 is used to acquire at least two target images obtained by surface acquisition of the target object; wherein the at least two target images are respectively acquired by at least two image acquisition devices at different positions; the first determination module 102 is used to determine the target defect area representing the same defect from each target image; wherein the defect area of one target image is the first defect area, and the defect area of the other target images is the second defect area; the conversion module 103 is used to use the conversion parameters between the at least two image acquisition devices to convert the second defect area to the image plane where the first defect area is located, and obtain the mapped defect area; the second determination module 104 is used to obtain the defect type determination result based on the position difference between the first defect area and the mapped defect area; wherein the defect type determination result is used to characterize whether the target object has a surface defect or an internal defect.
[0141] Among them, the second determination module 104 is also used to, before obtaining the defect type determination result based on the position difference between the first defect area and the mapped defect area, include: determining a first position reference point in the first defect area and a second position reference point in the mapped defect area; obtaining the position difference between the first position reference point and the second position reference point as the position difference between the first defect area and the mapped defect area.
[0142] The first position reference point and the second position reference point are center points of corresponding defect areas.
[0143] The center point of the defect area is the center point of the smallest circumscribed rectangular frame of the defect area.
[0144] Among them, there is one mapped defect area; the second determination module 104 is used to obtain a defect type determination result based on the position difference between the first defect area and the mapped defect area, including: in response to the position difference between the first defect area and the mapped defect area being greater than or equal to a difference threshold, determining that the target object has an internal defect; in response to the position difference between the first defect area and the mapped defect area being less than the difference threshold, determining that the target object has a surface defect.
[0145] Among them, the above-mentioned conversion parameters are a conversion matrix, and the conversion module 103 is used to use the conversion parameters between at least two image acquisition devices to convert the second defect area to the image plane where the first defect area is located to obtain a mapped defect area, including: obtaining the first coordinates of several first contour points of the second defect area in the first target image; converting the first coordinates of each first contour point into a first homogeneous coordinate; performing matrix multiplication of the first homogeneous coordinates of each first contour point with the conversion matrix to obtain the second coordinates of each second contour point of the mapped defect area.
[0146] The conversion module 103 is used to convert the second defect area to the image plane where the first defect area is located by using the conversion parameters between at least two image acquisition devices to obtain the mapped defect area, including: obtaining a first calibration image and a second calibration image acquired by the calibration plate; wherein the first calibration image and the second calibration image are acquired by the two image acquisition devices respectively; performing calibration point detection on the first calibration image and the second calibration image respectively to obtain the third coordinates of several first calibration points in the first calibration image and the third coordinates of several second calibration points in the second calibration image; wherein the first calibration point and the second calibration point represent points on the calibration plate; matching several first calibration points and several second calibration points to obtain several matching point pairs; using the third coordinates of several matching point pairs, determining the conversion parameters between the acquisition device corresponding to a target image and the acquisition device corresponding to other target images.
[0147] The conversion module 103 is used to perform calibration point detection on the first calibration image and the second calibration image respectively, and before obtaining the third coordinates of several first calibration points in the first calibration image and the third coordinates of several second calibration points in the second calibration image, it includes: performing binarization processing on the first calibration image and the second calibration image.
[0148] Among them, the third coordinate obtained by the above-mentioned calibration point detection is the coordinate of a pixel point in the corresponding calibration image, and the corresponding calibration image is the first calibration image or the second calibration image. The conversion module 103 is used to match a number of first calibration points and a number of second calibration points to obtain a number of matching point pairs, including: taking each first calibration point and the second calibration point as a target calibration point respectively; for each target calibration point, performing sub-pixel point detection on the corresponding calibration image based on the third coordinate of the target calibration point to obtain the optimized coordinate of the target calibration point, and updating the optimized coordinate of the target calibration point to the third coordinate of the target calibration point.
[0149] Among them, the above-mentioned calibration points are corner points of the calibration plate; and / or, the conversion module 103 is used to use the third coordinates of a number of matching point pairs to determine the conversion parameters between the acquisition device corresponding to a target image and the acquisition devices corresponding to other target images, including: for each matching point pair, converting the third coordinate of the first calibration point in the matching point pair into a second homogeneous coordinate; using the second homogeneous coordinate of the first calibration point in each matching point pair and the third coordinate of the second calibration point to determine the conversion parameters between the image acquisition device corresponding to a target image and the image acquisition devices corresponding to other target images.
[0150] Among them, the first determination module 102 is used to determine the target defect area representing the same defect from each target image respectively, including: for each target image, performing defect detection on the target image to obtain several initial defect areas in the target image; from the several initial defect areas, selecting an initial defect area whose defect area meets the area requirement as the target defect area.
[0151] Among them, the target object is the battery cell, which is equipped with an explosion-proof valve inside, and the internal defect is the defect on the explosion-proof valve.
[0152] See also Fig.11 , Fig.11 1 is a schematic diagram of the structure of an embodiment of an electronic device provided by the present application. The electronic device 110 includes a memory 111 and a processor 112 coupled to each other, and the processor 112 is used to execute program instructions stored in the memory 111 to implement the steps of any of the above-mentioned defect type determination method embodiments. In a specific implementation scenario, the electronic device 110 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 110 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.
[0153] Specifically, the processor 112 is used to control itself and the memory 111 to implement the steps of any of the above-mentioned defect type determination method embodiments. The processor 112 can also be called a CPU (Central Processing Unit). The processor 112 may be an integrated circuit chip with signal processing capabilities. The processor 112 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 112 can be implemented by an integrated circuit chip.
[0154] See also Fig.12 , Fig.12 It is a structural diagram of an embodiment of a computer-readable storage medium provided by the present application. The computer-readable storage medium 120 of the embodiment of the present application stores a program instruction 121, and when the program instruction 121 is executed, it implements the method provided by any embodiment of the defect type determination method of the present application and any non-conflicting combination. Among them, the program instruction 121 can form a program file and be stored in the above-mentioned computer-readable storage medium 120 in the form of a software product, so that a computer device (which can be a personal computer, a server, or a network device, etc.) executes all or part of the steps of the methods of each implementation method of the present application. The aforementioned computer-readable storage medium 120 includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, or a terminal device such as a computer, a server, a mobile phone, and a tablet.
[0155] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
[0156] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A defect type determination method, characterized in that: The method comprises: Acquire at least two target images acquired by capturing the surface of the target object; wherein the at least two target images are acquired by at least two image acquisition devices at different positions; Determining target defect regions representing the same defect from each of the target images respectively; wherein the defect region of one of the target images is a first defect region, and the defect regions of the other target images are second defect regions; Using the conversion parameters between the at least two image acquisition devices, the second defect area is converted to the image plane where the first defect area is located, so as to obtain a mapped defect area; wherein the conversion parameters between the at least two image acquisition devices are obtained by calibration based on a calibration plate, and the calibration plate is at the same horizontal position as the surface of the target object; Based on the position difference between the first defect area and the mapped defect area, a defect type determination result is obtained; wherein the defect type determination result is used to characterize whether the target object has a surface defect or an internal defect.
2. The method according to claim 1, characterized in that Before obtaining a defect type determination result based on the position difference between the first defect area and the mapped defect area, the method further includes: determining a first position reference point in the first defect area and a second position reference point in the mapped defect area; A position difference between the first position reference point and the second position reference point is acquired as a position difference between the first defect area and the mapped defect area.
3. The method according to claim 2, characterized in that The first position reference point and the second position reference point are center points of corresponding defect areas.
4. The method according to claim 3, characterized in that The center point of the defect area is the center point of the smallest circumscribed rectangular frame of the defect area.
5. The method according to claim 1, characterized in that The mapped defect area is one; and obtaining a defect type determination result based on a position difference between the first defect area and the mapped defect area includes: In response to a position difference between the first defect area and the mapped defect area being greater than or equal to a difference threshold, determining that the target object has an internal defect; In response to a position difference between the first defect area and the mapped defect area being smaller than the difference threshold, it is determined that the target object has a surface defect.
6. The method according to claim 1, characterized in that The conversion parameter is a conversion matrix, and the conversion parameter between the at least two image acquisition devices is used to convert the second defect area to the image plane where the first defect area is located to obtain a mapped defect area, including: Acquire first coordinates of a plurality of first contour points of the second defect area in other target images; Converting the first coordinates of each of the first contour points into first homogeneous coordinates; The first homogeneous coordinates of each of the first contour points are matrix multiplied by the transformation matrix to obtain the second coordinates of each of the second contour points of the mapped defect area.
7. The method according to claim 1, characterized in that Before converting the second defect area to the image plane where the first defect area is located by using the conversion parameters between the at least two image acquisition devices to obtain the mapped defect area, the method further includes: Acquire a first calibration image and a second calibration image acquired from the calibration plate; wherein the first calibration image and the second calibration image are acquired by the two image acquisition devices respectively; Performing calibration point detection on the first calibration image and the second calibration image respectively to obtain third coordinates of a plurality of first calibration points in the first calibration image and third coordinates of a plurality of second calibration points in the second calibration image; wherein the first calibration points and the second calibration points represent points on the calibration plate; Matching the plurality of first calibration points with the plurality of second calibration points to obtain a plurality of matching point pairs; The third coordinates of the plurality of matching point pairs are used to determine conversion parameters between the acquisition device corresponding to the one target image and the acquisition devices corresponding to the other target images.
8. The method according to claim 7, characterized in that Before respectively performing calibration point detection on the first calibration image and the second calibration image to obtain third coordinates of a plurality of first calibration points in the first calibration image and third coordinates of a plurality of second calibration points in the second calibration image, the method further includes: Binarization is performed on the first calibration image and the second calibration image.
9. The method according to claim 7, characterized in that: The third coordinates obtained by the calibration point detection are coordinates of a pixel point in the corresponding calibration image, and the corresponding calibration image is the first calibration image or the second calibration image. Before matching the first calibration points with the second calibration points to obtain a plurality of matching point pairs, the method further includes: Taking the first calibration point and the second calibration point as target calibration points respectively; For each of the target calibration points, sub-pixel point detection is performed on the corresponding calibration image based on the third coordinate of the target calibration point to obtain the optimized coordinates of the target calibration point, and the optimized coordinates of the target calibration point are updated to the third coordinates of the target calibration point.
10. The method according to claim 7, characterized in that The calibration points are corner points of the calibration plate; And / or, using the third coordinates of the plurality of matching point pairs to determine the conversion parameters between the acquisition device corresponding to the one target image and the acquisition device corresponding to the other target images includes: For each of the matching point pairs, converting the third coordinate of the first calibration point in the matching point pair into the second homogeneous coordinate; The conversion parameters between the image acquisition device corresponding to the one target image and the image acquisition device corresponding to the other target images are determined by using the second homogeneous coordinates of the first calibration point in each of the matching point pairs and the third coordinates of the second calibration point.
11. The method according to claim 1, characterized in that: The step of respectively determining target defect regions representing the same defect from each of the target images comprises: For each of the target images, performing defect detection on the target image to obtain a number of initial defect areas in the target image; From the plurality of initial defect regions, an initial defect region whose defect region area meets the area requirement is selected as the target defect region.
12. The method according to claim 1, characterized in that The target object is a battery cell, an explosion-proof valve is arranged inside the battery cell, and the internal defect is a defect on the explosion-proof valve.
13. A defect type determination device, characterized in that: The defect type determination device comprises: An acquisition module, used to acquire at least two target images acquired from the surface of the target object; wherein the at least two target images are acquired by at least two image acquisition devices at different positions; A first determination module is used to determine target defect regions representing the same defect from each of the target images respectively; wherein the defect region of one of the target images is a first defect region, and the defect regions of the other target images are second defect regions; a conversion module, configured to convert the second defect area to an image plane where the first defect area is located by using a conversion parameter between the at least two image acquisition devices, so as to obtain a mapped defect area; wherein the conversion parameter between the at least two image acquisition devices is obtained by calibration based on a calibration plate, and the calibration plate is at the same horizontal position as the surface of the target object; The second determination module is used to obtain a defect type determination result based on the position difference between the first defect area and the mapped defect area; wherein the defect type determination result is used to characterize whether the target object has a surface defect or an internal defect.
14. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores program instructions, and the processor is used to execute the program instructions to implement the defect type determination method according to any one of claims 1-12.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program instructions, and the program instructions can be executed to implement the defect type determination method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Method and system for distinguishing attached foreign matter defects and dust
CN109100363A