CN117635590A - Defect detection method, defect detection device and storage medium for notebook computer shell - Google Patents

Defect detection method, defect detection device and storage medium for notebook computer shell Download PDF

Info

Publication number
CN117635590A
CN117635590A CN202311702863.9A CN202311702863A CN117635590A CN 117635590 A CN117635590 A CN 117635590A CN 202311702863 A CN202311702863 A CN 202311702863A CN 117635590 A CN117635590 A CN 117635590A
Authority
CN
China
Prior art keywords
image
detected
difference
pixel
defect detection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311702863.9A
Other languages
Chinese (zh)
Inventor
雷晓宇
潘效田
李喜国
陈建华
余江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yingweisheng Technology Co ltd
Original Assignee
Shenzhen Yingweisheng Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yingweisheng Technology Co ltd filed Critical Shenzhen Yingweisheng Technology Co ltd
Priority to CN202311702863.9A priority Critical patent/CN117635590A/en
Publication of CN117635590A publication Critical patent/CN117635590A/en
Pending legal-status Critical Current

Links

Abstract

The invention is applicable to the technical field of image detection, and provides a defect detection method, a defect detection device and a storage medium for a notebook computer shell, wherein the defect detection method for the notebook computer shell comprises the following steps: the first image to be detected and the second image to be detected are obtained by acquiring the object to be detected on the same position. By comparing the target circumscribed rectangular frames with the standard images, the target circumscribed rectangular frames of the difference areas in the first image to be detected and the second image to be detected can be extracted respectively. And intercepting the first sub-image and the second sub-image from the first image to be detected and the second image to be detected according to the position information of the target circumscribed rectangular frame. The characteristics are processed and analyzed through a defect detection model, so that detection results aiming at defect types such as scratches, concave-convex, deformation, foreign matters, discoloration and the like can be obtained. In general, the technical scheme can realize defect type identification of objects such as a notebook computer shell and the like, and improve the detection precision and accuracy.

Description

