CN117522850A - Highlight defect detection method, highlight defect detection device, computer equipment and storage medium - Google Patents

Highlight defect detection method, highlight defect detection device, computer equipment and storage medium Download PDF

Info

Publication number
CN117522850A
CN117522850A CN202311626390.9A CN202311626390A CN117522850A CN 117522850 A CN117522850 A CN 117522850A CN 202311626390 A CN202311626390 A CN 202311626390A CN 117522850 A CN117522850 A CN 117522850A
Authority
CN
China
Prior art keywords
connected domain
stripe
defect
area
parcel
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
CN202311626390.9A
Other languages
Chinese (zh)
Inventor
葛俊辉
丁凡
沈小龙
邓文平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Shibite Robot Co Ltd
Original Assignee
Hunan Shibite Robot 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 Hunan Shibite Robot Co Ltd filed Critical Hunan Shibite Robot Co Ltd
Priority to CN202311626390.9A priority Critical patent/CN117522850A/en
Publication of CN117522850A publication Critical patent/CN117522850A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/0008Industrial image inspection checking presence/absence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Abstract

The application relates to a highlight defect detection method, a highlight defect detection device, computer equipment and a storage medium, wherein a stripe image of a highlight to be detected is obtained, a parcel phase diagram is obtained based on the stripe image of the same stripe frequency, connected domain analysis is carried out on each parcel phase diagram to obtain a corresponding connected domain mark image, at least one stripe connected domain area is marked in the connected domain mark image, defect detection is carried out on each stripe connected domain area in the connected domain mark image one by one to obtain a corresponding defect positioning result, merging processing is carried out based on the defect positioning result corresponding to each parcel phase diagram, and a target defect positioning result of the highlight to be detected is obtained. According to the method, the texture fluctuation characteristic is predicted through the texture characteristic of the wrapping phase diagram by using a traditional image processing method to distinguish whether defects exist or not, a large amount of actual defect data acquired in advance is not needed, so that the defect detection difficulty of a highlight surface is greatly reduced, and meanwhile, the detection accuracy is higher.

Description

