A blue film defect identification method, device, equipment and readable storage medium

CN121010536BActive Publication Date: 2026-10-27HANGZHOU ANMAISHENG INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410643766.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2026-10-27
Estimated Expiration
2044-05-22

AI Technical Summary

Technical Problem

[0004]有鉴于此,本发明的目的在于提供一种蓝膜缺陷识别方法,解决了现有技术中蓝膜缺陷识别准确性低的技术问题

Benefits of technology

[0015]可见,本发明通过对待检测图像进行特征定位,确定蓝膜的初始检测区域,并根据不同产品的实际情况对所初始检测区域进行特征筛选,确定蓝膜全部特征区域;确定蓝膜全部特征区域的RGB通道图像,并对RGB通道图像进行转换,得到包括S通道的通道图像,并对B通道图像进行阈值分割后,进行相应的Blob分析,得到蓝膜正常特征区域;根据蓝膜全部特征区域和蓝膜正常特征区域,确定初始缺陷区域;对初始缺陷区域的S通道进行边缘梯度检测后,进行阈值分割和Blob分析,将颜色有变化的区域作为疑似缺陷区域;利用特征检测算法对疑似缺陷区域进行检测,确定蓝膜缺陷;其中,特征检测算法为利用疑似缺陷区域的特征进行检测,确定蓝膜缺陷类别的算法。和当前人工目检确定蓝膜缺陷相比,本申请对待检测图像进行分析处理,提取出相应的疑似缺陷区域,然后利用特征检测算法对疑似缺陷区域进行检测,确定蓝膜对应的缺陷类别,故本申请可以提高蓝膜缺陷检测的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121010536B_ABST
    Figure CN121010536B_ABST
Patent Text Reader

Abstract

The application discloses a blue film defect identification method, device and equipment and a readable storage medium, and is applied to the technical field of data processing and comprises the following steps: performing feature positioning on a to-be-detected image to determine a whole feature region of a blue film, performing threshold segmentation and Blob analysis on the feature region of the blue film to determine a normal feature region of the blue film, and determining an initial defect region according to the whole feature region of the blue film and the normal feature region of the blue film; performing edge gradient detection on an S channel of the initial defect region, performing threshold segmentation and Blob analysis, and taking a region with color change as a suspected defect region; detecting the suspected defect region by using a feature detection algorithm to determine a blue film defect; and the feature detection algorithm is an algorithm for detecting the suspected defect region by using features of the suspected defect region to determine a blue film defect category. The application analyzes and processes a to-be-detected image, extracts a suspected defect region of a blue film, detects the suspected defect region by using a feature detection algorithm, and determines a blue film defect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a blue film defect identification method, apparatus, device, and readable storage medium. Background Technology

[0002] During the precision processing of metal products, after wrapping them with insulating blue film, the appearance of the blue film needs to be inspected before final packaging. The inspection identifies and classifies any defects such as damage and wrinkles. In the actual production line process, a visual inspection station is often arranged to specifically inspect the appearance of the products for defects. However, the quality of the inspection is greatly affected by subjective human factors, and the reliability of the product quality cannot be guaranteed.

[0003] Therefore, current methods for detecting blue film defects suffer from low accuracy. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a blue film defect identification method, which solves the technical problem of low accuracy in blue film defect identification in the prior art.

[0005] To address the aforementioned technical problems, this invention provides a method for identifying blue film defects, comprising: Feature localization is performed on the image to be detected to determine the initial detection area of ​​the blue film, and feature filtering is performed on the initial detection area according to the actual situation of different products to determine all feature areas of the blue film. The RGB channel images of all feature regions of the blue film are determined, and the RGB channel images are converted to obtain channel images including the S channel. After thresholding the B channel image, the corresponding Blob analysis is performed to obtain the normal feature regions of the blue film. The initial defect area is determined based on all characteristic areas of the blue film and the normal characteristic areas of the blue film; After edge gradient detection is performed on the S-channel of the initial defect area, threshold segmentation and Blob analysis are performed to identify areas with color changes as suspected defect areas. The suspected defect area is detected using a feature detection algorithm to determine the blue film defect; wherein, the feature detection algorithm is an algorithm that uses the features of the suspected defect area to detect and determine the type of blue film defect.

[0006] Optionally, the step of performing feature localization on the image to be detected to determine the initial detection area of ​​the blue film includes: The image to be detected is subjected to threshold segmentation to obtain a segmented image; The segmented image is subjected to Blob analysis to obtain the initial detection region; the initial detection region is the approximate region in the image where the region to be detected is located based on the corresponding features of the product.

[0007] Optionally, determining the initial defect region based on all characteristic regions of the blue film and the normal characteristic regions of the blue film includes: The normal feature regions of the blue film are removed from all feature regions of the blue film to obtain the initial defect region.

