Method, device, electronic device and storage medium for detecting appearance defects of articles
By obtaining multiple sets of shooting scene parameters and controlling the shooting equipment to capture multiple appearance images, the problem that fixed shooting scene parameters cannot effectively reflect appearance defects is solved, and the accuracy of appearance defect detection is improved.
Patent Information
- Application Number
- CN202310699830.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-13
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2043-06-13
AI Technical Summary
When the prior art automatically detects the appearance defects of the object to be tested, the fixed shooting scene parameters cannot effectively reflect various appearance defects, resulting in a decrease in detection accuracy.
By acquiring pre-stored multiple sets of shooting scene parameters, each set of parameters corresponds to at least one appearance defect of the object to be tested, the shooting device controls to take the appearance image of the object under each set of parameters, and then performs appearance defect detection.
By adopting different shooting scene parameters for different appearance defects, high-quality appearance images are obtained, which improves the accuracy of appearance defect detection.
Smart Images

Figure CN116908185B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of defect detection technology, and in particular, relates to a method, device, electronic device and storage medium for detecting appearance defects of an object. Background Art
[0002] At present, when automatically detecting the appearance defects of an object to be tested by electronic equipment, the object to be tested is usually photographed by a photographing device with fixed shooting scene parameters to obtain an appearance image, and then the appearance defect detection is performed on the appearance image to obtain the appearance defect detection result of the object to be tested. However, the appearance image obtained by photographing the object to be tested by a photographing device with fixed shooting scene parameters usually cannot well reflect various appearance defects, which will reduce the accuracy of appearance defect detection. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a method, device, electronic device and storage medium for detecting appearance defects of an object, which can improve the accuracy of detecting appearance defects of an object.
[0004] In a first aspect, an embodiment of the present application provides a method for detecting appearance defects of an object, comprising:
[0005] When it is detected that the object to be tested is at a specified position, a plurality of pre-stored groups of shooting scene parameters are obtained, each group of the shooting scene parameters corresponding to at least one appearance defect of the object to be tested;
[0006] Controlling a photographing device to respectively photograph at least one appearance image of the object to be tested under each set of the photographing scene parameters to obtain a plurality of appearance images of the object to be tested;
[0007] Perform appearance defect detection processing on the multiple appearance images to obtain appearance defect detection results of the object to be tested.
[0008] Optionally, the target shooting scene parameter is any one of the multiple groups of shooting scene parameters, and the controlling the shooting device to respectively shoot at least one appearance image of the object to be tested under each group of the shooting scene parameters includes:
[0009] Selecting a target shooting device from a plurality of shooting devices according to the target shooting scene parameters;
[0010] The target shooting device is controlled to shoot the object to be tested to obtain at least one appearance image of the object to be tested.
[0011] Optionally, before controlling the target shooting device to shoot the object to be tested, the method further includes:
[0012] Determining working parameters of the target shooting device according to the target shooting scene parameters;
[0013] The target shooting device is set according to the working parameters.
[0014] Optionally, the target shooting device includes a camera and a light source; and determining the working parameters of the target shooting device according to the target shooting scene parameters includes:
[0015] Determining camera parameters and light source parameters according to the target shooting scene parameters;
[0016] The setting of the target shooting device according to the working parameters includes:
[0017] Setting the camera according to the camera parameters;
[0018] The light source is set according to the light source parameters.
[0019] Optionally, the target shooting device includes a mechanical arm that clamps the object to be tested; and determining the working parameters of the target shooting device according to the target shooting scene parameters includes:
[0020] Determining the operating parameters of the robotic arm according to the target shooting scene parameters;
[0021] The setting of the target shooting device according to the working parameters includes:
[0022] The robotic arm is set according to the operating parameters.
[0023] Optionally, performing appearance defect detection processing on the multiple appearance images to obtain an appearance defect detection result of the object to be tested includes:
[0024] Performing appearance defect detection processing on the multiple appearance images to determine a target image having appearance defects among the multiple appearance images;
[0025] Extracting a boundary line of a target appearance defect existing in the target image and determining a defect type of the target appearance defect;
[0026] Determine the length, width and coverage area of the minimum box coverage of the target appearance defect according to the boundary line;
[0027] The appearance defect detection result of the object to be detected is determined according to the length, width and coverage area of the minimum square frame coverage.
[0028] Optionally, after performing appearance defect detection processing on the plurality of appearance images to obtain the appearance defect detection result of the object to be detected, the method further includes:
[0029] Determining whether the object to be tested is a superior product or a qualified product according to the appearance defect detection result and the pre-stored qualified product appearance evaluation standard;
[0030] If the object to be tested is a high-quality object, the object to be tested is sorted to the first area;
[0031] If the objects to be tested are qualified, the objects to be tested are sorted to the second area.
[0032] In a second aspect, an embodiment of the present application provides an appearance defect detection device for an article, comprising:
[0033] A parameter acquisition unit, configured to acquire a plurality of pre-stored groups of shooting scene parameters when it is detected that the object to be tested is at a specified position, each group of the shooting scene parameters corresponding to at least one appearance defect of the object to be tested;
[0034] A shooting unit, used to control a shooting device to respectively shoot at least one appearance image of the object to be tested under each set of shooting scene parameters, so as to obtain multiple appearance images of the object to be tested;
[0035] The appearance defect detection unit is used to perform appearance defect detection processing on the multiple appearance images to obtain the appearance defect detection result of the object to be detected.
[0036] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, each step in the method for detecting appearance defects of an article as described in any one of the first aspects above is implemented.
[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, each step in the method for detecting appearance defects of an article as described in any one of the first aspects above is implemented.
[0038] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes each step of the method for detecting appearance defects of an object as described in any one of the first aspects above.
[0039] The method, device, equipment and medium for detecting appearance defects of articles provided in the embodiments of the present application have the following beneficial effects:
[0040] The appearance defect detection method for an object provided in an embodiment of the present application, when it is detected that the object to be tested is in a specified position, obtains multiple sets of pre-stored shooting scene parameters, wherein each set of shooting scene parameters corresponds to at least one appearance defect of the object to be tested; then controls the shooting device to shoot at least one appearance image of the object to be tested under each set of shooting scene parameters, respectively, to obtain multiple appearance images of the object to be tested; and then performs appearance defect detection processing on the multiple appearance images to obtain appearance defect detection results of the object to be tested. Through the appearance defect detection method for an object in this scheme, different shooting scene parameters can be used to shoot the object to be tested according to different appearance defects that may exist on the object to be tested, so that high-quality appearance images that can better reflect appearance defects can be obtained, and then by performing appearance defect detection on the high-quality appearance images, more accurate appearance defect detection results can be obtained, that is, the accuracy of appearance defect detection of objects can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0042] Figure 1 A flowchart of a method for detecting appearance defects of an article provided in an embodiment of the present application;
[0043] Figure 2 A flowchart for implementing an embodiment of the present application to perform appearance defect detection processing on an appearance image to obtain an appearance defect detection result of an object to be tested;
[0044] Figure 3 A schematic diagram of determining the minimum box coverage of a target appearance defect according to a boundary line provided in an embodiment of the present application;
[0045] Figure 4 A schematic diagram of the structure of a device for detecting appearance defects of an article provided in an embodiment of the present application;
[0046] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] It should be noted that the terms used in the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. In the description of the embodiments of the present application, unless otherwise specified, "multiple" refers to two or more than two, and "at least one", "one or more" refers to one, two or more. The terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, it is defined that the "first" and "second" features can explicitly or implicitly include one or more of the features.
[0048] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0049] The execution subject of the method for detecting appearance defects of an article provided in the embodiment of the present application may be an electronic device, which may include a mobile phone, a tablet computer, a laptop computer, a desktop computer, an appearance defect detection device for an article, and other electronic devices.
[0050] The appearance defect detection method of an article provided in the embodiment of the present application can be applied to the appearance defect detection of the article to be tested. Specifically, when the user needs to perform appearance defect detection on the article to be tested, the various steps of the appearance defect detection method of the article provided in the embodiment of the present application can be performed by an electronic device, so as to obtain the appearance defect detection result of the article to be tested. In the embodiment of the present application, the article to be tested may include but is not limited to a watch.
[0051] See also Figure 1 , Figure 1 The present invention provides a flowchart of an implementation method for detecting appearance defects of an article provided in an embodiment of the present invention. The method for detecting appearance defects of an article may include S101 to S103, which are described in detail as follows:
[0052] In S101, when it is detected that the object to be tested is at a designated position, multiple sets of pre-stored shooting scene parameters are obtained.
[0053] Each set of shooting scene parameters corresponds to at least one appearance defect of the object to be tested.
[0054] In an embodiment of the present application, the watch to be tested can be transferred to an assembly line through a preset machine to transfer the watch to be tested to a specified position. When the electronic device detects that the watch to be tested is at the specified position, the electronic device can obtain multiple sets of pre-stored shooting scene parameters.
[0055] There may be different types of appearance defects on the watch to be tested. For example, the types of appearance defects on the watch to be tested can be classified into the following three categories:
[0056] Category 1: chipped corners, scratches, gaps in the bottom cover, tack glue, scratches on the clock frame, fractures, dust on the inner layer of the glass, etc.
[0057] The second category: black spots, impurities, dirt, etc. on the side of the dial inside the watch glass or on the side of the studs.
[0058] The third category: scratches, hair, etc. on the glass.
[0059] In practical applications, different types of appearance defects on the watches to be tested have different shooting scene parameters suitable for them. That is, if you want to obtain a high-quality appearance image that can better reflect a certain appearance defect, you need to first obtain the appropriate shooting scene parameters corresponding to the appearance defect of this type, and then control the shooting device to shoot under the shooting scene parameters, so as to obtain a high-quality appearance image that can better reflect the appearance defect of this type. For example, the glass itself has the characteristics of mirror reflection, and both the camera and laser detection will have the problem of interference from reflected light. The greater the light intensity, the lower the detection accuracy; therefore, the appearance defects on the glass, due to the high intensity of reflected light, can use 3D line spectrum to scan the circular glass sheet, and then the fine scratches, missing parts, foreign matter, etc. on the glass surface can be clearly scanned. For appearance defects such as discoloration, impurities, scratches, and paint peeling, high-precision three-dimensional detection is required. 3D line spectrum confocal sensors and 3D flash detection sensors can be used to quickly obtain 3D point cloud information on the watch surface.
[0060] Therefore, the shooting scene parameters suitable for each type of appearance defect can be obtained through experiments and tests. Among them, the shooting scene parameters may include camera parameters, light source parameters, and robot arm operation parameters. For example, some shooting scene parameters suitable for each type may be shown in Table 1. Please refer to Table 1. Table 1 is a schematic table of some suitable shooting scene parameters corresponding to various types of defects provided in an embodiment of the present application.
[0061] Table 1 Schematic table of some suitable shooting scene parameters corresponding to various types of defects
[0062]
[0063] Exemplarily, for the first type of defects (i.e., chipped corners, scratches, bottom cover gaps, tack glue, clock frame scratches, faults, dust on the inner layer of glass, etc.), the shooting scene parameters corresponding to the first type of defects may also include the shooting scene parameters shown in Table 2. Please refer to Table 2, which is a schematic table of some suitable shooting scene parameters corresponding to the first type of defects provided in an embodiment of the present application.
[0064] Table 2 Schematic table of some suitable shooting scene parameters corresponding to the first type of defects
[0065]
[0066]
[0067] Exemplarily, for the second type of defects (i.e., black spots, impurities, dirt, etc. on the side of the dial inside the watch glass or the side of the nails), the shooting scene parameters corresponding to the second type of defects may also include the shooting scene parameters shown in Table 3. Please refer to Table 3. Table 3 is a schematic table of some suitable shooting scene parameters corresponding to the second type of defects provided in an embodiment of the present application.
[0068] Table 3 Schematic table of some suitable shooting scene parameters corresponding to the second type of defects
[0069]
[0070] Exemplarily, for the third type of defects (i.e., scratches and hair on the glass), the shooting scene parameters corresponding to the third type of defects may also include the shooting scene parameters shown in Table 4. Please refer to Table 4, which is a schematic table of some suitable shooting scene parameters corresponding to the third type of defects provided in an embodiment of the present application.
[0071] Table 4 Schematic table of some suitable shooting scene parameters corresponding to the third type of defects
[0072]
[0073] Based on this, when the watch to be tested is in a specified position, the electronic device can obtain multiple sets of pre-stored shooting scene parameters (as shown in Tables 1 to 4).
[0074] In S102, the photographing device is controlled to respectively photograph at least one appearance image of the object to be tested under each set of photographing scene parameters to obtain a plurality of appearance images of the object to be tested.
[0075] In an embodiment of the present application, after the electronic device obtains a plurality of pre-stored groups of shooting scene parameters, it can control the shooting device to respectively shoot one or more appearance images of the watch to be tested under each group of shooting scene parameters, thereby obtaining a plurality of appearance images of the watch to be tested. Among them, the appearance image shot by the shooting device under each group of shooting scene parameters can be one, and in order to more accurately detect appearance defects, the appearance images shot by the shooting device under each group of shooting scene parameters can also be multiple. Exemplarily, the shooting scene parameters can be three groups, including a first shooting scene parameter, a second shooting scene parameter, and a third shooting scene parameter. The electronic device can control the shooting device to sequentially shoot at least one appearance image of the object to be tested under the first shooting scene parameter, the second shooting scene parameter, and the third shooting scene parameter, and obtain at least one appearance image corresponding to the first shooting scene parameter, at least one appearance image corresponding to the second shooting scene parameter, and at least one appearance image corresponding to the third shooting scene parameter.
[0076] In a possible implementation, let the target shooting scene parameter be any one of the multiple shooting scene parameters, S102 may include step a and step b, which are described in detail as follows:
[0077] In step a, a target shooting device is selected from a plurality of shooting devices according to target shooting scene parameters.
[0078] In this implementation, the target shooting device may include a camera, a light source, and a mechanical arm for holding the object to be tested. The camera may include a two-dimensional camera and a three-dimensional camera, and the light source may emit light with different light parameters (such as different light colors).
[0079] Based on this, the electronic device can select a target shooting device from multiple shooting devices according to the target shooting scene parameters. Exemplarily, the electronic device can select a two-dimensional camera and a light source that emits yellow light according to the target shooting scene parameters. Of course, the electronic device can also select a three-dimensional camera and a light source that emits three-color light according to the target shooting scene parameters, which is only used as an example here.
[0080] In step b, the target shooting device is controlled to shoot the object to be tested to obtain at least one appearance image of the object to be tested.
[0081] In this implementation, before step b, step c and step d may also be included, which are described in detail as follows:
[0082] In step c, the operating parameters of the target shooting device are determined according to the target shooting scene parameters.
[0083] Before controlling the target shooting device to shoot the object to be tested, the electronic device can also determine the working parameters of the target shooting device according to the target shooting scene parameters. The working parameters of the target shooting device can be found in Tables 1 to 4, which are not described here.
[0084] The target shooting device may include a camera and a light source, based on which the electronic device may determine the camera parameters and the light source parameters according to the target shooting scene parameters. The target shooting device may also include a mechanical arm for clamping the object to be tested, based on which the electronic device may determine the operating parameters of the mechanical arm according to the target shooting scene parameters.
[0085] In step d, the target shooting device is set according to the working parameters.
[0086] After the electronic device determines the working parameters of the target shooting device, the target shooting device can be set according to the working parameters. The working parameters of the target shooting device can be referred to Tables 1 to 4, which are not described here.
[0087] 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 also include the operating parameters of the robotic arm, based on which the electronic device may set the camera robotic arm according to the operating parameters of the robotic arm.
[0088] By setting appropriate camera parameters and light source parameters, the captured appearance image can better reflect the appearance defects on the watch to be tested. By setting appropriate operating parameters of the robotic arm, the positions of the watch, camera and light source can be adjusted so that each shooting device can obtain a suitable shooting angle. Specifically, the robotic arm can be controlled by adjusting the operating parameters of the robotic arm. By controlling the robotic arm, the watch to be tested can be controlled to translate or rotate, so that the camera lens is perpendicular to the shooting surface of the watch to be tested, thereby obtaining an appearance image that meets the preset requirements.
[0089] After the electronic device sets the camera parameters, the light source parameters and the operation parameters of the robot arm according to the working parameters, the electronic device can control the camera to shoot the object to be tested to obtain at least one appearance image of the object to be tested.
[0090] In S103, appearance defect detection processing is performed on the plurality of appearance images to obtain appearance defect detection results of the object to be detected.
[0091] In an embodiment of the present application, after obtaining multiple appearance images corresponding to each group of shooting scene parameters, the electronic device can perform appearance defect detection processing on each appearance image, and then obtain the appearance defect detection result of the watch to be tested. The appearance defect detection result may include whether there is an appearance defect, the type of appearance defect, the location of the appearance defect, and the digital information of the appearance defect. Among them, whether there is an appearance defect includes the presence of an appearance defect and the absence of an appearance defect. The type of appearance defect may include scratches, color points / convex points / concave points / stains / particles, points / blocks, strips / lines, burrs, cracks, gaps / breaks, incomplete printing / etching / marks, etc. The location of the appearance defect may include the bottom, the ear position of the back cover, the front glass position, the side of the case, the front of the bezel, the bezel, the case, etc. The digital information of the appearance defect may include depth, length, and width, etc.
[0092] In a possible implementation, S103 may include: Figure 2 S201 to S204 shown, Figure 2 A flowchart for implementing the method of performing appearance defect detection processing on an appearance image to obtain an appearance defect detection result of an object to be tested is provided in an embodiment of the present application, and is described in detail as follows:
[0093] In S201, appearance defect detection processing is performed on a plurality of appearance images to determine a target image having appearance defects among the plurality of appearance images.
[0094] In this implementation, after obtaining each appearance image, the electronic device may perform appearance defect detection processing on the multiple appearance images to determine a target image having appearance defects in each appearance image.
[0095] Specifically, when the appearance image is a two-dimensional image taken by a two-dimensional camera, the two-dimensional image can be preprocessed first, the color image obtained by the two-dimensional camera can be converted into a grayscale image, and the corresponding median filter can be used to remove the corresponding interference factors to form corresponding target class features and background class features. Then, the corresponding pixel threshold can be set to the mean of the image grayscale level and the neighborhood grayscale threshold can be set to the neighborhood average grayscale mean. Then, the variables are iteratively updated to determine the proportion of the target class in the entire image and the proportion of the background class. A new threshold vector can be calculated based on the distance measurement function. After it is determined that the optimal threshold is obtained, the processed two-dimensional image can be compared with a preset theoretical appearance image to determine whether the two-dimensional image has defects. If defects exist, the two-dimensional image is denoised, and the denoised two-dimensional image is used as the target image with appearance defects.
[0096] When the appearance image is a three-dimensional image taken by a three-dimensional camera, the three-dimensional image can be firstly processed with grayscale values and restored to three-dimensional data. The restored three-dimensional data is then processed by an algorithm. According to the calculation and processing results of the three-dimensional data, an appearance fitting map that conforms to the actual defect is generated. The appearance fitting map is then matched and compared with a preset theoretical three-dimensional arc surface map to determine whether the three-dimensional image has defects. If defects exist, the three-dimensional image is denoised and the denoised three-dimensional image is used as the target image with appearance defects.
[0097] When denoising original two-dimensional and original three-dimensional images, it can be achieved through the following steps: first, the original image is evenly divided into sub-regions of fixed size, and then the pixel grayscale is evaluated region by region for each sub-region in the image, and then the regions are grouped according to the grayscale similarity between the regions, and these regions are aggregated into a three-dimensional array, and then the three-dimensional array is transformed into 3D, and then the overlapping regions are weighted by aggregation to obtain basic image information, and the basic image information is used to perform a second grayscale evaluation on each region, and then the position of the region similar to it in the basic information is found again through region matching, and two three-dimensional arrays are obtained after matching, and the two three-dimensional arrays are jointly Wiener filtered, and finally the estimates of the overlapping regions are weighted averaged to obtain the final denoised image.
[0098] In S202, a boundary line of a target appearance defect existing in a target image is extracted and a defect type of the target appearance defect is determined.
[0099] In this implementation, after determining a target image with appearance defects and performing denoising, the electronic device can extract a boundary line of the target appearance defect existing in the target image and determine the defect type of the target appearance defect.
[0100] Extracting the boundary line of the target appearance defect in the target image can be achieved through the following steps: first, locate the appearance defect of the denoised target image, that is, determine the target area where the appearance defect target is located and the position coordinates of the target area, and extract the target area through the maximum threshold method according to the position coordinates of the target area. For some defects with weak edges or small targets, image morphology is used to reconstruct the missing parts to obtain the actual form of the defect, which is convenient for image analysis and recognition. After extracting the appearance defect, the optimal contrast between the foreground and background of the appearance defect image can be obtained through double threshold transformation, and then the boundary line of the appearance defect can be extracted according to the optimal contrast between the foreground and background of the appearance defect image. After the electronic device extracts the boundary line of the target appearance defect, it can determine the defect type of the target appearance defect according to the boundary line of the target appearance defect. The specific method for determining the defect type of the target appearance defect according to the boundary line of the target appearance defect can be set according to the actual application and is not limited here.
[0101] In S203, the length, width and coverage area of the minimum box coverage of the target appearance defect are determined according to the boundary line.
[0102] In this implementation, 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 square frame coverage of the target appearance defect can be determined according to the boundary line. Figure 3 As shown, Figure 3 A schematic diagram of determining the minimum box coverage of a target appearance defect according to a boundary line provided in an embodiment of the present application. Figure 3 As shown, the minimum box coverage of the target appearance defect a can be b, and the minimum box coverage of the target appearance defect c can be d. After determining the minimum box coverage of the target appearance defect, the length, width and coverage area of the minimum box coverage can be determined according to the minimum box coverage of the target appearance defect.
[0103] 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 box coverage.
[0104] In this implementation, after determining the length, width and coverage area of the minimum square coverage, the electronic device can determine the appearance defect detection result of the watch to be tested based on the length, width and coverage area of the minimum square coverage, that is, it can determine whether the watch to be tested has defects, the type of defects, the location of the defects and digital information of the appearance defects based on the length, width and coverage area of the minimum square coverage.
[0105] In this implementation, after S204, steps e to g may be further included, which are described in detail as follows:
[0106] In step e, the object to be tested is determined to be a superior product or a qualified product based on the appearance defect detection result and the pre-stored qualified product appearance evaluation standard.
[0107] In this implementation, after obtaining the appearance defect detection results, the electronic device can determine whether the item to be tested is a superior product or a qualified product based on the appearance defect detection results and the pre-stored qualified product appearance evaluation standards, where the pre-stored qualified product appearance evaluation standards can be set according to actual needs and are not limited here.
[0108] In step f, if the object to be tested is a high-quality object, the object to be tested is sorted to the first area.
[0109] In this implementation, if the electronic device determines that the watch to be tested is a high-quality product, it can sort the watch to be tested into the first area by controlling the robotic arm.
[0110] In step g, if the objects to be tested are qualified, the objects to be tested are sorted to the second area.
[0111] In this implementation, if the electronic device determines that the watch to be tested is a qualified product, it can sort the watch to be tested into the second area by controlling the robotic arm.
[0112] From the above, it can be seen that the appearance defect detection method of an object provided in the embodiment of the present application, when it is detected that the object to be tested is in a specified position, obtains multiple sets of pre-stored shooting scene parameters, wherein each set of shooting scene parameters corresponds to at least one appearance defect of the object to be tested; then controls the shooting device to shoot at least one appearance image of the object to be tested under each set of shooting scene parameters, respectively, to obtain multiple appearance images of the object to be tested; and then performs appearance defect detection processing on the multiple appearance images to obtain appearance defect detection results of the object to be tested. Through the appearance defect detection method of an object in this solution, different shooting scene parameters can be used to shoot the object to be tested according to different appearance defects that may exist on the object to be tested, so that high-quality appearance images that can better reflect appearance defects can be obtained, and then by performing appearance defect detection on the high-quality appearance images, more accurate appearance defect detection results can be obtained, so the appearance defect detection method of an object in this solution can improve the accuracy of appearance defect detection.
[0113] Based on the method for detecting appearance defects of an article provided in the above embodiment, the present application further provides an apparatus for detecting appearance defects of an article that implements the above method embodiment. Figure 4 , Figure 4 This is a schematic diagram of the structure of an appearance defect detection device for an article provided in an embodiment of the present application. Figure 4As shown, the device 40 for detecting appearance defects of an article may include a parameter acquisition unit 41, a photographing unit 42, and an appearance defect detection unit 43. Among them:
[0114] The parameter acquisition unit 41 is used to acquire a plurality of pre-stored groups of shooting scene parameters when it is detected that the object to be tested is at a specified position, each group of shooting scene parameters corresponding to at least one appearance defect of the object to be tested.
[0115] The photographing unit 42 is used to control the photographing device to respectively photograph at least one appearance image of the object to be tested under each set of photographing scene parameters, so as to obtain multiple appearance images of the object to be tested.
[0116] The appearance defect detection unit 43 is used to perform appearance defect detection processing on a plurality of appearance images to obtain appearance defect detection results of the object to be detected.
[0117] Optionally, the target shooting scene parameter is set to any one of the multiple shooting scene parameters, and the shooting unit 42 is specifically used to:
[0118] Selecting a target shooting device from multiple shooting devices according to target shooting scene parameters;
[0119] The target shooting device is controlled to shoot the object to be tested to obtain at least one appearance image of the object to be tested.
[0120] Optionally, the device 40 for detecting appearance defects of an object may further include a determining unit and a setting unit.
[0121] The determination unit is used to determine the working parameters of the target shooting device according to the target shooting scene parameters.
[0122] The setting unit is used to set the target shooting device according to the working parameters.
[0123] Optionally, the target shooting device includes a camera and a light source, and the determination unit is specifically used to determine camera parameters and light source parameters according to target shooting scene parameters; the setting unit is specifically used to set the camera according to the camera parameters; and set the light source according to the light source parameters.
[0124] Optionally, the target shooting device includes a robotic arm that clamps the object to be tested, and the determination unit is specifically used to determine the operating parameters of the robotic arm according to the target shooting scene parameters; the setting unit is specifically used to set the robotic arm according to the operating parameters.
[0125] Optionally, the appearance defect detection unit 43 is specifically used to perform appearance defect detection processing on the multiple appearance images, and determine the target image with appearance defects in the multiple appearance images;
[0126] Extracting the boundary line of the target appearance defect existing in the target image and determining the defect type of the target appearance defect;
[0127] Determine the length, width and coverage area of the minimum box coverage of the target appearance defect according to the boundary line;
[0128] The appearance defect detection result of the object to be tested is determined according to the length, width and coverage area of the minimum square coverage.
[0129] Optionally, the device 40 for detecting appearance defects of an object may further include a sorting unit, wherein:
[0130] The sorting unit is specifically used to determine whether the object to be tested is a superior product or a qualified product according to the appearance defect detection result and the pre-stored qualified product appearance evaluation standard;
[0131] If the object to be tested is a high-quality product, the object to be tested is sorted to the first area;
[0132] If the object to be tested is qualified, the object to be tested is sorted to the second area.
[0133] It should be noted that the information interaction, execution process and other contents between the above-mentioned units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be specifically referred to the method embodiment part and will not be repeated here.
[0134] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, 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 appearance defects of an object. When the processor 50 executes the computer program 52, the steps in the embodiment of the method for detecting appearance defects of an object are implemented, such as Figure 1 S101 to S103 shown and Figure 2 Alternatively, when the processor 50 executes the computer program 52, the functions of each module / unit in the embodiment corresponding to the electronic device 5 are realized, for example Figure 4 The functions of the units 41 to 43 are shown.
[0135] Exemplarily, the computer program 52 may be divided into one or more modules / units, one or more modules / units are stored in the memory 51 and executed by the processor 50 to complete the present application. One or more modules / units may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program 52 in the electronic device 5. For example, the computer program 52 may be divided into a parameter acquisition unit 41, a shooting unit 42, and an appearance defect detection unit 43. For the specific functions of each unit, please refer to Figure 4 The relevant descriptions in the corresponding embodiments are not repeated here.
[0136] Those skilled in the art will understand that Figure 5 The electronic device 5 is merely an example and does not constitute a limitation on the electronic device 5 , and may include more or less components than those shown in the figure, or may combine certain components, or may have different components.
[0137] The processor 50 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0138] The memory 51 may be an internal storage unit of the electronic device 5, such as a hard disk or 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, or a flash card, etc., equipped on the electronic device 5. Further, the memory 51 may also include both an internal storage unit of the electronic device 5 and an external storage device. 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.
[0139] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional units as needed, that is, the internal structure of the appearance defect detection device of the object is divided into different functional units to complete all or part of the functions described above. The functional units in the embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0140] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0141] An embodiment of the present application provides a computer program product. When the computer program product is executed on a terminal device, the terminal device implements the steps in the above-mentioned various method embodiments.
[0142] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0143] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0144] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for detecting appearance defects of an object, characterized in that: include: When it is detected that the object to be tested is at a specified position, a plurality of pre-stored groups of shooting scene parameters are obtained, each group of the shooting scene parameters corresponding to at least one appearance defect of the object to be tested; Controlling a photographing device to respectively photograph at least one appearance image of the object to be tested under each set of the photographing scene parameters to obtain a plurality of appearance images of the object to be tested; wherein the appearance images include two-dimensional images and three-dimensional images; Performing appearance defect detection processing on the multiple appearance images to obtain appearance defect detection results of the object to be tested; The performing appearance defect detection processing on the plurality of appearance images to obtain the appearance defect detection result of the object to be detected includes: Performing appearance defect detection processing on the multiple appearance images to determine a target image having appearance defects among the multiple appearance images; Extracting a boundary line of a target appearance defect existing in the target image and determining a defect type of the target appearance defect; Determine the length, width and coverage area of the minimum box coverage of the target appearance defect according to the boundary line; Determine the appearance defect detection result of the object to be tested according to the length, width and coverage area of the minimum box coverage; the appearance defect detection result includes whether the target appearance defect exists, the defect type of the target appearance defect, the location of the target appearance defect and the digital information of the target appearance defect; The performing appearance defect detection processing on the multiple appearance images to determine a target image having appearance defects among the multiple appearance images includes: When the appearance image is the three-dimensional image, the three-dimensional image is restored to three-dimensional data, and the three-dimensional data is processed by algorithm to generate an appearance fitting graph, and the appearance fitting graph is matched and compared with a preset theoretical three-dimensional arc surface graph to determine whether the three-dimensional image has defects. If defects exist, the three-dimensional image is denoised and the denoised three-dimensional image is used as the target image.
2. The method according to claim 1, characterized in that Assuming that the target shooting scene parameter is any one of the multiple groups of shooting scene parameters, the controlling the shooting device to respectively shoot at least one appearance image of the object to be tested under each group of the shooting scene parameters includes: Selecting a target shooting device from a plurality of shooting devices according to the target shooting scene parameters; The target shooting device is controlled to shoot the object to be tested to obtain at least one appearance image of the object to be tested.
3. The method according to claim 2, characterized in that Before controlling the target shooting device to shoot the object to be tested, the method further includes: Determining working parameters of the target shooting device according to the target shooting scene parameters; The target shooting device is set according to the working parameters.
4. The method according to claim 3, characterized in that: The target shooting device includes a camera and a light source; and determining the working parameters of the target shooting device according to the target shooting scene parameters includes: Determining camera parameters and light source parameters according to the target shooting scene parameters; The setting of the target shooting device according to the working parameters includes: Setting the camera according to the camera parameters; The light source is set according to the light source parameters.
5. The method according to claim 3, characterized in that: The target shooting device includes a mechanical arm that clamps the object to be tested; and determining the working parameters of the target shooting device according to the target shooting scene parameters includes: Determining the operating parameters of the robotic arm according to the target shooting scene parameters; The setting of the target shooting device according to the working parameters includes: The robotic arm is set according to the operating parameters.
6. The method according to any one of claims 1 to 5, characterized in that: After performing appearance defect detection processing on the plurality of appearance images to obtain the appearance defect detection result of the object to be detected, the method further includes: Determining whether the object to be tested is a superior product or a qualified product according to the appearance defect detection result and the pre-stored qualified product appearance evaluation standard; If the object to be tested is a high-quality object, sorting the object to be tested to the first area; If the objects to be tested are qualified, the objects to be tested are sorted to the second area.
7. A device for detecting appearance defects of an article, characterized in that: include: A parameter acquisition unit, configured to acquire a plurality of pre-stored groups of shooting scene parameters when it is detected that the object to be tested is at a specified position, each group of the shooting scene parameters corresponding to at least one appearance defect of the object to be tested; A shooting unit, used to control the shooting device to shoot at least one appearance image of the object to be tested under each set of shooting scene parameters, so as to obtain multiple appearance images of the object to be tested; wherein the appearance image includes a two-dimensional image and a three-dimensional image; An appearance defect detection unit, used to perform appearance defect detection processing on the multiple appearance images to obtain an appearance defect detection result of the object to be detected; The appearance defect detection unit is specifically used for: Performing appearance defect detection processing on the multiple appearance images to determine a target image having appearance defects among the multiple appearance images; Extracting a boundary line of a target appearance defect existing in the target image and determining a defect type of the target appearance defect; Determine the length, width and coverage area of the minimum box coverage of the target appearance defect according to the boundary line; Determine the appearance defect detection result of the object to be tested according to the length, width and coverage area of the minimum box coverage; the appearance defect detection result includes whether the target appearance defect exists, the defect type of the target appearance defect, the location of the target appearance defect and the digital information of the target appearance defect; The performing appearance defect detection processing on the multiple appearance images to determine a target image having appearance defects among the multiple appearance images includes: When the appearance image is the three-dimensional image, the three-dimensional image is restored to three-dimensional data, and the three-dimensional data is processed by algorithm to generate an appearance fitting graph, and the appearance fitting graph is matched and compared with a preset theoretical three-dimensional arc surface graph to determine whether the three-dimensional image has defects. If defects exist, the three-dimensional image is denoised and the denoised three-dimensional image is used as the target image.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, each step of the method for detecting appearance defects of an article as described in any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, each step of the method for detecting appearance defects of an article as claimed in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Defect detection method and device
CN112505056A
Hub surface defect identification method and device, storage medium and electronic equipment
CN114419038A
Decorative wallpaper defect detection method based on template matching
CN114419039A