CN117788438A - Industrial image detection method, device and visual detection system - Google Patents

Industrial image detection method, device and visual detection system Download PDF

Info

Publication number
CN117788438A
CN117788438A CN202311842652.5A CN202311842652A CN117788438A CN 117788438 A CN117788438 A CN 117788438A CN 202311842652 A CN202311842652 A CN 202311842652A CN 117788438 A CN117788438 A CN 117788438A
Authority
CN
China
Prior art keywords
image
light source
sample
product
pixel
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
CN202311842652.5A
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.)
Luster LightTech Co Ltd
Original Assignee
Luster LightTech 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 Luster LightTech Co Ltd filed Critical Luster LightTech Co Ltd
Priority to CN202311842652.5A priority Critical patent/CN117788438A/en
Publication of CN117788438A publication Critical patent/CN117788438A/en
Pending legal-status Critical Current

Links

Abstract

The application discloses an industrial image detection method, an industrial image detection device and a visual detection system, and belongs to the technical field of industrial detection. The method comprises the following steps: under the irradiation of a light source, obtaining a product image to be detected, wherein the product image comprises a product, and the product is produced by a plurality of production lines; inputting the product image into a product detection model to obtain image characteristic information of the product image output by the product detection model; the product detection model is obtained through training a training sample set, and the training sample set is obtained through the following steps: under the irradiation of a light source, acquiring a first sample image, wherein the first sample image comprises a sample product, and the sample product is produced by a plurality of production lines; determining illumination simulation parameters; and processing each pixel in the first sample image based on the illumination simulation parameters to obtain a plurality of second sample images corresponding to the first sample image, wherein the training sample set comprises the first sample image and the second sample image.

Description