[0008] Optionally, the step of using a feature detection algorithm to detect the suspected defect area and determine the blue film defect includes: The dimensions of the suspected defective region are expanded by pixels to obtain an expanded image. The blue film defect is determined by detecting the extended image using the aforementioned feature detection algorithm.

[0009] Optionally, the step of using a feature detection algorithm to detect the suspected defect area and determine the blue film defect includes: The suspected defect region is detected using a ConvNext classification network to determine the blue membrane defect; wherein, the ConvNext classification network is trained using labeled blue membrane defect data; Alternatively, an SVM model can be used to detect the suspected defective area and determine the blue film defect; the SVM model is a model obtained by training an SVM using the bounding rectangle of the region, the number of holes, the number of regions, the density, and the convexity features of the image.

[0010] Optionally, the step of using the ConvNext classification network to detect the suspected defect area and determine the blue film defect includes: The suspected defect area is detected using the ConvNext classification network to obtain the classification category of the blue film defect; the classification category is the defect type and the defect size. Determine whether the specifications meet the requirements based on the preset normal specifications corresponding to the classification category; If the requirements are met, then the blue film is determined to be defect-free; If the requirements are not met, a defect is identified, and the corresponding defect specification value is given.

[0011] Optionally, the step of using an SVM model to detect the suspected defect area and determine the blue film defect includes: The bounding rectangle of the suspected defect area, the number of holes, the number of regions, the density, and the convexity features of the image are input into the SVM model for inference to determine the blue film defect category.

[0012] This application also provides a blue film defect identification device, comprising: The blue film feature region determination module is used to locate features in the image to be detected, determine the initial detection region of the blue film, and perform feature filtering on the initial detection region according to the actual situation of different products to determine the entire feature region of the blue film. The blue film normal feature region determination module is used to determine the RGB channel image of all feature regions of the blue film, convert the RGB channel image to obtain a channel image including the S channel, and perform threshold segmentation on the B channel image and perform corresponding Blob analysis to obtain the normal feature region of the blue film. The initial defect region determination module is used to determine the initial defect region based on all feature regions of the blue film and the normal feature regions of the blue film; The suspected defect area determination module is used to perform edge gradient detection on the S channel of the initial defect area, then perform threshold segmentation and Blob analysis, and identify areas with color changes as suspected defect areas. The blue film defect determination module is used to detect the suspected defect area using a feature detection algorithm to determine the blue film defect; wherein, the feature detection algorithm is an algorithm that uses the features of the suspected defect area to detect and determine the type of blue film defect.

[0013] This application also provides a blue film defect identification device, including: Memory, used to store computer programs; A processor is used to implement the blue film defect identification method as described above when executing the computer program.

[0014] This application also provides a readable storage medium storing computer-executable instructions, which, when loaded and executed by a processor, implement the blue film defect identification method described above.

[0015] As can be seen, this invention determines the initial detection area of ​​the blue film by performing feature localization on the image to be inspected, and then filters the features of the initial detection area according to the actual situation of different products to determine all feature areas of the blue film; it determines the RGB channel images of all feature areas of the blue film, converts the RGB channel images to obtain channel images including the S channel, and performs threshold segmentation on the B channel image, followed by corresponding Blob analysis to obtain the normal feature areas of the blue film; based on the all feature areas and the normal feature areas of the blue film, the initial defect area is determined; after edge gradient detection on the S channel of the initial defect area, threshold segmentation and Blob analysis are performed, and areas with color changes are identified as suspected defect areas; a feature detection algorithm is used to detect the suspected defect areas to determine the defects of the blue film; wherein, the feature detection algorithm is an algorithm that uses the features of the suspected defect areas to detect and determine the defect category of the blue film. Compared with the current manual visual inspection to determine blue film defects, this application analyzes and processes the image to be inspected, extracts the corresponding suspected defect areas, and then uses a feature detection algorithm to detect the suspected defect areas to determine the corresponding defect category of the blue film, thus improving the accuracy of blue film defect detection.

[0016] In addition, the present invention also provides a blue film defect identification device, equipment and readable storage medium, which also have the above-mentioned beneficial effects. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0018] Figure 1 A flowchart of a blue film defect identification method provided in an embodiment of the present invention; Figure 2 A flowchart illustrating a blue film defect detection method provided in an embodiment of the present invention; Figure 3 A flowchart illustrating another blue film defect detection method provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a blue film defect identification device provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a blue film defect identification device provided in an embodiment of the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Please refer to Figure 1 , Figure 1 A flowchart illustrating a blue film defect identification method provided in an embodiment of the present invention. The method may include: S101, perform feature localization on the image to be detected, determine the initial detection area of ​​the blue film, and perform feature filtering on the initial detection area according to the actual situation of different products to determine all feature areas of the blue film.