Highlight defect detection method, highlight defect detection device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to a method and apparatus for detecting a defect of a highlight, a computer device, and a storage medium.
Background
With the improvement of living standard, consumers pay more attention to pursuing aesthetic feeling of product appearance, and finished products with high brightness such as mirror surfaces, mirror-like surfaces and the like are popular, so that the defect detection requirement on the high brightness products is increasing increasingly, common application scenes comprise household ceramic appearance detection, mirror-surface mobile phone shell defect detection, automobile finish quality detection and the like, and defect types mainly comprise scratches, dirt, pits, bulges and the like.
In the traditional technology, detection is generally realized by relying on manual visual or touch, but the efficiency is lower and the requirements on experience accumulation and concentration are higher. With the development of machine vision technology, an intelligent defect detection method combining a large number of historical defect data acquisition and labeling by utilizing a deep learning technology gradually becomes the mainstream. However, the method is highly dependent on a large amount of pre-collected actual defect data, so that the actual implementation difficulty is high and the detection accuracy is low.
Disclosure of Invention
Based on the foregoing, it is necessary to provide a highlight defect detection method, device, computer equipment and storage medium for solving the technical problems of the conventional method that the implementation difficulty is high and the defect detection accuracy is low.
In a first aspect, the present application provides a method for detecting a highlight defect, the method including:
Acquiring at least one stripe image of a highlight surface to be detected, and solving to obtain at least one parcel phase diagram based on the stripe images with the same stripe frequency;
carrying out connected domain analysis on each parcel phase map to obtain a connected domain mark image corresponding to each parcel phase map, wherein at least one stripe connected domain area is marked in the connected domain mark image;
performing defect detection on each stripe connected domain area in the connected domain mark image one by one to obtain a defect positioning result corresponding to each parcel phase map;
and combining the defect positioning results based on the corresponding parcel phase diagrams to obtain a target defect positioning result of the high-brightness surface to be detected.
In one embodiment, performing connected domain analysis on each parcel phase map to obtain a connected domain mark image corresponding to each parcel phase map, including:
performing foreground and background separation processing on the parcel phase map to obtain a boundary information image corresponding to the parcel phase map;
and carrying out stripe region extraction processing on the boundary information image corresponding to the parcel phase map to obtain a connected domain mark image corresponding to the parcel phase map.
In one embodiment, stripe region extraction processing is performed on a boundary information image corresponding to a parcel phase map, to obtain a connected domain mark image corresponding to the parcel phase map, including:
Traversing connected domain features in the boundary information image corresponding to the parcel phase diagram, and marking to obtain at least one connected domain region in the boundary information image, wherein the attribute information of the connected domain region at least comprises the connected domain area;
and filtering the connected domain areas of the connected domains in the boundary information image based on a preset area threshold value to obtain a connected domain mark image corresponding to the parcel phase diagram, wherein at least one stripe connected domain area is marked in the connected domain mark image.
In one embodiment, performing defect detection on each stripe connected domain area in the connected domain mark image one by one to obtain a defect positioning result corresponding to each parcel phase map, including:
obtaining mask images and parcel phase diagrams corresponding to each stripe connected domain region in the connected domain mark image;
coordinate transformation is carried out on the mask image and the wrapping phase diagram corresponding to each stripe connected domain area, and a standard mask image and a standard wrapping phase diagram corresponding to each stripe connected domain area are obtained;
performing defect detection based on the standard mask image corresponding to each stripe connected domain area and the standard parcel phase map to obtain a preliminary defect positioning result corresponding to the parcel phase map;
And carrying out coordinate inverse transformation on the preliminary defect positioning result corresponding to the parcel phase diagram to obtain the defect positioning result corresponding to the parcel phase diagram.
In one embodiment, coordinate transformation is performed on the mask image and the wrapping phase map corresponding to each stripe connected domain area, so as to obtain a standard mask image and a standard wrapping phase map corresponding to each stripe connected domain area, including:
performing rotary diameter measurement on the mask image corresponding to each stripe connected domain area to obtain the longest direction angle of each stripe connected domain area;
setting and obtaining a coordinate transformation coefficient based on the longest direction angle of each stripe connected domain area;
and carrying out coordinate transformation on the mask image corresponding to each stripe connected domain region and the wrapping phase map according to the coordinate transformation coefficient to obtain a standard mask image and a standard wrapping phase map corresponding to each stripe connected domain region.
In one embodiment, performing defect detection based on a standard mask image and a standard parcel phase map corresponding to each stripe connected domain region, to obtain a preliminary defect positioning result corresponding to the parcel phase map, including:
acquiring at least one non-zero pixel change line of a standard parcel phase diagram corresponding to each stripe connected domain area in a direction perpendicular to stripes;
Determining the distance information of each non-zero pixel point and a non-zero pixel change line on the standard mask image corresponding to each stripe connected domain area;
comparing each distance information with a preset distance threshold value, and determining a first defect area of each stripe connected domain area in the stripe direction;
calculating gradient change values of non-zero pixel points in a first defect area of each stripe connected domain area according to the direction perpendicular to the stripes;
and determining a second defect area of each stripe connected domain area based on each gradient change value and a preset gradient change threshold value, wherein the preliminary defect positioning result corresponding to the wrapping phase diagram comprises the second defect area of each stripe connected domain area.
In one embodiment, merging processing is performed based on defect positioning results corresponding to each parcel phase diagram to obtain a target defect positioning result of a to-be-detected high-brightness surface, including:
determining an intersection area and a union area between every two of the two based on defect positioning results corresponding to each parcel phase map;
calculating at least one intersection ratio information based on the intersection area and the union area;
and merging two defect positioning results corresponding to each cross ratio information larger than a preset cross ratio threshold value to obtain a target defect positioning result of the bright surface to be detected.
In a second aspect, the present application further provides a highlight defect detection apparatus, where the apparatus includes:
the parcel phase diagram solving module is used for acquiring at least one stripe image of the highlight surface to be detected and solving to obtain at least one parcel phase diagram based on the stripe images with the same stripe frequency;
the connected domain marking image acquisition module is used for carrying out connected domain analysis on each parcel phase diagram to obtain a connected domain marking image corresponding to each parcel phase diagram, and at least one stripe connected domain area is marked in the connected domain marking image;
the defect detection module is used for detecting the defects of the strip connected domain areas in the connected domain mark image one by one to obtain a defect positioning result corresponding to each parcel phase diagram;
and the defect merging module is used for merging based on the defect positioning results corresponding to the parcel phase diagrams to obtain a target defect positioning result of the high-brightness surface to be detected.
In a third aspect, the present application also provides a computer device comprising a memory storing a computer program and a processor implementing the steps of the method described above when the processor executes the computer program.
In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the above-described method.
According to the highlight defect detection method, the highlight defect detection device, the computer equipment and the storage medium, at least one fringe image of the highlight to be detected is obtained, at least one parcel phase diagram is obtained based on the fringe image with the same fringe frequency, connected domain analysis is conducted on each parcel phase diagram to obtain a connected domain mark image corresponding to each parcel phase diagram, at least one fringe connected domain area is marked in the connected domain mark image, defect detection is conducted on each fringe connected domain area in the connected domain mark image one by one to obtain defect positioning results corresponding to each parcel phase diagram, merging processing is conducted on the defect positioning results corresponding to each parcel phase diagram, and target defect positioning results of the highlight to be detected are obtained. According to the method, the texture fluctuation characteristic is predicted through the texture characteristic of the wrapping phase diagram by using a traditional image processing method to distinguish whether defects exist or not, a large amount of actual defect data acquired in advance is not needed, so that the defect detection difficulty of a highlight surface is greatly reduced, and meanwhile, the detection accuracy is higher.
Drawings
FIG. 1 is a diagram of an application environment for a highlight defect detection method in one embodiment;
FIG. 2 is a flow chart of a method for detecting a highlight defect according to one embodiment;
FIG. 3 is a schematic illustration of a parcel phase map in one embodiment;
FIG. 4 is a flowchart illustrating a step of obtaining a connected domain marker image according to an embodiment;
FIG. 5 is a schematic diagram of a Roberts direction operator in one embodiment;
FIG. 6 is a schematic diagram of a boundary information image corresponding to a parcel phase map in one embodiment;
FIG. 7 is a schematic diagram of a binary image corresponding to a parcel phase map in one embodiment;
FIG. 8 is a flowchart illustrating a step of obtaining a connected domain mark image according to another embodiment;
FIG. 9 is a schematic diagram of a connected domain marker image corresponding to a parcel phase map in an embodiment;
FIG. 10 is a flowchart illustrating steps for obtaining defect localization results corresponding to a parcel phase map according to an embodiment;
FIG. 11 is a flowchart illustrating a coordinate transformation process performed on a mask image and a parcel phase map according to an embodiment;
FIG. 12 is a schematic diagram illustrating steps performed in a rotational caliper process in one embodiment;
FIG. 13 is a flowchart illustrating a step of obtaining a defect localization result corresponding to a parcel phase map according to another embodiment;
FIG. 14 is a flowchart illustrating a step of merging defect localization results of each parcel phase map according to one embodiment;
FIG. 15 is a block diagram of a highlight defect detection device in one embodiment;
Fig. 16 is an internal structural view of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The method for detecting a defect on a highlight surface according to the embodiment of the present application may be applied to a defect detection system as shown in fig. 1, and may specifically include a display 110, an industrial camera 120, and a computer device 130. The computer device 130 may generate a stripe test pattern by encoding, project the stripe test pattern onto a detection area of the highlight of the object 140 to be detected through a screen of the display 110, and the industrial camera 120 is configured to collect a stripe image reflected by the detection area of the highlight of the object 140 to be detected, and transmit the stripe image back to the computer device 130 to implement the highlight defect detection of the object 140 to be detected.
Specifically, the computer device 130 communicates with the industrial camera 120 wirelessly or by wire, obtains at least one stripe image of the to-be-detected bright surface collected by the industrial camera 120, obtains at least one parcel phase map based on the stripe image of the same stripe frequency, performs connected domain analysis on each parcel phase map to obtain a connected domain mark image corresponding to each parcel phase map, marks at least one stripe connected domain area in the connected domain mark image, performs defect detection on each stripe connected domain area in the connected domain mark image one by one, obtains a defect positioning result corresponding to each parcel phase map, and finally performs merging processing based on the defect positioning result corresponding to each parcel phase map to obtain a target defect positioning result of the to-be-detected bright surface. The data storage system may store data that the computer device needs to process. The data storage system may be integrated on a computer device or may be located on a cloud or other network server.
The above-mentioned computer device 130 may be implemented in a terminal or a server, where the terminal may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, etc. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The server may be implemented as a stand-alone server or as a server cluster composed of a plurality of servers.
In an exemplary embodiment, as shown in fig. 2, a method for detecting a highlight defect is provided, and the method is applied to the computer device 130 in fig. 1 for illustration, and includes the following steps S200 to S800, where:
s200: and obtaining at least one fringe image of the highlight surface to be detected, and solving to obtain at least one parcel phase diagram based on the fringe images with the same fringe frequency.
It is understood that the highlight to be detected is a detection area of the highlight of the object to be detected. The inventor researches that the highlight surface has a light reflection characteristic, and the two-dimensional imaging mode is easy to overexposure and cannot better present texture information of the highlight surface. And the phase diagram projected onto the object is utilized to extract optical geometric information through the deflection beam measurement technology, so that the positioning defect information is detected according to the change of the geometric information, and the method has the characteristics of low cost, high robustness and high precision.
The computer device can generate a stripe test pattern capable of performing N-step phase shift through coding, uses devices such as a display and the like as a light source, projects the stripe test pattern on a highlight surface to be detected, performs phase shift while projecting by using a multi-step phase shift technology, and can reflect the stripe image carrying the stripe test pattern while receiving projection. And at the same time of phase shifting, the industrial camera collects the stripe image which is reflected by the highlight surface to be detected and carries the stripe test pattern, and feeds the collected stripe image back to the computer equipment.
Specifically, the number of collected stripe images on the highlight to be detected is not unique, and can be determined according to actual test requirements, namely, the number of stripe test patterns generated by the computer equipment. For example, the stripe test pattern can be generated based on different parameter information such as stripe type, stripe frequency and phase shift, and then multiple stripe test patterns can be generated under different parameter information combinations so as to acquire multiple stripe images reflected on the highlight to be detected. The stripe type can be transverse stripes or vertical stripes, and the stripe frequency can be selected according to specific test requirements. For example, the fringe frequency is not fixed, and for convenience of subsequent calculation, the fringe frequency may be set to be S S, S (S-1), (S-1), where S is a real number, and the value may be 5-10.
By way of example, in the embodiment of the present application, taking two stripe test patterns obtained by selecting the stripe type as vertical stripe, the stripe frequency as s×s, and (S-1) ×s-1 (s=6) as examples, the two stripe test patterns are respectively subjected to 4-step phase shift to acquire 8 reflected stripe images on the highlight to be detected, which are respectively I 11 、I 12 、I 13 、I 14 、I 21 、I 22 、I 23 And I 24 . It will be appreciated that where I 11 、I 12 、I 13 And I 14 The stripe frequencies of (2) are the same, and are S; i 21 、I 22 、I 23 And I 24 The stripe frequencies of (C) are the same, and are (S-1). Meanwhile, due to the 4-step phase shift of the stripe test pattern, the phase difference of two stripe images adjacent in the same directionIs pi/2, i.e. when I is obtained 14 Then, the stripe image obtained by performing one-step phase shift is matched with I 11 And consistent.
Further, the acquired fringe images with the same fringe frequency can be used for solving, intermediate processing information of a deflection beam measurement technology, namely a parcel phase diagram is obtained, and further, the defect detection of the highlight surface to be detected is realized by analyzing the geometric information change in the parcel phase diagram.
It can be understood that, because the parcel phase diagram obtained by solving under a single fringe frequency may have defects in the intersecting region of the fringe patterns and cannot be detected, and further, the embodiment of the application can make up for the defects in the intersecting region of the fringe patterns which cannot be detected by setting the fringe frequency to be a plurality of parcel phase diagrams, thereby achieving the purpose of improving the accuracy and the comprehensiveness of defect detection. Exemplary, the embodiment of the present application may respectively solve the 4 fringe images with the two fringe frequencies to obtain a first parcel phase diagram Phase map with second wrapping->Further, the defect areas which cannot be detected by the other party can be mutually compensated through the two parcel phase diagrams, so that the comprehensiveness of defect detection is ensured.
Further, the wrapping phase map is obtained by solving the fringe images based on the same fringe frequency, which can be that the sinusoidal component is obtained by solving according to the light intensity information of the fringe images with the same fringe frequencyAnd cosine component->Based on sinusoidal components->And cosine component->Solving through a preset formula to obtain a parcel phase diagram +.>. Wherein the sinusoidal component->And cosine component->The solution formula of (2) is as follows:
wherein I is n (x, y) is the light intensity information of the fringe image, n is the phase shift step number, the fringe image of the embodiment of the application is obtained through 4-step phase shift, and therefore, the values of n are 1, 2, 3 and 4 respectively. Parcel phase diagramThe solution formula of (2) is as follows:
illustratively, in order to obtain the geometric information change in the parcel phase map by analysis through the image processing means, the above-mentioned highlight defect detection method further includes, before performing the image processing of the following steps: and carrying out normalization pretreatment on each parcel phase diagram.
In particular, the preprocessing operation aims at mapping the parcel phaseNormalized to the 0-255 interval to facilitate the processing of the data of the parcel phase map in subsequent steps. From the above-mentioned parcel phase diagram- >The solving formula of (1) shows that the value range of the generated parcel phase diagram is +.>Furthermore, the parcel phase diagram can be +_ according to a preset normalization formula>The value range of (2) is converted to [0,255 ]]The preset normalization formula may specifically be:
further, according to the preset normalization formula, the first parcel phase map obtained by solving is calculatedPhase map with second wrapping->The normalization pretreatment is performed, and fig. 3 is a schematic diagram of a parcel phase diagram after the normalization pretreatment.
S400: and carrying out connected domain analysis on each parcel phase map to obtain a connected domain mark image corresponding to each parcel phase map, wherein at least one stripe connected domain area is marked in the connected domain mark image.
The connected domain refers to an image region which is formed by foreground pixel points with the same pixel value and adjacent positions in the image, and the connected domain analysis refers to finding and marking each connected domain in the image.
Specifically, the geometric information change in the parcel phase map can be extracted by carrying out connected domain analysis on the parcel phase map, namely, the area of the stripe pattern contained in each parcel phase map is extracted, so as to analyze the change condition of the boundary of each parcel phase map. It is understood that the connected domain marking image may be understood as marking a stripe region included in the parcel phase map, and also includes an image of a background region, that is, a region characterizing a stripe pattern included in the parcel phase map.
Further, as can be seen from fig. 3, the pixel change characteristic of the wrapping phase is a gradual change characteristic that the direction perpendicular to the stripe tends to 0-255, so the mode of obtaining the connected domain mark image may be that the wrapping phase image is firstly subjected to edge extraction, the background area and the stripe image area of the foreground are separated, and then each stripe image area included in the foreground area is respectively marked to obtain the connected domain mark image.
S600: and carrying out defect detection on each stripe connected domain area in the connected domain mark image one by one to obtain a defect positioning result corresponding to each parcel phase diagram.
Specifically, the defects are generally represented as regions with a sharp gradient change on the surface, so that the regions of each stripe connected domain in the connected domain marker image can be detected one by one based on the pixel value of the wrapping phase diagram of the region, and whether the regions with the sharp gradient change exist or not is analyzed, so that the defect positioning is realized.
It can be understood that, during actual testing, the collected stripe test pattern reflected by the stripe image of the highlight surface to be tested may have an angular offset, but the pixel variation characteristic of the wrapping phase is a gradual characteristic that tends to 0-255 perpendicular to the stripe direction. In order to improve defect detection efficiency, before defect detection is performed, the embodiment of the application can perform coordinate transformation on each stripe connected domain area in the connected domain mark image, and convert the stripe connected domain area into a vertical stripe approximately perpendicular to the lower edge of the image, so that defect detection can be conveniently realized according to the direction perpendicular to the stripe area.
Further, the defect positioning result is used for representing whether the package phase diagram comprises defect information or not and the position of the defect information in the package phase diagram.
S800: and combining the defect positioning results based on the corresponding parcel phase diagrams to obtain a target defect positioning result of the high-brightness surface to be detected.
Specifically, merging processing is performed based on defect positioning results corresponding to each parcel phase map, and one of the defect positioning results corresponding to each parcel phase map is to merge non-overlapped defect areas so as to solve the defect problem that the parcel phase map obtained by solving the single stripe frequency cannot detect the intersection area of the stripe patterns. And secondly, merging overlapped defect areas in defect positioning results corresponding to each parcel phase diagram so as to ensure that the detected defect areas are accurate enough.
It is understood for embodiments of the present application that the first parcel phase mapCorrespondingly, a first defect positioning result and a second wrapping phase diagram are obtained>And correspondingly obtaining a second defect positioning result, and further respectively merging the overlapping area and the non-overlapping area in the first defect positioning result and the second defect positioning result to obtain a target defect positioning result, namely an actual defect detection result of the highlight to be detected.
According to the highlight surface defect detection method, at least one stripe image of the highlight surface to be detected is obtained, at least one parcel phase diagram is obtained based on the stripe image with the same stripe frequency, connected domain analysis is conducted on each parcel phase diagram, connected domain mark images corresponding to each parcel phase diagram are obtained, at least one stripe connected domain area is marked in each connected domain mark image, defect detection is conducted on each stripe connected domain area in each connected domain mark image one by one, defect positioning results corresponding to each parcel phase diagram are obtained, merging processing is conducted on the defect positioning results corresponding to each parcel phase diagram, and target defect positioning results of the highlight surface to be detected are obtained. By using a traditional image processing method, texture fluctuation characteristics are predicted through the texture characteristics of the wrapping phase diagram to distinguish whether defects exist or not, and a large amount of actual defect data acquired in advance is not needed, so that the defect detection difficulty of a highlight surface is greatly reduced, and meanwhile, the detection accuracy is higher.
In one exemplary embodiment, as shown in fig. 4, S400 includes S420 to S440, wherein:
s420: and carrying out foreground and background separation processing on the parcel phase map to obtain a boundary information image corresponding to the parcel phase map.
In particular, packages may be segmented by image segmentation methodsPhase diagramPerforming foreground and background separation treatment to obtain a parcel phase diagram +.>Edge detection is carried out to extract and obtain a corresponding boundary information image B i . It can be understood that the method for image segmentation of the parcel phase map is not unique, and can be selected according to the requirements of those skilled in the art on the parcel phase map in actual testing, for example, a sobel algorithm, a Laplacian algorithm, a roberts algorithm, and the like can be selected.
The embodiment specifically implements foreground and background separation processing on the parcel phase map through a roberts algorithm, and specifically includes: four Roberts direction operators are constructed, and edges of the parcel phase map are enhanced by adopting the Roberts operators. The Roberts operator is also called a cross differential operator, is a gradient algorithm based on cross differential, detects edge lines through local differential calculation, is commonly used for processing an image with steep low noise, and has more ideal processing effect when the image edge is close to positive 45 degrees or negative 45 degrees.
As shown in fig. 5, the first direction operators are respectively from left to right and from top to bottom: -1, 0, 1; the second direction operator is respectively from left to right and from top to bottom: 0. -1, 0; the third direction operator is respectively from left to right and from top to bottom: 0. 1, -1, 0; the fourth direction operator is respectively from left to right and from top to bottom: 1. 0, -1. Correspondingly, the expressions of the four Roberts direction operators may be:
The naming mode of the subscripts in the expressions of the four Roberts direction operators is the sequence of the direction operators from left to right and from top to bottom. And x and y represent image coordinates, and Gray is the Gray value of the pixel point of the image.
It will be appreciated that wrapping phase based imagesThe element change characteristic is gradually changed towards 0-255 perpendicular to the direction of stripes, so that the gradient information of a background area and the boundary information of 0 and 255 between stripes of a foreground area can be extracted by adopting a Roberts edge extraction method to obtain a boundary information image B i . Wherein B is i The expression of (2) is:
FIG. 6 is a boundary information image B obtained by performing foreground and background separation processing on the parcel phase map shown in FIG. 3 i The connected domain characterized by the large-area blank region is a region of the stripe pattern, the region of the stripe pattern is also divided by a boundary line between the stripe patterns, and the background region is connected together by the finely broken small blocks.
Further, for the first parcel phase mapPerforming foreground and background separation to obtain a first parcel phase diagram +.>Corresponding first boundary information image B 1i For the second wrapping phase diagram +.>Performing foreground and background separation treatment to obtain second wrapping phase diagram +. >Corresponding second boundary information image B 2i
S440: and carrying out stripe region extraction processing on the boundary information image corresponding to the parcel phase map to obtain a connected domain mark image corresponding to the parcel phase map.
Specifically, the boundary information image B i Performing stripe region extraction processing on the boundary information image B i Performing connected domain analysis, namely boundary information image B i Image area finding composed of foreground pixel points with same pixel value and adjacent positionsAnd outputting and marking to obtain a connected domain marking image C corresponding to the parcel phase diagram.
In an exemplary embodiment, in boundary information image B i Before the connected domain analysis, boundary information image B is needed i Binarization processing is carried out to ensure that the areas of the stripe images have the same pixel value, so that stripe area extraction processing is facilitated. Illustratively, the boundary information image B i The binarization processing may be performed on the boundary information image B i The value range of the medium is 0-255]To obtain boundary information image B i Corresponding binary image B bin . It will be appreciated that a binary image is characterized by only two possible values or gray scale states for the pixel value of each pixel on the image. Fig. 7 is a view showing the boundary information image B shown in fig. 6 i Binary image B obtained by binarization processing bin
In one exemplary embodiment, as shown in fig. 8, S440 includes S442 to S444, wherein:
s442: traversing connected domain features in the boundary information image corresponding to the parcel phase diagram, and marking to obtain at least one connected domain region in the boundary information image, wherein the attribute information of the connected domain region at least comprises the connected domain area.
Specifically, the boundary information image B is traversed by pixel points i Corresponding binary image B bin Based on the connected domain feature, pixel points having the same pixel value and adjacent positions therein are marked as the same connected domain region.
It is understood that attribute information needs to be given to each connected domain region while the same connected domain region is marked. The attribute information of the connected domain region at least comprises a number, position information, and a connected domain area, wherein the position information comprises the center of gravity of the connected domain region and the position of the ROI (Region of Interest region of interest), and the position of the ROI comprises the center position coordinate, the width of the positioning frame, the height of the positioning frame, and the like
S444: and filtering the connected domain areas of the connected domains in the boundary information image based on a preset area threshold value to obtain a connected domain mark image corresponding to the parcel phase diagram, wherein at least one stripe connected domain area is marked in the connected domain mark image.
Specifically, as shown in fig. 7, it can be seen that the white area of the foreground area is far greater than the white particle area of the background area, and the areas of the stripe patterns in the foreground area tend to be approximately consistent, so that the preset area threshold T, which is approximately similar to the area of the stripe patterns, can be set a priori, and each connected domain area obtained by marking can be filtered to obtain at least one stripe connected domain area.
Further, the boundary information image B i Corresponding binary image B bin And (3) re-marking, namely marking the filtered connected domain areas of all the stripes so as to obtain a connected domain marking image C corresponding to the wrapping phase diagram. It will be understood that, in the connected domain mark image C, each stripe connected domain region is also given the above attribute information, i.e. includes at least a number, position information, and connected domain area, wherein the position information may include the center of gravity and ROI position of the connected domain region, and the ROI position may include the center position coordinate, the positioning frame width, and the positioning frame height, i.e.
Illustratively, in the connected domain labeled image C shown in fig. 9, in the stripe connected domain region with the number 1 corresponding to 101, the pixel values of the pixels thereof are all labeled 1, in the stripe connected domain region with the number 2 corresponding to 102, the pixel values of the pixels thereof are all labeled 2, and so on, and in the stripe connected domain region with the number 9 corresponding to 109, the pixel values of the pixels thereof are all labeled 9.
It can be understood that after the connected domain mark image C marked with at least one stripe connected domain region is obtained, defect detection can be performed one by one according to the number of the stripe connected domain region. In one exemplary embodiment, as shown in fig. 10, S600 includes S620 to S680, wherein:
s620: and obtaining a mask image and a parcel phase map corresponding to each stripe connected domain region in the connected domain mark image.
Specifically, the mask image corresponding to the stripe connected domain region is used for realizing data processing on the stripe connected domain region independently. It is understood that in the connected-domain labeled image C, the pixel values of the other image regions except for the stripe connected-domain region are all 0.
Illustratively, acquiring the mask image corresponding to the stripe connected domain region in the connected domain mark image may specifically include: initializing a mask image; and performing region-of-interest processing on the mask image based on the attribute information of the stripe connected region to obtain the mask image corresponding to the stripe connected region.
Specifically, the stripe connected domain area with the number of n is set as the stripe connected domain area to be processed to obtain the mask image. One mask image M may be initialized, i.e. each pixel value in the mask image M is set to zero. Updating the mask image M based on the pixel values of the pixel points of the stripe connected domain region with the number n to obtain a mask image associated with the stripe connected domain region with the number n . Wherein, can pass->The mask image M is updated. Finally the ROI position of the stripe connected domain region with the number n (namely +.>) Mask image->Performing region of interest processing to obtain mask image +.>
Further, the wrapping phase diagram corresponding to the stripe connected domain area is used for determining whether a defect with a sharp gradient change exists in the area or not so as to realize defect detection. It can be understood that, by combining the mask image and the wrapping phase map corresponding to the stripe connected domain region, the data processing can be performed on the stripe connected domain region alone, and whether the region has defects with severe gradient change or not is analyzed and determined, so that defect detection is realized.
For example, for the stripe connected domain region numbered n, the initial parcel phase map numbered n may be first mappedIs initialized to zero, in the presence of +.>For the initial parcel phase diagram->Updating to obtain an initial parcel phase diagram corresponding to the stripe connected domain area with the number of n>
S640: and carrying out coordinate transformation on the mask image and the wrapping phase map corresponding to each stripe connected domain area to obtain a standard mask image and a standard wrapping phase map corresponding to each stripe connected domain area.
Specifically, the standard mask image and the standard wrapping phase diagram are stripe images and are converted into images of vertical stripes approximately perpendicular to the lower edge of the images, so that defect detection is conveniently realized according to the direction perpendicular to the stripe area, and defect detection efficiency is improved.
In one exemplary embodiment, as shown in fig. 11, S640 includes S642 to S646, wherein:
s642: and carrying out rotary diameter measurement on the mask image corresponding to each stripe connected domain area to obtain the longest direction angle of each stripe connected domain area.
Specifically, the longest direction angle of the stripe communication region is an angle α between the longest direction of the stripe communication region and the vertical direction (Y-axis direction). It can be understood that the longest direction of the stripe communication area is generally the long side direction of the stripe communication area, and further, the mask image and the parcel phase diagram are converted based on the included angle alpha between the long side direction and the vertical direction, so that the stripe image in the stripe communication area can be converted into the image of the vertical stripe approximately perpendicular to the lower edge of the image.
Exemplary, mask images corresponding to each stripe connected region can be obtainedAnd (5) performing rotary diameter measurement treatment to obtain the longest direction angle of each stripe connected domain area. Specifically, mask image corresponding to the connected domain region by stripe +. >Edge profile sequence>One polygon P can be determined correspondingly, and further, the rotation diameter measurement processing can be performed in a manner shown in fig. 12 to determine the longest direction in the polygon P. The initial support line is set to be transverse (X-axis direction), and the point pair with the smallest and largest Y component on the convex polygon P is found as the initial point-point pair heel pair (point-point pair heel pair as shown in FIG. 12), namely, the initial point-point pair heel is ++>. Calculate two parallel support lines and sides +.>Side->Included angles of->,/>Is provided with->The supporting line is edgedEdge profile sequence direction rotation +.>Point pair now->To become a new point-point pair heel pair, the process is repeated until a cycle is completed until +.>Maximum dot pair->. Through point pair->The longest direction of the fringe pattern area can be obtained.
In addition, the edge profile sequence may be performed prior to the rotational caliper processNormalization processing is performed to improve efficiency in processing the longest direction of the fringe pattern area. Specifically, traverse mask image corresponding to stripe connected domain region +.>Edge profile sequence>Normalized sequence length->If->Greater than a preset threshold length->Then use the formula +.>Calculated->I.e. length of equal length samples, using +. >To reduce the edge profile sequence +.>Is to obtain the second edge profile sequence +.>And further based on the second edge profile sequence +.>Correspondingly determining a polygon P 2 And the polygon P is determined by performing rotation diameter measurement in the manner shown in FIG. 12 2 Based on which the longest direction angle α of the stripe connected domain region is obtained.
S644: the coordinate conversion coefficient is set based on the longest direction angle of each stripe connected domain region.
Specifically, after the longest directional angle α of each stripe connected domain area is obtained, the coordinate transformation coefficient R corresponding to each stripe connected domain area can be set by the following formula, specifically:
s646: and carrying out coordinate transformation on the mask image corresponding to each stripe connected domain region and the wrapping phase map according to the coordinate transformation coefficient to obtain a standard mask image and a standard wrapping phase map corresponding to each stripe connected domain region.
Specifically, after the coordinate transformation coefficients R corresponding to the respective stripe connected domain regions are obtained, the mask image corresponding to the respective stripe connected domain regions can be obtained by the following formulaPerforming coordinate transformation to obtain standard corresponding to each stripe connected domain regionMask image->The method specifically comprises the following steps:
M droi = R•M nori
Further, after the coordinate transformation coefficients R corresponding to the respective stripe connected domain regions are obtained, the parcel phase map corresponding to the respective stripe connected domain regions can be obtained by the following formulaCoordinate transformation is carried out to obtain a standard parcel phase diagram corresponding to each stripe connected domain area>The method specifically comprises the following steps:
s660: and performing defect detection based on the standard mask image corresponding to each stripe connected domain area and the standard parcel phase diagram to obtain a preliminary defect positioning result corresponding to the parcel phase diagram.
Specifically, the defects are generally represented as regions with a sharp gradient change on the surface, so that the regions of each stripe connected domain in the connected domain marker image can be detected one by one based on the pixel value of the wrapping phase diagram of the region, and whether the regions with the sharp gradient change exist or not is analyzed, so that the defect positioning is realized. The initial defect positioning result representation is a result obtained by performing defect detection based on a standard parcel phase diagram, and the defect positioning result of the actual parcel phase diagram can be represented only after coordinate inverse conversion.
Further, as shown in fig. 3, for a single stripe connected domain region, the pixels in the direction perpendicular to the stripe are linear change features tending to 0-255 or 255-0, so that linear fitting can be performed according to each pixel point in the direction perpendicular to the stripe, and then the region with the gradient severely changed in the direction of the stripe is estimated based on the distance between each pixel point and the fitting straight line. And positioning to obtain the region with the gradient which is changed severely in the direction perpendicular to the stripe direction based on the limitation of the region with the gradient which is changed severely in the stripe direction so as to position to obtain the defect region in the wrapping point bitmap.
It can be appreciated that the defect localization result can be the center coordinates of the defect localization frameAdding positioning frame length and width informationForm of (c) is expressed, e.g->
In one exemplary embodiment, as shown in fig. 13, S660 includes S661 to S665, wherein:
s661: and obtaining at least one non-zero pixel change line of the standard parcel phase diagram corresponding to each stripe connected domain area in the direction vertical to the stripes.
Wherein the non-zero pixel change lineAnd fitting a straight line based on each pixel point in the direction perpendicular to the stripes of the single stripe connected domain area.
In particular, can be based onFitting, wherein i represents a standard parcel phase diagram +.>Pixel row number, y i Each pixel value representing a pixel of the ith row, and x represents the sequential column number of the pixel of the ith row. Further, the non-zero pixel change line of the ith row of pixels can be obtained by linear fitting based on the x pixel values of the ith row of pixels>. It will be appreciated that y i The pixel values of the i-th row of pixels are all required to be non-zero pixel values, and the zero pixel values and the column numbers do not participate in fittingObtain non-zero pixel change line->
Further, for a single stripe connected domain region, the standard parcel phase diagram can be based onFitting in a direction perpendicular to the stripes to obtain at least one non-zero line of pixel variation +. >. Wherein the non-zero pixel change line +.>Is +.about.the number of (2) and its standard package phase diagram>The number of non-zero pixel rows included is uniform.
S662: and determining the distance information of each non-zero pixel point and a non-zero pixel change line on the standard mask image corresponding to each stripe connected domain area.
Specifically, after obtaining a standard parcel phase diagram corresponding to the stripe connected domain regionNon-zero pixel change line corresponding to each pixel row of (2)>Then, the standard mask image corresponding to the stripe connected domain area can be based on +.>Determining non-zero pixel change lines corresponding to the pixel rows of each non-zero pixel point row by row>Distance information d between them.
It can be understood that the standard mask image for the stripe connected regionEach non-zero pixel point on each line in the array, relative to straight line +.>Distance information d is calculated.
S663: and comparing each distance information with a preset distance threshold value, and determining a first defect area of each stripe connected domain area in the stripe direction.
Specifically, if the distance information d of the non-zero pixel point in a certain pixel row exceeds the preset distance threshold T d The pixel row may be marked as a defective row. Further, after finishing the distance information of all non-zero pixel points of all pixel rows and the preset distance threshold T d The first defect region of the stripe-connected region in the stripe direction can be determined based on all of the marked defect lines. The adjacent defect rows may be determined as the first defect area after the merging process. The first defect region can be understood as a standard wrap-around phase map corresponding to the stripe connected regionThere is a location of the row coordinates of the defect.
Exemplary, the distance information d of non-zero pixel points for a pixel row is compared with a preset distance threshold T d In the process of comparison, it can be determined that the distance information d of the non-zero pixel point exceeds the preset distance threshold T d And marking the pixel row as a defect and entering the comparison of the next pixel row so as to accelerate the defect positioning efficiency.
S664: and calculating gradient change values of non-zero pixel points in the first defect area of each stripe connected area according to the direction perpendicular to the stripes.
Specifically, for the determined first defect region in the stripe connected region, a standard mask image is calculated in a direction perpendicular to the stripeGradient change of each non-zero pixel pointAnd (5) converting the value t. The gradient change value t of each non-zero pixel point can be understood as a difference between the pixel value of the next pixel point and the pixel value of the previous pixel point in the row direction.
S665: and determining a second defect area of each stripe connected domain area based on each gradient change value and a preset gradient change threshold value, wherein the preliminary defect positioning result corresponding to the wrapping phase diagram comprises the second defect area of each stripe connected domain area.
Specifically, if the gradient change value T of the non-zero pixel point in a certain pixel row is greater than the preset gradient change threshold T t The pixel column where the non-zero pixel point is located can be marked as a defect column. Further, the gradient change value T of all non-zero pixel points of all pixel rows is completed with the preset gradient change threshold value T t After the comparison, the second defective area of the stripe communication area can be determined based on the defective columns of all marks. It will be appreciated that, since the second defect region is determined under the limitation of the defect row coordinates, the result of the second defect region may be further used as the defect localization result of the stripe communication region.
Further, after the second defect areas of all the stripe connected areas are sequentially determined, the second defect area of each stripe connected area can be determined as a wrapping phase diagramAnd (5) corresponding preliminary defect positioning results.
Similarly, adjacent defective columns may be determined as the second defective region after the merging process. The gradient change value T of the non-zero pixel points of a pixel row one by one and a preset gradient change threshold T t In the process of comparison, it may be determined that the gradient change value T of the non-zero pixel point exceeds the preset gradient change threshold T t And when the pixel column of the non-zero pixel point is marked as a defect column and enters the comparison of the next pixel row, so that the defect positioning efficiency is improved.
S680: and carrying out coordinate inverse transformation on the preliminary defect positioning result corresponding to the parcel phase diagram to obtain the defect positioning result corresponding to the parcel phase diagram.
Specifically, the standard parcel phase diagram corresponding to the stripe connected domain regionThe corresponding defect localization result is preliminary defect localization result +.>It can be understood that the defect localization result is in a coordinate system in which the coordinates are converted into an approximately vertical streak image. Furthermore, the preliminary defect localization result is required to be +.>Performing coordinate inverse transformation to obtain an actual parcel phase map +.>Corresponding defect localization results->
Illustratively, the ROI position of the connected domain region by each stripe (i.e) Center coordinates of defect positioning frame +.>Coordinate translation is performed to obtain the actual parcel phase map +.>Corresponding defect localization results->The calculation formula is as follows:
wherein, the defect positioning resultMiddle positioning frame length and width information->Preliminary defect localization results can be followed >Is a result of (a).
In one exemplary embodiment, as shown in fig. 14, S800 includes S820 to S860, wherein:
s820: and determining the intersection area and the union area between every two based on the defect positioning result corresponding to each parcel phase diagram.
Specifically, each parcel phase mapCorresponding defect localization results->The method comprises the steps of carrying out intersection and union treatment on a plurality of defect areas in pairs to determine at least one intersection area and at least one union area.
To a first parcel phase map as referred to in the embodiments of the present applicationPhase map with second wrapping->The corresponding defect localization results are explained. Let us assume the first parcel phase map->The corresponding first defect localization result Des1 (x, y, w, h) comprises a defect area, a second wrapping phase map +.>The corresponding second defect localization result Des2 (x, y, w, h) also includes only one defect area, and a set of intersection area and union area can be determined based on the two defect areas. And assume the first packetPhase diagram->The corresponding first defect localization result Des1 (x, y, w, h) comprises two defect areas, and the second wrapping phase map +_>The corresponding second defect positioning result Des2 (x, y, w, h) only includes one defect area, and then the two defect areas included in the first defect positioning result Des1 (x, y, w, h) are respectively processed with the defect areas included in the second defect positioning result Des2 (x, y, w, h) to determine two groups of intersection areas and union areas >
S840: and calculating at least one piece of intersection ratio information based on the intersection area and the union area. Specifically, the cross-over ratio information corresponding to at least one set of cross-over area and cross-over area can be obtained through calculation in a IOU (Intersection over Union) cross-over ratio mode.
S860: and merging two defect positioning results corresponding to each cross ratio information larger than a preset cross ratio threshold value to obtain a target defect positioning result of the bright surface to be detected.
Specifically, when the calculated cross-over ratio information is greater than a preset cross-over ratio threshold valueIn the case of (2), the two corresponding defect areas are characterized to have overlapping, and can be combined to ensure that the detected defect areas are sufficiently accurate.
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail with reference to a specific embodiment. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
In a specific embodiment, a method for detecting a highlight defect is provided, which specifically includes the following steps:
1. obtaining 8 stripe images with four-step phase shift and two stripe frequencies of a to-be-detected high-brightness surface, wherein each 4 images are identical The fringe frequency and each of the co-frequency images has a different phase shift. For example, can be respectively named I 11 、I 12 、I 13 、I 14 、I 21 、I 22 、I 23 And I 24 Wherein I 11 、I 12 、I 13 And I 14 The stripe frequencies of (2) are the same, and are S; i 21 、I 22 、I 23 And I 24 The stripe frequencies of (C) are the same, S-1 is (S-1), S is a real number, and the value can be 5-10.
2. Wrapping phase diagram for 4 stripe images with same frequencySolving to obtain a package phase diagram of two frequencies +.>、/>
3. Wrap phase diagram for two fringe frequencies、/>Carrying out normalization pretreatment, and taking the value from +.>Converted to->
4. Wrap phase diagram for two fringe frequencies、/>Image segmentation of the foreground and the background is carried out to obtain corresponding boundary information images B respectively i
5. Boundary information image B for two stripe frequencies i And (3) extracting the stripe regions to respectively obtain corresponding connected domain mark images C, wherein at least one stripe connected domain region is marked in the connected domain mark images C.
6. Wrap phase diagram for single fringe frequencyThe connected domain mark image C of the connected domain area is processed one by one, and the longest direction angle alpha of the connected domain area of the stripes is obtained first.
7. The stripe connected domain regions are converted into standard wrap-around phase maps approximating vertical stripes based on the longest directional angle α of each stripe connected domain region.
8. And performing defect detection on each standard parcel phase diagram to obtain a defect positioning result comprising a defect area.
9. And converting the defect positioning result of the standard parcel phase diagram into the defect positioning result of the original parcel phase diagram.
10. Repeating the steps 6-9 to obtain two wrapping phase diagrams with fringe frequencies、/>The defect localization result of each stripe connected domain region in the connected domain marker image C. Namely, the characterization step 6-9 can detect a parcel phase diagram +.>The defect information in the package phase diagram is detected by repeatedly executing the steps 6-9>Defect information in the image.
11. Phase diagram of package for two fringe frequencies、/>And combining the corresponding defect positioning results to obtain a final defect positioning result of the highlight to be detected finally.
In this embodiment, a traditional image processing method is adopted, no data learning is needed, the basic principle of deflection operation is mainly focused, the whole algorithm flow is decomposed into small problems in image processing by using the encoding result of the parcel phase diagram, the scene of each algorithm link is strictly controlled, and the stability of the algorithm is ensured. And predicting texture fluctuation characteristics by utilizing the texture characteristics of the parcel phase diagram to distinguish whether defects exist or not. And the direction of a single stripe region is determined by combining a rotary diameter measurement method, so that the detection of stripes at different angles is simplified, and the algorithm scene is simplified.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a highlight defect detection device for realizing the highlight defect detection method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in the embodiments of the device for detecting a defect on a highlight surface provided below may be referred to as the limitation of the method for detecting a defect on a highlight surface hereinabove, and will not be repeated here.
In an exemplary embodiment, as shown in fig. 15, there is provided a highlight defect detecting apparatus including: the package phase diagram solving module 10, the connected domain labeling image obtaining module 20, the defect detecting module 30 and the defect merging module 40, wherein:
the parcel phase diagram solving module 10 is configured to obtain at least one stripe image of a highlight surface to be detected, and solve to obtain at least one parcel phase diagram based on the stripe images with the same stripe frequency;
the connected domain mark image obtaining module 20 is configured to perform connected domain analysis on each parcel phase map, so as to obtain a connected domain mark image corresponding to each parcel phase map, where at least one stripe connected domain area is marked in the connected domain mark image;
the defect detection module 30 is configured to detect the stripe connected domain areas in the connected domain mark image one by one, so as to obtain a defect positioning result corresponding to each parcel phase map;
and the defect merging module 40 is used for merging based on the defect positioning results corresponding to the parcel phase diagrams to obtain a target defect positioning result of the high brightness surface to be detected.
In an exemplary embodiment, the connected domain label image obtaining module 20 is further configured to perform foreground and background separation processing on the parcel phase map, so as to obtain a boundary information image corresponding to the parcel phase map; and carrying out stripe region extraction processing on the boundary information image corresponding to the parcel phase map to obtain a connected domain mark image corresponding to the parcel phase map.
In an exemplary embodiment, the connected domain marking image obtaining module 20 is further configured to traverse the connected domain feature in the boundary information image corresponding to the parcel phase map, mark to obtain at least one connected domain area in the boundary information image, where the attribute information of the connected domain area at least includes the connected domain area; and filtering the connected domain areas of the connected domains in the boundary information image based on a preset area threshold value to obtain a connected domain mark image corresponding to the parcel phase diagram, wherein at least one stripe connected domain area is marked in the connected domain mark image.
In an exemplary embodiment, the defect detection module 30 is further configured to obtain a mask image and a parcel phase map corresponding to each stripe connected domain area in the connected domain mark image; coordinate transformation is carried out on the mask image and the wrapping phase diagram corresponding to each stripe connected domain area, and a standard mask image and a standard wrapping phase diagram corresponding to each stripe connected domain area are obtained; performing defect detection based on the standard mask image corresponding to each stripe connected domain area and the standard parcel phase map to obtain a preliminary defect positioning result corresponding to the parcel phase map; and carrying out coordinate inverse transformation on the preliminary defect positioning result corresponding to the parcel phase diagram to obtain the defect positioning result corresponding to the parcel phase diagram.
In an exemplary embodiment, the defect detection module 30 is further configured to perform a rotation diameter measurement process on the mask image corresponding to each stripe connected domain area, so as to obtain a longest directional angle of each stripe connected domain area; setting and obtaining a coordinate transformation coefficient based on the longest direction angle of each stripe connected domain area; and carrying out coordinate transformation on the mask image corresponding to each stripe connected domain region and the wrapping phase map according to the coordinate transformation coefficient to obtain a standard mask image and a standard wrapping phase map corresponding to each stripe connected domain region.
In an exemplary embodiment, the defect detection module 30 is further configured to obtain at least one non-zero pixel change line of the standard parcel phase map corresponding to each stripe connected domain area in a direction perpendicular to the stripe; determining the distance information of each non-zero pixel point and a non-zero pixel change line on the standard mask image corresponding to each stripe connected domain area; comparing each distance information with a preset distance threshold value, and determining a first defect area of each stripe connected domain area in the stripe direction; calculating gradient change values of non-zero pixel points in a first defect area of each stripe connected domain area according to the direction perpendicular to the stripes; and determining a second defect area of each stripe connected domain area based on each gradient change value and a preset gradient change threshold value, wherein the preliminary defect positioning result corresponding to the wrapping phase diagram comprises the second defect area of each stripe connected domain area.
In an exemplary embodiment, the defect merging module 40 is further configured to determine an intersection area and a union area between every two pairs based on defect positioning results corresponding to each parcel phase map; calculating at least one intersection ratio information based on the intersection area and the union area; and merging two defect positioning results corresponding to each cross ratio information larger than a preset cross ratio threshold value to obtain a target defect positioning result of the bright surface to be detected.
The above-described respective modules in the highlight defect detecting apparatus may be realized in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In an exemplary embodiment, a computer device, which may be a terminal, is provided, and an internal structure thereof may be as shown in fig. 16. The computer device includes a processor, a memory, an input/output interface, a communication interface, a display unit, and an input means. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program when executed by a processor implements a highlight defect detection method. The display unit of the computer device is used for forming a visual picture, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be a key, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 16 is merely a block diagram of a portion of the structure associated with the present application and is not limiting of the computer device to which the present application is applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In an exemplary embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method described above when executing the computer program.
In one embodiment, a computer readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, implements the steps of the method described above.
In an embodiment, a computer program product is provided comprising a computer program which, when executed by a processor, implements the steps of the method described above.
It should be noted that, the user information (including, but not limited to, user equipment information, user personal information, etc.) and the data (including, but not limited to, data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use, and processing of the related data are required to meet the related regulations.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (10)

1. A method for detecting a highlight defect, the method comprising:
acquiring at least one stripe image of a highlight surface to be detected, and solving to obtain at least one parcel phase diagram based on the stripe images with the same stripe frequency;
carrying out connected domain analysis on each parcel phase map to obtain a connected domain mark image corresponding to each parcel phase map, wherein at least one stripe connected domain area is marked in the connected domain mark image;
Performing defect detection on each stripe connected domain area in the connected domain mark image one by one to obtain a defect positioning result corresponding to each parcel phase map;
and combining the defect positioning results based on the corresponding parcel phase diagrams to obtain the target defect positioning result of the high-brightness surface to be detected.
2. The method according to claim 1, wherein the performing the connected domain analysis on each of the parcel phase maps to obtain the connected domain marker image corresponding to each of the parcel phase maps includes:
performing foreground and background separation processing on the parcel phase map to obtain a boundary information image corresponding to the parcel phase map;
and carrying out stripe region extraction processing on the boundary information image corresponding to the parcel phase map to obtain a connected domain mark image corresponding to the parcel phase map.
3. The method according to claim 2, wherein the performing stripe region extraction processing on the boundary information image corresponding to the parcel phase map to obtain a connected domain mark image corresponding to the parcel phase map includes:
traversing connected domain features in the boundary information image corresponding to the parcel phase diagram, and marking to obtain at least one connected domain region in the boundary information image, wherein the attribute information of the connected domain region at least comprises the connected domain area;
And filtering the connected domain area of each connected domain in the boundary information image based on a preset area threshold value to obtain a connected domain mark image corresponding to the parcel phase diagram, wherein at least one stripe connected domain area is marked in the connected domain mark image.
4. The method according to claim 1, wherein performing defect detection on each of the stripe connected domain areas in the connected domain mark image one by one to obtain a defect positioning result corresponding to each of the parcel phase maps comprises:
obtaining mask images and parcel phase diagrams corresponding to the stripe connected domain areas in the connected domain mark images;
performing coordinate transformation on the mask image and the wrapping phase map corresponding to each stripe connected domain area to obtain a standard mask image and a standard wrapping phase map corresponding to each stripe connected domain area;
performing defect detection based on a standard mask image and a standard parcel phase map corresponding to each stripe connected domain area, and obtaining a preliminary defect positioning result corresponding to the parcel phase map;
and carrying out coordinate inverse transformation on the preliminary defect positioning result corresponding to the parcel phase diagram to obtain the defect positioning result corresponding to the parcel phase diagram.
5. The method according to claim 4, wherein the performing coordinate transformation on the mask image and the parcel phase map corresponding to each stripe connected domain region to obtain the standard mask image and the standard parcel phase map corresponding to each stripe connected domain region includes:
performing rotary diameter measurement on the mask image corresponding to each stripe communication domain area to obtain the longest direction angle of each stripe communication domain area;
setting and obtaining a coordinate transformation coefficient based on the longest direction angle of each stripe connected domain area;
and carrying out coordinate transformation on the mask image and the wrapping phase map corresponding to each stripe connected domain region according to the coordinate transformation coefficient to obtain a standard mask image and a standard wrapping phase map corresponding to each stripe connected domain region.
6. The method of claim 4, wherein performing defect detection based on the standard mask image and the standard parcel phase map corresponding to each stripe connected domain region to obtain a preliminary defect positioning result corresponding to the parcel phase map, comprises:
acquiring at least one non-zero pixel change line of a standard parcel phase diagram corresponding to each stripe connected domain area in a direction perpendicular to stripes;
Determining distance information between each non-zero pixel point and the non-zero pixel change line on the standard mask image corresponding to each stripe connected domain region;
comparing each piece of distance information with a preset distance threshold value, and determining a first defect area of each stripe connected domain area in the stripe direction;
calculating gradient change values of non-zero pixel points in a first defect area of each stripe connected domain area according to the direction perpendicular to the stripes;
and determining a second defect area of each fringe communication domain area based on each gradient change value and a preset gradient change threshold value, wherein the preliminary defect positioning result corresponding to the wrapping phase diagram comprises the second defect area of each fringe communication domain area.
7. The method according to any one of claims 1 to 6, wherein the combining processing based on the defect positioning results corresponding to each of the parcel phase diagrams to obtain the target defect positioning result for the to-be-detected high-brightness surface includes:
determining intersection area and union area between every two based on defect positioning results corresponding to the parcel phase diagrams;
calculating at least one intersection ratio information based on the intersection area and the union area;
And merging two defect positioning results corresponding to the cross ratio information which is larger than a preset cross ratio threshold value to obtain the target defect positioning result of the to-be-detected high-brightness surface.
8. A highlight defect detection apparatus, the apparatus comprising:
the parcel phase diagram solving module is used for acquiring at least one stripe image of the highlight surface to be detected and solving to obtain at least one parcel phase diagram based on the stripe images with the same stripe frequency;
the connected domain mark image acquisition module is used for carrying out connected domain analysis on each parcel phase map to obtain a connected domain mark image corresponding to each parcel phase map, wherein at least one stripe connected domain area is marked in the connected domain mark image;
the defect detection module is used for detecting the defects of the stripe connected domain areas in the connected domain mark image one by one to obtain a defect positioning result corresponding to each parcel phase diagram;
and the defect merging module is used for merging based on the defect positioning results corresponding to the parcel phase diagrams to obtain the target defect positioning result of the to-be-detected high-brightness surface.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202311626390.9A 2023-11-30 2023-11-30 Highlight defect detection method, highlight defect detection device, computer equipment and storage medium Pending CN117522850A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311626390.9A CN117522850A (en) 2023-11-30 2023-11-30 Highlight defect detection method, highlight defect detection device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311626390.9A CN117522850A (en) 2023-11-30 2023-11-30 Highlight defect detection method, highlight defect detection device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117522850A true CN117522850A (en) 2024-02-06

Family

ID=89755005

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311626390.9A Pending CN117522850A (en) 2023-11-30 2023-11-30 Highlight defect detection method, highlight defect detection device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117522850A (en)

Similar Documents

Publication Publication Date Title
Zhou et al. Canny-vo: Visual odometry with rgb-d cameras based on geometric 3-d–2-d edge alignment
CN113781402B (en) Method and device for detecting scratch defects on chip surface and computer equipment
US10699476B2 (en) Generating a merged, fused three-dimensional point cloud based on captured images of a scene
Huhle et al. Fusion of range and color images for denoising and resolution enhancement with a non-local filter
Kovesi MATLAB and Octave functions for computer vision and image processing
US9245200B2 (en) Method for detecting a straight line in a digital image
CN109580630B (en) Visual inspection method for defects of mechanical parts
CN109977886B (en) Shelf vacancy rate calculation method and device, electronic equipment and storage medium
CN109544599B (en) Three-dimensional point cloud registration method based on camera pose estimation
Sibbing et al. Sift-realistic rendering
CN106062824B (en) edge detecting device and edge detection method
CN110866924A (en) Line structured light center line extraction method and storage medium
Zong et al. An intelligent and automated 3D surface defect detection system for quantitative 3D estimation and feature classification of material surface defects
JP7390497B2 (en) Image processing methods, apparatus, computer programs, and electronic devices
US20200258300A1 (en) Method and apparatus for generating a 3d reconstruction of an object
US20100266212A1 (en) Estimating Vanishing Points in Images
CN114627227A (en) Object reconstruction method and device based on PBR material and computer readable storage medium
Agresti et al. Stereo and ToF data fusion by learning from synthetic data
Biasutti et al. Visibility estimation in point clouds with variable density
Ujaldón et al. On the computation of the Circle Hough Transform by a GPU rasterizer
Shi et al. Depth sensing with coding-free pattern based on topological constraint
CN117522850A (en) Highlight defect detection method, highlight defect detection device, computer equipment and storage medium
Balado et al. Multi feature-rich synthetic colour to improve human visual perception of point clouds
CN115601616A (en) Sample data generation method and device, electronic equipment and storage medium
CN105930813B (en) A method of detection composes a piece of writing this under any natural scene

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