CN116908185A - Method and device for detecting appearance defects of article, electronic equipment and storage medium - Google Patents

Method and device for detecting appearance defects of article, electronic equipment and storage medium Download PDF

Info

Publication number
CN116908185A
CN116908185A CN202310699830.7A CN202310699830A CN116908185A CN 116908185 A CN116908185 A CN 116908185A CN 202310699830 A CN202310699830 A CN 202310699830A CN 116908185 A CN116908185 A CN 116908185A
Authority
CN
China
Prior art keywords
appearance
detected
target
parameters
appearance defect
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
CN202310699830.7A
Other languages
Chinese (zh)
Inventor
白辉
董伟轩
广兴祥
邱锋
李华娇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TIANWANG ELECTRONIC (SHENZHEN) CO Ltd
Original Assignee
TIANWANG ELECTRONIC (SHENZHEN) 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 TIANWANG ELECTRONIC (SHENZHEN) CO Ltd filed Critical TIANWANG ELECTRONIC (SHENZHEN) CO Ltd
Priority to CN202310699830.7A priority Critical patent/CN116908185A/en
Publication of CN116908185A publication Critical patent/CN116908185A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8887Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

The application is suitable for the technical field of defect detection, and provides an appearance defect detection method and device for an article, electronic equipment and a storage medium. The method for detecting the appearance defect of the article comprises the following steps: when the object to be detected is detected to be at the designated position, a plurality of groups of prestored shooting scene parameters are obtained, and each group of shooting scene parameters corresponds to at least one appearance defect of the object to be detected; controlling shooting equipment to respectively shoot at least one appearance image of the object to be detected under each group of shooting scene parameters to obtain a plurality of appearance images of the object to be detected; and carrying out appearance defect detection processing on the plurality of appearance images to obtain an appearance defect detection result of the to-be-detected object. According to the method for detecting the appearance defects of the article, different shooting scene parameters can be adopted for shooting the article to be detected aiming at different appearance defects possibly existing on the article to be detected, so that high-quality appearance images which better reflect the appearance defects can be obtained, and the accuracy of detecting the appearance defects of the article is improved.

Description