[0021] This embodiment does not limit the method of feature localization of the image to be detected to determine the initial detection area of ​​the blue film. For example, the image to be detected can be cropped based on empirically set values ​​to determine the initial detection area of ​​the blue film; or this embodiment can also perform threshold segmentation on the image to be detected and perform a series of Blob analyses, mainly to initially locate the approximate area in the image where the area to be detected is located based on the corresponding features of the product; or this embodiment can also perform mean filtering on the image to be detected to reduce the interference of image noise, thereby performing threshold segmentation on the mean-filtered image and performing a series of Blob analyses (Blob analysis is to group pixels with the same gray value range together based on different neighborhood types and regard them as the same detection object), thereby extracting features from the Blob-analyzed image to determine the initial detection area of ​​the blue film. It can be understood that the initial detection area refers to the approximate area of ​​the product that needs to be detected. In this project, it refers to the area where the blue film exists. After removing interfering features such as clips and white metal frames outside the blue film, the area obtained is the entire feature area of ​​the blue film. For example, to detect shoes in a box, the image field of view needs to contain the complete box. The box is the initial detection area to be detected. The product to be detected is the shoe. After removing other interfering features besides the shoe, we get the shoe (the entire feature area).

[0022] It should be further explained that, in order to improve the accuracy of the initial detection area determination, the above-mentioned feature localization of the image to be detected to determine the initial detection area of ​​the blue film may include: thresholding the image to be detected to obtain a segmented image; performing Blob analysis on the segmented image to obtain the initial detection area; the initial detection area is the approximate region in the image where the area to be detected is located based on the corresponding features of the product. This embodiment first performs thresholding on the image to be detected to amplify the image features, and then performs Blob analysis to determine the initial detection area of ​​the blue film based on its features. Because this embodiment performs thresholding to amplify the image features, it can improve the accuracy of subsequent Blob analysis, thereby improving the accuracy of the initial detection area determination.

[0023] S102, determine the RGB channel images of all feature regions of the blue membrane, convert the RGB channel images to obtain channel images including the S channel, and perform threshold segmentation on the B channel images, and then perform corresponding Blob analysis to obtain the normal feature regions of the blue membrane.

[0024] This embodiment extracts channels from all feature regions of the blue film to obtain an RGB channel image (RGB color space is the most basic, commonly used, and hardware-oriented color space in image processing). This embodiment converts the RGB channel image to obtain a channel image including the S channel. This embodiment does not limit the specific type of channel image including the S channel. For example, the channel image including the S channel in this embodiment could be an HSV channel image (HSV represents a color image with three components: Hue, Saturation, and Value); or the channel image including the S channel in this embodiment could be an HSL channel image (HLS has three components: hue, saturation, and brightness). This embodiment performs thresholding and Blob analysis on the B channel of the RGB image to obtain the normal feature regions of the blue film. Understandably, thresholding is used to process the image into a high-contrast, easily identifiable image by using a suitable pixel value as a boundary. This easily identifiable image is then subjected to Blob analysis, which provides machine vision applications with information on the number, location, shape, and orientation of blobs in the image. Thus, the normal feature regions of the blue film, excluding any defects, can be obtained.

[0025] S103, determine the initial defect area based on all characteristic areas of the blue film and the normal characteristic areas of the blue film.

[0026] This embodiment does not limit the specific process of determining the initial defect region based on all characteristic regions and normal characteristic regions of the blue film. For example, this embodiment can remove relevant features from all characteristic regions of the blue film based on the normal characteristic regions of the blue film to obtain the initial defect region; or this embodiment can also detect the normal characteristic regions of the blue film from all characteristic regions of the blue film to obtain the initial defect region.

[0027] It should be further explained that, in order to improve the efficiency of determining the initial defect region, the above-mentioned determination of the initial defect region based on all feature regions and normal feature regions of the blue film can include: removing the normal feature regions of the blue film from the all feature regions of the blue film to obtain the initial defect region. This embodiment directly removes the normal feature regions of the blue film from the all feature regions of the blue film, eliminating the need for feature analysis of the entire blue film feature region, thus improving the efficiency of determining the initial defect region.

[0028] S104 performs edge gradient detection on the initial defect region of the S channel of the initial defect region. After obtaining the edge gradient image, threshold segmentation and Blob analysis are performed on the edge gradient image, and the regions with color changes are identified as suspected defect regions.

[0029] This embodiment performs edge gradient detection on the S-channel of the initial defect area, followed by threshold segmentation and Blob analysis, identifying areas with color variations as suspected defect areas. It is understandable that wrinkles, Defective areas such as tears and exposed white areas will have the highest contrast in the S-channel of saturation on the surface of the blue film. Wrinkles and tears will cause changes in the color of the blue film surface.

[0030] S105, use a feature detection algorithm to detect suspected defect areas and determine blue film defects; wherein, the feature detection algorithm is an algorithm that uses the features of suspected defect areas to detect and determine the type of blue film defects.

[0031] The feature detection algorithm in this embodiment is an intelligent detection algorithm. The purpose of this feature detection algorithm is to extract the core feature points corresponding to different defects. The feature detection algorithm in this embodiment can be a CNN (Convolutional Neural Network); or it can also be an SVM (Support Vector Machine).

