CN117036331A - Visual detection method, device, equipment and medium based on image recognition - Google Patents
Visual detection method, device, equipment and medium based on image recognition Download PDFInfo
- Publication number
- CN117036331A CN117036331A CN202311068701.4A CN202311068701A CN117036331A CN 117036331 A CN117036331 A CN 117036331A CN 202311068701 A CN202311068701 A CN 202311068701A CN 117036331 A CN117036331 A CN 117036331A
- Authority
- CN
- China
- Prior art keywords
- image
- tile
- detected
- connected domain
- domain diagram
- 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
Links
- 238000001514 detection method Methods 0.000 title abstract description 19
- 230000000007 visual effect Effects 0.000 title abstract description 13
- 238000010586 diagram Methods 0.000 claims abstract description 55
- 238000000034 method Methods 0.000 claims abstract description 51
- 230000011218 segmentation Effects 0.000 claims abstract description 18
- 239000000919 ceramic Substances 0.000 claims abstract description 13
- 238000007781 pre-processing Methods 0.000 claims abstract description 12
- 238000004458 analytical method Methods 0.000 claims abstract description 11
- 230000006870 function Effects 0.000 claims description 38
- 238000011179 visual inspection Methods 0.000 claims description 25
- 238000012545 processing Methods 0.000 claims description 18
- 238000004590 computer program Methods 0.000 claims description 17
- 238000009499 grossing Methods 0.000 claims description 17
- 230000007547 defect Effects 0.000 claims description 11
- 230000009467 reduction Effects 0.000 claims description 4
- 241001292396 Cirrhitidae Species 0.000 description 10
- 230000008569 process Effects 0.000 description 8
- 230000004044 response Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000002950 deficient Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 235000019800 disodium phosphate Nutrition 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000010304 firing Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/187—Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/44—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
- G06V10/457—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by analysing connectivity, e.g. edge linking, connected component analysis or slices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/74—Image or video pattern matching; Proximity measures in feature spaces
- G06V10/75—Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
- G06V10/759—Region-based matching
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Quality & Reliability (AREA)
- Computing Systems (AREA)
- Databases & Information Systems (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Image Analysis (AREA)
Abstract
The embodiment of the application discloses a visual detection method, device, equipment and medium based on image recognition, and relates to the technical field of image detection. The method comprises the following steps: collecting an original tile image of a tile to be detected, and preprocessing the original tile image to obtain the tile image to be detected; acquiring a gray image corresponding to a tile image to be detected, dividing the gray image into a tile surface area and a crack area in a gray threshold segmentation mode, and obtaining a segmentation image; acquiring a connected domain in the segmented image to obtain a connected domain diagram to be detected; judging whether the connected domain diagram to be detected is the same as a preset reference connected domain diagram or not; if the ceramic tiles are different, judging that cracks exist in the ceramic tiles to be tested. The method provided by the embodiment of the application can be automatically executed by a machine, has higher efficiency, can exclude the influence of external environment based on the analysis mode of the connected domain, and has higher accuracy without being influenced by factors such as the color of the ceramic tile, the current brightness and the like.
Description
Technical Field
The present application relates to the field of image detection technologies, and in particular, to a visual detection method, device, equipment, and medium based on image recognition.
Background
During the firing process, air is introduced, and the tiles collide with each other when transported through the conveyor belt, so that the tiles are damaged and cracked. The tile cracks are broken, and due to high visual observation difficulty, a certain amount of defective products exist when the tile enters the market.
The traditional tile crack identification in China mainly depends on manual identification, and has the defects of long time consumption, difficulty in unification of results and the like.
Disclosure of Invention
The embodiment of the application provides a visual detection method, device, equipment and medium based on image recognition, which aim to solve the problems of low efficiency and low accuracy in the conventional tile crack recognition.
In a first aspect, an embodiment of the present application provides a visual inspection method based on image recognition, including:
collecting an original tile image of a tile to be detected, and preprocessing the original tile image to obtain the tile image to be detected;
acquiring a gray image corresponding to the tile image to be detected, and dividing the gray image into a tile surface area and a crack area in a gray threshold segmentation mode to obtain a segmentation image;
acquiring a connected domain in the segmented image to obtain a connected domain diagram to be detected;
judging whether the connected domain diagram to be detected is the same as a preset reference connected domain diagram or not;
and if the connected domain diagram to be detected is different from the preset reference connected domain diagram, judging that the crack exists in the ceramic tile to be detected.
Further, the preprocessing the original tile image to obtain a tile image to be detected includes:
noise removing treatment is carried out on the original tile image to obtain a first intermediate image;
smoothing the first intermediate image to obtain a second intermediate image;
and performing contrast enhancement processing on the second intermediate image to obtain the tile image to be detected.
Further, the dividing the gray image into a tile surface area and a crack area by the gray threshold segmentation method to obtain a segmented image includes:
dividing the gray image into a tile surface area and a crack area based on a preset pixel threshold and a gray threshold dividing function to obtain a divided image.
Further, the obtaining the connected domain in the segmented image to obtain a connected domain diagram to be detected includes:
and detecting the connected domain contained in the segmented image based on a preset connected domain analysis function to obtain the connected domain diagram to be detected.
Further, the noise removing processing is performed on the original tile image to obtain a first intermediate image, including: removing noise from the original tile image based on a preset noise reduction function to obtain a first intermediate image;
the smoothing processing is performed on the first intermediate image to obtain a second intermediate image, including: carrying out smoothing treatment on the first intermediate image based on a preset smoothing function to obtain a second intermediate image;
the step of performing contrast enhancement processing on the second intermediate image to obtain the tile image to be detected comprises the following steps: and carrying out contrast enhancement treatment on the second intermediate image based on a preset enhancement function to obtain the tile image to be detected.
Further, the visual detection method based on image recognition further comprises the following steps:
and if the connected domain diagram to be detected is the same as the preset reference connected domain diagram, judging that no crack exists in the ceramic tile to be detected.
Further, the visual detection method based on image recognition further comprises the following steps:
counting the number of tiles to be tested with cracks;
and determining the defect rate of the tiles to be tested based on the number of tiles to be tested with cracks and the total number of the tiles to be tested.
In a second aspect, an embodiment of the present application further provides an image recognition-based visual inspection apparatus, which includes a unit for performing the above method.
In a third aspect, an embodiment of the present application further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the method when executing the computer program.
In a fourth aspect, embodiments of the present application also provide a computer readable storage medium storing a computer program which, when executed by a processor, implements the above method.
The embodiment of the application provides a visual detection method, device, equipment and medium based on image recognition. Wherein the method comprises the following steps: collecting an original tile image of a tile to be detected, and preprocessing the original tile image to obtain the tile image to be detected; acquiring a gray image corresponding to the tile image to be detected, and dividing the gray image into a tile surface area and a crack area in a gray threshold segmentation mode to obtain a segmentation image; acquiring a connected domain in the segmented image to obtain a connected domain diagram to be detected; judging whether the connected domain diagram to be detected is the same as a preset reference connected domain diagram or not; and if the connected domain diagram to be detected is different from the preset reference connected domain diagram, judging that the crack exists in the ceramic tile to be detected. According to the technical scheme, the gray level image is divided into the tile surface area and the crack area, and then the connected domain analysis is further carried out, so that a connected domain diagram to be detected is obtained; and comparing the connected domain graph to be detected with a preset reference connected domain graph, so that whether a crack exists in the connected domain graph to be detected can be determined. The method is automatically executed by a machine, the efficiency is higher, meanwhile, the influence of external environment can be eliminated based on the mode of connected domain analysis, for example, the method is not influenced by factors such as tile color, current brightness and the like, and the accuracy is higher.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the application or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
One or more embodiments are illustrated by way of example and not limitation in the figures of the accompanying drawings, in which like references indicate similar elements, and in which the figures of the drawings are not to be taken in a limiting sense, unless otherwise indicated.
Fig. 1 is a schematic flow chart of a visual detection method based on image recognition according to an embodiment of the present application;
FIG. 2 is a schematic block diagram of a visual inspection device based on image recognition according to an embodiment of the present application;
fig. 3 is a schematic block diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
Referring to fig. 1, fig. 1 is a flowchart illustrating a visual inspection method based on image recognition according to an embodiment of the present application. As shown, the method includes the following steps S1-S5.
S1, acquiring an original tile image of a tile to be detected, and preprocessing the original tile image to obtain the tile image to be detected.
In specific implementation, the original tile image refers to an image obtained after image shooting of the tile to be tested by an image acquisition device (such as a camera, a video camera and the like). Specifically, when the tile to be tested passes through the conveyor belt, the original tile image of the tile to be tested is collected through the camera, namely, the complete tile is required to be seen in the collected original tile image, and the defect cannot be caused. And selecting a tile image without defects from the acquired original tile images as a reference image, and numbering other original tile images in sequence.
The original tile image is preprocessed to obtain the tile image to be detected, the preprocessing comprises noise reduction, smoothing, image enhancement and other processes, and the application is not particularly limited.
For example, in one embodiment, the preprocessing the original tile image to obtain the tile image to be tested specifically includes: noise removing treatment is carried out on the original tile image to obtain a first intermediate image; smoothing the first intermediate image to obtain a second intermediate image; and performing contrast enhancement processing on the second intermediate image to obtain the tile image to be detected.
In a specific implementation, the pretreatment process can be implemented by a function in Halcon, and it is to be noted that Halcon is a machine vision recognition tool.
Specifically, noise-removal processing may use a noise_reduction function in Halcon, specifically:
noise_reduction(Image:ImageReduced,Method:Param);
in the noise_reduction function, image is an input Image, imageReduced is an output denoised Image, and Method is a noise removal Method, and optional values include: "derivative_of_gaussian", "gaussian", "wiener" and "none", one of which can be selected by a person skilled in the art, the application not being particularly limited; param is a tuple containing the parameters needed for noise removal.
The smoothing process may use a smooth_image function in Halcon, specifically: smoothjimage (Image: imagesmooths, algorithm: param); in the smoothjimage function, image is an input Image, imagesmooths is an output smoothed Image, algorithm is a smoothing Algorithm, and optional values include: "gauss", "mean" and "mean", one of which can be selected by a person skilled in the art, the application being not particularly limited, param being a tuple containing smoothing parameters.
The contrast enhancement process may use a scale_image function in Halcon, specifically: scale_image (Image: imageScaled, scale, interaction); in the scale_image function, image is an input Image, imageScaled is an output scaled Image, scale is a tuple containing scaling factors in the horizontal and vertical directions, and Interpolation is an Interpolation algorithm, and optional values include: "nearest_neighbor", "bilinear", "bicubic" and "overlapping", one of which can be selected by those skilled in the art, the present application is not particularly limited.
S2, acquiring a gray level image corresponding to the tile image to be detected, and dividing the gray level image into a tile surface area and a crack area in a gray level threshold segmentation mode to obtain a segmentation image.
In specific implementation, before the gray threshold segmentation, the tile image to be detected needs to be converted into a gray image. And dividing the gray level image into a tile surface area and a crack area by a preset gray level threshold segmentation method to obtain a binary image, namely a segmented image. It will be appreciated that if there is no crack in the tile to be tested, accordingly, no crack area will be detected, i.e. the crack area may not be present.
For example, in one embodiment, the above steps divide the gray image into a tile surface area and a crack area by means of gray threshold segmentation, so as to obtain a segmented image, which specifically includes: dividing the gray image into a tile surface area and a crack area based on a preset pixel threshold and a gray threshold dividing function to obtain a divided image.
In a specific implementation, the implementation is performed using the threshold function in Halcon. The Threshold function is one of the binarization functions commonly used in Halcon for converting a gray image into a binarized image, i.e., a segmented image, and specifically, the Threshold function is as follows:
threshold (Image: imageBinary, threshold: threshold type, width, height: sub region); in the Threshold function, image is an input gray Image, imageBinary is an output binary Image, threshold is a set Threshold, threshold type is a set Threshold type, and the Threshold function can be set by 'H', 'abs', 'rel' or 'adapted', and one of them can be selected by a person skilled in the art. Width and Height are the Width and Height of the sub-regions, used to define the binarization range, and can be set to None if not required. Because the tile crack and the background difference are obvious, the threshold value threshold can be fixed between 0 and 128, and the input gray level image is divided into the tile surface area and the crack area based on the threshold value threshold, so that a binarized image, namely a segmentation image, is obtained.
And S3, acquiring the connected domain in the segmented image, and obtaining a connected domain diagram to be detected.
In a specific implementation, the connected region analysis is performed on the segmented image (specifically, the binarized image), and all the connected regions in the segmented image are found.
For example, in an embodiment, the step of obtaining the connected domain in the segmented image to obtain the connected domain diagram to be measured specifically includes: and detecting the connected domain contained in the segmented image based on a preset connected domain analysis function to obtain the connected domain diagram to be detected.
In particular implementations, this is achieved by a connection function in Halcon. The connection function is a function used in Halcon to connect adjacent binarized regions, and can connect interconnected regions in a binarized image to form a larger region, specifically, the connection function is as follows:
connection (Image: image connection, connections: type, pointOrdering, indines: regions), wherein in the connection function, image is an input binary Image, image connection is an output connected Image, type is a connection Type, and '4/8', '4', '8', 'maximum' are used to set, respectively, four-connection/eight-connection, four-connection, eight-connection, and maximum connection types, one of which can be selected by those skilled in the art, and the present application is not particularly limited. The PointOrdering is the ordering direction of the points, and may be set using 'row', 'column', 'none', one of which may be selected by those skilled in the art, and the present application is not particularly limited. Inds is the number of the outputted connected region, and Regions is the outputted connected region map.
And S4, judging whether the connected domain diagram to be detected is identical to a preset reference connected domain diagram.
In a specific implementation, the reference connected domain graph is a connected domain graph obtained by processing the reference image of the reference tile without cracks according to the steps S1-S3.
Judging whether the connected domain diagram to be detected is the same as a preset reference connected domain diagram or not can specifically comprise: judging whether the number and the shape of the connected domains in the to-be-detected connected domain graph are the same as those of the connected domains in the preset reference connected domain graph, and if the number and the shape are the same, judging that the number and the shape are the same.
S5, if the connected domain diagram to be detected is different from the preset reference connected domain diagram, judging that cracks exist in the ceramic tile to be detected.
In a specific implementation, if the to-be-detected connected domain diagram is different from the preset reference connected domain diagram, it is determined that a crack exists in the to-be-detected tile, that is, the to-be-detected tile is a disqualified tile, and the to-be-detected tile can be sorted to a disqualified product placement area at the moment so as to avoid the to-be-detected tile from flowing into the market.
According to the technical scheme, the gray level image is divided into the tile surface area and the crack area, and then the connected domain analysis is further carried out, so that a connected domain diagram to be detected is obtained; the method is carried out automatically by a machine, the efficiency is higher, and meanwhile, based on a mode of communicating domain analysis, the influence of external environment can be eliminated, for example, the method is not influenced by factors such as tile color, current brightness and the like, and the accuracy is higher.
Further, if the to-be-detected connected domain diagram is the same as the preset reference connected domain diagram, judging that no crack exists in the to-be-detected ceramic tile, and indicating that the to-be-detected ceramic tile is a qualified product.
Further, after the above step S5, the visual detection method based on image recognition further includes: counting the number of tiles to be tested with cracks; and determining the defect rate of the tiles to be tested based on the number of tiles to be tested with cracks and the total number of the tiles to be tested.
In specific implementation, the defect rate is the ratio of the number of tiles to be tested with cracks to the total number of tiles to be tested. If the defect rate is too high, the production process of the ceramic tile is problematic, and the process needs to be adjusted. Therefore, when the defect rate is larger than a preset defect rate threshold, alarm information is sent out to remind the user.
The technical effects of the embodiment of the application include:
1. based on the mode of connected domain analysis, external environmental influence, such as no influence of tile color and current brightness, can be eliminated.
2. The gray level map has less storage content and higher operation speed, and can efficiently identify tile cracks.
Halcon has high-efficiency multithreading processing capability, can rapidly process a large amount of image data, improves the efficiency of surface crack detection, and can flexibly configure and combine according to different surface crack detection tasks so as to meet different requirements.
4. The labor cost is reduced.
Referring to fig. 2, fig. 2 is a schematic block diagram of a visual inspection apparatus 20 based on image recognition according to an embodiment of the present application. Corresponding to the above visual detection method based on image recognition, the present application further provides a visual detection device 20 based on image recognition. The image recognition-based visual inspection apparatus 20 includes a unit for performing the above-described image recognition-based visual inspection method, and the image recognition-based visual inspection apparatus 20 may be configured in a terminal such as a desktop computer, a tablet computer, a laptop computer, or the like. Specifically, the visual inspection apparatus 20 based on image recognition includes:
a preprocessing unit 21, configured to collect an original tile image of a tile to be tested, and perform preprocessing on the original tile image to obtain a tile image to be tested;
the dividing unit 22 is configured to obtain a gray level image corresponding to the tile image to be detected, and divide the gray level image into a tile surface area and a crack area by using a gray level threshold segmentation method to obtain a segmented image;
an obtaining unit 23, configured to obtain a connected domain in the segmented image, so as to obtain a connected domain diagram to be measured;
a judging unit 24, configured to judge whether the connected domain diagram to be detected is the same as a preset reference connected domain diagram;
and the first determining unit 25 is configured to determine that a crack exists in the tile to be tested if the connected domain diagram to be tested is different from the preset reference connected domain diagram.
In an embodiment, the preprocessing the original tile image to obtain a tile image to be tested includes:
noise removing treatment is carried out on the original tile image to obtain a first intermediate image;
smoothing the first intermediate image to obtain a second intermediate image;
and performing contrast enhancement processing on the second intermediate image to obtain the tile image to be detected.
In an embodiment, the dividing the gray image into the tile surface area and the crack area by the gray threshold segmentation method to obtain a segmented image includes:
dividing the gray image into a tile surface area and a crack area based on a preset pixel threshold and a gray threshold dividing function to obtain a divided image.
In an embodiment, the obtaining the connected domain in the segmented image to obtain the connected domain diagram to be measured includes:
and detecting the connected domain contained in the segmented image based on a preset connected domain analysis function to obtain the connected domain diagram to be detected.
In an embodiment, the removing noise from the original tile image to obtain a first intermediate image includes: removing noise from the original tile image based on a preset noise reduction function to obtain a first intermediate image;
the smoothing processing is performed on the first intermediate image to obtain a second intermediate image, including: carrying out smoothing treatment on the first intermediate image based on a preset smoothing function to obtain a second intermediate image;
the step of performing contrast enhancement processing on the second intermediate image to obtain the tile image to be detected comprises the following steps: and carrying out contrast enhancement treatment on the second intermediate image based on a preset enhancement function to obtain the tile image to be detected.
In an embodiment, the visual inspection apparatus 20 based on image recognition further comprises:
and the second judging unit is used for judging that no crack exists in the ceramic tile to be tested if the connected domain diagram to be tested is the same as the preset reference connected domain diagram.
In an embodiment, the visual inspection apparatus 20 based on image recognition further comprises:
the counting unit is used for counting the number of the tiles to be tested with cracks;
and the determining unit is used for determining the defect rate of the tiles to be tested based on the number of the tiles to be tested with cracks and the total number of the tiles to be tested.
It should be noted that, as will be clearly understood by those skilled in the art, the specific implementation process of the above-mentioned visual inspection apparatus 20 and each unit based on image recognition may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, the description is omitted here.
The above-described image recognition based visual inspection apparatus 20 may be implemented in the form of a computer program that is executable on a computer device as shown in fig. 3.
Referring to fig. 3, fig. 3 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 may be a terminal or a server, where the terminal may be an electronic device with a communication function, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster formed by a plurality of servers.
The computer device 500 includes a processor 502, a memory, and a network interface 505, connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, may cause the processor 502 to perform a visual inspection method based on image recognition.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of a computer program 5032 in the non-volatile storage medium 503, which computer program 5032, when executed by the processor 502, causes the processor 502 to perform a visual inspection method based on image recognition.
The network interface 505 is used for network communication with other devices. It will be appreciated by those skilled in the art that the foregoing structure is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device 500 to which the present inventive arrangements may be implemented, and that a particular computer device 500 may include more or less components than those shown, or may be combined with certain components, or have a different arrangement of components.
The processor 502 is configured to execute a computer program 5032 stored in a memory, so as to implement the steps of a visual inspection method based on image recognition provided in any one of the method embodiments.
It should be appreciated that in an embodiment of the application, the processor 502 may be a central processing unit (Central Processing Unit, CPU), the processor 502 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (Application Specific Integrated Circuit, ASICs), field programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that all or part of the flow in a method embodying the above described embodiments may be accomplished by computer programs instructing the relevant hardware. The computer program may be stored in a storage medium that is a computer readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present application also provides a storage medium. The storage medium may be a computer readable storage medium. The storage medium stores a computer program. The computer program, when executed by a processor, causes the processor to perform the steps of a visual inspection method based on image recognition provided by any of the method embodiments described above.
The storage medium is a physical, non-transitory storage medium, and may be, for example, a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk. The computer readable storage medium may be nonvolatile or may be volatile.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the application can be combined, divided and deleted according to actual needs. In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The integrated unit may be stored in a storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application is essentially or part of what contributes to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a terminal, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and for those portions of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.
While the application has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the application. Therefore, the protection scope of the application is subject to the protection scope of the claims.
Claims (10)
1. A visual inspection method based on image recognition, comprising:
collecting an original tile image of a tile to be detected, and preprocessing the original tile image to obtain the tile image to be detected;
acquiring a gray image corresponding to the tile image to be detected, and dividing the gray image into a tile surface area and a crack area in a gray threshold segmentation mode to obtain a segmentation image;
acquiring a connected domain in the segmented image to obtain a connected domain diagram to be detected;
judging whether the connected domain diagram to be detected is the same as a preset reference connected domain diagram or not;
and if the connected domain diagram to be detected is different from the preset reference connected domain diagram, judging that the crack exists in the ceramic tile to be detected.
2. The visual inspection method based on image recognition according to claim 1, wherein the preprocessing the original tile image to obtain a tile image to be inspected comprises:
noise removing treatment is carried out on the original tile image to obtain a first intermediate image;
smoothing the first intermediate image to obtain a second intermediate image;
and performing contrast enhancement processing on the second intermediate image to obtain the tile image to be detected.
3. The visual inspection method based on image recognition according to claim 1, wherein the dividing the gray image into tile surface area and crack area by gray threshold segmentation, comprises:
dividing the gray image into a tile surface area and a crack area based on a preset pixel threshold and a gray threshold dividing function to obtain a divided image.
4. The visual inspection method based on image recognition according to claim 1, wherein the obtaining the connected domain in the segmented image to obtain the connected domain diagram to be inspected comprises:
and detecting the connected domain contained in the segmented image based on a preset connected domain analysis function to obtain the connected domain diagram to be detected.
5. The visual inspection method based on image recognition according to claim 1, wherein said performing noise removal processing on the original tile image to obtain a first intermediate image comprises: removing noise from the original tile image based on a preset noise reduction function to obtain a first intermediate image;
the smoothing processing is performed on the first intermediate image to obtain a second intermediate image, including: carrying out smoothing treatment on the first intermediate image based on a preset smoothing function to obtain a second intermediate image;
the step of performing contrast enhancement processing on the second intermediate image to obtain the tile image to be detected comprises the following steps: and carrying out contrast enhancement treatment on the second intermediate image based on a preset enhancement function to obtain the tile image to be detected.
6. The visual inspection method based on image recognition according to claim 1, further comprising:
and if the connected domain diagram to be detected is the same as the preset reference connected domain diagram, judging that no crack exists in the ceramic tile to be detected.
7. The visual inspection method based on image recognition according to claim 1, further comprising:
counting the number of tiles to be tested with cracks;
and determining the defect rate of the tiles to be tested based on the number of tiles to be tested with cracks and the total number of the tiles to be tested.
8. A visual inspection device based on image recognition, characterized by comprising means for performing the method according to any of claims 1-7.
9. A computer device, characterized in that it comprises a memory on which a computer program is stored and a processor which, when executing the computer program, implements the method according to any of claims 1-7.
10. A computer readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method according to any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311068701.4A CN117036331A (en) | 2023-08-23 | 2023-08-23 | Visual detection method, device, equipment and medium based on image recognition |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311068701.4A CN117036331A (en) | 2023-08-23 | 2023-08-23 | Visual detection method, device, equipment and medium based on image recognition |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117036331A true CN117036331A (en) | 2023-11-10 |
Family
ID=88622572
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311068701.4A Pending CN117036331A (en) | 2023-08-23 | 2023-08-23 | Visual detection method, device, equipment and medium based on image recognition |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117036331A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118485630A (en) * | 2024-05-09 | 2024-08-13 | 浙江大学 | Brick content analysis method based on microscope image of brick-mixed powder and related equipment |
-
2023
- 2023-08-23 CN CN202311068701.4A patent/CN117036331A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118485630A (en) * | 2024-05-09 | 2024-08-13 | 浙江大学 | Brick content analysis method based on microscope image of brick-mixed powder and related equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR20230124713A (en) | Fault detection methods, devices and systems | |
CN109242853B (en) | An intelligent detection method for PCB defects based on image processing | |
CN108896278B (en) | Optical filter silk-screen defect detection method and device and terminal equipment | |
CN109671078B (en) | Method and device for detecting product surface image abnormity | |
CN115222733A (en) | Metal component surface defect detection method based on image recognition | |
CN117392042A (en) | Defect detection method, defect detection apparatus, and storage medium | |
CN112348765A (en) | Data enhancement method and device, computer readable storage medium and terminal equipment | |
CN111915549A (en) | Defect detection method, electronic device and computer readable storage medium | |
CN112308854B (en) | Automatic detection method and system for chip surface flaws and electronic equipment | |
CN114004790B (en) | A battery cover quality detection method, device, computer equipment and storage medium | |
CN108918093B (en) | Optical filter mirror surface defect detection method and device and terminal equipment | |
CN111598801B (en) | Identification method for weak Mura defect | |
CN114022503A (en) | Detection method, detection system, device and storage medium | |
CN115953373B (en) | Glass defect detection method, device, electronic equipment and storage medium | |
CN113971681B (en) | A belt conveyor edge detection method in complex environment | |
CN117522778A (en) | Hollow brick flaw detection system | |
CN116883336A (en) | Image processing methods, devices, computer equipment and media | |
CN108288274A (en) | Mold detection method, device and electronic equipment | |
CN115060725A (en) | Double-disc appearance detection method and device | |
CN117036331A (en) | Visual detection method, device, equipment and medium based on image recognition | |
CN108876842A (en) | A kind of measurement method, system, equipment and the storage medium of sub-pixel edge angle | |
CN114723728A (en) | Method and system for detecting CD line defects of silk screen of glass cover plate of mobile phone camera | |
CN105825182A (en) | Double analysis method of online glume-gaping seed rice identification | |
CN117474915B (en) | Abnormality detection method, electronic equipment and storage medium | |
CN118501177A (en) | Appearance defect detection method and system for formed foil |
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 |