Industrial image detection method, device and visual detection system
Technical Field
The application belongs to the technical field of industrial detection, and particularly relates to an industrial image detection method, an industrial image detection device and a visual detection system.
Background
In industrial detection, products to be detected are often produced by a plurality of production lines, in actual production, illumination of different production lines is different, and an existing product detection model is poor in adaptability in a scene with the difference of illumination, so that false detection of defects, missing detection of defects and the like can be caused, and the accuracy of product detection is reduced.
Disclosure of Invention
The present application aims to solve at least one of the technical problems existing in the prior art. Therefore, the application provides an industrial image detection method, an industrial image detection device and a visual detection system, and the method can reduce false detection of defects and missing detection of defects and improve detection accuracy.
In a first aspect, the present application provides an industrial image detection method, the method comprising:
under the irradiation of a light source, acquiring a product image to be detected, wherein the product image comprises a product, and the product is produced by a plurality of production lines;
inputting the product image into a product detection model to obtain image characteristic information of the product image output by the product detection model;
the product detection model is obtained through training a training sample set, and the training sample set is obtained through the following steps:
under illumination of a light source, acquiring a first sample image, the first sample image comprising a sample product, the sample product produced by a plurality of production lines;
determining illumination simulation parameters;
and processing each pixel in the first sample image based on the illumination simulation parameters to obtain a plurality of second sample images corresponding to the first sample image, wherein the training sample set comprises the first sample image and the second sample image.
According to the industrial image detection method, illumination simulation is carried out on the first sample image based on the illumination simulation parameters, different second sample images subjected to illumination simulation can be obtained by adjusting the illumination simulation parameters, the second sample images can simulate illumination differences of products on different production lines, the first sample images and the second sample images are added into the training sample set, sample images under different illumination in the training sample set are enriched, the training sample set trains the product detection model, the product detection model can be applicable to product detection under different illumination, and detection accuracy is improved.
According to an embodiment of the present application, the illumination simulation parameters include a light source position parameter, a light source intensity parameter and an illumination range parameter, and the processing, based on the illumination simulation parameters, each pixel in the first sample image to obtain a plurality of second sample images corresponding to the first sample image includes:
determining light source distance information of each pixel in the first sample image based on the light source position parameter;
determining pixel transform coefficients for each pixel in the first sample image based on the light source distance information, the light source intensity parameter, and the illumination range parameter;
and processing each pixel in the first sample image based on the pixel transformation coefficient to obtain the second sample image.
According to an embodiment of the present application, the light source position parameter includes position information of at least one light source, and the determining light source distance information of each pixel in the first sample image based on the light source position parameter includes:
and determining the distance between a first pixel and each light source in the first sample image based on the light source position parameter, and taking the shortest distance as the light source distance information corresponding to the first pixel.
According to one embodiment of the application, the determining the pixel transform coefficients of each pixel in the first sample image based on the light source distance information, the light source intensity parameter and the illumination range parameter comprises:
determining an illumination attenuation factor based on the illumination range parameter;
a pixel transform coefficient for each pixel in the first sample image is determined based on the illumination attenuation factor, the light source intensity parameter, and the light source distance information for each pixel in the first sample image.
According to one embodiment of the present application, the processing each pixel in the first sample image based on the pixel transform coefficient to obtain the second sample image includes:
multiplying the original pixel in the first sample image with the corresponding pixel transformation coefficient to obtain a new pixel;
and obtaining the second sample image based on the new pixel.
In a second aspect, the present application provides an industrial image detection apparatus comprising:
the acquisition module is used for acquiring a product image to be detected under the irradiation of a light source, wherein the product image comprises a product, and the product is produced by a plurality of production lines;
the processing module is used for inputting the product image into a product detection model and obtaining image characteristic information of the product image output by the product detection model;
the product detection model is obtained through training a training sample set, and the training sample set is obtained through the following steps:
under illumination of a light source, acquiring a first sample image, the first sample image comprising a sample product, the sample product produced by a plurality of production lines;
determining illumination simulation parameters;
and processing each pixel in the first sample image based on the illumination simulation parameters to obtain a plurality of second sample images corresponding to the first sample image, wherein the training sample set comprises the first sample image and the second sample image.
According to the industrial image detection device, illumination simulation is carried out on the first sample image based on the illumination simulation parameters, the illumination simulation parameters are adjusted to obtain different second sample images which are subjected to illumination simulation, the second sample images can simulate illumination differences of products on different production lines, the first sample images and the second sample images are added into the training sample set, sample images under different illumination in the training sample set are enriched, the training sample set trains the product detection model, the product detection model can be applicable to product detection under different illumination, and detection accuracy is improved.
In a third aspect, the present application provides a visual inspection system comprising:
the device comprises an image acquisition device and a light source, wherein the image acquisition device is used for acquiring a product image to be detected under the irradiation of the light source;
and the data processing device is electrically connected with the image acquisition device and is used for executing the industrial image detection method according to the first aspect.
According to the visual detection system, illumination simulation is carried out on the first sample image based on the illumination simulation parameters, the illumination simulation parameters are adjusted to obtain different second sample images which are subjected to illumination simulation, the second sample images can simulate illumination differences of products on different production lines, the first sample images and the second sample images are added into the training sample set, sample images under different illumination in the training sample set are enriched, the training sample set trains the product detection model, the product detection model can be enabled to be suitable for product detection under different illumination, and detection accuracy is improved.
In a fourth aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the industrial image detection method according to the first aspect described above when executing the computer program.
In a fifth aspect, the present application provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the industrial image detection method as described in the first aspect above.
In a sixth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the industrial image detection method as described in the first aspect above.
Additional aspects and advantages of the application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, wherein:
fig. 1 is a schematic flow chart of an industrial image detection method according to an embodiment of the present application;
FIG. 2 is one of the schematic diagrams of the position of the simulated light source in the first sample image provided in the embodiments of the present application;
FIG. 3 is a second schematic diagram of the position of the analog light source in the first sample image according to the embodiment of the present application;
FIG. 4 is a third schematic diagram of the position of the simulated light source in the first sample image according to the embodiment of the present application;
FIG. 5 is a schematic diagram of a simulated light source in a first sample image according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a pixel transformation coefficient according to a change of light source distance information according to an embodiment of the present application;
FIG. 7 is a schematic illustration of a first sample image provided by an embodiment of the present application;
FIG. 8 is one of the schematic diagrams of a second sample image provided by an embodiment of the present application;
FIG. 9 is a second schematic diagram of a second sample image provided by an embodiment of the present application;
FIG. 10 is a third schematic illustration of a second sample image provided in an embodiment of the present application;
FIG. 11 is a fourth schematic illustration of a second sample image provided by an embodiment of the present application;
FIG. 12 is a schematic diagram of an industrial image detection device according to an embodiment of the present disclosure;
fig. 13 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application are within the scope of the protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type and not limited to the number of objects, e.g., the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The industrial image detection method, the industrial image detection device, the visual detection system, the electronic device and the readable storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings by specific embodiments and application scenarios thereof.
The industrial image detection method can be applied to the terminal, and can be specifically executed by hardware or software in the terminal.
The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet having a touch sensitive surface (e.g., a touch screen display and/or a touch pad). It should also be appreciated that in some embodiments, the terminal may not be a portable communication device, but rather a desktop computer having a touch-sensitive surface (e.g., a touch screen display and/or a touch pad).
In the following various embodiments, a terminal including a display and a touch sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and joystick.
The execution body of the industrial image detection method provided in the embodiment of the present application may be an electronic device or a functional module or a functional entity capable of implementing the industrial image detection method in the electronic device, where the electronic device mentioned in the embodiment of the present application includes, but is not limited to, a mobile phone, a tablet computer, a camera, a wearable device, and the like, and the industrial image detection method provided in the embodiment of the present application is described below by taking the electronic device as an execution body as an example.
As shown in fig. 1, the industrial image detection method includes: step 110 and step 120.
Step 110, under the irradiation of a light source, obtaining a product image to be detected, wherein the product image comprises a product, and the product is produced by a plurality of production lines.
In this embodiment, the light source may be a natural light source or an artificial light source, and the light source may irradiate the product at any angle, and the brightness of the image of the product to be detected obtained under the irradiation of different light sources is different.
Wherein a product image may include a complete product, which may be a workpiece product on an industrial line, such as an engine block, a drive gear, a hydraulic component, etc.
In this embodiment, the production line is a system that passes raw materials or semi-finished products through a series of sequential processes, assemblies, and ultimately produces a product.
In this embodiment, the product is produced by a plurality of production lines, each production line being responsible for accomplishing a specific task, each production line being illuminated differently, and accordingly the brightness of the image of the product to be detected being acquired on the different production lines being different.
And 120, inputting the product image into a product detection model to obtain the image characteristic information of the product image output by the product detection model.
The product detection model is obtained through training a training sample set, and the training sample set is obtained through the following steps:
under the irradiation of a light source, acquiring a first sample image, wherein the first sample image comprises a sample product, and the sample product is produced by a plurality of production lines;
determining illumination simulation parameters;
and processing each pixel in the first sample image based on the illumination simulation parameters to obtain a plurality of second sample images corresponding to the first sample image, wherein the training sample set comprises the first sample image and the second sample image.
In this embodiment, the product detection model is used to detect a product, for example, detect a defect of the product, the input of the product detection model is a product image, the product detection model may detect a pixel corresponding to the product in the product image, and the output of the product detection model is image feature information of the product image.
In this embodiment, the training sample set may comprise different sample images, the training sample set being used to train the product detection model.
In this embodiment, the light source in step 120 and the light source in step 110 may be the same light source or different light sources.
In this embodiment, a batch of products may be sampled to obtain one or more sample products, the sample products may be photographed to obtain a first sample image, and a complete sample product may be included in the first sample image.
In this embodiment, the product image may also be sampled to obtain one or more first sample images.
In this embodiment, the illumination simulation parameters are used to simulate illumination, and when the illumination simulation parameters are different, the position of the light source, the intensity of illumination, etc. may be different.
In this embodiment, the process of processing each pixel in the first sample image may be a process of illumination simulation based on the illumination simulation parameters.
In this embodiment, a processing value corresponding to a certain pixel in the first sample image may be obtained based on the illumination simulation parameter, the processing value and the original value of the pixel are calculated to obtain a new value corresponding to the pixel, and the processing of the same step is performed on each pixel in the first sample image, so as to obtain the second sample image.
The first sample image is a sample image to be subjected to illumination simulation, and the second sample image is a sample image subjected to illumination simulation.
In this embodiment, the value corresponding to the illumination simulation parameter may be adjusted, and the illumination simulation may be performed on the first sample image using different illumination simulation parameters, so as to obtain a plurality of different second sample images.
In this embodiment, the first sample image and the corresponding second sample image may be added to the training sample set.
In the embodiment, the first sample image and the corresponding second sample image are added into the training sample set, so that sample images under different illumination in the training sample set can be added, the training sample set is enriched, the training sample set trains the product detection model, the product detection model can be suitable for product detection under different illumination, and the detection precision is improved.
According to the industrial image detection method provided by the embodiment of the application, the first sample image is subjected to illumination simulation based on the illumination simulation parameters, the illumination simulation parameters are adjusted to obtain different second sample images subjected to illumination simulation, the second sample images can simulate illumination differences of products on different production lines, the first sample images and the second sample images are added into the training sample set, sample images under different illumination in the training sample set are enriched, the training sample set trains the product detection model, the product detection model can be applicable to product detection under different illumination, and detection accuracy is improved.
In some embodiments, the illumination simulation parameters include a light source position parameter, a light source intensity parameter, and an illumination range parameter, and processing each pixel in the first sample image based on the illumination simulation parameters to obtain a plurality of second sample images corresponding to the first sample image, including:
determining light source distance information of each pixel in the first sample image based on the light source position parameter;
determining pixel transformation coefficients of each pixel in the first sample image based on the light source distance information, the light source intensity parameter and the illumination range parameter;
and processing each pixel in the first sample image based on the pixel transformation coefficient to obtain a second sample image.
Wherein the first sample image is an image obtained by actual photographing, and the light source position parameter characterizes that an analog light source is arranged at a corresponding position in the first sample image, for example, an analog light source is arranged at a position shown by X of the first sample image in fig. 2-5.
It should be noted that the number of the analog light sources may be plural, and the light source position parameter may include positions of the plural analog light sources, for example, the light source position parameter is that the analog light sources are disposed at a center point and four vertices of the first sample image.
For example, there are 4 simulated light sources or 5 simulated light sources in the first sample image, and as shown in fig. 2, the light source position parameter is to set the simulated light sources at four vertexes of the first sample image; as shown in fig. 3, the light source position parameter is to set an analog light source at the midpoints of four sides of the first sample image; as shown in fig. 4, the light source position parameters are that analog light sources are arranged at four vertexes and a center point of the first sample image; as shown in fig. 5, the light source position parameter is to set the analog light source at the midpoint of the four sides of the first sample image and at the center point of the image.
In this embodiment, the light source intensity parameter characterizes the illumination intensity of the simulated light source, e.g. the light source intensity parameter is 550lx.
It should be noted that, when there are multiple analog light sources, the analog light sources disposed at different positions may correspond to different light source intensity parameters.
For example, the analog light sources are disposed at four vertices and a center point of the first sample image, the light source intensity parameter corresponding to the analog light source disposed at the four vertices is a, and the light source intensity parameter corresponding to the analog light source disposed at the center point is B.
In this embodiment, the illumination range parameter characterizes the illumination range of the simulated light source, e.g., the illumination range parameter is an illumination range that is a circular range of 10 pixels in radius.
It should be noted that, when there are multiple analog light sources, the analog light sources disposed at different positions may correspond to different illumination range parameters.
For example, the simulated light sources are arranged at the four vertexes and the center point of the first sample image, the illumination range parameters corresponding to the simulated light sources arranged at the four vertexes are the circular range with the radius of 10 pixels, and the illumination range parameters corresponding to the simulated light sources arranged at the center point are the circular range with the radius of 5 pixels.
In this embodiment, the light source distance information of a certain pixel in the first sample image may be determined based on the distance of the pixel from each of the analog light sources, for example, the light source distance information may be the smallest distance among the distances of the pixel from each of the analog light sources.
In this embodiment, the coordinates of all the analog light sources may be obtained according to the light source position parameters, and the distance between the pixel and each analog light source may be determined according to the coordinates of the pixel and the coordinates of each analog light source, thereby determining the light source distance information of the pixel.
For example, there are four analog light sources, namely, an analog light source a, an analog light source B, an analog light source C, and an analog light source D, wherein a distance between a certain pixel and the analog light source a is 1cm, a distance between the pixel and the analog light source B is 2cm, a distance between the pixel and the analog light source C is 3cm, and a minimum distance, that is, a distance between the pixel and the analog light source a is 1cm, can be determined as light source distance information of the pixel.
In this embodiment, the pixel transform coefficient of a certain pixel in the first sample image may be determined based on the light source intensity parameter, the illumination range parameter, and the light source distance information of the pixel, and the pixel transform coefficient may process a value corresponding to the pixel, for example, a gray value of the pixel.
When a plurality of analog light sources are set in the first sample image, the light source intensity parameter of a certain pixel may be the minimum distance among the distances between the pixel and each analog light source, and when the pixel transformation coefficient of the pixel is calculated, the light source intensity parameter and the illumination range parameter corresponding to the analog light source with the minimum distance are used.
For example, there are 3 analog light sources, namely, an analog light source a, an analog light source b and an analog light source c, and if the distance between the pixel i and the analog light source a is the shortest, the light source distance information of the pixel i is the distance between the pixel i and the analog light source a, and when calculating the pixel i, the light source intensity parameter and the illumination range parameter corresponding to the analog light source a are used.
In some embodiments, the light source position parameters include position information of at least one light source, determining light source distance information of each pixel in the first sample image based on the light source position parameters, comprising:
and determining the distance between the first pixel and each light source in the first sample image based on the light source position parameters, and taking the shortest distance as light source distance information corresponding to the first pixel.
In this embodiment, the pixel may be processed based on the pixel transform coefficient of a certain pixel in the first sample image, for example, the pixel transform coefficient of the certain pixel and the gray value of the pixel are calculated, and each pixel in the first sample image is processed, so that the second sample image may be obtained.
In some embodiments, determining pixel transform coefficients for each pixel in the first sample image based on the light source distance information, the light source intensity parameter, and the illumination range parameter comprises:
determining an illumination attenuation factor based on the illumination range parameter;
pixel transform coefficients for each pixel in the first sample image are determined based on the illumination attenuation factor, the light source intensity parameter, and the light source distance information for each pixel in the first sample image.
Wherein the illumination attenuation factor may characterize the attenuation of the illumination intensity of the simulated light source with increasing light propagation distance.
In this embodiment, based on one illumination range parameter, a plurality of illumination attenuation factors may be determined, and different illumination range parameters may be determined.
In this embodiment, the illumination attenuation factor may be used as a coefficient of the light source distance information, and the light source intensity parameter may be multiplied by the inverse of the light source distance information to determine the pixel transform coefficient.
For example, based on the illumination range parameters, 3 illumination attenuation factors K are determined c 、K l 、K q Wherein Kc characterizes a constant,K l K is the primary coefficient of the distance information of the light source q Is the quadratic coefficient of the light source distance information.
When the light source intensity parameter is λ and the light source distance information of a certain pixel in the first sample image is d, the pixel transform coefficient att of the pixel may be
It can be understood that when the same analog light source is corresponding, the distance between the analog light source and the pixel conversion coefficient is different from the distance information of the analog light source.
For example, as shown in fig. 6, as the light source Distance information (Distance in the corresponding diagram) increases, the pixel transform coefficient (density in the corresponding diagram) decreases, and the decrease is fast at the beginning and slow at the subsequent decrease.
In some embodiments, processing each pixel in the first sample image based on the pixel transform coefficients to obtain a second sample image comprises:
multiplying the original pixel in the first sample image with the corresponding pixel transformation coefficient to obtain a new pixel;
based on the new pixel, a second sample image is obtained.
Wherein the original pixel is an original pixel in the first sample image.
In this embodiment, the gray value of a certain original pixel in the first sample image may be multiplied by the pixel transform coefficient corresponding to the original pixel, and a new gray value of the pixel may be determined, so as to obtain a new pixel.
In this embodiment, the gray value of each original pixel in the first sample image is updated by traversal, and the gray value of each original pixel is multiplied by the corresponding pixel transform coefficient, so that each new pixel can be obtained, and the sample image formed by all the new pixels is the second sample image.
A specific example of obtaining the second sample image in the training sample set is as follows.
Step one, as shown in fig. 7, under the irradiation of a light source, a first sample image is acquired, wherein the first sample image comprises sample products, the sample products are produced by a plurality of production lines, and the sample products are round workpieces.
Step two, determining illumination simulation parameters, wherein the light source intensity parameter is set to be 1, the illumination range parameter is set to be 3250, the light source intensity parameter of each simulation light source is the same as the illumination range parameter, and the light source position parameter is that the simulation light source is arranged at four vertexes of the first sample image, or the simulation light source is arranged at the middle point of four sides of the first sample image, or the simulation light source is arranged at four vertexes and the center point of the first sample image, or the simulation light source is arranged at the middle point of four sides of the first sample image and the center point of the image.
Step three, processing each pixel of the first sample image in fig. 7 based on the illumination simulation parameters determined in the step two to obtain a plurality of second sample images corresponding to the first sample image, wherein the light source position parameters are the second sample images corresponding to the simulated light sources arranged at four vertexes of the first sample image as shown in fig. 8; as shown in fig. 9, a second sample image corresponding to the analog light source is arranged at the middle point of four sides of the first sample image; as shown in fig. 10, a second sample image corresponding to the simulated light source is arranged at four vertexes and a center point of the first sample image; fig. 11 shows a second sample image corresponding to the analog light source set at the midpoint of the four sides of the first sample image and at the center point of the image.
According to the industrial image detection method provided by the embodiment of the application, the execution subject can be an industrial image detection device. In the embodiment of the present application, an industrial image detection device is described by taking an industrial image detection method performed by the industrial image detection device as an example.
The embodiment of the application also provides an industrial image detection device.
As shown in fig. 12, the industrial image detecting apparatus includes:
an acquisition module 1210, configured to acquire a product image to be detected under irradiation of a light source, where the product image includes a product, and the product is produced by a plurality of production lines;
the processing module 1220 is configured to input the product image to the product detection model, and obtain image feature information of the product image output by the product detection model;
the product detection model is obtained through training a training sample set, and the training sample set is obtained through the following steps:
under the irradiation of a light source, acquiring a first sample image, wherein the first sample image comprises a sample product, and the sample product is produced by a plurality of production lines;
determining illumination simulation parameters;
and processing each pixel in the first sample image based on the illumination simulation parameters to obtain a plurality of second sample images corresponding to the first sample image, wherein the training sample set comprises the first sample image and the second sample image.
According to the industrial image detection device provided by the embodiment of the application, the first sample image is subjected to illumination simulation based on the illumination simulation parameters, the illumination simulation parameters are adjusted to obtain different second sample images subjected to illumination simulation, the second sample images can simulate illumination differences of products on different production lines, the first sample images and the second sample images are added into the training sample set, sample images under different illumination in the training sample set are enriched, the training sample set trains the product detection model, the product detection model can be applicable to product detection under different illumination, and the detection precision is improved.
In some embodiments, the processing module 1220 is configured to determine light source distance information for each pixel in the first sample image based on the light source position parameters;
determining pixel transformation coefficients of each pixel in the first sample image based on the light source distance information, the light source intensity parameter and the illumination range parameter;
and processing each pixel in the first sample image based on the pixel transformation coefficient to obtain a second sample image.
In some embodiments, the processing module 1220 is configured to determine, based on the light source position parameter, a distance between the first pixel and each light source in the first sample image, and use the shortest distance as the light source distance information corresponding to the first pixel.
In some embodiments, the processing module 1220 is configured to determine an illumination attenuation factor based on the illumination range parameter;
pixel transform coefficients for each pixel in the first sample image are determined based on the illumination attenuation factor, the light source intensity parameter, and the light source distance information for each pixel in the first sample image.
In some embodiments, the processing module 1220 is configured to multiply the original pixel in the first sample image with the corresponding pixel transform coefficient to obtain a new pixel;
based on the new pixel, a second sample image is obtained.
The industrial image detection device in the embodiment of the application may be an electronic device, or may be a component in the electronic device, for example, an integrated circuit or a chip. The electronic device may be a terminal, or may be other devices than a terminal. By way of example, the electronic device may be a mobile phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, mobile internet appliance (Mobile Internet Device, MID), augmented reality (augmented reality, AR)/Virtual Reality (VR) device, robot, wearable device, ultra-mobile personal computer, UMPC, netbook or personal digital assistant (personal digital assistant, PDA), etc., but may also be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and the embodiments of the present application are not limited in particular.
The industrial image detection device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which is not specifically limited in the embodiments of the present application.
The industrial image detection device provided in the embodiment of the present application can implement each process implemented by the method embodiment of fig. 1, and in order to avoid repetition, a description is omitted here.
The embodiment of the application also provides a visual detection system.
The vision detection system comprises an image acquisition device, a light source and a data processing device.
The image acquisition device is used for acquiring a product image to be detected under the irradiation of the light source.
The data processing device is electrically connected with the image acquisition device and is used for executing the industrial image detection method.
In this embodiment, the data processing device may be a chip, a CPU, or the like, to which the above-described industrial image detection method is written.
According to the visual detection system provided by the embodiment of the application, the first sample image is subjected to illumination simulation based on the illumination simulation parameters, the illumination simulation parameters are adjusted to obtain different second sample images subjected to illumination simulation, the second sample images can simulate illumination differences of products on different production lines, the first sample images and the second sample images are added into the training sample set, sample images under different illumination in the training sample set are enriched, the training sample set trains the product detection model, the product detection model can be applicable to product detection under different illumination, and the detection precision is improved.
In some embodiments, as shown in fig. 13, the embodiment of the present application further provides an electronic device 1300, including a processor 1301, a memory 1302, and a computer program stored in the memory 1302 and capable of running on the processor 1301, where the program when executed by the processor 1301 implements the processes of the above-mentioned embodiment of the industrial image detection method, and the same technical effects can be achieved, and for avoiding repetition, a description is omitted herein.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device described above.
The embodiment of the present application further provides a non-transitory computer readable storage medium, on which a computer program is stored, where the computer program when executed by a processor implements each process of the above embodiment of the industrial image detection method, and the same technical effects can be achieved, so that repetition is avoided, and no further description is given here.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application also provides a computer program product, which comprises a computer program, and the computer program realizes the industrial image detection method when being executed by a processor.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled with the processor, and the processor is used for running a program or an instruction, so that each process of the industrial image detection method embodiment can be implemented, and the same technical effect can be achieved, so that repetition is avoided, and no redundant description is provided here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solutions of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those of ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are also within the protection of the present application.
In the description of the present specification, reference to the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present application have been shown and described, it will be understood by those of ordinary skill in the art that: many changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the application, the scope of which is defined by the claims and their equivalents.