[0032] It should be further explained that, in order to improve the accuracy of blue film defect detection, the above-mentioned use of feature detection algorithms to detect suspected defect areas and determine blue film defects may include: expanding the dimensions of the suspected defect areas by pixels to obtain an expanded image; and using feature detection algorithms to detect the expanded image to determine the blue film defect. This embodiment does not limit the specific value of the pixel expansion. For example, this embodiment may expand the image by twenty pixels in both dimensions; or this embodiment may crop the image and expand it by thirty pixels in both dimensions. This embodiment performs pixel expansion processing on the identified suspected defect areas, improving image clarity and thus improving the accuracy of blue film defect detection.

[0033] It should be further explained that, in order to improve the diversity of blue film defect detection, the above-mentioned use of feature detection algorithms to detect suspected defect areas and determine blue film defects can include: The ConvNext classification network was used to detect suspected defect areas and identify blue membrane defects; the ConvNext classification network was trained using labeled blue membrane defect data. Alternatively, an SVM model can be used to detect suspected defect areas and determine blue film defects. The SVM model is obtained by training an SVM using the bounding rectangle of the region, the number of holes, the number of regions, the density, and the convexity features of the image.

[0034] This embodiment utilizes a ConvNext classification network to detect suspected defect areas and identify blue membrane defects. The training process of the ConvNext classification network includes: pre-training a ConvNext or ConvNeXt network with labeled defects, using ReLU (activation function) as the loss function. In this embodiment, when training the ConvNext classification network, the epochs can be 400 (a single training iteration that propagates forward and backward once across all batches (all samples)), the batch size is 4096, and the warmup epochs (learning rate) is 5, training corresponding CNN models (convolutional networks) for defects such as broken, wrinkled, and normal blue membranes. To improve the accuracy of blue membrane recognition, this embodiment can simultaneously use both the ConvNext classification network and the SVM model for detection. Since this embodiment provides two methods for blue membrane defect detection—the ConvNext classification network and the SVM model—it can increase the diversity of blue membrane defect detection.

[0035] It should be further explained that, in order to improve the comprehensiveness of blue film defect identification, the above-mentioned detection of suspected defect areas using the ConvNext classification network to determine blue film defects may include: using the ConvNext classification network to detect suspected defect areas and obtain the classification category of the blue film defect; the classification category is defect type and defect size; judging whether it meets the specification requirements according to the preset normal specifications corresponding to the classification category; if it meets the requirements, it is determined that the blue film is defect-free; if it does not meet the requirements, it is determined that a defect exists, and the corresponding defect specification value is given. This embodiment does not limit the specific blue film defect classification category. For example, the blue film defect classification category in this embodiment can be a wrinkle of 0.1 mm; or the classification category in this embodiment can also be a break of 0.01 mm. This embodiment does not limit the preset normal specifications corresponding to each defect type. It can be understood that the preset normal specifications refer to the range within which a defect is acceptable. After detecting suspected defect areas according to the ConvNext classification network, this embodiment further judges the blue film defects according to the preset normal specifications, thereby improving the accuracy of blue film defect judgment.

[0036] It should be further explained that, to improve the accuracy of blue film defect detection using the SVM model, the above-mentioned detection of suspected defect areas using the SVM model to determine blue film defects may include: inputting the bounding box, number of holes, number of regions, density, and image convexity features of the suspected defect area into the SVM model for inference to determine the blue film defect category. In this embodiment, the SVM is a supervised learning model with a relevant learning algorithm. It analyzes data used for classification and regression analysis. Given a set of training examples, each example is labeled as belonging to one or the other of each category. The SVM training algorithm constructs a model, assigning new examples to one category or the other, making it a non-probabilistic binary linear classifier. This embodiment utilizes the bounding box, number of holes, number of regions, density, and image convexity features to perform blue film defect detection, thereby improving the accuracy of blue film defect detection.

