Methods and devices for detecting abnormal protrusions, electronic equipment and storage media
By using machine vision inspection methods and image processing technology, abnormal protrusions on the electrode sheets are automatically identified, solving the problem of low efficiency in traditional manual inspection and achieving high-precision and high-efficiency battery quality control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-04
- Publication Date
- 2026-03-06
AI Technical Summary
In the battery production process, traditional manual inspection methods are inefficient and have a high defect rate. They are also difficult to effectively detect abnormal protrusions such as burrs on the electrode sheets, which affects battery quality and safety.
The machine vision inspection method is adopted to extract the target object from the image to be tested through image processing technology. Then, it automatically identifies and determines abnormal protrusion areas by using morphological methods, edge detection and denoising, difference calculation and other steps.
It achieves high-precision and high-efficiency automated testing, reduces labor costs, improves the consistency and efficiency of battery production quality, and ensures product quality.
Smart Images

Figure CN115908282B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of semiconductor processing technology, and more specifically to a method and apparatus for detecting abnormal protrusions, an electronic device, and a storage medium. Background Technology
[0002] In the battery production process, high quality testing is required to ensure battery quality and safety. If defective batteries, such as those with leakage, scratches, wrinkles, or air bubbles, are missed during testing and end up on the market, it could lead to very serious consequences.
[0003] After coating, battery electrodes are slit using a slitting machine. The electrode slitting machine is equipment that cuts the rolled battery electrodes according to battery specifications. The main technical requirements are that the slit electrodes must not have wrinkles or powder shedding, and the slitting dimensions must be highly accurate. Simultaneously, the burrs on the electrode edges must be small; otherwise, dendrites will form on the burrs, piercing the separator and causing a short circuit inside the battery. Slitting machines typically use lasers / roll cutters for cutting. Laser cutting is characterized by high production efficiency and good process stability, and is widely used in the cutting of lithium-ion battery electrodes. The basic principle of laser cutting is to use a high-power-density laser beam to irradiate the battery electrode being cut, rapidly heating it to a very high temperature, quickly melting, vaporizing, ablating, or reaching the ignition point to form holes. As the beam moves across the electrode, the holes continuously form a very narrow kerf, completing the cutting of the electrode. Unstable laser parameters or damaged cutters during the slitting process can cause burrs.
[0004] Before batteries leave the factory, they need to undergo quality inspection, including checking for burrs. Traditional production lines typically use manual sampling for inspection, which is not only inefficient but also results in a high defect rate. Summary of the Invention
[0005] The present invention was proposed in view of the above-mentioned problems. The present invention provides a method for detecting abnormal protrusions, a device for detecting abnormal protrusions, an electronic device, and a storage medium.
[0006] According to one aspect of the present invention, a method for detecting abnormal protrusions is provided. The method is used to detect whether an abnormal protrusion occurs within a target object in a test image. The method includes: extracting a first detection region image corresponding to the test object from the test image, wherein the first detection region image includes the target object and a background; denoising the first detection region image to obtain a second detection region image with the abnormal protrusion removed; obtaining a third detection region image containing the abnormal protrusion based on the first and second detection region images; extracting a fourth detection region image containing only the target object based on the test image or the first detection region image; and determining the abnormal protrusion region on the target object based on the third and fourth detection region images.
[0007] For example, extracting the first detection region image corresponding to the object under test from the image under test includes: converting the image under test to grayscale to obtain a grayscale image; performing connectivity operations on the grayscale image using morphological methods to obtain a first connected region image containing one or more first connected regions, wherein the morphological methods include closing operations; determining the largest first connected region with the largest area among the one or more first connected regions; and obtaining an image containing only the largest first connected region as the first detection region image based on the first connected region image.
[0008] For example, morphological methods also include an opening operation performed prior to the closing operation.
[0009] For example, denoising the first detection region image to obtain a second detection region image with abnormal protrusions removed includes: performing edge detection on the first detection region image to determine a rectangular region containing the object being measured, wherein the structuring element used for edge detection is a rectangular element with an angle; and performing an opening operation on the rectangular region in the first detection region image to obtain the second detection region image.
[0010] For example, obtaining a third detection region image containing abnormal protrusions based on a first detection region image and a second detection region image includes: performing a difference operation between the first detection region image and the second detection region image to obtain the third detection region image.
[0011] For example, extracting a fourth detection region image containing only the target object based on the image to be tested or the first detection region image includes: determining a second connected region from the grayscale image corresponding to the image to be tested or the first detection region image, wherein the second connected region is the connected region corresponding to the target object containing the abnormal protrusion; extracting a second connected region image containing the second connected region from the grayscale image or the first detection region image; and obtaining the fourth detection region image based on the second connected region image.
[0012] For example, determining the second connected region from the grayscale image corresponding to the image to be tested or the first detection region image includes: determining a target object region containing the target object in the grayscale image or the first detection region image based on the relationship between the grayscale value of each pixel and a preset grayscale value threshold; performing a connection operation in the target object region according to the extension direction of the abnormal protrusion to obtain an abnormal protrusion connected region; performing a connection operation in the target object region according to the extension direction of the target object to obtain a target object connected region; and merging the target object connected region and the abnormal protrusion connected region to obtain the second connected region.
[0013] For example, obtaining a fourth detection region image based on a second connected region image includes: for any second connected region in the second connected region image, comparing the area of the second connected region with a first area threshold and a second area threshold; if the area of the second connected region is less than the first area threshold or greater than the second area threshold, then determining that the second connected region does not belong to the target object; otherwise, determining that the second connected region belongs to the target object; and extracting an image containing the second connected region belonging to the target object from the second connected region image as the fourth detection region image.
[0014] For example, determining the abnormal protrusion region on the target object based on the third detection region image and the fourth detection region image includes: taking the intersection of the third detection region image and the fourth detection region image to determine the abnormal protrusion region on the target object.
[0015] For example, after determining the abnormal protrusion region on the target object based on the third detection region image and the fourth detection region image, the method further includes: using the abnormal protrusion region to determine the height of the abnormal protrusion.
[0016] For example, determining the height of an abnormal protrusion using an abnormal protrusion region includes: performing edge detection on the abnormal protrusion region to determine the contour edge of the abnormal protrusion; in the first detection region image, performing line fitting on the edge of the object being tested within a preset range around the abnormal protrusion region to obtain the object edge; and determining the height of the abnormal protrusion based on the difference between the contour edge and the object edge.
[0017] According to another aspect of the present invention, an abnormal protrusion detection device is also provided for detecting whether an abnormal protrusion occurs in a target object within a test object in a test image. The device includes: a first extraction module for extracting a first detection region image corresponding to the test object from the test image, wherein the first detection region image includes the target object and a background; a denoising module for denoising the first detection region image to obtain a second detection region image with the abnormal protrusion removed; an obtaining module for obtaining a third detection region image containing the abnormal protrusion based on the first and second detection region images; a second extraction module for extracting a fourth detection region image containing only the target object based on the test image or the first detection region image; and a determining module for determining the abnormal protrusion region on the target object based on the third and fourth detection region images.
[0018] According to another aspect of the present invention, an electronic device is also provided, including a processor and a memory, wherein the memory stores computer program instructions, which are executed by the processor to perform the above-described method for detecting abnormal protrusions.
[0019] According to another aspect of the present invention, a storage medium is also provided, on which program instructions are stored, wherein the program instructions are used to execute the above-described method for detecting abnormal protrusions when executed.
[0020] The abnormal protrusion detection method, apparatus, electronic device, and storage medium according to embodiments of the present invention can automatically detect abnormal protrusions (such as burrs) on a target object using machine vision inspection methods. Denoising itself can be used to remove noise such as abnormal protrusions. A third detection area image containing the abnormal protrusion can be obtained using a first detection area image before denoising and a second detection area image after denoising. Furthermore, by combining the third detection area image with a fourth detection area image containing only the target object, the abnormal protrusion area of the target object can be determined. Compared with traditional inspection, machine vision inspection has significant advantages, such as high accuracy, high efficiency, strong stability, and convenient information integration and retention. Therefore, the above-mentioned abnormal protrusion detection scheme has advantages such as high automation, high speed, high accuracy, and high stability, which helps to significantly reduce the labor costs of traditional visual inspection methods and helps to ensure product quality consistency and high operating efficiency, greatly improving the production efficiency and product quality of battery manufacturers. Attached Figure Description
[0021] The above and other objects, features, and advantages of the present invention will become more apparent from the more detailed description of the embodiments of the invention in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same parts or steps.
[0022] Figure 1 A schematic flowchart of a method for detecting abnormal protrusions according to an embodiment of the present invention is shown;
[0023] Figure 2 A schematic diagram of an electrode sheet according to an embodiment of the present invention is shown;
[0024] Figure 3 A schematic diagram of an electrode sheet according to an embodiment of the present invention is shown;
[0025] Figure 4 A schematic diagram of an electrode sheet according to an embodiment of the present invention is shown;
[0026] Figure 5 A schematic block diagram of a detection device for abnormal protrusions according to an embodiment of the present invention is shown; and
[0027] Figure 6 A schematic block diagram of an electronic device according to an embodiment of the present invention is shown. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the present invention more apparent, exemplary embodiments according to the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely a part of the embodiments of the present invention, and not all of the embodiments of the present invention. It should be understood that the present invention is not limited to the exemplary embodiments described herein. Based on the embodiments of the present invention described herein, all other embodiments obtained by those skilled in the art without inventive effort should fall within the protection scope of the present invention.
[0029] To at least partially address the aforementioned problems, embodiments of the present invention provide a method for detecting abnormal protrusions. This method can be used to detect whether abnormal protrusions occur in a target object within a test object in a test image. It should be noted that although this document primarily uses the detection of burrs on electrode sheets as an example to describe the method for detecting abnormal protrusions according to embodiments of the present invention, this is merely an example and not a limitation of the invention. The present invention can be applied to the detection of abnormal protrusions in any type of target object on any type of test object. Figure 1 A schematic flowchart of an abnormal protrusion detection method 100 according to an embodiment of the present invention is shown, such as... Figure 1As shown, the method 100 includes steps S110, S120, S130, S140 and S150.
[0030] Step S110: Extract the first detection region image corresponding to the object to be tested from the image to be tested, wherein the first detection region image includes the target object and the background.
[0031] The image to be tested is an image acquired after photographing the object being tested. For example, the image to be tested can be an RGB image or a grayscale image. The image to be tested can be a static image or any video frame from a dynamic video. Furthermore, the image to be tested can be the original image captured by the image acquisition device, or an image after preprocessing of the original image captured by the image acquisition device. Preprocessing can include operations such as digitization, geometric transformation, normalization, and filtering of the original image.
[0032] In the battery field, the image under test is an image of an electrode taken with a camera; obviously, the object under test can be the electrode. Electrodes contain substances such as carbon powder and metals. The target object can be the metal within the electrode, and the portion of the electrode other than the metal can be considered the background. Abnormal protrusions can include burrs on the metal, etc.
[0033] For example, the location of the object to be tested can be determined from the image to be tested using methods such as object detection or image segmentation, and a first detection region image corresponding to the object to be tested can be extracted from the image to be tested. The first detection region image may contain the target object and the background. The background may include noise, interference, and environmental information. The object detection described herein can be implemented using any existing or future suitable object detection algorithm, and the image segmentation described herein can be implemented using any existing or future suitable image segmentation algorithm.
[0034] It should be noted that the extraction of an image C containing any object B from any image A, as described in this article, can be, but is not limited to, the following: extracting an image block containing only object B from image A, and using this image block directly or after scaling or other processing as image C; or, setting the pixel values of pixels in image A other than object B to predetermined values to obtain image C, whereby the predetermined values render the corresponding pixels ineffective in subsequent image processing. These predetermined values can be any suitable value, such as 0 or 255.
[0035] Figure 2 A schematic diagram of an electrode sheet according to an embodiment of the present invention is shown. Figure 2As shown, the area between solid lines A and B can be considered as the area where the electrode is located. The brighter area (white area) within the area where the electrode is located can represent metal 220, and the remaining gray and black areas can represent the background other than metal 220, including toner, etc. Figure 3 A schematic diagram of an electrode sheet according to an embodiment of the present invention is shown. Figure 3 As shown, the brighter area (white area) within the white dashed line can represent burr 320.
[0036] For example, extracting the first detection region image corresponding to the object under test from the image under test (step S110) may include: performing grayscale processing on the image under test to obtain a grayscale image; performing connectivity operations on the grayscale image using morphological methods to obtain a first connected region image containing one or more first connected regions, wherein the morphological methods may include closing operations; determining the largest first connected region with the largest area among the one or more first connected regions; and obtaining an image containing only the largest first connected region as the first detection region image based on the first connected region image.
[0037] In one embodiment, if the image to be tested is an RGB image, it can be converted to grayscale using a weighted average or max-min average method to obtain a grayscale image. Then, morphological methods are used to perform connectivity operations on the grayscale image. Exemplarily, and not limitingly, any morphological method described herein can be implemented using algorithms from the OpenCV library.
[0038] For example, a first connected region image can be obtained by performing a connection operation on a grayscale image using a closing operation. The first connected region image can contain one or more connected regions. If the first connected region image contains only one connected region, that connected region can be directly used as the largest first connected region. If the first connected region image contains multiple connected regions, the connected region with the largest area is selected as the largest first connected region. For example, a connected region area threshold can be preset. Based on this threshold, the connected region with the largest area that is greater than or equal to the threshold is selected as the largest first connected region. Based on the determined largest first connected region, an image containing only that largest first connected region is extracted from the first connected region image as the first detection region image.
[0039] In the above technical solution, the closing operation in morphological methods can connect partially disconnected regions in a grayscale image. Furthermore, selecting the largest first connected region can further remove some connected regions caused by external noise. This improves the accuracy of detecting abnormal protrusions in the target object.
[0040] For example, morphological methods may also include an opening operation performed prior to the closing operation.
[0041] In one embodiment, an opening operation can be performed before obtaining the connected regions of the grayscale image through a closing operation. For example, the area of the structuring element used in the opening operation is smaller than a preset area. Setting the structuring element of the opening operation to be relatively small allows the opening operation to remove smaller noise in the grayscale image beforehand. This further ensures the accuracy of detecting abnormal protrusions in the target object.
[0042] Step S120: Denoise the first detection region image to obtain a second detection region image with abnormal protrusions removed.
[0043] In one embodiment, the first detection region image can be denoised using methods such as mean filtering, median filtering, or Gaussian filtering. In another embodiment, morphological methods, such as opening operations, can also be used to denoise the first detection region image. The denoising operation can remove abnormal protrusions and some isolated noise points. After the denoising operation is completed, a second detection region image with abnormal protrusions removed can be obtained. In the electrode detection scenario, denoising can yield a second detection region image with burrs removed.
[0044] For example, denoising the first detection region image to obtain a second detection region image with abnormal protrusions removed (step S120) may include: performing edge detection on the first detection region image to determine a rectangular region containing the object being measured, wherein the structuring element used for edge detection is a rectangular element with an angle; performing an opening operation on the rectangular region in the first detection region image to obtain the second detection region image.
[0045] The aforementioned edge detection can be implemented using any existing or future edge detection algorithm, such as the Roberts algorithm, Sobel algorithm, and Canny algorithm. In one embodiment, an angled edge detection algorithm can be used to perform edge detection on the first detection region image. In this angled edge detection algorithm, the structuring element can be a rectangular element with a specific angle. The specific angle can be set to any suitable size as needed; for example, it can be 30 degrees, 45 degrees, or 60 degrees. Based on the edge detection results, a rectangular region containing the target object can be obtained. The specific angle can represent the rotation angle of the rectangular region relative to the horizontal direction. Edge detection can more accurately determine the location of the measured object (i.e., the rectangular region containing the measured object). After obtaining the rectangular region, an opening operation is performed on the rectangular region to obtain a denoised second detection region image.
[0046] In the above technical solution, edge detection can be performed on the first detection area image. This edge detection method can more accurately determine the location of the object being measured and help eliminate the influence of noise outside the object. Furthermore, opening operations are performed on the rectangular region containing the object being measured in the first detection area image to further remove noise in that rectangular region. This solution has a relatively good denoising effect.
[0047] Step S130: Based on the first detection region image and the second detection region image, obtain a third detection region image containing the abnormal protrusion.
[0048] In one embodiment, the difference between the first detection region image and the second detection region image can be used to obtain the third detection region image. The third detection region image contains abnormal bumps and may also contain the aforementioned isolated noise points. Exemplarily, and not limitingly, the difference operation can be implemented using algorithms from the OpenCV library. The following explanation uses an electrode detection scenario as an example. Abnormal bumps can represent burrs. The third detection region image can represent an electrode image containing burrs. Simultaneously, this image may also contain some isolated noise points.
[0049] For example, obtaining a third detection region image containing abnormal protrusions based on the first detection region image and the second detection region image (step S130) may include: performing a difference operation between the first detection region image and the second detection region image to obtain the third detection region image.
[0050] As described above, the difference operation can be implemented using algorithms from the OpenCV library. In one embodiment, the pixel value of each pixel in the first detection region image can be subtracted from the pixel value of the corresponding pixel in the second detection region image, and the resulting pixel value difference can be used as the pixel value of the corresponding pixel in the third detection region image. According to this technical solution, a third detection region image containing abnormal protrusions can be obtained quickly and accurately.
[0051] Step S140: Extract a fourth detection region image containing only the target object based on the image to be tested or the first detection region image.
[0052] Both the image to be tested and the first detection region image contain the object being tested, and both also contain the target object. Taking the electrode detection scenario as an example, the object being tested can represent the electrode used for detection. The target object can represent the metal within the electrode. Both the image to be tested and the first detection region image contain the detected electrode and the metal within it. Therefore, a fourth detection region image containing only the target object, such as a fourth detection region image containing only the metal, can be extracted from either the image to be tested or the first detection region image. The location of the target object can be determined using methods such as object detection or image segmentation, and the fourth detection region image containing only the target object can be extracted.
[0053] For example, extracting a fourth detection region image containing only the target object based on the image to be tested or the first detection region image (step S140) may include: determining a second connected region from the grayscale image corresponding to the image to be tested or the first detection region image, wherein the second connected region is the connected region corresponding to the target object containing the abnormal protrusion; extracting a second connected region image containing the second connected region from the grayscale image or the first detection region image; and obtaining a fourth detection region image based on the second connected region image.
[0054] In one embodiment, the grayscale processing method described above can be used to grayscale the image to be tested to obtain a grayscale image, and the second connected region can be determined from the grayscale image corresponding to the image to be tested. In another embodiment, the second connected region can be determined directly from the first detection region image. Exemplarily, the second connected region can be a metal connected region corresponding to the metal containing burrs on the electrode sheet; obviously, the metal connected region includes the burr connected region. Based on the determined second connected region, a second connected region image corresponding to the second connected region is extracted from the grayscale image. Similarly, a second connected region image corresponding to the second connected region can also be extracted from the first detection region image. Subsequently, a fourth detection region image can be obtained based on the second connected region image. In one example, the second connected region image can be directly determined as the fourth detection region image. In another example, the second connected region image can be further processed to obtain the fourth detection region image.
[0055] In the above technical solution, based on the second connected region corresponding to the target object containing the abnormal protrusion, the second connected region image is extracted from the grayscale image or the first detection region image, thereby obtaining the fourth detection region image. The fourth detection region image obtained in this way contains target objects with higher accuracy, removing regions that do not contain target objects, such as toner particles.
[0056] For example, determining the second connected region from the grayscale image corresponding to the image to be tested or the first detection region image may include: determining a target object region containing the target object in the grayscale image or the first detection region image based on the relationship between the grayscale value of each pixel and a preset grayscale value threshold; performing a connection operation in the target object region according to the extension direction of the abnormal protrusion to obtain an abnormal protrusion connected region; performing a connection operation in the target object region according to the extension direction of the target object to obtain a target object connected region; and merging the target object connected region and the abnormal protrusion connected region to obtain the second connected region.
[0057] In one embodiment, the target object region containing the target object can be determined in either the grayscale image or the first detection region image. The following explanation uses the determination of the target object region in the first detection region image as an example. A similar method can be used in the grayscale image. A grayscale value threshold can be preset to determine the target object region containing the target object. The preset grayscale value threshold can be set to any suitable value as needed; for example, the preset grayscale value threshold is 200. The grayscale value of each pixel in the first detection region image is compared with the preset grayscale value threshold, and whether it belongs to the target object is determined based on the comparison result. For example, if the grayscale value of any pixel is higher than the preset grayscale value threshold, it can be determined that it belongs to the target object; otherwise, it is determined that it does not belong to the target object. Alternatively, it can be set that if the grayscale value of any pixel is lower than the preset grayscale value threshold, it can be determined that it belongs to the target object; otherwise, it is determined that it does not belong to the target object. The region where the target object is located is the target object region.
[0058] Return to reference Figure 2 In the area between solid lines A and B, the brighter portion (white area) belongs to metal 220. This can be identified through the above grayscale value comparison. Figure 2 The white area where metal 220 is located is called the metal region. However, the metal region determined in the above manner may have many discontinuous parts. Therefore, the burr connected region and the metal connected region can be further determined by the following connectivity operation, and then the two can be merged together to obtain a more complete and coherent metal + burr connected region.
[0059] For example, within the target object region, a connection operation can be performed using a closing operation along the extension direction of the abnormal bulge to obtain an abnormally bulging connected region. It can be understood that the abnormally bulging connected region may contain one or more sub-abnormally bulging connected regions. That is, the abnormally bulging connected region can be fully connected or partially connected. Similarly, for example, within the determined target object region, a connection operation can be performed using a closing operation along the extension direction of the target object to obtain a target object connected region. The target object connected region can also be fully connected or partially connected. Merging the target object connected region with the abnormally bulging connected region yields a second connected region.
[0060] Taking an electrode detection scenario as an example, the second connected region is determined by identifying a metal region containing metal based on the relationship between the grayscale value of each pixel and a preset grayscale threshold. Within the metal region, a connection operation is performed according to the extension direction of the burrs to obtain a burr connected region. Another connection operation is performed within the metal region according to the extension direction of the metal to obtain a metal connected region. The metal connected region and the burr connected region are then merged to obtain the second connected region. The following will combine... Figure 4 Describe it.
[0061] Figure 4 A schematic diagram of an electrode sheet according to an embodiment of the present invention is shown. Figure 4 The extension direction of the metal (420) and the extension direction of the burr on the metal (410) are indicated by white dashed lines. Note that... Figure 4 The extension direction shown is merely an example, and an approximate one. In reality, the extension directions of the target object and the abnormal protrusion are not limited to this example. For instance, the extension direction of the target object can be a single direction or it can contain multiple directions. Similarly, the extension direction of the abnormal protrusion can also be a single direction or it can contain multiple directions. Performing a connectivity operation along extension direction 420 yields a metallic connected region containing the metal portion (which can be referred to as the metal body) excluding the burr. Performing a connectivity operation along extension direction 410 yields a burr connected region. Combining the metallic connected region and the burr connected region results in a metallic and burr connected region that contains both the metal body and the burr.
[0062] According to the above technical solution, the region where the target object is located is determined based on a preset grayscale threshold. This method is relatively accurate and efficient in identifying the target object. Within the target object region, the connected regions of the abnormal protrusion and the target object are determined according to their respective extension directions, thereby obtaining the second connected region corresponding to the target object containing the abnormal protrusion. This approach can determine a relatively complete location of the target object containing the abnormal protrusion, which helps to more accurately determine the abnormal protrusion region subsequently.
[0063] For example, obtaining a fourth detection region image based on a second connected region image may include: for any second connected region in the second connected region image, comparing the area of the second connected region with a first area threshold and a second area threshold; if the area of the second connected region is less than the first area threshold or greater than the second area threshold, then determining that the second connected region does not belong to the target object; otherwise, determining that the second connected region belongs to the target object; and extracting an image containing the second connected region belonging to the target object from the second connected region image as the fourth detection region image.
[0064] In one embodiment, the second connected region image may contain one or more second connected regions. A first area threshold and a second area threshold can be preset. The first and second area thresholds can be set to any suitable size as needed, wherein the first area threshold is less than or equal to the second area threshold. The area of each second connected region is compared with the first and second area thresholds respectively. The following is an example of an electrode detection scenario. If the area of the currently selected second connected region is less than the first area threshold, it indicates that the second connected region may be debris or interference. At this time, it can be determined that the second connected region does not belong to the target object (i.e., metal). If the area of the currently selected second connected region is greater than the second area threshold, it indicates that the second connected region may be toner, because there may also be some slightly larger areas that are too bright within toner. Similarly, it can also be determined that the second connected region does not belong to metal. After comparing the area of each second connected region with the first and second area thresholds, second connected regions with an area greater than or equal to the first area threshold and less than or equal to the second area threshold can be obtained. These second connected regions are determined as second connected regions belonging to the target object, and an image containing the second connected regions belonging to the target object is extracted from the second connected region image. This extracted image can be used as the fourth detection region image.
[0065] According to the above technical solution, by comparing the second connected region with a first area threshold and a second area threshold respectively, regions that do not contain the target object, such as toner, noise, and interference, are filtered out. This method can effectively reduce the false detection rate of the target object, thereby helping to improve the detection accuracy of abnormal protrusions.
[0066] Step S150: Based on the third detection region image and the fourth detection region image, determine the abnormal protrusion region on the target object.
[0067] The third detection region image contains the abnormal protrusion, while the fourth detection region image only contains the target object. Therefore, by combining these two images, the location of the abnormal protrusion on the target object, i.e., the abnormal protrusion region, can be determined. In the case of electrode detection, this method can be used to determine the burr region on the metal. In one embodiment, the intersection of the third and fourth detection region images can be taken to obtain the abnormal protrusion region on the target object. Exemplarily, and not limitingly, the intersection operation can be implemented using algorithms from the OpenCV library.
[0068] For example, determining the abnormal protrusion region on the target object based on the third detection region image and the fourth detection region image (step S150) may include: taking the intersection of the third detection region image and the fourth detection region image to determine the abnormal protrusion region on the target object.
[0069] In one embodiment, the third detection region image may contain abnormal protrusions and isolated noise points. The fourth detection region image may contain the target object. Furthermore, noise, interference, and areas corresponding to toner have already been filtered out in the fourth detection region image. Therefore, by taking the intersection of the third and fourth detection region images, the abnormal protrusion region on the target object can be obtained.
[0070] According to the above technical solution, abnormal protrusion regions on the target object are determined by taking the intersection of the third detection region image and the fourth detection region image. This allows for convenient, fast, and accurate identification of abnormal protrusion regions.
[0071] The abnormal protrusion detection method 100 according to an embodiment of the present invention can automatically detect abnormal protrusions (such as burrs) on a target object using a machine vision inspection method. Denoising itself can be used to remove noise such as abnormal protrusions. A third detection region image containing the abnormal protrusion can be obtained using a first detection region image before denoising and a second detection region image after denoising. Furthermore, by combining the third detection region image with a fourth detection region image containing only the target object, the abnormal protrusion region of the target object can be determined. Compared with traditional inspection, machine vision inspection has significant advantages, such as high accuracy, high efficiency, strong stability, and convenient information integration and retention. Therefore, the above-mentioned abnormal protrusion detection scheme has advantages such as high automation, high speed, high accuracy, and high stability, which helps to significantly reduce the labor costs of traditional visual inspection methods and helps to ensure product quality consistency and high operating efficiency, greatly improving the production efficiency and product quality of battery manufacturers.
[0072] For example, after determining the abnormal protrusion region on the target object based on the third detection region image and the fourth detection region image (step S150), the method may further include: determining the height of the abnormal protrusion using the abnormal protrusion region.
[0073] In one embodiment, the height of the abnormal protrusion can be determined solely based on the identified abnormal protrusion region on the target object. For example, the minimum bounding rectangle of the abnormal protrusion region can be determined, and the height of this minimum bounding rectangle can be defined as the height of the abnormal protrusion. This approach is relatively simple to implement and highly efficient. Furthermore, it can be combined with edge detection of the object under test to achieve higher precision (e.g., sub-pixel) height detection.
[0074] For example, determining the height of an abnormal protrusion using an abnormal protrusion region may include: performing edge detection on the abnormal protrusion region to determine the contour edge of the abnormal protrusion; in the first detection region image, performing line fitting on the edge of the object being tested within a preset range around the abnormal protrusion region to obtain the object edge; and determining the height of the abnormal protrusion based on the difference between the contour edge and the object edge.
[0075] The preset range (which can be called the first preset range) can be any suitable size range, and it can be set as needed. This is because the object being measured has at least two edges (such as upper and lower edges). Figure 2 (The edges corresponding to solid lines A and B shown). Therefore, by setting a preset range, it is possible to avoid fitting irrelevant edges of the measured object that are far from the abnormally protruding area.
[0076] In one embodiment, edge detection of the abnormal protrusion region can be performed using any suitable edge detection algorithm, such as the Roberts algorithm, Sobel algorithm, or Canny algorithm. Based on the edge detection results, the contour edge of the abnormal protrusion can be determined. This contour edge is a sub-pixel edge. For example, the edge can be calculated within a preset range (which can be called the second preset range) around the smallest bounding rectangle of the abnormal protrusion region to obtain the contour edge of the abnormal protrusion.
[0077] For the first detection region image described above, a straight line is fitted to the edge of the object under test within a preset range around the abnormal protrusion contained therein. Based on the straight line fitting result, the sub-pixel edge of the object can be obtained. Exemplarily, but not limitingly, the height of the abnormal protrusion can be represented by the difference between the point farthest from the object edge in the contour edge and the object edge.
[0078] According to the above technical solution, sub-pixel abnormal protrusion contour edges can be obtained through edge detection, and sub-pixel object edges can be obtained by fitting straight lines to the edges of the measured object within a preset range around the abnormal protrusion region. This method yields more accurate and realistic abnormal protrusion contour edges and object edges. Therefore, the accuracy of determining the height of the abnormal protrusion based on the difference between the contour edge and the object edge is also higher.
[0079] According to another aspect of the present invention, an abnormal protrusion detection device is provided, which can be used to detect whether an abnormal protrusion occurs in a target object within a test object in a test image. Figure 5 A schematic block diagram of an abnormal protrusion detection device 500 according to an embodiment of the present invention is shown. Figure 5As shown, the device 500 may include a first extraction module 510, a noise reduction module 520, an acquisition module 530, a second extraction module 540, and a determination module 550.
[0080] The first extraction module 510 is used to extract the first detection region image corresponding to the object being tested from the image to be tested, wherein the first detection region image includes the target object and the background.
[0081] The denoising module 520 is used to denoise the first detection area image to obtain a second detection area image with abnormal protrusions removed.
[0082] The acquisition module 530 is used to obtain a third detection region image containing abnormal protrusions based on the first detection region image and the second detection region image.
[0083] The second extraction module 540 is used to extract a fourth detection region image containing only the target object based on the image to be tested or the first detection region image.
[0084] The determination module 550 is used to determine abnormal protrusion regions on the target object based on the third detection region image and the fourth detection region image.
[0085] For example, the first extraction module 510 may include: a grayscale submodule, used to perform grayscale processing on the image to be tested to obtain a grayscale image; a connectivity submodule, used to perform connectivity operations on the grayscale image using morphological methods to obtain a first connected region image containing one or more first connected regions, the morphological methods including closing operations; a first determination submodule, used to determine the largest first connected region with the largest area among the one or more first connected regions; and a first acquisition submodule, used to obtain an image containing only the largest first connected region as a first detection region image based on the first connected region image.
[0086] For example, the denoising module 520 may include: a first edge detection submodule, used to perform edge detection on the first detection region image to determine a rectangular region containing the target object, wherein the structuring element used for edge detection is a rectangular element with an angle; and an opening operation submodule, used to perform an opening operation on the rectangular region in the first detection region image to obtain a second detection region image.
[0087] For example, the obtaining module 530 may include a difference operation submodule, used to perform a difference operation between the first detection region image and the second detection region image to obtain a third detection region image.
[0088] For example, the second extraction module 540 may include: a second determining submodule, configured to determine a second connected region from the grayscale image or the first detection region image corresponding to the image to be tested, wherein the second connected region is a connected region corresponding to the target object containing the abnormal protrusion; an extraction submodule, configured to extract a second connected region image containing the second connected region from the grayscale image or the first detection region image; and a second obtaining submodule, configured to obtain a fourth detection region image based on the second connected region image.
[0089] For example, the second determining submodule may include: a determining unit, configured to determine a target object region containing the target object in the grayscale image or the first detection region image based on the relationship between the grayscale value of each pixel and a preset grayscale value threshold; a first connecting unit, configured to perform a connecting operation in the target object region according to the extension direction of the abnormal protrusion to obtain an abnormal protrusion connected region; a second connecting unit, configured to perform a connecting operation in the target object region according to the extension direction of the target object to obtain a target object connected region; and a merging unit, configured to perform a merging operation on the target object connected region and the abnormal protrusion connected region to obtain a second connected region.
[0090] For example, the second obtaining submodule may include: a comparison unit, configured to compare the area of any second connected region in the second connected region image with a first area threshold and a second area threshold; if the area of the second connected region is less than the first area threshold or greater than the second area threshold, then determine that the second connected region does not belong to the target object; otherwise, determine that the second connected region belongs to the target object; and an extraction unit, configured to extract an image containing the second connected region belonging to the target object from the second connected region image as a fourth detection region image.
[0091] For example, the determining module 550 may further include an intersection submodule for taking the intersection of the third detection region image and the fourth detection region image to determine the abnormal protrusion region on the target object.
[0092] For example, the device 500 may further include: a height determination module, used to determine the height of the abnormal protrusion by utilizing the abnormal protrusion region after the determination module 550 determines the abnormal protrusion region on the target object based on the third detection region image and the fourth detection region image.
[0093] For example, the height determination module includes: a second edge detection submodule, used to perform edge detection on the abnormal protrusion region and determine the contour edge of the abnormal protrusion; a fitting submodule, used to perform straight line fitting on the edge of the measured object located within a preset range around the abnormal protrusion region in the first detection region image to obtain the object edge; and a height determination submodule, used to determine the height of the abnormal protrusion based on the difference between the contour edge and the object edge.
[0094] According to another aspect of the present invention, an electronic device is also provided. Figure 6 A schematic block diagram of an electronic device 600 according to an embodiment of the present invention is shown, such as... Figure 6 As shown, the electronic device 600 may include a processor 610 and a memory 620. The memory 620 stores a computer program, and the processor 610 executes the computer program to implement the aforementioned method for detecting abnormal protrusions.
[0095] According to another aspect of the present invention, a storage medium is also provided. It stores a computer program / instructions that, when executed by a processor, implement the aforementioned method for detecting abnormal bumps. The storage medium may, for example, include a storage component of a tablet computer, a hard disk of a personal computer, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disc read-only memory (CD-ROM), a USB memory, or any combination of the above storage media. The computer-readable storage medium may be any combination of one or more computer-readable storage media.
[0096] Those skilled in the art can understand the specific implementation scheme and beneficial effects of the above-mentioned abnormal protrusion detection device, electronic device and storage medium by reading the relevant description of the abnormal protrusion detection method. For the sake of brevity, they will not be described in detail here.
[0097] Although exemplary embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above exemplary embodiments are merely illustrative and are not intended to limit the scope of the invention. Various changes and modifications can be made therein by those skilled in the art without departing from the scope and spirit of the invention. All such changes and modifications are intended to be included within the scope of the invention as claimed in the appended claims.
[0098] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0099] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed.
[0100] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0101] Similarly, it should be understood that, in order to streamline the invention and aid in understanding one or more of the various aspects of the invention, features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the description of exemplary embodiments of the invention. However, this approach should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the corresponding claims, its inventive point lies in solving the corresponding technical problem with fewer features than all of those in a single disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of the invention.
[0102] Those skilled in the art will understand that, apart from the mutual exclusion of features, all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or apparatus so disclosed can be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0103] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments can be used in any combination.
[0104] The various component embodiments of the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some modules in the abnormal protrusion detection device according to embodiments of the present invention. The present invention can also be implemented as a device program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
[0105] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0106] The above description is merely a specific embodiment of the present invention or an explanation of that embodiment. The scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. The scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method of detecting abnormal protrusions, characterized by, A method for detecting whether a target object in a measured object in a to-be-measured image has an abnormal protrusion, the method comprising: extracting a first detection region image corresponding to the measured object from the to-be-measured image, wherein the first detection region image contains the target object and a background; denoising the first detection region image to obtain a second detection region image in which abnormal protrusions are removed; based on the first detection region image and the second detection region image, obtaining a third detection region image containing the abnormal protrusions; extracting a fourth detection region image containing only the target object based on the to-be-measured image or the first detection region image; based on the third detection region image and the fourth detection region image, determining an abnormal protrusion region on the target object; wherein the fourth detection region image containing only the target object based on the to-be-measured image or the first detection region image comprises: determining a second connected region from a grayscale image corresponding to the to-be-measured image or the first detection region image, the second connected region being a connected region corresponding to the target object containing the abnormal protrusions; extracting a second connected region image containing the second connected region from the grayscale image or the first detection region image; obtaining the fourth detection region image based on the second connected region image; wherein the second connected region is determined from the grayscale image corresponding to the to-be-measured image or the first detection region image comprises: in the grayscale image or the first detection region image, determining a target object region containing the target object based on the size relationship between the grayscale value of each pixel and a preset grayscale value threshold; in the target object region, performing a connected operation in the extension direction of the abnormal protrusions to obtain an abnormal protrusion connected region; in the target object region, performing a connected operation in the extension direction of the target object to obtain a target object connected region; performing a merge operation on the target object connected region and the abnormal protrusion connected region to obtain the second connected region; wherein the fourth detection region image is obtained based on the second connected region image comprises: for any second connected region in the second connected region image, comparing the area of the second connected region with a first area threshold and a second area threshold, if the area of the second connected region is less than the first area threshold or greater than the second area threshold, it is determined that the second connected region does not belong to the target object, otherwise it is determined that the second connected region belongs to the target object; extracting an image containing the second connected region belonging to the target object from the second connected region image as the fourth detection region image.
2. The method of claim 1, wherein, The first detection region image corresponding to the measured object is extracted from the to-be-measured image, comprising: performing grayscale processing on the to-be-measured image to obtain a grayscale image; performing a connected operation on the grayscale image using a morphological method to obtain a first connected region image containing one or more first connected regions, the morphological method comprising a closing operation; determining a largest first connected region with a largest area in the one or more first connected regions; obtaining, based on the first connected region image, an image containing only the largest first connected region as the first detection region image.
3. The method of claim 2, wherein, The morphological method further comprises an opening operation performed before the closing operation.
4. The method according to any one of claims 1 to 3, characterized in that, The denoising of the first detection region image to obtain a second detection region image with abnormal protrusions removed comprises: performing edge detection on the first detection region image to determine a rectangular region containing the measured object, wherein the edge detection uses a rectangular element with an angle as a structural element; performing an opening operation on the rectangular region in the first detection region image to obtain the second detection region image.
5. The method according to any one of claims 1 to 3, characterized in that, The obtaining of a third detection region image containing the abnormal protrusions based on the first detection region image and the second detection region image comprises: performing a difference operation on the first detection region image and the second detection region image to obtain the third detection region image.
6. The method according to any one of claims 1 to 3, characterized in that, The determination of an abnormal protrusion region on the target object based on the third detection region image and the fourth detection region image comprises: performing an intersection operation on the third detection region image and the fourth detection region image to determine the abnormal protrusion region on the target object.
7. The method according to any one of claims 1 to 3, characterized in that, After the determination of the abnormal protrusion region on the target object based on the third detection region image and the fourth detection region image, the method further comprises: determining the height of the abnormal protrusion using the abnormal protrusion region.
8. The method of claim 7, wherein, The determination of the height of the abnormal protrusion using the abnormal protrusion region comprises: performing edge detection on the abnormal protrusion region to determine a contour edge of the abnormal protrusion; performing linear fitting on edges of the measured object within a preset range around the abnormal protrusion region in the first detection region image to obtain an object edge; determining the height of the abnormal protrusion based on the difference between the contour edge and the object edge.
9. An abnormal protrusion detecting apparatus characterized by comprising: An apparatus for detecting whether a target object in a measured object in a to-be-detected image has an abnormal protrusion, the apparatus comprising: a first extraction module configured to extract a first detection region image corresponding to the measured object from the to-be-detected image, wherein the first detection region image contains the target object and a background; a denoising module configured to denoise the first detection region image to obtain a second detection region image with abnormal protrusions removed; an obtaining module configured to obtain a third detection region image containing the abnormal protrusions based on the first detection region image and the second detection region image; a second extraction module configured to extract a fourth detection region image containing only the target object based on the to-be-detected image or the first detection region image; a determination module configured to determine an abnormal protrusion region on the target object based on the third detection region image and the fourth detection region image; The second extraction module comprises: a second determining sub-module, configured to determine a second connected region from the gray image corresponding to the to-be-detected image or the first detection region image, the second connected region being a connected region corresponding to the target object containing the abnormal protrusion; an extracting sub-module, configured to extract a second connected region image containing the second connected region from the gray image or the first detection region image; a second obtaining sub-module, configured to obtain the fourth detection region image based on the second connected region image; The second determining sub-module includes: a determining unit, configured to determine a target object region containing the target object based on a size relationship between a gray value of each pixel and a preset gray value threshold in the gray image or the first detection region image; a first connecting unit, configured to perform a connecting operation in the target object region according to an extension direction of the abnormal protrusion to obtain an abnormal protrusion connected region; a second connecting unit, configured to perform a connecting operation in the target object region according to an extension direction of the target object to obtain a target object connected region; a merging unit, configured to perform a merging operation on the target object connected region and the abnormal protrusion connected region to obtain the second connected region; The second obtaining sub-module includes: a comparing unit, configured to compare an area of any second connected region in the second connected region image with a first area threshold and a second area threshold, and if the area of the second connected region is less than the first area threshold or greater than the second area threshold, it is determined that the second connected region does not belong to the target object, otherwise it is determined that the second connected region belongs to the target object; an extracting unit, configured to extract an image containing the second connected region belonging to the target object from the second connected region image as the fourth detection region image.
10. An electronic device comprising a processor and a memory, wherein, The memory stores computer program instructions, and the computer program instructions are run by the processor to execute the detection method of the abnormal protrusion.
11. A storage medium on which program instructions are stored, wherein, The program instructions are run to execute the detection method of the abnormal protrusion.
Citation Information
Patent Citations
Illegal parking detection method based on image texture
CN104376554A
Sub-pixel edge detection method based on improved morphology
CN104732536A