Defect detection method, defect detection device and storage medium for notebook computer shell
Technical Field
The invention belongs to the technical field of image detection, and particularly relates to a defect detection method and device for a notebook computer shell.
Background
Housing defect detection refers to detecting the presence of defects or damage to the exterior surface of an object (e.g., a machine, an electronic product, an automobile, etc.) using various techniques and methods. These shell defects may be cracks, scratches, wear, deformation, etc. Defects in the housing may lead to weakening of the structure of the product, affecting its performance and life, and even bringing about a safety hazard.
In the conventional art, the detection of defects in a housing is often performed by using an ultrasonic detection technique that detects defects by transmitting high-frequency sound waves into the housing and then analyzing the characteristics of the sound waves propagating inside an object. When an acoustic wave encounters a defect, reflection or scattering occurs, so that the location and nature of the defect can be determined.
However, the conventional ultrasonic detection cannot detect the defect types of the defects of the housing, and the detection accuracy is low, which is a technical problem to be solved.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a defect detection method, a defect detection device and a storage medium for a notebook computer casing, so as to solve the technical problems that the traditional ultrasonic detection cannot detect the defect type of the casing defect separately, and the detection accuracy is low.
A first aspect of an embodiment of the present invention provides a method for detecting a defect of a notebook computer casing, where the method for detecting a defect of a notebook computer casing includes:
acquiring a first to-be-detected image corresponding to a top surface light source and a second to-be-detected image corresponding to a side surface light source of an object to be detected on the same position; the object to be detected comprises the notebook computer shell;
comparing the first image to be detected and the second image to be detected with a standard image respectively;
respectively extracting target circumscribed rectangular frames of difference areas in the first image to be detected and the second image to be detected; the difference region refers to a region where the first image to be detected or the second image to be detected is different from the standard image;
according to the position information corresponding to the target circumscribed rectangular frame, a first sub-image and a second sub-image are intercepted in the first image to be detected and the second image to be detected respectively;
extracting difference pixel points in the first sub-image and the second sub-image, and calculating pixel differences between two pixel points corresponding to the difference pixel points; the difference pixel points are pixel points with pixel differences of the same pixel positions in the first sub-image, the second sub-image and the standard image being larger than a first threshold value;
Forming a difference image according to the position of the difference pixel point and the pixel difference value;
inputting the first image to be detected into a first feature extraction layer of a defect detection model, inputting the second image to be detected into a second feature extraction layer of the defect detection model, and inputting the difference image into a third feature extraction layer of the defect detection model to obtain a defect detection result output by the defect detection model; the defect detection results include scratches, irregularities, deformations, foreign substances, and discoloration.
Further, the step of extracting the target circumscribed rectangular frames of the difference areas in the first to-be-detected image and the second to-be-detected image respectively includes:
traversing a difference region between the first image to be detected and the standard image;
traversing a difference region between the second image to be detected and the standard image;
and selecting a minimum circumscribed rectangular frame corresponding to the difference area with the most pixels as the target circumscribed rectangular frame.
Further, the step of traversing the difference region between the first image to be detected and the standard image includes:
graying the first image to be detected and the standard image to obtain a first gray level image and a second gray level image;
Identifying a first contour region and a second contour region in the first gray level image and the second gray level image through a contour identification algorithm;
aligning the first contour region and the second contour region, and traversing a difference pixel point between the first contour region and the second contour region;
and if the pixel difference value of the difference pixel points is larger than a second threshold value and the number of the adjacent difference pixel points exceeds the preset number, taking the corresponding region as the difference region.
Further, the step of forming a difference image according to the position of the difference pixel point and the pixel difference value includes:
generating a blank image according to the image size of the target circumscribed rectangular frame; the blank image refers to an image without pixel values;
in the blank image, setting a pixel point of a first pixel position as the pixel difference value according to the first pixel position of a difference pixel point corresponding to a first sub-image to obtain a first image;
in the blank image, setting a pixel point of a second pixel position as the pixel difference value according to the second pixel position of a difference pixel point corresponding to a second sub-image to obtain a second image;
And merging the first image and the second image to obtain the difference image.
Further, the defect detection model comprises a first feature extraction layer, a second feature extraction layer, a third feature extraction layer, a fourth feature extraction layer, a downsampling layer and a classifier;
the first image to be detected is processed by a first feature extraction layer to obtain a first feature image;
the second image to be detected is processed by a second feature extraction layer to obtain a second feature image;
the difference image is processed by a third feature extraction layer to obtain a third feature image;
calculating a first similarity between the third feature image and the first feature image;
calculating a second similarity between the third feature image and the second feature image;
if the first similarity is greater than the second similarity, fusing the third characteristic image and the first characteristic image to obtain a fused image;
if the first similarity is smaller than the second similarity, fusing the third characteristic image and the second characteristic image to obtain a fused image;
the fusion image is processed by the fourth feature extraction layer to obtain a fourth feature image;
And the fourth characteristic image is processed by the downsampling layer and the classifier to obtain the defect detection result.
Further, before the step of obtaining the first to-be-detected image corresponding to the top surface light source and the second to-be-detected image corresponding to the side surface light source, the method further includes:
acquiring an initial model and a plurality of training samples, wherein each training sample comprises a first sample image, a second sample image, a sample difference image and a label;
randomly selecting a preset number of training samples from a plurality of training samples, and performing interference processing on the preset number of training samples to obtain a plurality of interference samples;
and training the initial model through a plurality of training samples and a plurality of interference samples to obtain the defect detection model.
Further, the step of randomly selecting a preset number of training samples from the plurality of training samples, and performing interference processing on the preset number of training samples to obtain a plurality of interference samples includes:
randomly selecting a preset number of training samples from a plurality of training samples;
substituting the training sample input into the following formula, and obtaining the target iteration interference sample after K iterations;
The formula is:
wherein,representing a current iteration interference sample, wherein the current iteration interference sample of the Kth iteration is the target iteration interference sample,>representing the last iteration interference sample, alpha representing the hyper-parameter controlling the iteration step, and +.>Representing the gradient of the training sample, L representing the loss function, y representing the label corresponding to the original sample, pi x+s Representing the projection operation, sign () represents a sign function.
A second aspect of an embodiment of the present invention provides a defect detecting device for a notebook computer casing, including:
the acquisition unit is used for acquiring a first image to be detected corresponding to the top surface light source and a second image to be detected corresponding to the side surface light source, wherein the first image to be detected and the second image to be detected are positioned at the same position of the object to be detected; the object to be detected comprises the notebook computer shell;
the comparison unit is used for comparing the first image to be detected and the second image to be detected with the standard image respectively;
the extraction unit is used for respectively extracting target circumscribed rectangular frames of difference areas in the first image to be detected and the second image to be detected; the difference region refers to a region where the first image to be detected or the second image to be detected is different from the standard image;
The intercepting unit is used for intercepting a first sub-image and a second sub-image in the first image to be detected and the second image to be detected respectively according to the position information corresponding to the target external rectangular frame;
a first calculating unit, configured to extract difference pixel points in the first sub-image and the second sub-image, and calculate a pixel difference between two pixel points corresponding to the difference pixel points; the difference pixel points are pixel points with pixel differences of the same pixel positions in the first sub-image, the second sub-image and the standard image being larger than a first threshold value;
the processing unit is used for forming a difference image according to the positions of the difference pixel points and the pixel difference values;
the second computing unit is used for inputting the first image to be detected into a first feature extraction layer of a defect detection model, inputting the second image to be detected into a second feature extraction layer of the defect detection model, and inputting the difference image into a third feature extraction layer of the defect detection model to obtain a defect detection result output by the defect detection model; the defect detection results include scratches, irregularities, deformations, foreign substances, and discoloration.
A third aspect of an embodiment of the present invention provides a terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method of the first aspect when executing the computer program.
A fourth aspect of the embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method of the first aspect.
Compared with the prior art, the embodiment of the invention has the beneficial effects that: the method comprises the steps of obtaining a first image to be detected corresponding to a top surface light source and a second image to be detected corresponding to a side surface light source on the same position of an object to be detected; comparing the first image to be detected and the second image to be detected with a standard image respectively; respectively extracting target circumscribed rectangular frames of difference areas in the first image to be detected and the second image to be detected; the difference region refers to a region where the first image to be detected or the second image to be detected is different from the standard image; according to the position information corresponding to the target circumscribed rectangular frame, a first sub-image and a second sub-image are intercepted in the first image to be detected and the second image to be detected respectively; extracting difference pixel points in the first sub-image and the second sub-image, and calculating pixel differences between two pixel points corresponding to the difference pixel points; the difference pixel points are pixel points with pixel differences of the same pixel positions in the first sub-image, the second sub-image and the standard image being larger than a first threshold value; forming a difference image according to the position of the difference pixel point and the pixel difference value; inputting the first image to be detected into a first feature extraction layer of a defect detection model, inputting the second image to be detected into a second feature extraction layer of the defect detection model, and inputting the difference image into a third feature extraction layer of the defect detection model to obtain a defect detection result output by the defect detection model; the defect detection results include scratches, irregularities, deformations, foreign substances, and discoloration. According to the scheme, the first to-be-detected image corresponding to the top surface light source and the second to-be-detected image corresponding to the side surface light source are obtained, and the comparison and analysis can be performed by comprehensively utilizing the image information of a plurality of angles, so that the accuracy of detecting the defects of the shell is improved. By comparing the target circumscribed rectangular frames with the standard images, the target circumscribed rectangular frames of the difference areas in the first image to be detected and the second image to be detected can be extracted respectively. The difference region refers to a region which is different from the standard image, so that a potential shell defect region can be rapidly positioned. And intercepting the first sub-image and the second sub-image from the first image to be detected and the second image to be detected according to the position information of the target circumscribed rectangular frame. By doing so, the method can focus on a difference area, reduce the interference of irrelevant information and improve the detection precision. And extracting difference pixel points in the difference sub-image, and calculating pixel differences between the pixel points. The difference pixel points are pixel points with pixel difference values of the same pixel position larger than a set threshold value. By calculating the amount of pixel difference, the degree of difference can be quantified, and different types of defects can be further identified and classified. The method comprises the steps of inputting the features of a first image to be detected into a first feature extraction layer of a defect detection model, inputting the features of a second image to be detected into a second feature extraction layer of the defect detection model, and inputting a difference image into a third feature extraction layer of the defect detection model. The characteristics are processed and analyzed through a defect detection model, so that detection results aiming at defect types such as scratches, concave-convex, deformation, foreign matters, discoloration and the like can be obtained. In general, the technical scheme can realize defect type identification of objects such as notebook computer shells and the like and improve the detection precision and accuracy by integrating the steps of multi-angle information, difference region extraction, sub-image extraction, pixel difference calculation, defect detection model analysis and the like.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are required to be used in the embodiments or the related technical descriptions will be briefly described, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
FIG. 1 is a schematic flow chart of a method for detecting defects of a notebook computer casing;
FIG. 2 is a schematic diagram of a defect detecting device for a notebook computer casing according to an embodiment of the present invention;
fig. 3 shows a schematic diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
The embodiment of the invention provides a defect detection method, a defect detection device and a storage medium for a notebook computer shell, which are used for solving the technical problems that the traditional ultrasonic detection cannot detect the defect types of shell defects respectively and the detection precision is low.
Firstly, the invention provides a defect detection method for a notebook computer shell. Referring to fig. 1, fig. 1 is a schematic flow chart of a defect detection method for a notebook computer casing according to the present invention. As shown in fig. 1, the defect detection method for a notebook computer case may include the following steps:
step 101: acquiring a first to-be-detected image corresponding to a top surface light source and a second to-be-detected image corresponding to a side surface light source of an object to be detected on the same position; the object to be detected comprises the notebook computer shell;
in order to obtain defect information of the notebook computer shell more accurately, the method and the device respectively obtain a first to-be-detected image corresponding to the top surface light source and a second to-be-detected image corresponding to the side surface light source on the same position of the to-be-detected object.
The notebook computer shell is transmitted to an image acquisition area by a transmission module, and a top surface light source and a side surface light source are arranged in the image acquisition area. When the top light source is turned on and the side light source is turned off, the image pickup device picks up a first image to be detected. When the top light source is turned off and the side light source is turned on, the image pickup device picks up a second image to be detected.
It is noted that, due to defects of the case such as unevenness, deformation, or foreign matter, different bright areas and shadow areas appear on the defective surface by the light source irradiated by the top surface light source and the side surface light source. Therefore, the defect type is comprehensively detected and the defect detection precision is improved by acquiring the first to-be-detected image corresponding to the top light source and the second to-be-detected image corresponding to the side light source.
Step 102: comparing the first image to be detected and the second image to be detected with a standard image respectively;
the standard image refers to the image corresponding to the defect-free shell. And comparing the first image to be detected and the second image to be detected with the standard image respectively, and determining whether the shells in the first image to be detected and the second image to be detected have suspected defects or not.
Step 103: respectively extracting target circumscribed rectangular frames of difference areas in the first image to be detected and the second image to be detected; the difference region refers to a region where the first image to be detected or the second image to be detected is different from the standard image;
specifically, step 103 specifically includes steps 1031 to 1033:
step 1031: traversing a difference region between the first image to be detected and the standard image;
Specifically, step 1031 includes steps a through D:
step A: graying the first image to be detected and the standard image to obtain a first gray level image and a second gray level image;
if the shell has defects, bright areas and shadow areas can appear in the defect areas after the shell is irradiated by a top surface light source or a side surface light source. If the shell has no defects, the brightness of the surface of the shell is more gentle after the shell is irradiated by the top surface light source or the side surface light source. Therefore, only the gray level image is needed to be compared to obtain the difference region. Therefore, the first image to be detected and the standard image are subjected to graying processing to obtain the first gray image and the second gray image, so that unnecessary calculation amount is reduced.
And (B) step (B): identifying a first contour region and a second contour region in the first gray level image and the second gray level image through a contour identification algorithm;
because the area outside the shell is not required to be analyzed, the first contour area and the second contour area in the first gray level image and the second gray level image are identified through the contour identification algorithm, and then the first contour area and the second contour area are intercepted, so that unnecessary calculation amount is reduced.
Step C: aligning the first contour region and the second contour region, and traversing a difference pixel point between the first contour region and the second contour region;
because the first image to be detected and the standard image are shot at the same height and the same position, the sizes of the shell image areas of the first image to be detected and the standard image are consistent. In order to better compare the difference between the first image to be detected and the standard image, it is necessary to align the first contour region and the second contour region and traverse the difference pixel points between the first contour region and the second contour region. The difference pixel points are pixel points with pixel differences of the same pixel positions in the first contour area and the second contour area being larger than a second threshold value.
Step D: and if the pixel difference value of the difference pixel points is larger than a second threshold value and the number of the adjacent difference pixel points exceeds the preset number, taking the corresponding region as the difference region.
In this embodiment, graying processing is performed on the first image to be detected and the standard image, so as to obtain a first gray level image and a second gray level image. And identifying a first contour region and a second contour region in the first gray level image and the second gray level image through a contour identification algorithm. The first contour region and the second contour region are aligned and the difference pixel point between them is traversed. And if the pixel difference value of the difference pixel points is larger than a second threshold value and the number of adjacent difference pixel points exceeds a preset number, taking the corresponding area as a difference area. According to the technical scheme, the difference area can be extracted from the first image to be detected and the standard image. These difference regions represent the difference between the two images, with a higher extraction accuracy.
Step 1032: traversing a difference region between the second image to be detected and the standard image;
the calculation logic of step 1032 is identical to that of step 1031, please refer to the calculation logic of step 1031, and further description is omitted herein.
Step 1033: and selecting a minimum circumscribed rectangular frame corresponding to the difference area with the most pixels as the target circumscribed rectangular frame.
In order to ensure that effective pixel information is reserved as far as possible, the method selects a minimum circumscribed rectangular frame corresponding to a difference area with the most pixels as a target circumscribed rectangular frame.
In the present embodiment, two input images, a first image to be detected and a standard image, respectively, are required. The two images should have the same size and scale. First, a difference region between a first image to be detected and a standard image is traversed. By comparing the differences of the pixel points, the difference between the two images is determined. In the difference region between the first image to be detected and the standard image, a difference region having the most pixels is selected. This can be achieved by calculating the number of pixels of the difference region. After the difference area with the most pixels is selected, the minimum circumscribed rectangular frame corresponding to the area is extracted. The circumscribed rectangle is the smallest rectangle that encloses the difference region. Finally, the extracted circumscribed rectangle frame is taken as a target circumscribed rectangle frame. This circumscribed rectangular frame can accurately enclose the region of maximum difference from the standard image. According to the technical scheme, the extraction of the target circumscribed rectangular frame is realized by comparing the difference areas between the two images and extracting the smallest circumscribed rectangular frame with the most difference pixels. This method can quickly and accurately find the target area.
Step 104: according to the position information corresponding to the target circumscribed rectangular frame, a first sub-image and a second sub-image are intercepted in the first image to be detected and the second image to be detected respectively;
and intercepting a first sub-image from the position information corresponding to the circumscribed rectangular frame of the target in the first image to be detected. And intercepting a second sub-image from the position information corresponding to the target circumscribed rectangular frame in the second image to be detected.
Step 105: extracting difference pixel points in the first sub-image and the second sub-image, and calculating pixel differences between two pixel points corresponding to the difference pixel points; the difference pixel points are pixel points with pixel differences of the same pixel positions in the first sub-image, the second sub-image and the standard image being larger than a first threshold value;
and aligning the first sub-image with the shell image in the standard image, comparing pixel differences of the same pixel positions between the two images, and taking the pixel point as a difference pixel point if the pixel differences of the same pixel positions are larger than a first threshold value.
And aligning the second sub-image with the shell image in the standard image, comparing pixel differences of the same pixel positions between the two images, and taking the pixel point as a difference pixel point if the pixel differences of the same pixel positions are larger than a first threshold value.
Step 106: forming a difference image according to the position of the difference pixel point and the pixel difference value;
in order to better extract the shell defect characteristics, the application forms a difference image according to the positions of the difference pixel points and the pixel difference values, and the specific logic is as follows:
specifically, step 106 specifically includes steps 1061 to 1064:
step 1061: generating a blank image according to the image size of the target circumscribed rectangular frame; the blank image refers to an image without pixel values;
step 1062: in the blank image, setting a pixel point of a first pixel position as the pixel difference value according to the first pixel position of a difference pixel point corresponding to a first sub-image to obtain a first image;
step 1063: in the blank image, setting a pixel point of a second pixel position as the pixel difference value according to the second pixel position of a difference pixel point corresponding to a second sub-image to obtain a second image;
step 1064: and merging the first image and the second image to obtain the difference image.
In order to further highlight the difference region, the present application superimposes the two images, i.e. the first image and the second image are combined, resulting in a difference image.
In this embodiment, a blank image is generated according to the image size of the target circumscribed rectangular frame. This blank image refers to an image without any pixel values. In the blank image, according to a first pixel position of a difference pixel point corresponding to the first sub-image, setting the pixel point at the position as a pixel difference value. This means that using the first sub-image as a reference, it is determined which pixels in the blank image need to be filled in order to reflect the difference between the first sub-image and the target. Similarly, in the blank image, according to the second pixel position of the difference pixel point corresponding to the second sub-image, the pixel point at the position is set as a pixel difference value. This means that the second sub-image is used as a reference, with its difference pixels added to the blank image to reflect the difference between the second sub-image and the target. And finally, merging the first image and the second image to obtain a final difference image. This difference image will contain the result of the superposition of the difference pixels of the two sub-images. The technical scheme has the effect that a difference image is generated, and the difference condition of the two sub-images relative to the target can be intuitively displayed by the image. The pixel values in the difference image represent the pixel difference magnitudes of the two sub-images at the corresponding locations. By the scheme, sufficient data preparation can be provided for subsequent feature extraction.
Step 107: inputting the first image to be detected into a first feature extraction layer of a defect detection model, inputting the second image to be detected into a second feature extraction layer of the defect detection model, and inputting the difference image into a third feature extraction layer of the defect detection model to obtain a defect detection result output by the defect detection model; the defect detection results include scratches, irregularities, deformations, foreign substances, and discoloration.
The network structure in the defect detection model includes, but is not limited to, a first feature extraction layer, a second feature extraction layer, a third feature extraction layer, a fourth feature extraction layer, a downsampling layer, a classifier, and the like.
The specific execution logic of the defect detection model is as follows: the first image to be detected is processed by a first feature extraction layer to obtain a first feature image; the second image to be detected is processed by a second feature extraction layer to obtain a second feature image; the difference image is processed by a third feature extraction layer to obtain a third feature image; calculating a first similarity between the third feature image and the first feature image; calculating a second similarity between the third feature image and the second feature image; if the first similarity is greater than the second similarity, fusing the third characteristic image and the first characteristic image to obtain a fused image; if the first similarity is smaller than the second similarity, fusing the third characteristic image and the second characteristic image to obtain a fused image; the fusion image is processed by the fourth feature extraction layer to obtain a fourth feature image; and the fourth characteristic image is processed by the downsampling layer and the classifier to obtain the defect detection result.
The defect detection model achieves defect detection by using a plurality of feature extraction layers and similarity calculations. Firstly, a first image to be detected is processed by a first feature extraction layer to obtain a first feature image; and simultaneously, the second image to be detected is processed by a second feature extraction layer to obtain a second feature image. Then, the difference image is processed by a third feature extraction layer to obtain a third feature image. Next, a first similarity between the third feature image and the first feature image is calculated, and a second similarity between the third feature image and the second feature image is calculated. If the first similarity is greater than the second similarity, fusing the third characteristic image and the first characteristic image to obtain a fused image; if the first similarity is smaller than the second similarity, the third characteristic image and the second characteristic image are fused to obtain a fused image. And secondly, processing the fused image through a fourth feature extraction layer to obtain a fourth feature image. And finally, processing the fourth characteristic image through a downsampling layer and a classifier to obtain a defect detection result. The invention point of the technical proposal is to use the similarity to fusion the characteristic images. And comparing the similarity between the third characteristic image and the first and second characteristic images, and selecting more similar characteristic images for fusion so as to improve the detection precision and accuracy. In addition, using multiple feature extraction layers and classifiers can capture more abundant feature information and output final defect detection results through downsampling and classifier combinations. The technical scheme has the advantages that the information and similarity calculation of the plurality of feature extraction layers can be comprehensively utilized to perform image fusion, so that the accuracy and the robustness of defect detection are improved. By gradually processing and fusing the images with different characteristics, key characteristics in the images can be effectively extracted, and misjudgment or omission is reduced.
In this embodiment, by acquiring a first to-be-detected image corresponding to the top light source and a second to-be-detected image corresponding to the side light source, where the to-be-detected object is at the same position; comparing the first image to be detected and the second image to be detected with a standard image respectively; respectively extracting target circumscribed rectangular frames of difference areas in the first image to be detected and the second image to be detected; the difference region refers to a region where the first image to be detected or the second image to be detected is different from the standard image; according to the position information corresponding to the target circumscribed rectangular frame, a first sub-image and a second sub-image are intercepted in the first image to be detected and the second image to be detected respectively; extracting difference pixel points in the first sub-image and the second sub-image, and calculating pixel differences between two pixel points corresponding to the difference pixel points; the difference pixel points are pixel points with pixel differences of the same pixel positions in the first sub-image, the second sub-image and the standard image being larger than a first threshold value; forming a difference image according to the position of the difference pixel point and the pixel difference value; inputting the first image to be detected into a first feature extraction layer of a defect detection model, inputting the second image to be detected into a second feature extraction layer of the defect detection model, and inputting the difference image into a third feature extraction layer of the defect detection model to obtain a defect detection result output by the defect detection model; the defect detection results include scratches, irregularities, deformations, foreign substances, and discoloration. According to the scheme, the first to-be-detected image corresponding to the top surface light source and the second to-be-detected image corresponding to the side surface light source are obtained, and the comparison and analysis can be performed by comprehensively utilizing the image information of a plurality of angles, so that the accuracy of detecting the defects of the shell is improved. Difference region extraction: by comparing the target circumscribed rectangular frames with the standard images, the target circumscribed rectangular frames of the difference areas in the first image to be detected and the second image to be detected can be extracted respectively. The difference region refers to a region which is different from the standard image, so that a potential shell defect region can be rapidly positioned. And intercepting the first sub-image and the second sub-image from the first image to be detected and the second image to be detected according to the position information of the target circumscribed rectangular frame. By doing so, the method can focus on a difference area, reduce the interference of irrelevant information and improve the detection precision. And extracting difference pixel points in the difference sub-image, and calculating pixel differences between the pixel points. The difference pixel points are pixel points with pixel difference values of the same pixel position larger than a set threshold value. By calculating the amount of pixel difference, the degree of difference can be quantified, and different types of defects can be further identified and classified. The method comprises the steps of inputting the features of a first image to be detected into a first feature extraction layer of a defect detection model, inputting the features of a second image to be detected into a second feature extraction layer of the defect detection model, and inputting a difference image into a third feature extraction layer of the defect detection model. The characteristics are processed and analyzed through a defect detection model, so that detection results aiming at defect types such as scratches, concave-convex, deformation, foreign matters, discoloration and the like can be obtained. In general, the technical scheme can realize defect type identification of objects such as notebook computer shells and the like and improve the detection precision and accuracy by integrating the steps of multi-angle information, difference region extraction, sub-image extraction, pixel difference calculation, defect detection model analysis and the like.
Optionally, before step 101, steps 11 to 13 are further included:
step 11: acquiring an initial model and a plurality of training samples, wherein each training sample comprises a first sample image, a second sample image, a sample difference image and a label;
step 12: randomly selecting a preset number of training samples from a plurality of training samples, and performing interference processing on the preset number of training samples to obtain a plurality of interference samples;
specifically, step 12 specifically includes:
randomly selecting a preset number of training samples from a plurality of training samples;
substituting the training sample input into the following formula, and obtaining the target iteration interference sample after K iterations;
the formula is:
wherein,representing a current iteration interference sample, wherein the current iteration interference sample of the Kth iteration is the target iteration interference sample,>representing the last iteration interference sample, alpha representing the hyper-parameter controlling the iteration step, and +.>Representing the gradient of the training sample, L representing the loss function, y representing the label corresponding to the original sample, pi x+s Representing the projection operation, sign () represents a sign function.
Step 13: and training the initial model through a plurality of training samples and a plurality of interference samples to obtain the defect detection model.
In this embodiment, data is obtained from an initial model and a plurality of training samples. Each training sample includes a first sample image, a second sample image, a sample difference image, and a corresponding label. And randomly selecting a certain number of samples from the plurality of training samples to form a preset number of training sample sets. This ensures diversity and representativeness of the training set. And performing interference processing on the selected training samples to generate a plurality of interference samples. The interference processing may include performing transformation operations such as rotation, scaling, translation, etc. on the image to increase the diversity of the training samples. And fusing the characteristic images in the training samples and the interference samples by using a similarity calculation method. The detection capability of the model on the target defects can be enhanced by fusing the characteristic images with higher similarity. And using the fused characteristic images as input data, and performing iterative optimization on the initial model through a training process. The training process may employ conventional supervised learning algorithms, such as Convolutional Neural Networks (CNNs), and the like. After multiple rounds of training, an optimized defect detection model is obtained. The model can provide more accurate and robust results according to the fused characteristic images when detecting defects. Through the steps, the technical scheme fully utilizes a plurality of training samples and interference samples, combines similarity calculation to perform feature image fusion, and improves the accuracy and stability of the defect detection model. Compared with the traditional method, the method is beneficial to improving the generalization capability of the model and is suitable for various defect detection scenes.
Referring to fig. 2, fig. 2 is a schematic diagram showing a defect detecting device 2 for a notebook computer casing according to the present invention, and fig. 2 shows a defect detecting device for a notebook computer casing according to the present invention, which includes:
an acquiring unit 21, configured to acquire a first image to be detected corresponding to a top light source and a second image to be detected corresponding to a side light source, where the objects to be detected are at the same position; the object to be detected comprises the notebook computer shell;
a comparing unit 22, configured to compare the first to-be-detected image and the second to-be-detected image with standard images respectively;
an extracting unit 23, configured to extract target circumscribed rectangular frames of difference regions in the first to-be-detected image and the second to-be-detected image respectively; the difference region refers to a region where the first image to be detected or the second image to be detected is different from the standard image;
the intercepting unit 24 is configured to intercept a first sub-image and a second sub-image in the first to-be-detected image and the second to-be-detected image respectively according to position information corresponding to the target circumscribed rectangular frame;
A first calculating unit 25, configured to extract difference pixel points in the first sub-image and the second sub-image, and calculate a pixel difference between two pixel points corresponding to the difference pixel points; the difference pixel points are pixel points with pixel differences of the same pixel positions in the first sub-image, the second sub-image and the standard image being larger than a first threshold value;
a processing unit 26, configured to form a difference image according to the position of the difference pixel point and the pixel difference value;
a second calculating unit 27, configured to input the first image to be detected into a first feature extraction layer of a defect detection model, input the second image to be detected into a second feature extraction layer of the defect detection model, and input the difference image into a third feature extraction layer of the defect detection model, so as to obtain a defect detection result output by the defect detection model; the defect detection results include scratches, irregularities, deformations, foreign substances, and discoloration.
According to the defect detection device for the notebook computer shell, the first to-be-detected image corresponding to the top surface light source and the second to-be-detected image corresponding to the side surface light source are obtained by acquiring the to-be-detected object at the same position; comparing the first image to be detected and the second image to be detected with a standard image respectively; respectively extracting target circumscribed rectangular frames of difference areas in the first image to be detected and the second image to be detected; the difference region refers to a region where the first image to be detected or the second image to be detected is different from the standard image; according to the position information corresponding to the target circumscribed rectangular frame, a first sub-image and a second sub-image are intercepted in the first image to be detected and the second image to be detected respectively; extracting difference pixel points in the first sub-image and the second sub-image, and calculating pixel differences between two pixel points corresponding to the difference pixel points; the difference pixel points are pixel points with pixel differences of the same pixel positions in the first sub-image, the second sub-image and the standard image being larger than a first threshold value; forming a difference image according to the position of the difference pixel point and the pixel difference value; inputting the first image to be detected into a first feature extraction layer of a defect detection model, inputting the second image to be detected into a second feature extraction layer of the defect detection model, and inputting the difference image into a third feature extraction layer of the defect detection model to obtain a defect detection result output by the defect detection model; the defect detection results include scratches, irregularities, deformations, foreign substances, and discoloration. According to the scheme, the first to-be-detected image corresponding to the top surface light source and the second to-be-detected image corresponding to the side surface light source are obtained, and the comparison and analysis can be performed by comprehensively utilizing the image information of a plurality of angles, so that the accuracy of detecting the defects of the shell is improved. Difference region extraction: by comparing the target circumscribed rectangular frames with the standard images, the target circumscribed rectangular frames of the difference areas in the first image to be detected and the second image to be detected can be extracted respectively. The difference region refers to a region which is different from the standard image, so that a potential shell defect region can be rapidly positioned. And intercepting the first sub-image and the second sub-image from the first image to be detected and the second image to be detected according to the position information of the target circumscribed rectangular frame. By doing so, the method can focus on a difference area, reduce the interference of irrelevant information and improve the detection precision. And extracting difference pixel points in the difference sub-image, and calculating pixel differences between the pixel points. The difference pixel points are pixel points with pixel difference values of the same pixel position larger than a set threshold value. By calculating the amount of pixel difference, the degree of difference can be quantified, and different types of defects can be further identified and classified. The method comprises the steps of inputting the features of a first image to be detected into a first feature extraction layer of a defect detection model, inputting the features of a second image to be detected into a second feature extraction layer of the defect detection model, and inputting a difference image into a third feature extraction layer of the defect detection model. The characteristics are processed and analyzed through a defect detection model, so that detection results aiming at defect types such as scratches, concave-convex, deformation, foreign matters, discoloration and the like can be obtained. In general, the technical scheme can realize defect type identification of objects such as notebook computer shells and the like and improve the detection precision and accuracy by integrating the steps of multi-angle information, difference region extraction, sub-image extraction, pixel difference calculation, defect detection model analysis and the like.
Fig. 3 is a schematic diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 3, a terminal device 3 of this embodiment includes: a processor 30, a memory 31 and a computer program 32 stored in said memory 31 and executable on said processor 30, for example a program for defect detection of a notebook computer casing. The processor 30, when executing the computer program 32, implements the steps of the above-described embodiments of the method for detecting defects in a notebook computer casing, such as steps 101 to 107 shown in fig. 1. Alternatively, the processor 30, when executing the computer program 32, performs the functions of the units in the above-described device embodiments, such as the functions of the units 21 to 27 shown in fig. 2.
By way of example, the computer program 32 may be divided into one or more units, which are stored in the memory 31 and executed by the processor 30 to complete the present invention. The one or more units may be a series of computer program instruction segments capable of performing a specific function describing the execution of the computer program 32 in the one terminal device 3. For example, the computer program 32 may be partitioned into units having the following specific functions:
The acquisition unit is used for acquiring a first image to be detected corresponding to the top surface light source and a second image to be detected corresponding to the side surface light source, wherein the first image to be detected and the second image to be detected are positioned at the same position of the object to be detected; the object to be detected comprises the notebook computer shell;
the comparison unit is used for comparing the first image to be detected and the second image to be detected with the standard image respectively;
the extraction unit is used for respectively extracting target circumscribed rectangular frames of difference areas in the first image to be detected and the second image to be detected; the difference region refers to a region where the first image to be detected or the second image to be detected is different from the standard image;
the intercepting unit is used for intercepting a first sub-image and a second sub-image in the first image to be detected and the second image to be detected respectively according to the position information corresponding to the target external rectangular frame;
a first calculating unit, configured to extract difference pixel points in the first sub-image and the second sub-image, and calculate a pixel difference between two pixel points corresponding to the difference pixel points; the difference pixel points are pixel points with pixel differences of the same pixel positions in the first sub-image, the second sub-image and the standard image being larger than a first threshold value;
The processing unit is used for forming a difference image according to the positions of the difference pixel points and the pixel difference values;
the second computing unit is used for inputting the first image to be detected into a first feature extraction layer of a defect detection model, inputting the second image to be detected into a second feature extraction layer of the defect detection model, and inputting the difference image into a third feature extraction layer of the defect detection model to obtain a defect detection result output by the defect detection model; the defect detection results include scratches, irregularities, deformations, foreign substances, and discoloration.
Including but not limited to a processor 30 and a memory 31. It will be appreciated by those skilled in the art that fig. 3 is merely an example of one type of terminal device 3 and is not meant to be limiting as to one type of terminal device 3, and may include more or fewer components than shown, or may combine certain components, or different components, e.g., the one type of terminal device may also include input and output devices, network access devices, buses, etc.
The processor 30 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 31 may be an internal storage unit of the terminal device 3, such as a hard disk or a memory of the terminal device 3. The memory 31 may also be an external storage device of the terminal device 3, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the terminal device 3. Further, the memory 31 may also include both an internal storage unit and an external storage device of the one terminal device 3. The memory 31 is used for storing the computer program and other programs and data required for the one roaming control device. The memory 31 may also be used for temporarily storing data that has been output or is to be output.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present invention, specific functions and technical effects thereof may be referred to in the method embodiment section, and will not be described herein.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules, so as to perform all or part of the functions described above. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present invention. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
Embodiments of the present invention also provide a computer readable storage medium storing a computer program which, when executed by a processor, implements steps for implementing the various method embodiments described above.
Embodiments of the present invention provide a computer program product which, when run on a mobile terminal, causes the mobile terminal to perform steps that enable the implementation of the method embodiments described above.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present invention may implement all or part of the flow of the method of the above embodiments, and may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing device/terminal apparatus, recording medium, computer Memory, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), electrical carrier signals, telecommunications signals, and software distribution media. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/network device and method may be implemented in other manners. For example, the apparatus/network device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in the present description and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to a detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is monitored" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon monitoring a [ described condition or event ]" or "in response to monitoring a [ described condition or event ]".
Furthermore, the terms "first," "second," "third," and the like in the description of the present specification and in the appended claims, are used for distinguishing between descriptions and not necessarily for indicating or implying a relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the invention. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (10)