[0037] This invention provides a blue film defect identification method, which may include: S101, performing feature localization on the image to be detected, determining the initial detection area of ​​the blue film, and performing feature filtering on the initial detection area according to the actual situation of different products to determine all feature areas of the blue film; S102, determining the RGB channel images of all feature areas of the blue film, converting the RGB channel images to obtain channel images including the S channel, and performing threshold segmentation on the B channel images, followed by corresponding Blob analysis to obtain the normal feature areas of the blue film; S103, determining the initial defect area based on all feature areas and the normal feature areas of the blue film; S104, performing edge gradient detection on the initial defect area of ​​the S channel of the initial defect area, obtaining the edge gradient image, and then performing threshold segmentation and Blob analysis on the edge gradient image, identifying areas with color changes as suspected defect areas; S105, using a feature detection algorithm to detect the suspected defect areas and determine the blue film defect; wherein, the feature detection algorithm is an algorithm that uses the features of the suspected defect areas to detect and determine the type of blue film defect. Compared with the current manual detection of blue film defects, this application analyzes and processes the image to be detected, extracts the corresponding suspected defect areas, and then uses a feature detection algorithm to detect the suspected defect areas to determine the type of blue film defect. Furthermore, this embodiment improves the accuracy of subsequent blob analysis and thus the accuracy of initial detection region determination by performing threshold segmentation to amplify image features. It also directly removes normal blue film feature regions from all blue film feature regions, eliminating the need for feature analysis across all blue film feature regions, thereby improving the efficiency of initial defect region determination. Additionally, it enlarges the pixels of identified suspected defect regions to enhance image clarity and improve the accuracy of blue film defect detection. Moreover, by providing both ConvNext classification networks and SVM models for blue film defect detection, this embodiment increases the diversity of blue film defect detection methods. After detecting suspected defect regions using the ConvNext classification network, it further judges blue film defects based on preset normal specifications, improving the accuracy of blue film defect judgment. Finally, this embodiment utilizes multiple features, including the bounding rectangle, number of holes, number of regions, density, and image convexity, to perform blue film defect detection, further enhancing the accuracy of blue film defect detection.

[0038] For a clearer understanding of this invention, please refer to the following details. Figure 2 , Figure 2 A flowchart illustrating a blue film defect detection method provided in this embodiment of the invention may specifically include: S201, perform mean filtering on the original image to obtain a preprocessed image.

[0039] In this embodiment, the original image is the image to be detected. Besides using mean filtering, this embodiment can also use Gaussian filtering to obtain a preprocessed image.

[0040] S202, after thresholding the preprocessed image, perform Blob analysis to obtain the approximate detection area; the approximate detection area includes the areas of the detection object and interference information.

[0041] This embodiment performs threshold segmentation on the preprocessed image and a series of Blob analyses, mainly to initially locate the approximate region in the image where the area to be detected is located based on the corresponding features of the product.

[0042] S203, based on the actual situation of the original image, remove the interference information in the approximate detection area to obtain the complete feature area of ​​the blue film.

[0043] After obtaining the approximate detection area of ​​the image in this embodiment, the precise detection range of the product is obtained according to the actual situation of different products (some products have a white metal frame, so the white metal frame is removed, or the workpiece clamp is removed, etc.). It can be understood that the blue film involved in this method is surrounded by a metal frame. After removing the area of ​​the metal frame, the detection area is the blue film detection area. After obtaining the metal frame, the detection area is shifted towards the center to the actual size of the metal frame, and finally the entire feature area of ​​the blue film is obtained.

[0044] S204: Extract channels from all feature regions of the blue film to obtain RGB channel images, and then convert the RGB channel images into HSV channel images.

[0045] This embodiment can also convert RGB channel images into HSL channel images.

[0046] S205, perform threshold segmentation on the B channel image and perform corresponding Blob analysis to obtain the normal feature region of the blue film; wherein, the normal feature region of the blue film is the region after removing interference.

[0047] S206 uses all the feature regions of the blue film to crop out the normal feature regions of the blue film to obtain the initial defect region. Then, edge gradient detection is performed on the initial defect region of the S channel. After obtaining the edge gradient image, threshold segmentation is performed on the edge gradient image. At the same time, a series of Blob analyses are performed to extract the regions with color changes.

[0048] S207, crop the image of the area with color variation and expand its length and width by twenty pixels to obtain the target defect area including the defect.

[0049] In this embodiment, the target defect area can be a candidate area of ​​certain damaged and wrinkled foreign objects and a certain background image.

[0050] S208. The ConvNext classification network is used to detect the target defect area and obtain the corresponding classification category and confidence level.

[0051] S209 calculates the minimum bounding rectangle of the area with color changes. Based on the actual inspection requirements, it determines whether the damage and wrinkle categories meet the specifications. If they meet the requirements, it outputs that there are no defects; otherwise, it outputs that there are defects and the corresponding defect value.

[0052] This embodiment can resize the target defect area to 196. After processing 196 images, the data is fed into a pre-trained ConvNext classification network for inference, yielding the corresponding classification category and confidence level. The confidence level in this embodiment can be used in subsequent judgments to assist relevant personnel. After classification, the minimum bounding rectangle of the region is calculated. This minimum bounding rectangle is used to calculate the length and width features of the region. Based on actual detection requirements, it is determined whether the damage and wrinkle categories meet the specifications. If they meet the requirements, the output is OK (normal); otherwise, NG (abnormal) and the corresponding specification value are output. This invention utilizes the ConvNext classification network to determine the defects and defect values ​​present in the blue film, improving the accuracy of blue film defect detection.

[0053] For a clearer understanding of this invention, please refer to the following details. Figure 3 , Figure 3 A flowchart illustrating another blue film defect detection method provided in this embodiment of the invention may specifically include: S301, perform mean filtering on the original image to obtain a preprocessed image.