Method and device for detecting appearance defects of article, electronic equipment and storage medium
Technical Field
The application belongs to the technical field of defect detection, and particularly relates to an appearance defect detection method and device for an article, electronic equipment and a storage medium.
Background
At present, when an appearance defect of an article to be detected is automatically detected through electronic equipment, the shooting equipment usually shoots the article to be detected through fixed shooting scene parameters to obtain an appearance image, and then the appearance image is subjected to appearance defect detection to obtain an appearance defect detection result of the article to be detected. However, an appearance image obtained by photographing an object to be measured with a photographing apparatus with a fixed photographing scene parameter often cannot better reflect various appearance defects, which may result in a decrease in accuracy of appearance defect detection.
Disclosure of Invention
In view of the above, embodiments of the present application provide a method, an apparatus, an electronic device, and a storage medium for detecting an appearance defect of an article, which can improve the accuracy of detecting the appearance defect of the article.
In a first aspect, an embodiment of the present application provides a method for detecting an appearance defect of an article, including:
when the object to be detected is detected to be at a designated position, acquiring a plurality of groups of prestored shooting scene parameters, wherein each group of shooting scene parameters corresponds to at least one appearance defect of the object to be detected;
controlling shooting equipment to respectively shoot at least one appearance image of the object to be detected under each group of shooting scene parameters to obtain a plurality of appearance images of the object to be detected;
and carrying out appearance defect detection processing on the appearance images to obtain an appearance defect detection result of the to-be-detected object.
Optionally, the target shooting scene parameter is any one of the plurality of groups of shooting scene parameters, and the controlling shooting device respectively shoots at least one appearance image of the object to be detected under each group of shooting scene parameters, including:
selecting target shooting equipment from a plurality of shooting equipment according to the target shooting scene parameters;
and controlling the target shooting equipment to shoot the object to be detected, so as to obtain at least one appearance image of the object to be detected.
Optionally, before the controlling the target shooting device to shoot the object to be detected, the method further includes:
determining working parameters of the target shooting equipment according to the target shooting scene parameters;
and setting the target shooting equipment according to the working parameters.
Optionally, the target shooting device comprises a camera and a light source; the determining the working parameters of the target shooting equipment according to the target shooting scene parameters comprises the following steps:
determining camera parameters and light source parameters according to the target shooting scene parameters;
the setting the target shooting device according to the working parameters comprises the following steps:
setting the camera according to the camera parameters;
and setting the light source according to the light source parameters.
Optionally, the target shooting device includes a mechanical arm for clamping the object to be detected; the determining the working parameters of the target shooting equipment according to the target shooting scene parameters comprises the following steps:
determining the operation parameters of the mechanical arm according to the target shooting scene parameters;
the setting the target shooting device according to the working parameters comprises the following steps:
and setting the mechanical arm according to the operation parameters.
Optionally, the performing appearance defect detection processing on the plurality of appearance images to obtain an appearance defect detection result of the to-be-detected article includes:
performing appearance defect detection processing on the appearance images, and determining target images with appearance defects in the appearance images;
extracting boundary lines of target appearance defects existing in the target image and determining defect types of the target appearance defects;
determining the length, width and coverage area of the minimum square frame coverage of the target appearance defect according to the boundary line;
and determining an appearance defect detection result of the object to be detected according to the length, the width and the coverage area of the minimum square frame coverage.
Optionally, after performing appearance defect detection processing on the plurality of appearance images to obtain an appearance defect detection result of the to-be-detected article, the method further includes:
determining whether the object to be detected is a superior product or an acceptable product according to the appearance defect detection result and a prestored acceptable product appearance evaluation standard;
if the to-be-detected object is a superior object, sorting the to-be-detected object to a first area;
and if the to-be-detected object is a qualified object, sorting the to-be-detected object to a second area.
In a second aspect, an embodiment of the present application provides an appearance defect detection apparatus for an article, including:
the parameter acquisition unit is used for acquiring prestored multiple groups of shooting scene parameters when the object to be detected is detected to be at the designated position, wherein each group of shooting scene parameters corresponds to at least one appearance defect of the object to be detected;
the shooting unit is used for controlling shooting equipment to respectively shoot at least one appearance image of the object to be detected under each group of shooting scene parameters to obtain a plurality of appearance images of the object to be detected;
and the appearance defect detection unit is used for carrying out appearance defect detection processing on the plurality of appearance images to obtain an appearance defect detection result of the object to be detected.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps in the method for detecting an appearance defect of an article according to any one of the first aspect when the computer program is executed.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps in the method for detecting an appearance defect of an article according to any one of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product for, when run on an electronic device, causing the electronic device to perform the steps of the method for detecting an appearance defect of an article according to any one of the first aspect above.
The method, the device, the equipment and the medium for detecting the appearance defects of the article have the following beneficial effects:
according to the method for detecting the appearance defects of the articles, when the articles to be detected are detected to be at the designated positions, a plurality of groups of prestored shooting scene parameters are obtained, wherein each group of shooting scene parameters corresponds to at least one appearance defect of the articles to be detected; then controlling shooting equipment to respectively shoot at least one appearance image of the object to be detected under each group of shooting scene parameters to obtain a plurality of appearance images of the object to be detected; and then carrying out appearance defect detection processing on the plurality of appearance images to obtain an appearance defect detection result of the to-be-detected object. According to the method for detecting the appearance defects of the articles, different shooting scene parameters can be adopted for shooting the articles to be detected aiming at different appearance defects possibly existing on the articles to be detected, so that high-quality appearance images capable of reflecting the appearance defects better can be obtained, appearance defect detection is carried out on the high-quality appearance images, further more accurate appearance defect detection results can be obtained, and the accuracy of detecting the appearance defects of the articles can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of an implementation of a method for detecting an appearance defect of an article according to an embodiment of the present application;
FIG. 2 is a flowchart of an implementation of performing appearance defect detection processing on an appearance image to obtain an appearance defect detection result of an object to be detected according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a minimum frame coverage for determining an appearance defect of a target according to a boundary line according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of an apparatus for detecting an appearance defect of an article according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
It is to be understood that the terminology used in the embodiments of the application is for the purpose of describing particular embodiments of the application only, and is not intended to be limiting of the application. In the description of the embodiments of the present application, unless otherwise indicated, "a plurality" means two or more, and "at least one", "one or more" means one, two or more. The terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a definition of "a first", "a second" feature may explicitly or implicitly include one or more of such features.
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 application. 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 execution main body of the method for detecting the appearance defects of the article provided by the embodiment of the application can be electronic equipment. The electronic device may include an electronic device such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, and an appearance defect detecting device for an article.
The method for detecting the appearance defects of the article, provided by the embodiment of the application, can be applied to detecting the appearance defects of the article to be detected. Specifically, when a user needs to detect the appearance defects of the to-be-detected object, the steps of the method for detecting the appearance defects of the object provided by the embodiment of the application can be executed through the electronic equipment, so that the appearance defect detection result of the to-be-detected object can be obtained. In embodiments of the present application, the article to be tested may include, but is not limited to, a wristwatch.
Referring to fig. 1, fig. 1 is a flowchart illustrating an implementation of an appearance defect detection method of an article according to an embodiment of the present application, where the appearance defect detection method of the article may include S101 to S103, which are described in detail as follows:
in S101, when it is detected that the object to be measured is at the specified position, a plurality of sets of pre-stored shooting scene parameters are acquired.
Wherein, every group shoots scene parameter and all corresponds the at least one outward appearance defect of awaiting measuring article.
In the embodiment of the application, the wristwatch to be measured can be transmitted to the assembly line through the preset machine so as to be transmitted to the appointed position, and when the electronic equipment detects that the wristwatch to be measured is positioned at the appointed position, the electronic equipment can acquire the prestored multiple groups of shooting scene parameters.
Different kinds of appearance defects may exist on the wristwatch to be measured, and the kinds of appearance defects on the wristwatch to be measured can be classified into the following three types:
first category: angle collapse, scratch, bottom cover gaps, word nail glue, clock frame scratch, faults, dust on the inner layer of glass and the like.
The second category: black spots, impurities, dirt and the like of three-dimensional positions on the side surface of a dial plate in the watch glass or the upper side surface of a word nail.
Third category: scratch on glass, broken filaments, etc.
In practical application, shooting scene parameters suitable for different types of appearance defects on a wristwatch to be detected are different, namely, in order to obtain a high-quality appearance image capable of better reflecting a certain appearance defect, the proper shooting scene parameters corresponding to the type of appearance defect need to be obtained first, and then shooting is performed under the shooting scene parameters by controlling shooting equipment, so that the high-quality appearance image capable of better reflecting the type of appearance defect is obtained. For example, the glass has the characteristic of mirror reflection, the interference problem of reflected light can exist in the camera and the laser detection, and the detection precision is lower as the light intensity is larger; therefore, the appearance defect on the glass can scan the round glass sheet by utilizing the 3D line spectrum because of the larger intensity of the reflected light, and can clearly scan fine scratches, defects, foreign matters and the like on the surface of the glass. For different colors, impurities, scratches and paint dropping appearance defects, high-precision three-dimensional detection is required, and 3D point cloud information on the surface of the wristwatch can be rapidly acquired by using a 3D line spectrum confocal sensor and a 3D flash sensor.
Therefore, shooting scene parameters suitable for each appearance defect can be obtained through experiments and tests. The shooting scene parameters may include camera parameters, light source parameters, and operation parameters of the mechanical arm, and exemplary, suitable part of the shooting scene parameters of each type may be shown in table 1, please refer to table 1, and table 1 is a schematic table of suitable part of the shooting scene parameters corresponding to defects of each type provided in one embodiment of the present application.
Table 1 schematic table of suitable shooting scene parameters for each kind of defect
For example, for the first type of defect (i.e. a broken corner, a scratch, a bottom cover gap, a word nail glue, a clock frame scratch, a fault, a dust on an inner layer of glass, etc.), the shooting scene parameters corresponding to the first type of defect may further include shooting scene parameters shown in table 2, please refer to table 2, where table 2 is a schematic table of suitable shooting scene parameters corresponding to the first type of defect provided by an embodiment of the present application.
Table 2 schematic table of partially suitable shooting scene parameters corresponding to defects of the first type
For example, for the second type of defect (i.e. black dot, impurity, dirt, etc. on the side of the inner dial of the watch glass or on the side of the word nail), the shooting scene parameters corresponding to the second type of defect may further include shooting scene parameters shown in table 3, please refer to table 3, table 3 is a schematic table of suitable shooting scene parameters corresponding to the second type of defect provided by one embodiment of the present application.
Table 3 schematic table of partially suitable shooting scene parameters corresponding to defects of the second class
For example, for the third type of defect (i.e. scratch, broken filament, etc. on the glass), the shooting scene parameters corresponding to the third type of defect may further include shooting scene parameters shown in table 4, please refer to table 4, and table 4 is a schematic table of suitable shooting scene parameters corresponding to the third type of defect provided in one embodiment of the present application.
Table 4 schematic table of partially suitable shooting scene parameters corresponding to defects of the third class
Based on the above, when the wristwatch to be measured is at the designated position, the electronic device may acquire a plurality of groups of pre-stored shooting scene parameters (as shown in tables 1 to 4).
In S102, the photographing device is controlled to photograph at least one appearance image of the object to be measured under each group of photographing scene parameters, so as to obtain a plurality of appearance images of the object to be measured.
In the embodiment of the application, after the electronic equipment acquires the prestored multiple groups of shooting scene parameters, the shooting equipment can be controlled to respectively shoot one or more appearance images of the wristwatch to be detected under the shooting scene parameters of each group, so that the multiple appearance images of the wristwatch to be detected can be obtained. The appearance images shot by the shooting device under the shooting scene parameters of each group can be one, and in order to more accurately detect the appearance defects, the appearance images shot by the shooting device under the shooting scene parameters of each group can be multiple. The electronic device may control the photographing device to sequentially photograph at least one appearance image of the object to be measured under the first photographing scene parameter, the second photographing scene parameter, and the third photographing scene parameter, so as to obtain at least one appearance image corresponding to the first photographing scene parameter, at least one appearance image corresponding to the second photographing scene parameter, and at least one appearance image corresponding to the third photographing scene parameter.
In a possible implementation manner, let the target shooting scene parameters be any one of multiple groups of shooting scene parameters, S102 may include step a and step b, which are described in detail as follows:
in step a, a target photographing apparatus is selected from a plurality of photographing apparatuses according to a target photographing scene parameter.
In this implementation, the target photographing apparatus may include a camera, a light source, and a mechanical arm that clamps an object to be measured. The cameras may include two-dimensional cameras and three-dimensional cameras, and the light sources may emit light of different light parameters (e.g., different light colors).
Based on this, the electronic device can select a target photographing device from a plurality of photographing devices according to the target photographing scene parameter. For example, the electronic device may select a two-dimensional camera and a light source emitting yellow light according to the target shooting scene parameters, and of course, the electronic device may also select a three-dimensional camera and a light source emitting tri-chromatic light according to the target shooting scene parameters, which are only examples herein.
In the step b, the target shooting equipment is controlled to shoot the object to be detected, and at least one appearance image of the object to be detected is obtained.
In this implementation, before step b, step c and step d may be further included, which are described in detail below:
in step c, the operating parameters of the target photographing apparatus are determined according to the target photographing scene parameters.
Before the target shooting equipment is controlled to shoot the object to be detected, the electronic equipment can also determine the working parameters of the target shooting equipment according to the target shooting scene parameters. The working parameters of the target photographing apparatus may be referred to in tables 1 to 4, and will not be described herein.
The target capture device may include a camera and a light source, based on which the electronic device may determine camera parameters and light source parameters from the target capture scene parameters. The target shooting device may further include a mechanical arm that clamps the object to be detected, based on which the electronic device may determine an operation parameter of the mechanical arm according to the target shooting scene parameter.
In step d, the target photographing apparatus is set according to the operation parameters.
After the electronic device determines the operation parameters of the target photographing device, the target photographing device may be set according to the operation parameters. The working parameters of the target photographing apparatus may be referred to in tables 1 to 4, and will not be described herein.
The target shooting scene parameters may include camera parameters and light source parameters, based on which the electronic device may set the camera according to the camera parameters and the electronic device may set the light source according to the light source parameters. The target shooting scene parameters may further include operation parameters of the robotic arm, based on which the electronic device may be set according to the operation parameters of the robotic arm.
The camera parameters and the light source parameters are set to enable the appearance image obtained through shooting to reflect appearance defects on the wristwatch to be detected, the position among the wristwatch, the camera and the light source can be adjusted through setting the operation parameters of the proper mechanical arm, so that each shooting device obtains a proper shooting angle, specifically, the mechanical arm can be controlled through adjusting the operation parameters of the mechanical arm, translation or rotation of the wristwatch to be detected can be controlled through controlling the mechanical arm, and then the lens of the camera is perpendicular to the shooting surface of the wristwatch to be detected, and then the appearance image meeting preset requirements is obtained.
After the electronic equipment sets the camera parameters, the light source parameters and the operation parameters of the mechanical arm according to the working parameters, the electronic equipment can control the camera to shoot the object to be detected, and at least one appearance image of the object to be detected is obtained.
In S103, appearance defect detection processing is performed on the plurality of appearance images, so as to obtain an appearance defect detection result of the object to be detected.
In the embodiment of the application, after obtaining a plurality of appearance images corresponding to each group of shooting scene parameters, the electronic equipment can perform appearance defect detection processing on each appearance image, so as to obtain an appearance defect detection result of the wristwatch to be detected. The appearance defect detection result may include whether an appearance defect exists, the type of appearance defect exists, the location where the appearance defect exists, and digitized information of the appearance defect. Wherein, whether the appearance defect exists or not includes the existence of the appearance defect and the absence of the appearance defect, the types of the existence of the appearance defect can include scratches, color points/bumps/pits/stains/particles, dots/blocks, strips/lines, burrs, cracks, gaps/breaks, printing/etching/marking incompleteness, and the like, the positions where the appearance defect exists can include a bottom, a back cover lug position, a front glass position, a case side, a case front, a case band, and the like, and the digital information of the appearance defect can include depth, length, width, and the like.
In a possible implementation manner, S103 may include S201 to S204 shown in fig. 2, and fig. 2 is a flowchart of implementation of performing appearance defect detection processing on an appearance image to obtain an appearance defect detection result of an object to be detected according to an embodiment of the present application, which is described in detail below:
in S201, appearance defect detection processing is performed on the plurality of appearance images, and a target image having an appearance defect among the plurality of appearance images is determined.
In this implementation manner, after each appearance image is obtained, the electronic device may perform appearance defect detection processing on the plurality of appearance images, and determine a target image having an appearance defect in each appearance image.
Specifically, when the appearance image is a two-dimensional image shot by a two-dimensional camera, preprocessing the two-dimensional image, converting a color image obtained by the two-dimensional camera into a gray level image, removing corresponding interference factors by adopting a corresponding median filter to form corresponding target class features and background class features, setting a corresponding pixel threshold value as an average value of image gray levels and a neighborhood gray level threshold value as a neighborhood average gray level average value, performing iterative update of variables, determining the proportion occupied by the target class in the whole image and the proportion occupied by the background class, calculating a new threshold vector according to a distance measure function, comparing the processed two-dimensional image with a preset theoretical appearance image after judging that the optimal threshold value is obtained, judging whether the two-dimensional image has defects, denoising the two-dimensional image if the two-dimensional image has defects, and taking the denoised two-dimensional image as the target image with the appearance defects.
When the appearance image is a three-dimensional image shot by a three-dimensional camera, gray value processing can be performed on the three-dimensional image, the three-dimensional image is restored to three-dimensional data, algorithm processing is performed on the restored three-dimensional data, an appearance fitting image which accords with actual defects is generated according to the calculation and processing results of the three-dimensional data, the appearance fitting image is matched and compared with a preset theoretical three-dimensional cambered surface image, whether the three-dimensional image has defects is judged, if the defects exist, denoising is performed on the three-dimensional image, and the denoised three-dimensional image is used as a target image with the appearance defects.
When denoising the original two-dimensional and original three-dimensional images, the denoising method can be realized by the following steps: the method comprises the steps of firstly dividing an original image into subareas with fixed sizes, carrying out pixel gray level evaluation on each subarea in the image area by area, grouping the subareas according to gray level similarity between the subareas, gathering the subareas into a three-dimensional array, carrying out 3D conversion on the three-dimensional array, weighting the overlapped areas through gathering to obtain basic image information, carrying out secondary gray level evaluation on each subarea by utilizing the basic image information, finding the positions of the similar subareas in the basic information through area matching again, obtaining two three-dimensional arrays after matching, carrying out joint wiener filtering on the two formed three-dimensional arrays, and finally carrying out weighted average on the estimation of the overlapped areas to obtain the final denoising image.
In S202, boundary lines of the target appearance defects present in the target image are extracted and defect types of the target appearance defects are determined.
In this implementation manner, after determining the target image with the appearance defect and denoising the target image, the electronic device may extract the boundary line of the appearance defect of the target existing in the target image and determine the defect type of the appearance defect of the target.
The extraction of the boundary line of the target appearance defect existing in the target image can be achieved by the following steps: firstly, positioning appearance defects of a denoised target image, namely determining a target area where the appearance defect target is located and position coordinates of the target area, extracting the target area according to the position coordinates of the target area by a maximum threshold method, reconstructing missing parts of defects of weak edges or small targets by adopting image morphology to obtain actual forms of the defects, facilitating analysis and identification of the images, obtaining optimal contrast of foreground and background of the appearance defect image through double-threshold transformation after the appearance defects are extracted, and further extracting boundary lines of the appearance defects according to the optimal contrast of the foreground and the background of the appearance defect image. After the electronic device extracts the boundary line of the target appearance defect, the defect type of the target appearance defect may be determined according to the boundary line of the target appearance defect, and the specific method for determining the defect type of the target appearance defect according to the boundary line of the target appearance defect may be set according to practical applications, which is not limited herein.
In S203, the length, width, and coverage area of the minimum frame coverage of the target appearance defect are determined from the boundary line.
In this implementation manner, after the electronic device extracts the boundary line of the appearance defect and determines the defect type of the target appearance defect, the coverage area of the minimum frame coverage of the target appearance defect may be determined according to the boundary line. Fig. 3 is a schematic diagram of determining a minimum coverage of a frame of a target appearance defect according to a boundary line according to an embodiment of the present application, as shown in fig. 3. As shown in fig. 3, the minimum square coverage of the target appearance defect a may be b, the minimum square coverage of the target appearance defect c may be d, and after determining the minimum square coverage of the target appearance defect, the length, width and coverage area of the minimum square coverage may be determined according to the minimum square coverage of the target appearance defect.
In S204, the appearance defect detection result of the object to be detected is determined according to the length, width and coverage area of the minimum frame coverage.
In this implementation manner, after determining the length, width and coverage area of the minimum square frame coverage, the electronic device may determine an appearance defect detection result of the wristwatch to be tested according to the length, width and coverage area of the minimum square frame coverage, that is, determine whether the wristwatch to be tested has a defect, a type of the defect, a location of the defect and digitized information of the appearance defect according to the length, width and coverage area of the minimum square frame coverage.
In this implementation, after S204, steps e to g may be further included, which are described in detail below:
in step e, determining that the object to be detected is a superior object or an acceptable object according to the appearance defect detection result and the prestored acceptable object appearance evaluation standard.
In this implementation manner, after the electronic device obtains the appearance defect detection result, it may determine that the object to be detected is a superior product or an acceptable product according to the appearance defect detection result and a pre-stored acceptable product appearance evaluation standard, where the pre-stored acceptable product appearance evaluation standard may be set according to an actual requirement, and is not limited herein.
In step f, if the object to be measured is a superior object, the object to be measured is sorted to the first area.
In this implementation manner, if the electronic device determines that the wristwatch to be measured is a superior product, the electronic device may sort the wristwatch to be measured into the first area by controlling the mechanical arm.
In step g, if the object to be detected is a qualified product, the object to be detected is sorted to the second area.
In this implementation manner, if the electronic device determines that the wristwatch to be measured is a qualified product, the electronic device may sort the wristwatch to be measured into the second area by controlling the mechanical arm.
As can be seen from the above, in the method for detecting an appearance defect of an article according to the embodiment of the present application, when an article to be detected is detected to be at a specified position, a plurality of groups of pre-stored shooting scene parameters are obtained, where each group of shooting scene parameters corresponds to at least one appearance defect of the article to be detected; then controlling shooting equipment to respectively shoot at least one appearance image of the object to be detected under each group of shooting scene parameters to obtain a plurality of appearance images of the object to be detected; and then carrying out appearance defect detection processing on the plurality of appearance images to obtain an appearance defect detection result of the to-be-detected object. According to the method for detecting the appearance defects of the articles, different shooting scene parameters can be adopted for shooting the articles to be detected aiming at different appearance defects possibly existing on the articles to be detected, so that high-quality appearance images capable of better reflecting the appearance defects can be obtained, appearance defect detection is carried out on the high-quality appearance images, further more accurate appearance defect detection results can be obtained, and the accuracy of appearance defect detection of the articles can be improved.
Based on the method for detecting the appearance defects of the object provided by the embodiment of the present application, the embodiment of the present application further provides an apparatus for detecting the appearance defects of the object for implementing the method embodiment of the present application, refer to fig. 4, and fig. 4 is a schematic structural diagram of an apparatus for detecting the appearance defects of the object provided by the embodiment of the present application. As shown in fig. 4, the appearance defect detecting device 40 of the article may include a parameter acquiring unit 41, a photographing unit 42, and an appearance defect detecting unit 43. Wherein:
the parameter obtaining unit 41 is configured to obtain, when it is detected that the object to be measured is at the specified position, prestored multiple sets of shooting scene parameters, where each set of shooting scene parameters corresponds to at least one appearance defect of the object to be measured.
The photographing unit 42 is configured to control the photographing device to photograph at least one appearance image of the object under test under each set of photographing scene parameters, so as to obtain a plurality of appearance images of the object under test.
The appearance defect detecting unit 43 is configured to perform appearance defect detection processing on the plurality of appearance images, so as to obtain an appearance defect detection result of the object to be detected.
Optionally, the shooting unit 42 is specifically configured to:
selecting target shooting equipment from a plurality of shooting equipment according to the target shooting scene parameters;
and controlling the target shooting equipment to shoot the object to be detected, so as to obtain at least one appearance image of the object to be detected.
Optionally, the appearance defect detecting device 40 of the article may further include a determining unit and a setting unit. Wherein:
the determining unit is used for determining the working parameters of the target shooting equipment according to the target shooting scene parameters.
The setting unit is used for setting the target shooting equipment according to the working parameters.
Optionally, the target shooting device includes a camera and a light source, and the determining unit is specifically configured to determine a camera parameter and a light source parameter according to a target shooting scene parameter; the setting unit is specifically used for setting the camera according to the camera parameters; the light source is set according to the light source parameters.
Optionally, the target shooting device comprises a mechanical arm for clamping the object to be detected, and the determining unit is specifically configured to determine an operation parameter of the mechanical arm according to the target shooting scene parameter; the setting unit is specifically used for setting the mechanical arm according to the operation parameters.
Optionally, the appearance defect detecting unit 43 is specifically configured to perform appearance defect detection processing on the plurality of appearance images, and determine a target image with appearance defects in the plurality of appearance images;
extracting boundary lines of target appearance defects existing in the target image and determining defect types of the target appearance defects;
determining the length, width and coverage area of the minimum square frame coverage of the target appearance defect according to the boundary line;
and determining the appearance defect detection result of the object to be detected according to the length, the width and the coverage area of the minimum square frame coverage.
Optionally, the appearance defect detecting device 40 of the article may further include a sorting unit, wherein:
the sorting unit is specifically used for determining whether the object to be detected is a superior product or an acceptable product according to the appearance defect detection result and a prestored acceptable product appearance evaluation standard;
if the object to be detected is a superior object, sorting the object to be detected to a first area;
and if the object to be detected is a qualified product, sorting the object to be detected to a second area.
It should be noted that, because the content of information interaction and execution process between the above units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be referred to the method embodiment specifically, and will not be described herein again.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the application. As shown in fig. 5, the electronic device 5 provided in this embodiment may include: a processor 50, a memory 51 and a computer program 52 stored in the memory 51 and executable on the processor 50. For example, a program corresponding to the method for detecting the appearance defect of the article. The steps in the embodiment of the appearance defect detection method applied to the article described above, such as S101 to S103 shown in fig. 1 and S201 to S204 shown in fig. 2, are implemented when the processor 50 executes the computer program 52. Alternatively, the processor 50 may execute the computer program 52 to implement the functions of the modules/units in the embodiment corresponding to the electronic device 5, for example, the functions of the units 41 to 43 shown in fig. 4.
By way of example, the computer program 52 may be partitioned into one or more modules/units, which are stored in the memory 51 and executed by the processor 50 to complete the present application. One or more of the modules/units may be a series of computer program instruction segments capable of performing a specific function for describing the execution of the computer program 52 in the electronic device 5. For example, the computer program 52 may be divided into a parameter obtaining unit 41, a shooting unit 42 and an appearance defect detecting unit 43, and the specific functions of the respective units are described with reference to the corresponding embodiment of fig. 4, which is not repeated here.
It will be appreciated by those skilled in the art that fig. 5 is merely an example of the electronic device 5 and is not limiting of the electronic device 5 and may include more or fewer components than shown, or certain components may be combined, or different components.
The processor 50 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 51 may be an internal storage unit of the electronic device 5, such as a hard disk or a memory of the electronic device 5. The memory 51 may also be an external storage device of the electronic device 5, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card (flash card), or the like, which are provided on the electronic device 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the electronic device 5. The memory 51 is used to store computer programs and other programs and data required by the electronic device. The memory 51 may also be used to temporarily store data that has been output or is to be output.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units, that is, the internal structure of the appearance defect detecting device of the article is divided into different functional units, so as to perform all or part of the above-described functions. The functional units 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 are also only for distinguishing from each other, and are not used to limit the protection scope of the present application. The specific working process of the units 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 application also provide a computer readable storage medium having a computer program stored therein, which when executed by a processor, performs the steps of the respective method embodiments described above.
The embodiments of the present application provide a computer program product for causing a terminal device to carry out the steps of the respective method embodiments described above when the computer program product is run on the terminal device.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference may be made to 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 application.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application 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 application, and are intended to be included in the scope of the present application.