1. The defect detection method for the notebook computer shell is characterized by comprising the following steps of:
acquiring a first to-be-detected image corresponding to a top surface light source and a second to-be-detected image corresponding to a side surface light source of an object to be detected on the same position; the object to be detected comprises the notebook computer shell;
comparing the first image to be detected and the second image to be detected with a standard image respectively;
respectively extracting target circumscribed rectangular frames of difference areas in the first image to be detected and the second image to be detected; the difference region refers to a region where the first image to be detected or the second image to be detected is different from the standard image;
according to the position information corresponding to the target circumscribed rectangular frame, a first sub-image and a second sub-image are intercepted in the first image to be detected and the second image to be detected respectively;
extracting difference pixel points in the first sub-image and the second sub-image, and calculating pixel differences between two pixel points corresponding to the difference pixel points; the difference pixel points are pixel points with pixel differences of the same pixel positions in the first sub-image, the second sub-image and the standard image being larger than a first threshold value;
Forming a difference image according to the position of the difference pixel point and the pixel difference value;
inputting the first image to be detected into a first feature extraction layer of a defect detection model, inputting the second image to be detected into a second feature extraction layer of the defect detection model, and inputting the difference image into a third feature extraction layer of the defect detection model to obtain a defect detection result output by the defect detection model; the defect detection results include scratches, irregularities, deformations, foreign substances, and discoloration.
2. The method for detecting defects of a notebook computer casing according to claim 1, wherein the step of extracting the target circumscribed rectangular frame of the difference region in the first image to be detected and the second image to be detected, respectively, comprises:
traversing a difference region between the first image to be detected and the standard image;
traversing a difference region between the second image to be detected and the standard image;
and selecting a minimum circumscribed rectangular frame corresponding to the difference area with the most pixels as the target circumscribed rectangular frame.
3. The method of detecting defects of a notebook computer casing according to claim 2, wherein the step of traversing a difference region between the first image to be detected and the standard image includes:
Graying the first image to be detected and the standard image to obtain a first gray level image and a second gray level image;
identifying a first contour region and a second contour region in the first gray level image and the second gray level image through a contour identification algorithm;
aligning the first contour region and the second contour region, and traversing a difference pixel point between the first contour region and the second contour region;
and if the pixel difference value of the difference pixel points is larger than a second threshold value and the number of the adjacent difference pixel points exceeds the preset number, taking the corresponding region as the difference region.
4. The method of claim 1, wherein the forming a difference image according to the positions of the difference pixels and the pixel differences comprises:
generating a blank image according to the image size of the target circumscribed rectangular frame; the blank image refers to an image without pixel values;
in the blank image, setting a pixel point of a first pixel position as the pixel difference value according to the first pixel position of a difference pixel point corresponding to a first sub-image to obtain a first image;
In the blank image, setting a pixel point of a second pixel position as the pixel difference value according to the second pixel position of a difference pixel point corresponding to a second sub-image to obtain a second image;
and merging the first image and the second image to obtain the difference image.
5. The method for detecting defects of a notebook computer casing according to claim 1, wherein the defect detection model comprises a first feature extraction layer, a second feature extraction layer, a third feature extraction layer, a fourth feature extraction layer, a downsampling layer and a classifier;
the first image to be detected is processed by a first feature extraction layer to obtain a first feature image;
the second image to be detected is processed by a second feature extraction layer to obtain a second feature image;
the difference image is processed by a third feature extraction layer to obtain a third feature image;
calculating a first similarity between the third feature image and the first feature image;
calculating a second similarity between the third feature image and the second feature image;
if the first similarity is greater than the second similarity, fusing the third characteristic image and the first characteristic image to obtain a fused image;
If the first similarity is smaller than the second similarity, fusing the third characteristic image and the second characteristic image to obtain a fused image;
the fusion image is processed by the fourth feature extraction layer to obtain a fourth feature image;
and the fourth characteristic image is processed by the downsampling layer and the classifier to obtain the defect detection result.
6. The method for detecting defects of a notebook computer casing according to claim 1, further comprising, before the step of acquiring the first image to be detected corresponding to the top light source and the second image to be detected corresponding to the side light source, the object to be detected being at the same position:
acquiring an initial model and a plurality of training samples, wherein each training sample comprises a first sample image, a second sample image, a sample difference image and a label;
randomly selecting a preset number of training samples from a plurality of training samples, and performing interference processing on the preset number of training samples to obtain a plurality of interference samples;
and training the initial model through a plurality of training samples and a plurality of interference samples to obtain the defect detection model.
7. The method for detecting defects of a notebook computer casing according to claim 6, wherein the step of randomly selecting a predetermined number of training samples from a plurality of the training samples, and performing interference processing on the predetermined number of training samples to obtain a plurality of interference samples comprises:
Randomly selecting a preset number of training samples from a plurality of training samples;
substituting the training sample input into the following formula, and obtaining the target iteration interference sample after K iterations;
the formula is:
wherein,representing a current iteration interference sample, wherein the kth iterationThe current iteration interference sample is the target iteration interference sample, < > or->Representing the last iteration interference sample, alpha representing the hyper-parameter controlling the iteration step, and +.>Representing the gradient of the training sample, L representing the loss function, y representing the label corresponding to the original sample, pi x+s Representing the projection operation, sign () represents a sign function.
8. The utility model provides a defect detection device of notebook computer casing which characterized in that, the defect detection device of notebook computer casing includes:
the acquisition unit is used for acquiring a first image to be detected corresponding to the top surface light source and a second image to be detected corresponding to the side surface light source, wherein the first image to be detected and the second image to be detected are positioned at the same position of the object to be detected; the object to be detected comprises the notebook computer shell;
the comparison unit is used for comparing the first image to be detected and the second image to be detected with the standard image respectively;
the extraction unit is used for respectively extracting target circumscribed rectangular frames of difference areas in the first image to be detected and the second image to be detected; the difference region refers to a region where the first image to be detected or the second image to be detected is different from the standard image;
The intercepting unit is used for intercepting a first sub-image and a second sub-image in the first image to be detected and the second image to be detected respectively according to the position information corresponding to the target external rectangular frame;
a first calculating unit, configured to extract difference pixel points in the first sub-image and the second sub-image, and calculate a pixel difference between two pixel points corresponding to the difference pixel points; the difference pixel points are pixel points with pixel differences of the same pixel positions in the first sub-image, the second sub-image and the standard image being larger than a first threshold value;
the processing unit is used for forming a difference image according to the positions of the difference pixel points and the pixel difference values;
the second computing unit is used for inputting the first image to be detected into a first feature extraction layer of a defect detection model, inputting the second image to be detected into a second feature extraction layer of the defect detection model, and inputting the difference image into a third feature extraction layer of the defect detection model to obtain a defect detection result output by the defect detection model; the defect detection results include scratches, irregularities, deformations, foreign substances, and discoloration.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 7.
CN202311702863.9A 2023-12-12 2023-12-12 Defect detection method, defect detection device and storage medium for notebook computer shell Pending CN117635590A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311702863.9A CN117635590A (en) 2023-12-12 2023-12-12 Defect detection method, defect detection device and storage medium for notebook computer shell

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311702863.9A CN117635590A (en) 2023-12-12 2023-12-12 Defect detection method, defect detection device and storage medium for notebook computer shell