[0054] S302, after thresholding the preprocessed image, perform Blob analysis to obtain the approximate detection area; the approximate detection area includes the areas of the detection object and interference information.

[0055] S303, based on the actual situation of the original image, removes the interference information in the approximate detection area to obtain the full feature area of ​​the blue film.

[0056] S304: Extract channels from all feature regions of the blue film to obtain RGB channel images, and then convert the RGB channel images into HSV channel images.

[0057] S305, threshold segmentation is performed on the B channel image, and corresponding Blob analysis is performed to obtain the normal feature region of the blue film; wherein, the normal feature region of the blue film is the region after removing interference.

[0058] S306, remove the normal area of ​​the blue film from all the characteristic areas of the blue film to obtain the initial defect area.

[0059] S307 performs edge gradient detection on the initial defect area, obtains the edge gradient image, performs threshold segmentation on the S channel image, and performs a series of Blob analyses to extract areas with color changes, which are then used as suspected blue film defect areas.

[0060] S308: Obtain the bounding rectangle, number of holes, number of regions, density, and image convexity features of the suspected blue film defect area. Put these features into the SVM model for inference to determine the defect category.

[0061] This embodiment uses an SVM model to examine suspected areas of blue film defects and determine the defect category. Since no manual inspection is required, the accuracy of blue film defect category determination can be improved.

[0062] The following describes a blue film defect identification device provided by an embodiment of the present invention. The blue film defect identification device described below and the blue film defect identification method described above can be referred to in correspondence.

[0063] Please refer to the details. Figure 4 , Figure 4 A schematic diagram of a blue film defect identification device provided in an embodiment of the present invention may include: The blue film feature region determination module 100 is used to perform feature localization on the image to be detected, determine the initial detection region of the blue film, and perform feature filtering on the initial detection region according to the actual situation of different products to determine the entire feature region of the blue film. The blue film normal feature region determination module 200 is used to determine the RGB channel image of all feature regions of the blue film, convert the RGB channel image to obtain a channel image including the S channel, and perform corresponding Blob analysis after threshold segmentation of the B channel image to obtain the normal feature region of the blue film. The initial defect region determination module 300 is used to determine the initial defect region based on all feature regions of the blue film and the normal feature regions of the blue film; The suspected defect area determination module 400 is used to perform edge gradient detection on the S channel of the initial defect area, then perform threshold segmentation and Blob analysis, and identify areas with color changes as suspected defect areas. The blue film defect determination module 500 is used to detect the suspected defect area using a feature detection algorithm to determine the blue film defect; wherein, the feature detection algorithm is an algorithm that uses the features of the suspected defect area to detect and determine the type of blue film defect.

[0064] Furthermore, based on the above embodiments, the blue film full feature region determination module 100 may include: The image segmentation determination unit is used to perform threshold segmentation on the image to be detected to obtain a segmented image; The initial detection region determination unit is used to perform Blob analysis processing on the segmented image to obtain the initial detection region; the initial detection region is the approximate region in the image where the region to be detected is located based on the corresponding features of the product.

[0065] Furthermore, based on any of the above embodiments, the initial defect region determination module 300 may include: The initial defect region determination unit is used to remove the normal feature region of the blue film from all feature regions of the blue film to obtain the initial defect region.

[0066] Furthermore, based on any of the above embodiments, the blue film defect determination module 500 may include: A pixel expansion unit is used to perform pixel expansion processing on the length and width of the suspected defect area to obtain an expanded image; The blue film defect determination unit is used to detect the blue film defect by using the feature detection algorithm on the extended image.

[0067] Furthermore, based on any of the above embodiments, the blue film defect determination module 500 may include: Blue membrane defect units are identified using a ConvNext classification network, which is used to detect the suspected defect areas and determine the blue membrane defect; wherein, the ConvNext classification network is trained using labeled blue membrane defect data; The blue film defect unit is determined using an SVM model, and the suspected defect area is detected using the SVM model to determine the blue film defect. The SVM model is a model obtained by training an SVM using the bounding rectangle of the region, the number of holes, the number of regions, the density, and the convexity features of the image.

[0068] Furthermore, based on the above embodiments, the determination of blue film defect units using the ConvNext classification network may include: The classification category determination subunit is used to detect the suspected defect area using the ConvNext classification network to obtain the classification category of the blue film defect; the classification category is the defect type and the defect size; The specification judgment subunit is used to determine whether the specification requirements are met based on the preset normal specifications corresponding to the classification category. The defect-free determination subunit is used to determine that the blue film is defect-free if the requirements are met. The defect specification value determination sub-unit is used to determine the existence of a defect if the requirements are not met, and to provide the corresponding defect specification value.

[0069] Furthermore, based on the above embodiments, the determination of blue film defect units using an SVM model may include: The inference subunit is used to input the bounding rectangle of the suspected defect area, the number of holes, the number of regions, the density, and the convexity features of the image into the SVM model for inference to determine the blue film defect category.