Claims (10)

1. An industrial image detection method, comprising:
under the irradiation of a light source, acquiring a product image to be detected, wherein the product image comprises a product, and the product is produced by a plurality of production lines;
inputting the product image into a product detection model to obtain image characteristic information of the product image output by the product detection model;
the product detection model is obtained through training a training sample set, and the training sample set is obtained through the following steps:
under illumination of a light source, acquiring a first sample image, the first sample image comprising a sample product, the sample product produced by a plurality of production lines;
determining illumination simulation parameters;
and processing each pixel in the first sample image based on the illumination simulation parameters to obtain a plurality of second sample images corresponding to the first sample image, wherein the training sample set comprises the first sample image and the second sample image.
2. The industrial image detection method according to claim 1, wherein the illumination simulation parameters include a light source position parameter, a light source intensity parameter, and an illumination range parameter, and the processing each pixel in the first sample image based on the illumination simulation parameters to obtain a plurality of second sample images corresponding to the first sample image includes:
determining light source distance information of each pixel in the first sample image based on the light source position parameter;
determining pixel transform coefficients for each pixel in the first sample image based on the light source distance information, the light source intensity parameter, and the illumination range parameter;
and processing each pixel in the first sample image based on the pixel transformation coefficient to obtain the second sample image.
3. The industrial image detection method of claim 2, wherein the light source position parameter includes position information of at least one light source, and wherein the determining light source distance information of each pixel in the first sample image based on the light source position parameter includes:
and determining the distance between a first pixel and each light source in the first sample image based on the light source position parameter, and taking the shortest distance as the light source distance information corresponding to the first pixel.
4. The industrial image detection method of claim 2, wherein the determining pixel transform coefficients for each pixel in the first sample image based on the light source distance information, the light source intensity parameter, and the illumination range parameter comprises:
determining an illumination attenuation factor based on the illumination range parameter;
a pixel transform coefficient for each pixel in the first sample image is determined based on the illumination attenuation factor, the light source intensity parameter, and the light source distance information for each pixel in the first sample image.
5. The industrial image detection method according to claim 2, wherein the processing each pixel in the first sample image based on the pixel transform coefficient to obtain the second sample image includes:
multiplying the original pixel in the first sample image with the corresponding pixel transformation coefficient to obtain a new pixel;
and obtaining the second sample image based on the new pixel.
6. An industrial image detection device, comprising:
the acquisition module is used for acquiring a product image to be detected under the irradiation of a light source, wherein the product image comprises a product, and the product is produced by a plurality of production lines;
the processing module is used for inputting the product image into a product detection model and obtaining image characteristic information of the product image output by the product detection model;
the product detection model is obtained through training a training sample set, and the training sample set is obtained through the following steps:
under illumination of a light source, acquiring a first sample image, the first sample image comprising a sample product, the sample product produced by a plurality of production lines;
determining illumination simulation parameters;
and processing each pixel in the first sample image based on the illumination simulation parameters to obtain a plurality of second sample images corresponding to the first sample image, wherein the training sample set comprises the first sample image and the second sample image.
7. A visual inspection system, comprising:
the device comprises an image acquisition device and a light source, wherein the image acquisition device is used for acquiring a product image to be detected under the irradiation of the light source;
a data processing device electrically connected to the image acquisition device, the data processing device for performing the industrial image detection method of any one of claims 1-5.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the industrial image detection method of any one of claims 1-5 when the program is executed by the processor.
9. A non-transitory computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements the industrial image detection method according to any one of claims 1-5.
10. A computer program product comprising a computer program which, when executed by a processor, implements the industrial image detection method according to any one of claims 1-5.
CN202311842652.5A 2023-12-28 2023-12-28 Industrial image detection method, device and visual detection system Pending CN117788438A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311842652.5A CN117788438A (en) 2023-12-28 2023-12-28 Industrial image detection method, device and visual detection system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311842652.5A CN117788438A (en) 2023-12-28 2023-12-28 Industrial image detection method, device and visual detection system