Publications (1)

Publication Number Publication Date
CN117635590A true CN117635590A (en) 2024-03-01

Family

ID=90021521

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311702863.9A Pending CN117635590A (en) 2023-12-12 2023-12-12 Defect detection method, defect detection device and storage medium for notebook computer shell

Country Status (1)

Country Link
CN (1) CN117635590A (en)

Similar Documents

Publication Publication Date Title
CN110414507B (en) License plate recognition method and device, computer equipment and storage medium
CN111369545B (en) Edge defect detection method, device, model, equipment and readable storage medium
US7613328B2 (en) Label detection
US8983200B2 (en) Object segmentation at a self-checkout
US9760789B2 (en) Robust cropping of license plate images
CN111444921A (en) Scratch defect detection method and device, computing equipment and storage medium
EP3176751B1 (en) Information processing device, information processing method, computer-readable recording medium, and inspection system
US9679354B2 (en) Duplicate check image resolution
CN111325717B (en) Mobile phone defect position identification method and equipment
CN110751619A (en) Insulator defect detection method
CN116109637B (en) System and method for detecting appearance defects of turbocharger impeller based on vision
Thajeel et al. A Novel Approach for Detection of Copy Move Forgery using Completed Robust Local Binary Pattern.
CN116485779B (en) Adaptive wafer defect detection method and device, electronic equipment and storage medium
CN116703909B (en) Intelligent detection method for production quality of power adapter
CN113537211A (en) Deep learning license plate frame positioning method based on asymmetric IOU
CN115830004A (en) Surface defect detection method, device, computer equipment and storage medium
CN112784675B (en) Target detection method and device, storage medium and terminal
CN114359161A (en) Defect detection method, device, equipment and storage medium
CN115797314B (en) Method, system, equipment and storage medium for detecting surface defects of parts
CN115131355B (en) Intelligent method for detecting waterproof cloth abnormity by using electronic equipment data
CN117635590A (en) Defect detection method, defect detection device and storage medium for notebook computer shell
CN113822361B (en) SAR image similarity measurement method and system based on Hamming distance
CN111935480B (en) Detection method for image acquisition device and related device
CN115035168A (en) Multi-constraint-based photovoltaic panel multi-source image registration method, device and system
US10679336B2 (en) Detecting method, detecting apparatus, and computer readable storage medium

Legal Events

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