[0070] It should be noted that the order of the modules and units in the aforementioned blue film defect identification device can be changed without affecting the logic.

[0071] This invention provides a blue film defect identification device, which may include: a blue film full feature region determination module 100, used to perform feature localization on the image to be detected, determine the initial detection region of the blue film, and perform feature filtering on the initial detection region according to the actual situation of different products to determine the full feature region of the blue film; a blue film normal feature region determination module 200, used to determine the RGB channel image of the full feature region of the blue film, convert the RGB channel image to obtain a channel image including the S channel, and perform threshold segmentation on the B channel image and perform corresponding Blob analysis to obtain the normal feature region of the blue film; an initial defect region determination module 300, used to determine the initial defect region based on the full feature region of the blue film and the normal feature region of the blue film; a suspected defect region determination module 400, used to perform edge gradient detection on the S channel of the initial defect region, perform threshold segmentation and Blob analysis, and take the region with color change as the suspected defect region; and a blue film defect determination module 500, used to detect the suspected defect region using a feature detection algorithm to determine the blue film defect; wherein, the feature detection algorithm is an algorithm that uses the features of the suspected defect region to detect and determine the blue film defect category. Compared with the current manual detection of blue film defects, this application analyzes and processes the image to be detected, extracts the corresponding suspected defect areas, and then uses a feature detection algorithm to detect the suspected defect areas to determine the type of blue film defect. Furthermore, this embodiment improves the accuracy of subsequent blob analysis and thus the accuracy of initial detection region determination by performing threshold segmentation to amplify image features. It also directly removes normal blue film feature regions from all blue film feature regions, eliminating the need for feature analysis across all blue film feature regions, thereby improving the efficiency of initial defect region determination. Additionally, it enlarges the pixels of identified suspected defect regions to enhance image clarity and improve the accuracy of blue film defect detection. Moreover, by providing both ConvNext classification networks and SVM models for blue film defect detection, this embodiment increases the diversity of blue film defect detection methods. After detecting suspected defect regions using the ConvNext classification network, it further judges blue film defects based on preset normal specifications, improving the accuracy of blue film defect judgment. Finally, this embodiment utilizes multiple features, including the bounding rectangle, number of holes, number of regions, density, and image convexity, to perform blue film defect detection, further enhancing the accuracy of blue film defect detection.

[0072] The following describes a blue film defect identification device provided by an embodiment of the present invention. The blue film defect identification device described below and the blue film defect identification method described above can be referred to in correspondence.

[0073] Please refer to Figure 5 , Figure 5 A schematic diagram of a blue film defect identification device provided in an embodiment of the present invention may include: Memory 10 is used to store computer programs; The processor 20 is used to execute computer programs to implement the blue film defect identification method described above.

[0074] The memory 10, processor 20, and communication interface 30 all communicate with each other through the communication bus 40.

[0075] In this embodiment of the invention, the memory 10 is used to store one or more programs. The programs may include program code, which includes computer operation instructions. In this embodiment of the invention, the memory 10 may store programs for implementing the following functions: Feature localization is performed on the image to be tested to determine the initial detection area of ​​the blue film, and feature filtering is performed on the initial detection area according to the actual situation of different products to determine all feature areas of the blue film. The RGB channel images of all feature regions of the blue membrane are determined, and the RGB channel images are converted to obtain channel images including the S channel. After thresholding the B channel images, the corresponding Blob analysis is performed to obtain the normal feature regions of the blue membrane. The initial defect area is determined based on all characteristic areas of the blue film and the normal characteristic areas of the blue film. After edge gradient detection of the S-channel of the initial defect area, threshold segmentation and Blob analysis are performed to identify areas with color changes as suspected defect areas. The blue film defect is identified by detecting suspected defect areas using a feature detection algorithm. The feature detection algorithm is an algorithm that uses the features of suspected defect areas to detect and determine the type of blue film defect.

[0076] In one possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; and the data storage area may store data created during use.

[0077] Furthermore, memory 10 may include read-only memory and random access memory, providing instructions and data to the processor. A portion of the memory may also include NVRAM. The memory stores operating systems and operating instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and handling hardware-based tasks.

[0078] Processor 20 can be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field-programmable gate array, or other programmable logic device. Processor 20 can be a microprocessor or any conventional processor. Processor 20 can call programs stored in memory 10.

[0079] The communication interface 30 can be an interface for the communication module, used to connect with other devices or systems.

[0080] Of course, it should be noted that, Figure 5 The structure shown does not constitute a limitation on the blue film defect identification device in the embodiments of the present invention. In practical applications, the blue film defect identification device may include more than Figure 5 More or fewer components as shown, or combinations of certain components.

[0081] The readable storage medium provided in the embodiments of the present invention is described below. The readable storage medium described below can be referred to in correspondence with the blue film defect identification method described above.

[0082] The present invention also provides a readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described blue film defect identification method.

[0083] The readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0084] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0085] Those skilled in the art will further 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, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. 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.

