Image processing method and device, computer device, storage medium and program product
By generating a reference noise model and a clear image, and optimizing image processing using parameter analysis tools, the problem of low accuracy in image defect detection in existing technologies is solved, achieving higher detection precision.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies for image defect detection suffer from unsatisfactory denoising effects, resulting in low detection accuracy.
By generating a reference noise model and a reference clear image, the parameters of the most suitable reference model are predicted using parameter analysis tools, multiple reference clear images are generated, and the target clear image is selected from them for defect detection.
It improves the accuracy of defect detection, effectively removes noise interference, and ensures image clarity and detection precision.
Smart Images

Figure CN115526866B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of machine vision, and relates to an image processing method and device, a computer device, a storage medium and a program product. BACKGROUND
[0002] With the development of artificial intelligence and computer vision technology, machine vision technology is increasingly applied in industrial scenarios, and its position is becoming higher and higher. For example, machine vision technology can be applied to the quality control link in industrial production processes, and a method of detecting defects in an image by image recognition has emerged as the times require.
[0003] At present, when detecting defects in an image, the image to be detected needs to be denoised first. At present, denoising in defect detection is performed by a filter to change the pixel value of a pixel with a large difference in gray value in the image to be detected to a value close to the pixel value of the surrounding pixel. This method is effective for eliminating isolated noise points, but may not be ideal for removing other types of noise points, resulting in the presence of noise points in the detected image, which interferes with defect detection and leads to low accuracy of detecting defect information in the image. SUMMARY
[0004] The present application proposes an image processing method, device, electronic device and storage medium to solve the technical problem of low accuracy of defect detection in the prior art.
[0005] In one aspect, an image processing method is provided, comprising:
[0006] obtaining an image to be detected and obtaining image information of the image to be detected;
[0007] generating at least one reference noise point model based on a preset initial noise point model and the image information;
[0008] inputting the image to be detected into the at least one reference noise point model to obtain at least one reference noise point image, and generating a reference clear image corresponding to each reference noise point image;
[0009] determining a target clear image based on the at least one reference clear image, and performing defect detection based on the target clear image to obtain a defect feature in the image to be detected.
[0010] In some possible implementations, the image information includes multiple types of image information.
[0011] The at least one reference noise point model is generated based on the preset initial noise point model and the image information, comprising:
[0012] determining at least one reference model parameter corresponding to each type of image information respectively through a preset parameter analysis tool;
[0013] generating at least one reference noise model based on the preset initial noise model and the at least one reference model parameter corresponding to each type.
[0014] In some possible implementation manners, the determining at least one reference model parameter corresponding to each type of image information respectively through a preset parameter analysis tool comprises:
[0015] inputting the extracted image information of multiple types into the parameter analysis tool to obtain a reference model parameter range corresponding to each type of image information;
[0016] determining at least one reference model parameter from each reference model parameter range respectively.
[0017] In some possible implementation manners, the parameter analysis tool comprises a parameter analysis model.
[0018] The parameter analysis model is obtained through training in the following manner:
[0019] obtaining sample image information of multiple types and a sample parameter range corresponding to each type of sample image information;
[0020] training a preset initial analysis model based on the sample image information and the sample parameter range to obtain the parameter analysis model.
[0021] In some possible implementation manners, the generating a reference clear image corresponding to each reference noise image comprises:
[0022] respectively converting each pixel point in the to-be-detected image and each pixel point in each reference noise image to obtain a first image feature of the to-be-detected image and a second image feature of each reference noise image;
[0023] determining a difference between the first image feature and each second image feature to obtain each corresponding third feature image;
[0024] converting each third feature image to obtain a corresponding reference clear image.
[0025] In some possible implementation manners, the defect detection based on the target clear image to obtain a defect feature in the to-be-detected image comprises:
[0026] comparing a pixel feature of each pixel point in the target clear image with adjacent pixel features to determine whether a defect exists at the position of the pixel point;
[0027] The contrast result of each pixel point is used to determine the defect feature in the to-be-detected image.
[0028] In some possible implementation manners, the defect detection based on the target clear image obtains the defect feature in the to-be-detected image, and includes:
[0029] At least one contour shape information is extracted from the target clear image.
[0030] The at least one contour shape information is compared with preset defect contours in similarity respectively.
[0031] The contour feature corresponding to the contour shape information with a similarity greater than a preset threshold is taken as the defect feature.
[0032] In some possible implementation manners, the types of image information include definitions, colors, image units, image sizes, and image coordinate systems of clear pixel points and noise pixel points.
[0033] In another aspect, an image processing apparatus is provided, which includes:
[0034] An acquisition module is configured to acquire a to-be-detected image and acquire image information of the to-be-detected image.
[0035] A first generation module is configured to generate at least one reference noise point model based on a preset initial noise point model and the image information.
[0036] A second generation module is configured to input the to-be-detected image into the at least one reference noise point model respectively, to obtain at least one reference noise point image, and to generate a reference clear image corresponding to each reference noise point image.
[0037] A detection module is configured to determine a target clear image based on the at least one reference clear image, and to perform defect detection based on the target clear image, to obtain a defect feature in the to-be-detected image.
[0038] In some possible implementation manners, the image information includes multiple types of image information.
[0039] When the first generation module generates the at least one reference noise point model based on the preset initial noise point model and the image information, the first generation module is specifically configured to:
[0040] At least one reference model parameter corresponding to each type of image information is determined respectively by using a preset parameter analysis tool.
[0041] The at least one reference noise point model is generated based on the preset initial noise point model and the at least one reference model parameter corresponding to each type.
[0042] In some possible implementation manners, the first generation module is specifically configured to:
[0043] input the extracted image information of the plurality of types into the parameter analysis tool to obtain the reference model parameter range corresponding to each type of image information;
[0044] determine the at least one reference model parameter from each reference model parameter range.
[0045] In some possible implementation manners, the parameter analysis tool includes a parameter analysis model.
[0046] The apparatus further includes a training module configured to:
[0047] obtain sample image information of a plurality of types and a sample parameter range corresponding to each type of sample image information;
[0048] train the preset initial analysis model based on the sample image information and the sample parameter range to obtain the parameter analysis model.
[0049] In some possible implementation manners, the second generation module is specifically configured to:
[0050] convert each pixel point in the to-be-detected image and each pixel point in each reference noise image to obtain a first image feature of the to-be-detected image and a second image feature of each reference noise image;
[0051] determine a difference between the first image feature and each second image feature to obtain each corresponding third feature image;
[0052] convert each third feature image to obtain a corresponding reference clear image.
[0053] In some possible implementation manners, the detection module is specifically configured to:
[0054] for a pixel feature of each pixel point in the target clear image, compare the pixel feature with adjacent pixel features to determine whether a defect exists at the position of the pixel point;
[0055] determine a defect feature in the to-be-detected image based on the comparison result of each pixel point.
[0056] In some possible implementation manners, the detection module is specifically configured to:
[0057] extracting at least one contour shape information from the target clear image;
[0058] comparing the at least one contour shape information with preset defect contours respectively in similarity;
[0059] taking the contour feature corresponding to the contour shape information with similarity greater than the preset threshold as the defect feature.
[0060] In some possible implementation manners, the types of the image information include definitions, colors, image units, image sizes and image coordinate systems for clear pixels and noise pixels.
[0061] In another aspect, a computer device is provided, including a memory, a processor and a computer program stored in the memory, the processor executes the computer program to implement the image processing method described above.
[0062] In another aspect, a computer readable storage medium is provided, having a computer program stored thereon, the computer program is executed by a processor to implement the image processing method described above.
[0063] In another aspect, a computer program product is provided, including a computer program, the computer program is executed by a processor to implement the image processing method described above.
[0064] The technical scheme provided by the present application has the beneficial effects that:
[0065] At least one reference noise point model is generated through the image information in the to-be-detected image, the to-be-detected model is respectively subjected to denoising processing to obtain at least one reference noise point image, and the corresponding reference clear image is generated, and then the target clear image is determined from the at least one reference clear image. Different types of to-be-detected images can all obtain more accurate clear images, remove the noise point interference in the to-be-detected image, and thus improve the accuracy of defect detection.
[0066] Further, through the parameter analysis tool, the reference model parameters most suitable for the to-be-detected image are predicted according to the different types of image information of the to-be-detected image, a plurality of reference clear images with better effects are generated, and the final target clear image is selected based on the plurality of reference clear images, which can effectively improve the denoising effect and thus improve the accuracy of defect detection.
[0067] Additional aspects and advantages of the present application will be in part apparent and in part pointed out hereinafter. BRIEF DESCRIPTION OF DRAWINGS
[0068] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the following description, taken in conjunction with the following drawings in which:
[0069] Figure 1 An implementation environment schematic diagram of an image processing method provided by an embodiment of the present application;
[0070] Figure 2 A flow schematic diagram of an image processing method provided by an embodiment of the present application;
[0071] Figure 3 A schematic diagram of a scheme for generating a plurality of reference clear images provided in an example of the present application;
[0072] Figure 4 A schematic diagram of a scheme for generating a defect saliency map provided in an example of the present application;
[0073] Figure 5 A schematic diagram of a scheme for comparing a small segmentation average concentration with an average concentration of surroundings provided in an example of the present application;
[0074] Figure 6 A schematic diagram of a scheme for comparing a small segmentation average concentration with an average concentration of surroundings provided in an example of the present application;
[0075] Figure 7 A structure schematic diagram of an image processing device provided by an embodiment of the present application;
[0076] Figure 8 A structure schematic diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0077] Embodiments of the present application will be described below in conjunction with the accompanying drawings. It should be understood that the embodiments described below in conjunction with the accompanying drawings are exemplary descriptions of the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions of the embodiments of the present application.
[0078] Those skilled in the art can understand that the singular forms "a", "an", "said" and "the" used herein also include the plural forms unless specifically stated otherwise. It should be further understood that the terms "include" and "contain" used in the embodiments of the present application mean that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude other features, information, data, steps, operations, elements, components and / or their combinations supported by the art. It should be understood that when we say that an element is "connected" or "coupled" to another element, the element can be directly connected or coupled to the other element, or it can mean that the element and the other element establish a connection relationship through an intermediate element. In addition, "connection" or "coupling" used herein can include wireless connection or wireless coupling. The term "and / or" used herein indicates that at least one of the items defined by the term, for example, "A and / or B" indicates that "A" is implemented, or "A" is implemented, or "A and B" are implemented.
[0079] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below with specific examples. It should be pointed out that the following embodiments can be mutually referred to, learned from or combined, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.
[0080] Figure 1 is a schematic diagram of an application environment of an image processing method provided by an embodiment of the present application, referring to Figure 1 The application environment can include a terminal 101 and a server 102. The terminal 101 sends a to-be-detected image to the server 102. The server 102 obtains image information of the to-be-detected image, generates at least one reference noise point model based on a preset initial noise point model and the image information. The server 102 inputs the to-be-detected image into the at least one reference noise point model respectively, obtains at least one reference noise point image, and generates a reference clear image corresponding to each reference noise point image. The server 102 determines a target clear image based on the at least one reference clear image, performs defect detection based on the target clear image, obtains a defect feature in the to-be-detected image, and sends the defect feature to the terminal 101.
[0081] It can be understood that Figure 1 represents an application scenario in an example, and does not limit the application scenario of the image processing method of the present application. In other application scenarios, the terminal can also directly perform image defect detection.
[0082] Those skilled in the art can understand that the server can be a stand-alone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server or server cluster providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal can be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a notebook computer, a digital broadcast receiver, a MID (Mobile Internet Device), a PDA (Personal Digital Assistant), a desktop computer, a smart home appliance, a vehicle terminal (such as a vehicle navigation terminal, a vehicle computer, etc.), a smart speaker, a smart watch, etc. The terminal and the server can be connected directly or indirectly through wired or wireless communication, but are not limited thereto. Specifically, the terminal and the server can be determined based on actual application scenarios, and are not limited herein.
[0083] The image processing method provided by the embodiments of the present application can be applied to a server or a terminal.
[0084] Figure 2 A flowchart of an image processing method provided by the embodiments of the present application is shown. The execution subject of the method can be a server. As shown in Figure 2 The method can include the following steps:
[0085] In step S201, an image to be detected is acquired, and image information of the image to be detected is acquired.
[0086] The image information can include multiple types of image information.
[0087] Specifically, the types of image information include definitions of clear pixel points and noise pixel points, colors, image units, image sizes, and image coordinate systems.
[0088] The definitions of clear pixel points and noise pixel points can be to define the clear pixel points or the noise pixel points as specified numbers, for example, the clear pixel points can be defined as "1", and the noise pixel points can be defined as "0". The colors can include different color channel "R", "G", "B" information of the image to be detected. The image units can include units of the image to be detected, for example, microns, pixels, etc. The image sizes can include diameters, radii, widths, etc. of the image, and different sizes are set for images of different shapes. The image coordinate information can be a coordinate system, for example, an xy coordinate system, which is used to mark and record the defect positions in the image to be detected.
[0089] Step S202, generating at least one reference noise model based on the preset initial noise model and the image information.
[0090] The reference noise model is used for denoising the to-be-detected image.
[0091] Specifically, at least one reference model parameter for the initial noise model can be predicted according to the image information. At least one reference noise model can be generated based on the preset initial noise model and the predicted reference model parameter. The generation process of the reference noise model will be further described below.
[0092] Step S203, inputting the to-be-detected image into at least one reference noise model respectively to obtain at least one reference noise image, and generating a reference clear image corresponding to each reference noise image.
[0093] Specifically, the to-be-detected image is input into at least one reference noise model respectively, each reference noise model outputs a corresponding reference noise image, and then a corresponding reference clear image is generated according to the to-be-detected image and the reference noise image.
[0094] In the specific implementation process, the to-be-detected image can be subtracted from the reference noise image to obtain a corresponding reference clear image. The specific generation process of the reference clear image will be further described below.
[0095] Step S204, determining a target clear image based on at least one reference clear image, and performing defect detection based on the target clear image to obtain defect features in the to-be-detected image.
[0096] In some embodiments, the server can send at least one reference clear image to the terminal, receive selection information input by a user of the terminal, and determine a target clear image from the at least one reference clear image based on the selection information.
[0097] In another embodiment, the server can send at least one reference clear image to the terminal. If the user is not satisfied with the displayed reference clear image, the user can input parameters to the terminal, i.e., the server can generate a noise image model according to the input parameters of the user to obtain a final target clear image. Specifically, the user can input and adjust multiple times according to the displayed target clear image until a final satisfactory target clear image is obtained.
[0098] In the specific implementation process, the target clear image can be subjected to defect detection to obtain a defect saliency map, which is used to represent defect features in the to-be-detected image.
[0099] As Figure 3As shown, at least one reference noise point model is generated, three reference noise point models are shown in the figure, each reference noise point model outputs a reference noise point image, and a corresponding reference clear image is determined, and the target clear image is determined from at least one reference clear image.
[0100] The image processing method described above generates at least one reference noise point model through image information in the to-be-detected image, respectively denoises the to-be-detected model to obtain at least one reference noise point image, and generates a corresponding reference clear image, and then determines the target clear image from at least one reference clear image. Different types of to-be-detected images can obtain more accurate clear images, remove noise interference in the to-be-detected image, and thus improve the accuracy of defect detection.
[0101] The specific process of generating a reference noise point model will be described below in conjunction with an embodiment.
[0102] In some possible implementations, the image information includes multiple types of image information. Step S202 of generating at least one reference noise point model based on the preset initial noise point model and the image information can include:
[0103] (1) Determine at least one reference model parameter corresponding to each type of image information by using a preset parameter analysis tool.
[0104] The parameter analysis tool can be a trained neural network, for example, a parameter analysis model, which can predict the reference model parameter most suitable for the to-be-detected image according to different types of image information of the to-be-detected image.
[0105] In a specific implementation process, determining at least one reference model parameter corresponding to each type of image information by using a preset parameter analysis tool can include:
[0106] a. Input the extracted multiple types of image information into the parameter analysis tool to obtain a reference model parameter range corresponding to each type of image information.
[0107] b. Determine at least one reference model parameter from each reference model parameter range.
[0108] Specifically, multiple reference model parameters can be selected from the reference model parameter range at intervals of a preset value, for example, if the reference model parameter range is 10-20, 12, 14, 16, and 18 can be selected as the reference model parameters.
[0109] Specifically, a range median can be determined from the reference model parameter range, and the median and values near the median can be selected as the reference model parameters, for example, the reference model parameter range is 10-20, the range median 15 can be selected, and 14 and 16 can be selected as the reference model parameters.
[0110] (2) Based on the preset initial noise point model and at least one reference model parameter corresponding to each type, at least one reference noise point model is generated.
[0111] Specifically, one reference model parameter corresponding to each type can be used as a parameter of the initial noise point model to generate a corresponding reference noise point model, so that at least one reference model parameter can correspond to the generation of at least one reference noise point model.
[0112] In some possible embodiments, the parameter analysis tool includes a parameter analysis model.
[0113] The parameter analysis model can be trained in the following manner:
[0114] (1) Obtain sample image information of multiple types, and a sample parameter range corresponding to sample image information of each type;
[0115] (2) Based on the sample image information and the sample parameter range, the preset initial analysis model is trained to obtain the parameter analysis model.
[0116] Specifically, obtaining the sample parameter range corresponding to the sample image information of each type can include: obtaining a sample clear image corresponding to each sample image information, and determining parameter information corresponding to a sample noise point model used to output a sample noise point image to obtain the sample clear image, to obtain the sample parameter range.
[0117] Specifically, the sample image information can be input into the initial analysis model to output a predicted parameter range, a loss function between the preset parameter range and the sample parameter range is determined, and the parameters of the initial analysis model are adjusted to make the loss function meet a preset condition, for example, the loss function converges, the number of iterations reaches a preset number, or the loss value of the loss function is less than a preset threshold, to obtain the parameter analysis model.
[0118] In the above embodiments, the parameter analysis tool predicts the reference model parameters most suitable for the to-be-detected image according to different types of image information of the to-be-detected image, thereby generating multiple reference clear images with good effects, and selecting a final target clear image based on the multiple reference clear images can effectively improve the denoising effect and improve the accuracy of defect detection.
[0119] The above embodiments describe the specific process of generating a reference noise point model, and the specific process of generating a reference clear image will be further described in combination with the embodiments.
[0120] In some possible implementations, step S203, which generates a reference sharp image corresponding to each reference noise image, may include:
[0121] (1) Convert each pixel in the image to be detected and each pixel in each reference noise image respectively to obtain the first image feature of the image to be detected and the second image feature of each reference noise image.
[0122] (2) Determine the difference between the first image feature and each second image feature to obtain each corresponding third feature image;
[0123] (3) Transform each third feature image to obtain the corresponding reference clear image.
[0124] Specifically, preset definition information for noisy pixels and clear image points can be used to convert each pixel in the image to be detected and each pixel in each reference noisy image.
[0125] In the specific implementation process, the corresponding clear image can be obtained by removing the features of the corresponding noise image from the image to be detected. That is, by subtracting the second image features of the reference noise image from the first image features of the image to be detected, the third image features of the reference clear image can be obtained, thus obtaining the corresponding reference clear image.
[0126] like Figure 4 As shown, subtracting the noise image from the image to be detected (i.e. the original image) generates a clear image. Then, image fusion detection, i.e. defect detection, is performed on the clear image to obtain a defect saliency map, which is the defect feature of the image to be detected.
[0127] The above embodiments illustrate the specific process of generating a clear reference image. The following will further illustrate the specific process of defect detection with reference to the embodiments.
[0128] In some possible implementations, step S204, which involves defect detection based on a clear target image to obtain defect features in the image to be detected, may include:
[0129] For each pixel in the clear target image, the pixel features are compared with the features of adjacent pixels to determine whether there are defects at the pixel location;
[0130] Defect features in the image to be detected are determined based on the comparison results of each pixel.
[0131] Pixel features may include at least one of subpixels, pixels, and superpixels.
[0132] In the implementation process, if the contrast result between the pixel feature and the adjacent pixel feature is that the similarity is less than the preset similarity, it can be considered that the pixel position has defects.
[0133] In some possible implementation manners, the step S204 performs defect detection based on the target clear image to obtain defect features in the to-be-detected image, which can include:
[0134] extracting at least one contour shape information from the target clear image;
[0135] comparing the at least one contour shape information with a preset defect contour in similarity;
[0136] taking a contour feature corresponding to the contour shape information with the similarity greater than the preset threshold as a defect feature.
[0137] Specifically, the contour shape information can be extracted from the to-be-detected image, and the similarity comparison is performed multiple times, and the contour shape information with high similarity is preferentially selected and defined as a defect.
[0138] In some possible implementation manners, the step S204 performs defect detection based on the target clear image to obtain defect features in the to-be-detected image, which can include:
[0139] adopting the small segmentation average concentration and the average concentration around the small segmentation average concentration to compare to determine the defect features in the to-be-detected image.
[0140] As shown in FIG. 1, Figure 5 In one example, the to-be-detected image is generated by scanning the edge position in the to-be-inspected region of the workpiece, and the target clear image is generated according to the to-be-detected image. The detection frame detects the edge position of each point according to the trend edge width. This scene can detect the edge width of multiple points and does not miss any subtle changes. The region with narrow width is moved to the trend direction with a fine moving width (i.e., the moving amount), and the edge width or edge position of each point is detected, and the maximum value and the minimum value are detected, that is, the minimum internal size detection and the maximum external size detection shown in the figure.
[0141] As shown in FIG. 1, Figure 6 When high-precision position detection is required, the size of the segment is reduced; when the processing time needs to be shortened, the moving width and / or the moving amount of the segment are reduced, and the trend moving direction refers to the moving direction of the segment.
[0142] Specifically, in the detection area, a small area (partition) of any size is moved by a preset ratio of the partition size, for example, by 1 / 4 of the partition size, to determine the average concentration. In the 4-partition detection direction including the current partition, the maximum concentration and the minimum concentration are measured. The value is the "defect level" of the current partition. When the defect level exceeds the set threshold, the current partition is counted as a defect. The count value is the "damage amount" inspection result. By comparing the concentrations of the surrounding 4 partitions (not just the adjacent 2 partitions), small concentration changes (defects) can be detected.
[0143] The image processing method described above generates at least one reference noise point model through image information in a to-be-detected image, respectively performs denoising processing on the to-be-detected model to obtain at least one reference noise point image, and generates a corresponding reference clear image. Then, a target clear image is determined from the at least one reference clear image. For different types of to-be-detected images, a more accurate clear image can be obtained, noise point interference in the to-be-detected image is removed, and thus the accuracy of defect detection is improved.
[0144] Further, through a parameter analysis tool, reference model parameters most suitable for the to-be-detected image are predicted according to different types of image information of the to-be-detected image, thereby generating multiple reference clear images with better effects, and the final target clear image is selected based on the multiple reference clear images. The denoising effect can be effectively improved, and thus the accuracy of defect detection is improved.
[0145] Figure 7 A structural schematic diagram of an image processing device provided by an embodiment of the present application is shown in FIG. 1. As shown in FIG. 1, the device includes: Figure 7
[0146] The acquisition module 701 is configured to acquire a to-be-detected image and acquire image information of the to-be-detected image.
[0147] The first generation module 702 is configured to generate at least one reference noise point model based on a preset initial noise point model and the image information.
[0148] The second generation module 703 is configured to input the to-be-detected image into the at least one reference noise point model respectively to obtain at least one reference noise point image, and generate a reference clear image corresponding to each reference noise point image.
[0149] The detection module 704 is configured to determine a target clear image based on the at least one reference clear image, and perform defect detection based on the target clear image to obtain a defect feature in the to-be-detected image.
[0150] In some possible implementation manners, the image information includes multiple types of image information.
[0151] The first generation module 702 is specifically configured to:
[0152] The preset parameter analysis tool is used to determine at least one reference model parameter corresponding to each type of image information.
[0153] Based on the preset initial noise model and the at least one reference model parameter corresponding to each type, at least one reference noise model is generated.
[0154] In some possible implementation manners, when the first generation module 702 determines at least one reference model parameter corresponding to each type of image information by using the preset parameter analysis tool, the first generation module 702 is specifically configured to:
[0155] The extracted image information of the plurality of types is input into the parameter analysis tool to obtain a reference model parameter range corresponding to each type of image information.
[0156] At least one reference model parameter is determined from each reference model parameter range.
[0157] In some possible implementation manners, the parameter analysis tool includes a parameter analysis model.
[0158] The apparatus further includes a training module configured to:
[0159] Obtain sample image information of a plurality of types and a sample parameter range corresponding to sample image information of each type.
[0160] The preset initial analysis model is trained based on the sample image information and the sample parameter range to obtain the parameter analysis model.
[0161] In some possible implementation manners, when the second generation module 703 generates a reference clear image corresponding to each reference noise image, the second generation module 703 is specifically configured to:
[0162] Each pixel point in the to-be-detected image and each pixel point in each reference noise image are converted to obtain a first image feature of the to-be-detected image and a second image feature of each reference noise image.
[0163] A difference between the first image feature and each second image feature is determined to obtain each corresponding third feature image.
[0164] Each third feature image is converted to obtain a corresponding reference clear image.
[0165] In some possible implementation manners, when the detection module 704 detects defects in the to-be-detected image based on the target clear image to obtain defect features in the to-be-detected image, the detection module 704 is specifically configured to:
[0166] For each pixel feature of the target clear image, the pixel feature is compared with adjacent pixel features to determine whether a defect exists at the pixel position;
[0167] The defect feature in the to-be-detected image is determined based on the comparison result of each pixel.
[0168] In some possible implementation manners, when the detection module 704 performs defect detection based on the target clear image to obtain the defect feature in the to-be-detected image, the detection module 704 is specifically configured to:
[0169] extract at least one contour shape information from the target clear image;
[0170] perform similarity comparison of the at least one contour shape information and a preset defect contour respectively;
[0171] the contour feature corresponding to the contour shape information with a similarity greater than a preset threshold is taken as the defect feature.
[0172] In some possible implementation manners, the types of the image information include definitions, colors, image units, image sizes, and image coordinate systems of clear pixel points and noise pixel points.
[0173] The image processing apparatus described above generates at least one reference noise point model through image information in the to-be-detected image, performs denoising processing on the to-be-detected model to obtain at least one reference noise point image, and generates a corresponding reference clear image, and then determines the target clear image from the at least one reference clear image. Different types of to-be-detected images can all obtain more accurate clear images, remove noise interference in the to-be-detected image, and thus improve the accuracy of defect detection.
[0174] Further, through the parameter analysis tool, reference model parameters most suitable for the to-be-detected image are predicted according to different types of image information of the to-be-detected image, so as to generate multiple reference clear images with better effects, and the final target clear image is selected based on the multiple reference clear images, which can effectively improve the denoising effect and thus improve the accuracy of defect detection.
[0175] Figure 8 is a structural schematic diagram of a computer device provided in an embodiment of the present application. As shown in Figure 8 the computer device includes a memory and a processor, and at least one program stored in the memory and used to be executed by the processor to achieve the following compared with the prior art:
[0176] The image information in the to-be-detected image is used to generate at least one reference noise point model, the to-be-detected model is respectively denoised to obtain at least one reference noise point image, and a corresponding reference clear image is generated, and then a target clear image is determined from the at least one reference clear image. Different types of to-be-detected images can obtain more accurate clear images, remove noise interference in the to-be-detected image, and improve the accuracy of defect detection. Through a parameter analysis tool, reference model parameters most suitable for the to-be-detected image are predicted according to different types of image information of the to-be-detected image, thereby generating multiple reference clear images with better effects, and the final target clear image is selected based on the multiple reference clear images, which can effectively improve the denoising effect and improve the accuracy of defect detection.
[0177] In an optional embodiment, a computer device is provided, comprising Figure 8 as shown in the figure, Figure 8 The computer device 800 shown in the figure comprises a processor 801 and a memory 803. The processor 801 and the memory 803 are connected, for example, through a bus 802. Optionally, the computer device 800 can further comprise a transceiver 804, which can be used for data interaction, such as data transmission and / or data reception, between the computer device and other computer devices. It should be noted that in actual application, the transceiver 804 is not limited to one, and the structure of the computer device 800 does not constitute a limitation on the embodiments of the present application.
[0178] The processor 801 can be a CPU (Central Processing Unit, central processor), a general-purpose processor, a DSP (Digital Signal Processor, data signal processor), an ASIC (Application Specific Integrated Circuit, application specific integrated circuit), an FPGA (Field Programmable Gate Array, field programmable gate array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logical blocks, modules and circuits described in combination with the disclosure content of the present application. The processor 801 can also be a combination of computing functions, such as one or more microprocessor combinations, combinations of DSP and microprocessor, etc.
[0179] The bus 802 can include a path that transmits information between the above components. The bus 802 can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 802 can be divided into an address bus, a data bus, a control bus, and the like. For convenience of representation, Figure 8 Only one thick line is used in the figure to represent the bus, but it does not mean that there is only one bus or only one type of bus.
[0180] The memory 803 can be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to this.
[0181] The memory 803 is used to store application program code (computer program) for implementing the scheme of the present application, and is controlled by the processor 801 to execute. The processor 801 is used to execute the application program code stored in the memory 803 to realize the content shown in the foregoing method embodiments.
[0182] The computer device includes, but is not limited to, a virtualized computer device, a virtual machine, a server, a service cluster, a user's terminal, and the like.
[0183] The computer readable storage medium provided by the embodiment of the present application stores a computer program, and when the computer program runs on the computer, the computer can execute the corresponding content of the image processing method in the foregoing method embodiments.
[0184] The embodiment of the present application provides a computer program product or computer program, the computer program product or computer program includes computer instructions stored in a computer readable storage medium. The processor of the computer equipment reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer equipment executes the image processing method described above.
[0185] It should be understood that, although each step in the flowchart of the accompanying drawings is displayed in sequence according to the indication of the arrow, these steps are not necessarily executed in sequence according to the indication of the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and they can be executed in other sequences. Moreover, at least part of the steps in the flowchart of the accompanying drawings can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be alternately executed with at least part of other steps or sub-steps or stages of other steps.
[0186] It should be noted that the computer readable medium of the present disclosure described above can be a computer readable signal medium or a computer readable storage medium or any combination of the above two. The computer readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of the computer readable storage medium can include but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In the present disclosure, the computer readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium other than the computer readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or apparatus. The program code contained in the computer readable medium can be transmitted by any suitable medium, including but not limited to: a wire, an optical cable, an RF (radio frequency) or the like, or any suitable combination thereof.
[0187] The computer readable medium described above can be included in the electronic device described above; or can exist separately from the electronic device and be not assembled into the electronic device.
[0188] The computer readable medium described above carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the embodiments described above.
[0189] Computer program code for carrying out operations of the present disclosure can be written in one or more programming languages or combinations of languages including object oriented programming languages such as Java, Smalltalk, C++ as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0190] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of present disclosure. In this regard, each block in the flow diagrams or block diagrams can represent a module, a procedure, or a part of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in a different order than that noted in the figures. For example, two blocks noted in succession can in fact be executed substantially concurrently or in the opposite order, depending on the functionality involved. It should also be noted that each block in the block diagrams and / or flow diagrams, and combinations of blocks in the block diagrams and / or flow diagrams, can be implemented by dedicated hardware-based systems that perform the specified functions or operations, or can be implemented by a combination of dedicated hardware-based systems and computer instructions.
[0191] The modules involved in the embodiments of the present disclosure can be implemented in the form of software or in the form of hardware. Among them, the name of the module does not constitute a limitation to the module itself in some cases. For example, the extraction module can also be described as "a module for extracting user key point features".
[0192] The above description is merely exemplary of the disclosure and the application of the principles thereof and it is not intended to limit the scope of the disclosure to the specific forms set forth. The disclosure is susceptible to numerous modifications and alternative forms of implementation, all of which are intended to be within the scope of the disclosure. Indeed, the specific forms set forth are only exemplary embodiments of the disclosure and other embodiments are possible. The scope of the disclosure is therefore not intended to be limited to the specific forms set forth and any modifications and / or improvements are intended to be within the scope of the disclosure.
Claims
1. An image processing method, characterized in that, include: Acquire the image to be detected, and acquire the image information of the image to be detected; At least one reference noise model is generated based on a preset initial noise model and the image information. The image to be detected is input into at least one reference noise model to obtain at least one reference noise image, and a reference clear image corresponding to each reference noise image is generated. A target clear image is determined based on the at least one reference clear image, and defect detection is performed based on the target clear image to obtain the defect features in the image to be detected; The image information includes multiple types of image information; The generation of at least one reference noise model based on a preset initial noise model and image information includes: Using a pre-set parameter analysis tool, at least one reference model parameter corresponding to each type of image information is determined. Based on a preset initial noise model and at least one reference model parameter corresponding to each type, the at least one reference noise model is generated.
2. The image processing method according to claim 1, characterized in that, The step of determining at least one reference model parameter corresponding to each type of image information using a preset parameter analysis tool includes: The extracted image information of multiple types is input into the parameter analysis tool to obtain the reference model parameter range corresponding to each type of image information; At least one reference model parameter is determined from each reference model parameter range.
3. The image processing method according to claim 1, characterized in that, The parameter analysis tool includes a parameter analysis model; The parameter analysis model was trained in the following manner: Acquire sample image information of multiple types, and the range of sample parameters corresponding to each type of sample image information; The preset initial analysis model is trained based on the sample image information and the sample parameter range to obtain the parameter analysis model.
4. The image processing method according to claim 1, characterized in that, The generation of a reference clear image corresponding to each reference noise image includes: Each pixel in the image to be detected and each pixel in each of the reference noise images are transformed to obtain the first image feature of the image to be detected and the second image feature of each reference noise image. Determine the difference between the first image feature and each second image feature to obtain each corresponding third feature image; Each third feature image is transformed to obtain the corresponding clear reference image.
5. The image processing method according to claim 1, characterized in that, The defect detection based on the target clear image, to obtain the defect features in the image to be detected, includes: For each pixel in the target clear image, the pixel features are compared with the features of adjacent pixels to determine whether there is a defect at the position of the pixel. The defect features in the image to be detected are determined based on the comparison results of each pixel.
6. The image processing method according to claim 1, characterized in that, The defect detection based on the target clear image, to obtain the defect features in the image to be detected, includes: Extract at least one contour morphology information from the target clear image; The similarity of the at least one contour morphology information with the preset defect contour is compared respectively. Contour features corresponding to contour morphology information with similarity greater than a preset threshold are used as defect features.
7. The image processing method according to claim 2, characterized in that, The types of image information include definitions for clear pixels and noisy pixels, color, image units, image size, and image coordinate system.
8. An image processing apparatus, characterized in that, The device includes: An acquisition module is used to acquire the image to be detected and to acquire the image information of the image to be detected; The first generation module is used to generate at least one reference noise model based on a preset initial noise model and the image information. The second generation module is used to input the image to be detected into at least one reference noise model to obtain at least one reference noise image, and generate a reference clear image corresponding to each reference noise image. The detection module is used to determine a target clear image based on the at least one reference clear image, and to perform defect detection based on the target clear image to obtain defect features in the image to be detected; The image information includes multiple types of image information; The first generation module is used to perform the following steps to generate at least one reference noise model based on a preset initial noise model and the image information: Using a pre-set parameter analysis tool, at least one reference model parameter corresponding to each type of image information is determined. Based on a preset initial noise model and at least one reference model parameter corresponding to each type, the at least one reference noise model is generated.
9. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the image processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the image processing method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the image processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Image denoising method and device, computer equipment and storage medium
CN113538281A
Ceramic tile surface defect detection method and device and storage medium
CN114782418A