Claims (10)

1. A method for detecting an appearance defect of an article, comprising:
when the object to be detected is detected to be at a designated position, acquiring a plurality of groups of prestored shooting scene parameters, wherein each group of shooting scene parameters corresponds to at least one appearance defect of the object to be detected;
controlling shooting equipment to respectively shoot at least one appearance image of the object to be detected under each group of shooting scene parameters to obtain a plurality of appearance images of the object to be detected;
and carrying out appearance defect detection processing on the appearance images to obtain an appearance defect detection result of the to-be-detected object.
2. The method according to claim 1, wherein the controlling the photographing device to photograph at least one appearance image of the object under each group of photographing scene parameters includes:
selecting target shooting equipment from a plurality of shooting equipment according to the target shooting scene parameters;
and controlling the target shooting equipment to shoot the object to be detected, so as to obtain at least one appearance image of the object to be detected.
3. The method according to claim 2, further comprising, before said controlling the target photographing apparatus to photograph the object to be measured:
determining working parameters of the target shooting equipment according to the target shooting scene parameters;
and setting the target shooting equipment according to the working parameters.
4. The method of claim 3, wherein the target capture device comprises a camera and a light source; the determining the working parameters of the target shooting equipment according to the target shooting scene parameters comprises the following steps:
determining camera parameters and light source parameters according to the target shooting scene parameters;
the setting the target shooting device according to the working parameters comprises the following steps:
setting the camera according to the camera parameters;
and setting the light source according to the light source parameters.
5. A method according to claim 3, wherein the target photographing device comprises a robotic arm holding the item to be tested; the determining the working parameters of the target shooting equipment according to the target shooting scene parameters comprises the following steps:
determining the operation parameters of the mechanical arm according to the target shooting scene parameters;
the setting the target shooting device according to the working parameters comprises the following steps:
and setting the mechanical arm according to the operation parameters.
6. The method according to claim 1, wherein the performing the appearance defect detection processing on the plurality of appearance images to obtain an appearance defect detection result of the to-be-detected object includes:
performing appearance defect detection processing on the appearance images, and determining target images with appearance defects in the appearance images;
extracting boundary lines of target appearance defects existing in the target image and determining defect types of the target appearance defects;
determining the length, width and coverage area of the minimum square frame coverage of the target appearance defect according to the boundary line;
and determining an appearance defect detection result of the object to be detected according to the length, the width and the coverage area of the minimum square frame coverage.
7. The method according to any one of claims 1 to 6, wherein after performing appearance defect detection processing on the plurality of appearance images to obtain an appearance defect detection result of the object to be detected, further comprising:
determining whether the object to be detected is a superior product or an acceptable product according to the appearance defect detection result and a prestored acceptable product appearance evaluation standard;
if the to-be-detected object is a superior object, sorting the to-be-detected object to a first area;
and if the to-be-detected object is a qualified object, sorting the to-be-detected object to a second area.
8. An appearance defect detection device for an article, comprising:
the parameter acquisition unit is used for acquiring prestored multiple groups of shooting scene parameters when the object to be detected is detected to be at the designated position, wherein each group of shooting scene parameters corresponds to at least one appearance defect of the object to be detected;
the shooting unit is used for controlling shooting equipment to respectively shoot at least one appearance image of the object to be detected under each group of shooting scene parameters to obtain a plurality of appearance images of the object to be detected;
and the appearance defect detection unit is used for carrying out appearance defect detection processing on the plurality of appearance images to obtain an appearance defect detection result of the object to be detected.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the method for detecting an appearance defect of an article according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the method for detecting an appearance defect of an article according to any one of claims 1 to 7.
CN202310699830.7A 2023-06-13 2023-06-13 Method and device for detecting appearance defects of article, electronic equipment and storage medium Pending CN116908185A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310699830.7A CN116908185A (en) 2023-06-13 2023-06-13 Method and device for detecting appearance defects of article, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310699830.7A CN116908185A (en) 2023-06-13 2023-06-13 Method and device for detecting appearance defects of article, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116908185A true CN116908185A (en) 2023-10-20