[0086] Finally, it should be noted that in this document, relationships such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0087] The above provides a detailed description of the blue film defect identification method, apparatus, device, and readable storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for identifying blue film defects, characterized in that, include: Feature localization is performed on the image to be detected to determine the initial detection area of ​​the blue film, and interference information other than the blue film is removed from the initial detection area to determine all feature areas of the blue film. The RGB channel images of all feature regions of the blue film are determined, and the RGB channel images are converted to obtain channel images including the S channel. After thresholding the B channel image in the RGB channel image, the corresponding Blob analysis is performed to obtain the normal feature regions of the blue film. The initial defect area is determined based on all characteristic areas of the blue film and the normal characteristic areas of the blue film; Edge gradient detection is performed on the initial defect region of the S-channel image. After obtaining the edge gradient image, threshold segmentation and Blob analysis are performed on the edge gradient image, and the region with color change is identified as the suspected defect region. The suspected defect area is detected using a feature detection algorithm to determine the blue film defect; wherein, the feature detection algorithm is an algorithm that uses the features of the suspected defect area to detect and determine the type of blue film defect.

2. The blue film defect identification method according to claim 1, characterized in that, The step of performing feature localization on the image to be detected to determine the initial detection area of ​​the blue film includes: The image to be detected is subjected to threshold segmentation to obtain a segmented image; The segmented image is subjected to Blob analysis to obtain the initial detection region; the initial detection region is the region in the image that needs to be detected, located according to the corresponding features of the product.

3. The blue film defect identification method according to claim 1, characterized in that, The step of determining the initial defect region based on all characteristic regions of the blue film and the normal characteristic regions of the blue film includes: The normal feature regions of the blue film are removed from all feature regions of the blue film to obtain the initial defect region.

4. The blue film defect identification method according to claim 1, characterized in that, The step of using a feature detection algorithm to detect the suspected defect area and determine the blue film defect includes: The dimensions of the suspected defective region are expanded by pixels to obtain an expanded image. The blue film defect is determined by detecting the extended image using the aforementioned feature detection algorithm.

5. The blue film defect identification method according to any one of claims 1 to 4, characterized in that, The step of using a feature detection algorithm to detect the suspected defect area and determine the blue film defect includes: The suspected defect region is detected using a ConvNext classification network to determine the blue membrane defect; wherein, the ConvNext classification network is trained using labeled blue membrane defect data; Alternatively, an SVM model can be used to detect the suspected defective area and determine the blue film defect; the SVM model is a model obtained by training an SVM using the bounding rectangle of the region, the number of holes, the number of regions, the density, and the convexity features of the image.

6. The blue film defect identification method according to claim 5, characterized in that, The step of using a ConvNext classification network to detect the suspected defect area and determine the blue film defect includes: The suspected defect area is detected using the ConvNext classification network to obtain the classification category of the blue film defect; the classification category is the defect type and the defect size. Determine whether the specifications meet the requirements based on the preset normal specifications corresponding to the classification category; If the requirements are met, then the blue film is determined to be defect-free; If the requirements are not met, a defect is identified, and the corresponding defect specification value is given.

7. The blue film defect identification method according to claim 5, characterized in that, The step of using an SVM model to detect the suspected defect area and determine the blue film defect includes: The bounding rectangle of the suspected defect area, the number of holes, the number of regions, the density, and the convexity features of the image are input into the SVM model for inference to determine the blue film defect category.

8. A blue film defect identification device, characterized in that, include: The blue film feature region determination module is used to perform feature localization on the image to be detected, determine the initial detection region of the blue film, remove interference information other than the blue film in the initial detection region, and determine the entire feature region of the blue film. The blue film normal feature region determination module is used to determine the RGB channel image of all feature regions of the blue film, convert the RGB channel image to obtain a channel image including the S channel, and perform threshold segmentation on the B channel image in the RGB channel image, and then perform corresponding Blob analysis to obtain the normal feature region of the blue film. The initial defect region determination module is used to determine the initial defect region based on all feature regions of the blue film and the normal feature regions of the blue film; The suspected defect region determination module is used to perform edge gradient detection on the initial defect region of the S-channel image, and after obtaining the edge gradient image, to perform threshold segmentation and Blob analysis on the edge gradient image, and to identify the region with color change as the suspected defect region. The blue film defect determination module is used to detect the suspected defect area using a feature detection algorithm to determine the blue film defect; wherein, the feature detection algorithm is an algorithm that uses the features of the suspected defect area to detect and determine the type of blue film defect.

9. A blue film defect identification device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the blue film defect identification method as described in any one of claims 1 to 7.

10. A readable storage medium, characterized in that, The readable storage medium stores computer-executable instructions, which, when loaded and executed by a processor, implement the blue film defect identification method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • FPC defect detection method and system based on HSV and CNN, and storage medium

    CN114266743A

  • Blue film detection method, device and system

    CN117911420A