Publications (1)

Publication Number Publication Date
CN117788438A true CN117788438A (en) 2024-03-29

Family

ID=90394253

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311842652.5A Pending CN117788438A (en) 2023-12-28 2023-12-28 Industrial image detection method, device and visual detection system

Country Status (1)

Country Link
CN (1) CN117788438A (en)

Similar Documents

Publication Publication Date Title
CN109447154B (en) Picture similarity detection method, device, medium and electronic equipment
JP7006567B2 (en) Shooting method and shooting equipment
CN111369550A (en) Image registration and defect detection method, model, training method, device and equipment
CN115984662B (en) Multi-mode data pre-training and identifying method, device, equipment and medium
Li et al. A new edge detection method using Gaussian-Zernike moment operator
CN108960012B (en) Feature point detection method and device and electronic equipment
JP2014507722A (en) Generalized robust multi-channel feature detector
CN110738625B (en) Image resampling method, device, terminal and computer readable storage medium
Yang et al. Fast reconstruction for Monte Carlo rendering using deep convolutional networks
CN117788438A (en) Industrial image detection method, device and visual detection system
CN116416227A (en) Background image processing method and device
CN116309473A (en) Training method of gas leakage detection model and gas leakage detection method
CN108256477B (en) Method and device for detecting human face
CN113610856B (en) Method and device for training image segmentation model and image segmentation
CN112488112B (en) Target object identification method and device, electronic equipment and storage medium
CN116245808A (en) Workpiece defect detection method and device, electronic equipment and storage medium
TW200842339A (en) Mura detection method and system
JP6703672B1 (en) Defect detection method for inspection target product, apparatus therefor, and computer program therefor
CN117788437A (en) Data enhancement method, deformation detection method and visual detection system
Elloumi et al. A locally weighted metric for measuring the perceptual quality of 3D objects
Wang et al. A computer vision method for measuring angular velocity
CN117274525B (en) Virtual tape measure measurement simulation method and system
KR20210026176A (en) Generating method of labeling image for deep learning
CN116524201B (en) Feature extraction method, device, equipment and medium of multi-scale gating fusion unit
TWI762193B (en) Image defect detection method, image defect detection device, electronic device and storage media

Legal Events

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