Family

ID=88355352

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310699830.7A Pending CN116908185A (en) 2023-06-13 2023-06-13 Method and device for detecting appearance defects of article, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116908185A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117368210A (en) * 2023-12-08 2024-01-09 荣旗工业科技(苏州)股份有限公司 Defect detection method based on multi-dimensional composite imaging technology

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117368210A (en) * 2023-12-08 2024-01-09 荣旗工业科技(苏州)股份有限公司 Defect detection method based on multi-dimensional composite imaging technology
CN117368210B (en) * 2023-12-08 2024-02-27 荣旗工业科技(苏州)股份有限公司 Defect detection method based on multi-dimensional composite imaging technology

Similar Documents

Publication Publication Date Title
US11854173B2 (en) System and method for finding lines in an image with a vision system
CN113570605B (en) Defect detection method and system based on liquid crystal display panel
CN108896278B (en) Optical filter silk-screen defect detection method and device and terminal equipment
EP3109826B1 (en) Using 3d vision for automated industrial inspection
JP7049983B2 (en) Object recognition device and object recognition method
CN110189322B (en) Flatness detection method, device, equipment, storage medium and system
US11158039B2 (en) Using 3D vision for automated industrial inspection
CN115908269B (en) Visual defect detection method, visual defect detection device, storage medium and computer equipment
CN110672007A (en) Workpiece surface quality detection method and system based on machine vision
US8315457B2 (en) System and method for performing multi-image training for pattern recognition and registration
Ouellet et al. Precise ellipse estimation without contour point extraction
CN112164050B (en) Method and device for detecting surface defects of products on production line and storage medium
CN113608378B (en) Full-automatic defect detection method and system based on LCD (liquid crystal display) process
CN110706182A (en) Method and device for detecting flatness of shielding case, terminal equipment and storage medium
WO2017071406A1 (en) Method and system for detecting pin of gold needle element
TWI765442B (en) Method for defect level determination and computer readable storage medium thereof
CN116908185A (en) Method and device for detecting appearance defects of article, electronic equipment and storage medium
CN115619787A (en) UV adhesive defect detection method, system, equipment and medium
CN116503388A (en) Defect detection method, device and storage medium
CN115526820A (en) Workpiece detection method and equipment
CN113614774A (en) Method and system for defect detection in image data of target coating
Song et al. Automatic calibration method based on improved camera calibration template
CN110874837B (en) Defect automatic detection method based on local feature distribution
CN112508925A (en) Electronic lock panel quality detection method, system, computer device and storage medium
CN115619783B (en) Method and device for detecting product processing defects, storage medium and terminal

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