CN111899239A - Image processing method and device - Google Patents
Image processing method and device Download PDFInfo
- Publication number
- CN111899239A CN111899239A CN202010733029.6A CN202010733029A CN111899239A CN 111899239 A CN111899239 A CN 111899239A CN 202010733029 A CN202010733029 A CN 202010733029A CN 111899239 A CN111899239 A CN 111899239A
- Authority
- CN
- China
- Prior art keywords
- image
- color channel
- images
- channel parameters
- data set
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
- G06T5/92—Dynamic range modification of images or parts thereof based on global image properties
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/30—Determination of transform parameters for the alignment of images, i.e. image registration
- G06T7/33—Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Artificial Intelligence (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Quality & Reliability (AREA)
- Image Processing (AREA)
Abstract
本申请的实施例提供了一种图像处理方法和装置,涉及计算机技术领域。本申请实施例中的图像处理方法包括:基于图像数据集中各图像的颜色通道参数,对图像数据集中的图像进行聚类处理,得到多个图像聚类集;从多个图像聚类集中选取图像数量最多的目标图像聚类集,基于目标图像聚类集中各图像的颜色通道参数,计算目标图像聚类集中图像的平均颜色通道参数;基于目标图像聚类集中图像的平均颜色通道参数,对待检测图像的颜色通道参数进行校准处理,得到校准后的待检测图像。本申请实施例的技术方案使得图像缺陷定位模型能对特定颜色模式聚集的液晶面板图像实现准确的缺陷定位,提高了图像缺陷定位模型进行缺陷定位的精准度。
Embodiments of the present application provide an image processing method and apparatus, which relate to the technical field of computers. The image processing method in the embodiment of the present application includes: based on the color channel parameters of each image in the image data set, clustering the images in the image data set to obtain multiple image cluster sets; selecting images from the multiple image cluster sets The largest number of target image clustering sets, based on the color channel parameters of each image in the target image clustering set, calculate the average color channel parameters of the images in the target image clustering set; The color channel parameters of the image are calibrated to obtain a calibrated image to be detected. The technical solutions of the embodiments of the present application enable the image defect localization model to achieve accurate defect localization for liquid crystal panel images gathered in a specific color mode, thereby improving the accuracy of defect localization by the image defect localization model.
Description
技术领域technical field
本申请涉及计算机技术领域,具体而言,涉及一种图像处理方法和装置。The present application relates to the field of computer technology, and in particular, to an image processing method and apparatus.
背景技术Background technique
在液晶面板的制造过程中,需要将通过每个加工工艺进行加工的液晶面板进行拍摄,得到液晶面板图像,并通过图像缺陷定位模型来对液晶面板图像进行处理,以得到液晶面板图像的缺陷位置。In the manufacturing process of the liquid crystal panel, it is necessary to photograph the liquid crystal panel processed by each processing process to obtain the image of the liquid crystal panel, and process the image of the liquid crystal panel through the image defect positioning model to obtain the defect position of the liquid crystal panel image. .
图像缺陷定位模型需要通过大量的液晶面板图像来进行训练,相关技术中,一般直接将对液晶面板的制造过程进行拍摄的液晶面板图像作为图像缺陷定位模型的训练样本数据来训练图像缺陷定位模型。The image defect localization model needs to be trained by a large number of LCD panel images. In the related art, the LCD panel image captured during the manufacturing process of the LCD panel is generally used as the training sample data of the image defect localization model to train the image defect localization model.
由于液晶面板的拍摄会受到环境光照、相机成像参数以及液晶面板的反光度等多种因素的影响,导致对图像缺陷定位模型进行训练的液晶面板图像呈现特定的颜色模式聚集,如呈现浅黄色、黄绿色、棕黄色或橘黄色等等。将这些液晶面板图像直接作为图像缺陷定位模型的训练样本数据,会导致图像缺陷定位模型对特定颜色模式聚集的液晶面板图像无法实现准确的缺陷定位,缺陷定位的精准度不高。Since the shooting of the LCD panel will be affected by various factors such as ambient light, camera imaging parameters, and the reflectivity of the LCD panel, the LCD panel images trained on the image defect localization model show a specific color pattern aggregation, such as light yellow, Yellow-green, brown-yellow or orange-yellow, etc. Using these LCD panel images directly as the training sample data for the image defect localization model will result in the image defect localization model being unable to achieve accurate defect localization for the LCD panel images gathered in a specific color mode, and the defect localization accuracy is not high.
发明内容SUMMARY OF THE INVENTION
本申请的实施例提供了一种图像处理方法和装置,可以在一定程度上解决图像缺陷定位模型对特定颜色模式聚集的液晶面板图像无法实现准确的缺陷定位,缺陷定位的精准度不高的技术问题。The embodiments of the present application provide an image processing method and device, which can to a certain extent solve the problem that the image defect localization model cannot achieve accurate defect localization for liquid crystal panel images gathered in a specific color mode, and the accuracy of defect localization is not high. question.
本申请的其他特性和优点将通过下面的详细描述变得显然,或部分地通过本申请的实践而习得。Other features and advantages of the present application will become apparent from the following detailed description, or be learned in part by practice of the present application.
根据本申请实施例的一个方面,提供了一种图像处理方法,包括:基于图像数据集中各图像的颜色通道参数,对所述图像数据集中的图像进行聚类处理,得到多个图像聚类集;从所述多个图像聚类集中选取图像数量最多的目标图像聚类集,基于所述目标图像聚类集中各图像的颜色通道参数,计算所述目标图像聚类集中图像的平均颜色通道参数;基于所述目标图像聚类集中图像的平均颜色通道参数,对待检测图像的颜色通道参数进行校准处理,得到校准后的待检测图像。According to an aspect of the embodiments of the present application, an image processing method is provided, comprising: performing clustering processing on images in the image data set based on color channel parameters of each image in the image data set to obtain a plurality of image clustering sets Select the target image cluster set with the largest number of images from the multiple image cluster sets, calculate the average color channel parameters of the images in the target image cluster set based on the color channel parameters of each image in the target image cluster set ; Based on the average color channel parameters of the images in the target image cluster set, the color channel parameters of the images to be detected are calibrated to obtain the calibrated images to be detected.
根据本申请实施例的一个方面,提供了一种图像处理装置,包括:聚类单元,用于基于图像数据集中各图像的颜色通道参数,对所述图像数据集中的图像进行聚类处理,得到多个图像聚类集;计算单元,用于从所述多个图像聚类集中选取图像数量最多的目标图像聚类集,基于所述目标图像聚类集中各图像的颜色通道参数,计算所述目标图像聚类集中图像的平均颜色通道参数;第一校准单元,用于基于所述目标图像聚类集中图像的平均颜色通道参数,对待检测图像的颜色通道参数进行校准处理,得到校准后的待检测图像。According to an aspect of the embodiments of the present application, an image processing apparatus is provided, including: a clustering unit configured to perform clustering processing on the images in the image data set based on the color channel parameters of each image in the image data set, to obtain a plurality of image clustering sets; a computing unit for selecting a target image clustering set with the largest number of images from the multiple image clustering sets, and calculating the The average color channel parameter of the images in the target image clustering set; the first calibration unit is configured to perform calibration processing on the color channel parameter of the image to be detected based on the average color channel parameter of the image in the target image clustering set, and obtain the calibrated to-be-detected image. Detect images.
在本申请的一些实施例中,基于前述方案,所述聚类单元被配置为:基于所述图像数据集中每个图像所包含的所有像素对应的颜色通道参数,分别计算所述图像数据集中每个图像相对应的平均颜色通道参数;基于所述图像数据集中每个图像相对应的平均颜色通道参数,对所述图像数据集中的图像进行聚类处理,得到多个图像聚类集。In some embodiments of the present application, based on the foregoing solution, the clustering unit is configured to: based on the color channel parameters corresponding to all pixels included in each image in the image data set, separately calculate each pixel in the image data set. The average color channel parameters corresponding to each image; and based on the average color channel parameters corresponding to each image in the image data set, the images in the image data set are clustered to obtain a plurality of image cluster sets.
在本申请的一些实施例中,基于前述方案,所述聚类单元被配置为:基于所述图像数据集中每个图像所包含的所有像素在各个颜色通道下的颜色通道参数,分别计算所述图像数据集中每个图像在各个颜色通道下的平均颜色通道参数。In some embodiments of the present application, based on the foregoing solution, the clustering unit is configured to: based on the color channel parameters of all pixels included in each image in the image dataset under each color channel, calculate the The average color channel parameters under each color channel for each image in the image dataset.
在本申请的一些实施例中,基于前述方案,所述第一校准单元被配置为:基于待检测图像所包含的所有像素的颜色通道参数,确定待检测图像相对应的平均颜色通道参数;基于所述目标图像聚类集中图像的平均颜色通道参数以及所述待检测图像相对应的平均颜色通道参数,生成校准参数;基于所述校准参数,对所述待检测图像所包含的所有像素的颜色通道参数进行校准处理,得到校准后的待检测图像。In some embodiments of the present application, based on the foregoing solution, the first calibration unit is configured to: determine, based on color channel parameters of all pixels included in the image to be detected, an average color channel parameter corresponding to the image to be detected; The average color channel parameters of the images in the target image cluster set and the average color channel parameters corresponding to the images to be detected generate calibration parameters; based on the calibration parameters, the colors of all pixels included in the images to be detected are analyzed The channel parameters are calibrated to obtain a calibrated image to be detected.
在本申请的一些实施例中,基于前述方案,所述第一校准单元被配置为:计算所述目标图像聚类集中图像的平均颜色通道参数与所述待检测图像相对应的平均颜色通道参数之间的比值;基于所述比值,生成校准参数。In some embodiments of the present application, based on the foregoing solution, the first calibration unit is configured to: calculate the average color channel parameter of the images in the target image cluster set and the average color channel parameter corresponding to the image to be detected A ratio between; based on the ratio, a calibration parameter is generated.
在本申请的一些实施例中,基于前述方案,所述图像处理装置,还包括:输入单元,用于输入所述校准后的待检测图像至预训练的图像缺陷定位模型中;定位单元,用于通过所述图像缺陷定位模型对所述校准后的待检测图像进行缺陷定位处理,输出缺陷定位结果。In some embodiments of the present application, based on the foregoing solution, the image processing apparatus further includes: an input unit for inputting the calibrated to-be-detected image into a pre-trained image defect localization model; a localization unit for using Defect localization processing is performed on the calibrated image to be inspected through the image defect localization model, and a defect localization result is output.
在本申请的一些实施例中,基于前述方案,所述图像处理装置,还包括:第二校准单元,用于基于所述目标图像聚类集中图像的平均颜色通道参数,对所述图像数据集中的图像的颜色通道参数进行校准处理,得到校准后的图像数据集;标注单元,用于对所述校准后的图像数据集中的图像进行图像缺陷标注处理,得到标注后的图像数据集;生成单元,用于基于标注后的图像数据集,生成训练样本数据;训练单元,用于基于生成的所述训练样本数据对机器学习模型进行训练,得到所述图像缺陷定位模型。In some embodiments of the present application, based on the foregoing solution, the image processing apparatus further includes: a second calibration unit, configured to perform a calibration on the image data set based on the average color channel parameters of the images in the target image cluster set The color channel parameter of the image is calibrated to obtain a calibrated image data set; the labeling unit is used to perform image defect labeling processing on the images in the calibrated image data set to obtain the labeled image data set; The generating unit , which is used to generate training sample data based on the marked image data set; the training unit is used to train the machine learning model based on the generated training sample data to obtain the image defect localization model.
在本申请的一些实施例中,基于前述方案,所述生成单元被配置为:从所述标注后的图像数据集,选取目标图像;对所述目标图像进行数据增强处理,得到处理后的图像;基于所述处理后的图像以及所述标注后的图像数据集,生成训练样本数据。In some embodiments of the present application, based on the aforementioned solution, the generating unit is configured to: select a target image from the labeled image data set; perform data enhancement processing on the target image to obtain a processed image ; Generate training sample data based on the processed image and the labeled image data set.
在本申请的一些实施例中,基于前述方案,所述生成单元被配置为:获取数据增强概率阈值;为所述标注后的图像数据集中的图像分配随机数;将分配的随机数小于或等于所述数据增强概率阈值的图像,确定为所述目标图像。In some embodiments of the present application, based on the foregoing solution, the generating unit is configured to: obtain a data enhancement probability threshold; assign random numbers to the images in the labeled image dataset; assign the assigned random numbers less than or equal to The image with the data enhancement probability threshold is determined as the target image.
根据本申请实施例的一个方面,提供了一种计算机可读介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上述实施例中所述的图像处理方法。According to an aspect of the embodiments of the present application, a computer-readable medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, implements the image processing method described in the foregoing embodiments.
根据本申请实施例的一个方面,提供了一种电子设备,包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现如上述实施例中所述的图像处理方法。According to an aspect of the embodiments of the present application, an electronic device is provided, including: one or more processors; and a storage device for storing one or more programs, when the one or more programs are stored by the one or more programs When executed by multiple processors, the one or more processors are made to implement the image processing method described in the above embodiments.
在本申请的一些实施例所提供的技术方案中,通过基于图像数据集中各图像的颜色通道参数,对图像数据集中的图像进行聚类处理,得到多个图像聚类集,并从多个图像聚类集中选取图像数量最多的目标图像聚类集,且基于目标图像聚类集中各图像的颜色通道参数,计算目标图像聚类集中图像的平均颜色通道参数,再基于目标图像聚类集中图像的平均颜色通道参数,对待检测图像的颜色通道参数进行校准处理,得到校准后的待检测图像,通过先对待检测图像进行图像校准的数据预处理,再由图像缺陷定位模型根据校准后的待检测图像来进行缺陷定位检测,相较于将不经过图像校准的数据预处理的待检测图像直接输入至图像缺陷定位模型,使得在当待检测图像为特定颜色模式聚集的液晶面板图像时,图像缺陷定位模型也能进行准确的缺陷定位,提高了图像缺陷定位模型进行缺陷定位的精准度。In the technical solutions provided by some embodiments of the present application, the images in the image data set are clustered based on the color channel parameters of each image in the image data set, so as to obtain multiple image clustering sets, and from multiple image clustering sets, The target image cluster set with the largest number of images is selected in the cluster set, and based on the color channel parameters of each image in the target image cluster set, the average color channel parameters of the images in the target image cluster set are calculated, and then the average color channel parameters of the images in the target image cluster set are calculated. Average color channel parameters, calibrate the color channel parameters of the image to be inspected, and obtain the calibrated image to be inspected. First, perform image calibration data preprocessing on the image to be inspected, and then use the image defect localization model according to the calibrated image to be inspected. Compared with directly inputting the image to be inspected without data preprocessing without image calibration into the image defect localization model, when the image to be inspected is an LCD panel image gathered in a specific color mode, the image defect can be located The model can also perform accurate defect location, which improves the accuracy of defect location by the image defect location model.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not limiting of the present application.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。在附图中:The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description serve to explain the principles of the application. Obviously, the drawings in the following description are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort. In the attached image:
图1示出了可以应用本申请实施例的技术方案的示例性系统架构的示意图。FIG. 1 shows a schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of the present application can be applied.
图2示出了根据本申请的一个实施例的图像处理方法的流程图。FIG. 2 shows a flowchart of an image processing method according to an embodiment of the present application.
图3示出了根据本申请的一个实施例的图像处理方法的步骤S210的具体流程图。FIG. 3 shows a specific flowchart of step S210 of the image processing method according to an embodiment of the present application.
图4示出了根据本申请的一个实施例的图像处理方法的步骤S230的具体流程图。FIG. 4 shows a specific flowchart of step S230 of the image processing method according to an embodiment of the present application.
图5示出了根据本申请的一个实施例的图像处理方法的步骤S410的具体流程图。FIG. 5 shows a specific flowchart of step S410 of the image processing method according to an embodiment of the present application.
图6示出了根据本申请的一个实施例的图像处理方法的流程图。FIG. 6 shows a flowchart of an image processing method according to an embodiment of the present application.
图7示出了根据本申请的一个实施例的图像处理方法的流程图。FIG. 7 shows a flowchart of an image processing method according to an embodiment of the present application.
图8示出了根据本申请的一个实施例的图像处理方法的步骤S720的具体流程图。FIG. 8 shows a specific flowchart of step S720 of the image processing method according to an embodiment of the present application.
图9示出了根据本申请的一个实施例的图像处理方法的步骤S810的具体流程图。FIG. 9 shows a specific flowchart of step S810 of the image processing method according to an embodiment of the present application.
图10示出了根据本申请的一个实施例的图像处理装置的框图。FIG. 10 shows a block diagram of an image processing apparatus according to an embodiment of the present application.
图11示出了适于用来实现本申请实施例的电子设备的计算机系统的结构示意图。FIG. 11 shows a schematic structural diagram of a computer system suitable for implementing the electronic device according to the embodiment of the present application.
具体实施方式Detailed ways
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本申请将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments, however, can be embodied in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
此外,所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施例中。在下面的描述中,提供许多具体细节从而给出对本申请的实施例的充分理解。然而,本领域技术人员将意识到,可以实践本申请的技术方案而没有特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知方法、装置、实现或者操作以避免模糊本申请的各方面。Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided in order to give a thorough understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical solutions of the present application may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be employed. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the present application.
附图中所示的方框图仅仅是功能实体,不一定必须与物理上独立的实体相对应。即,可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。The block diagrams shown in the figures are merely functional entities and do not necessarily necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices entity.
附图中所示的流程图仅是示例性说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解,而有的操作/步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flowcharts shown in the figures are only exemplary illustrations and do not necessarily include all contents and operations/steps, nor do they have to be performed in the order described. For example, some operations/steps can be decomposed, and some operations/steps can be combined or partially combined, so the actual execution order may be changed according to the actual situation.
图1示出了可以应用本申请实施例的技术方案的示例性系统架构的示意图。FIG. 1 shows a schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of the present application can be applied.
如图1所示,系统架构可以包括客户端101、网络102和服务器103。网络102用以在客户端101和服务器103之间提供通信链路的介质。网络102可以包括各种连接类型,例如有线通信链路、无线通信链路等等。As shown in FIG. 1 , the system architecture may include a
应该理解,图1中的客户端101、网络102和服务器103的数目仅仅是示意性的。根据实现需要,可以具有任意数目的客户端101、网络102和服务器103,比如服务器103可以是多个服务器组成的服务器集群等。It should be understood that the numbers of
客户端101通过网络102与服务器103交互,以接收或发送消息等,服务器103可以是提供各种服务的服务器,例如可以为提供图像处理应用的服务器。The
客户端101通过基于图像数据集中各图像的颜色通道参数,对图像数据集中的图像进行聚类处理,得到多个图像聚类集,并从多个图像聚类集中选取图像数量最多的目标图像聚类集,且基于目标图像聚类集中各图像的颜色通道参数,计算目标图像聚类集中图像的平均颜色通道参数,再基于目标图像聚类集中图像的平均颜色通道参数,对待检测图像的颜色通道参数进行校准处理,得到校准后的待检测图像,通过先对待检测图像进行图像校准的数据预处理,再由图像缺陷定位模型根据校准后的待检测图像来进行缺陷定位检测,相较于将不经过图像校准的数据预处理的待检测图像直接输入至图像缺陷定位模型,使得在当待检测图像为特定颜色模式聚集的液晶面板图像时,图像缺陷定位模型也能进行准确的缺陷定位,提高了图像缺陷定位模型进行缺陷定位的精准度。The
需要说明的是,本申请实施例所提供的图像处理方法一般由客户端101执行,相应地,图像处理装置一般设置于客户端101中。但是,在本申请的其它实施例中,服务器103也可以与客户端101具有相似的功能,从而执行本申请实施例所提供的图像处理方法的方案。It should be noted that the image processing method provided by the embodiment of the present application is generally executed by the
以下对本申请实施例的技术方案的实现细节进行详细阐述。The implementation details of the technical solutions of the embodiments of the present application are described in detail below.
图2示出了根据本申请的一个实施例的图像处理方法的流程图,该图像处理方法可以由客户端来执行,该客户端可以是图1中所示的客户端101。参照图2所示,该图像处理方法至少包括步骤S210至步骤S230,详细介绍如下。FIG. 2 shows a flowchart of an image processing method according to an embodiment of the present application. The image processing method may be executed by a client, and the client may be the
在步骤S210中,基于图像数据集中各图像的颜色通道参数,对图像数据集中的图像进行聚类处理,得到多个图像聚类集。In step S210, based on the color channel parameters of each image in the image data set, cluster processing is performed on the images in the image data set to obtain a plurality of image cluster sets.
在一个实施例中,在液晶面板的制造过程中,当液晶面板经过某个加工工艺进行加工后,可以通过特定的图像拍摄装置对加工后的液晶面板进行拍摄得到液晶面板图像,拍摄所得的液晶面板图像作为对液晶面板进行颜色缺陷分析的图像。图像数据集为对液晶面板进行拍摄所得到的图像集合,需要指出的是,由于各个液晶面板图像所处拍摄环境的客观差异,例如由于环境光照、相机成像参数以及液晶面板的反光度等多种不同因素作用下而产生的拍摄环境差异,进而导致液晶面板图像的颜色存在差异。因而,图像数据集包含的液晶面板图像集合一般指的是存在色彩特性差异的液晶面板图像集合。In one embodiment, in the manufacturing process of the liquid crystal panel, after the liquid crystal panel is processed by a certain processing process, a specific image capturing device can be used to capture the processed liquid crystal panel to obtain an image of the liquid crystal panel, and the obtained liquid crystal panel can be captured by capturing the image of the liquid crystal panel. The panel image is used as an image for color defect analysis of the liquid crystal panel. The image data set is a collection of images obtained by shooting the LCD panel. It should be pointed out that due to the objective differences in the shooting environment where each LCD panel image is located, for example, due to various factors such as ambient lighting, camera imaging parameters, and the reflectivity of the LCD panel. Differences in the shooting environment caused by different factors lead to differences in the color of the LCD panel image. Therefore, the liquid crystal panel image set included in the image data set generally refers to the liquid crystal panel image set with differences in color characteristics.
在一个实施例中,图像的颜色通道参数作为图像在特定色彩模式下所对应的颜色通道中的参数值,图像的颜色通道参数可以作为表征图像的色彩特性的一种参数,图像一般包含多个像素,各个像素具有相应的颜色通道参数,图像所包含的所有像素的颜色通道参数构成了该图像的颜色通道参数。In one embodiment, the color channel parameter of the image is used as the parameter value in the color channel corresponding to the image in a specific color mode, and the color channel parameter of the image can be used as a parameter that characterizes the color characteristics of the image. The image generally contains multiple Each pixel has corresponding color channel parameters, and the color channel parameters of all pixels included in the image constitute the color channel parameters of the image.
图像所对应的色彩模式可以是单个颜色通道的色彩模式,例如灰度图,对于单颜色通道的图像,各个像素对应的颜色通道参数值只有一个颜色通道下的参数值。图像所对应的色彩模式也可以是多个颜色通道的色彩模式,例如红绿蓝RGB色彩模式,例如在RGB色彩模式下,相应的颜色通道参数为三个参数值,即在R颜色通道、G颜色通道以及B颜色通道下的参数值。The color mode corresponding to the image may be the color mode of a single color channel, such as a grayscale image. For an image with a single color channel, the color channel parameter value corresponding to each pixel has only the parameter value under one color channel. The color mode corresponding to the image can also be a color mode with multiple color channels, such as the red, green, and blue RGB color mode. For example, in the RGB color mode, the corresponding color channel parameters are three parameter values, that is, in the R color channel, G The color channel and the parameter value under the B color channel.
在一个实施例中,为了确定图像数据集所包含的所有图像所具有的共同色彩特性,可以基于图像数据集中各图像的颜色通道参数,对图像数据集中的图像进行聚类处理,得到多个图像聚类集,各个图像聚类集可以作为表征具有相同色彩特性的图像集合。In one embodiment, in order to determine the common color characteristics of all images included in the image dataset, the images in the image dataset may be clustered based on the color channel parameters of each image in the image dataset to obtain multiple images Clustering set, each image clustering set can be used as a set of images representing the same color characteristics.
可选的,对图像数据集中的图像进行聚类处理所采用的聚类算可以为Mean-Shift聚类算法或k-means聚类算法等等,当然,还可以为其它聚类算法,在此不作限定。Optionally, the clustering algorithm used for clustering the images in the image dataset can be the Mean-Shift clustering algorithm or the k-means clustering algorithm, etc. Of course, it can also be other clustering algorithms, here Not limited.
可选的,将图像数据集中各图像的颜色通道参数作为进行聚类处理的输入数据时,可以将图像所包含的所有像素所对应的颜色通道参数直接作为进行聚类的输入数据,来对图像数据集中的图像进行聚类处理,得到多个图像聚类集,以实现根据图像所包含的色彩特性对图像数据集中的图像进行聚类。Optionally, when the color channel parameters of each image in the image dataset are used as the input data for clustering processing, the color channel parameters corresponding to all pixels included in the image can be directly used as the input data for clustering to analyze the image data. The images in the data set are clustered to obtain a plurality of image cluster sets, so as to realize the clustering of the images in the image data set according to the color characteristics contained in the images.
参考图3,图3示出了根据本申请的一个实施例的图像处理方法的步骤S210的具体流程图,在该实施例中,步骤S210具体可以包括步骤S310至步骤S320,详细描述如下。Referring to FIG. 3, FIG. 3 shows a specific flowchart of step S210 of the image processing method according to an embodiment of the present application. In this embodiment, step S210 may specifically include steps S310 to S320, which are described in detail as follows.
在步骤S310中,基于图像数据集中每个图像所包含的所有像素对应的颜色通道参数,分别计算图像数据集中每个图像相对应的平均颜色通道参数。In step S310, based on the color channel parameters corresponding to all pixels included in each image in the image data set, the average color channel parameters corresponding to each image in the image data set are calculated respectively.
在一个实施例中,在基于图像数据集中各图像的颜色通道参数,对图像数据集中的图像进行聚类处理时,也可以先根据图像数据集中每个图像所包含的所有像素对应的颜色通道参数,分别计算图像数据集中每个图像相对应的平均颜色通道参数,换而言之,针对图像数据集中的每个图像,根据该图像所包含的所有像素所对应的颜色通道参数,计算该图像相对应的平均颜色通道参数,平均颜色通道参数作为反映该图像所具有的整体色彩特性的参数。In one embodiment, when performing clustering processing on the images in the image dataset based on the color channel parameters of each image in the image dataset, the color channel parameters corresponding to all the pixels included in each image in the image dataset may also be firstly processed. , respectively calculate the average color channel parameters corresponding to each image in the image data set, in other words, for each image in the image data set, according to the color channel parameters corresponding to all the pixels contained in the image, calculate the The corresponding average color channel parameter, the average color channel parameter is used as a parameter reflecting the overall color characteristics of the image.
具体的,可以将所有像素的颜色通道参数相加,并除以图像所包含的像素个数,得到该图像相对应的平均颜色通道参数。Specifically, the color channel parameters of all pixels can be added up and divided by the number of pixels included in the image to obtain the average color channel parameter corresponding to the image.
可选的,在当图像所对应的色彩模式为单个颜色通道的色彩模式时,可以根据每个图像所包含的所有像素对应的单个颜色通道参数相加,并除以该图像所包含的像素个数得到图像相对应的平均颜色通道参数,所得到的图像相对应的平均颜色通道参数仅为一个。Optionally, when the color mode corresponding to the image is the color mode of a single color channel, the parameters of the single color channel corresponding to all pixels contained in each image can be added and divided by the number of pixels contained in the image. number to obtain the average color channel parameter corresponding to the image, and the average color channel parameter corresponding to the obtained image is only one.
可选的,在当图像的色彩模式下为多颜色通道的色彩模式时,步骤S310具体可以包括:基于图像数据集中每个图像所包含的所有像素在各个颜色通道下的颜色通道参数,分别计算图像数据集中每个图像在各个颜色通道下的平均颜色通道参数。Optionally, when the color mode of the image is a color mode with multiple color channels, step S310 may specifically include: based on the color channel parameters of all the pixels included in each image in the image data set under each color channel, calculate respectively. The average color channel parameters under each color channel for each image in the image dataset.
在图像的色彩模式下为多颜色通道的色彩模式时,图像相对应的平均颜色通道参数为多个颜色通道中的颜色通道参数。以RGB色彩模式下的图像为例,可以将每个图像所包含的所有像素在R颜色通道下的颜色通道参数相加,并除以该图像所包含的像素个数,得到该图像在R颜色通道下的平均颜色通道参数,同理,可以分别计算得到该图像在G颜色通道下的平均颜色通道参数以及在B颜色通道下的平均颜色通道参数,进而计算得到该图像分别在R颜色通道、G颜色通道下以及B颜色通道下的平均颜色通道参数,该图像在三个不同颜色通道下的平均颜色通道参数构成了该图像所对应的平均颜色通道参数。When the color mode of the image is the color mode of multiple color channels, the average color channel parameter corresponding to the image is the color channel parameter of the multiple color channels. Taking the image in RGB color mode as an example, you can add the color channel parameters of all pixels contained in each image under the R color channel, and divide by the number of pixels contained in the image to get the image in the R color channel. In the same way, the average color channel parameters of the image in the G color channel and the average color channel parameters in the B color channel can be calculated respectively, and then the image in the R color channel, The average color channel parameters under the G color channel and the B color channel, the average color channel parameters of the image under three different color channels constitute the average color channel parameter corresponding to the image.
在步骤S320中,基于图像数据集中每个图像相对应的平均颜色通道参数,对图像数据集中的图像进行聚类处理,得到多个图像聚类集。In step S320, based on the average color channel parameter corresponding to each image in the image data set, the images in the image data set are clustered to obtain a plurality of image cluster sets.
在一个实施例中,在获取图像数据集中每个图像相对应的平均颜色通道参数后,将其作为聚类算法的输入数据,通过聚类算法对输入数据进行处理,输出多个图像聚类集的聚类结果,从而实现根据图像数据集中各图像的颜色通道参数对图像数据集中的图像进行聚类处理。In one embodiment, after acquiring the average color channel parameter corresponding to each image in the image data set, it is used as the input data of the clustering algorithm, the input data is processed by the clustering algorithm, and a plurality of image clustering sets are output The clustering result of the image data set is realized, so that the images in the image data set can be clustered according to the color channel parameters of each image in the image data set.
图3所示实施例的技术方案中,通过先根据图像数据集中每个图像所包含的所有像素对应的颜色通道参数,分别计算图像数据集中每个图像相对应的平均颜色通道参数,再基于图像数据集中每个图像相对应的平均颜色通道参数,对图像数据集中的图像进行聚类处理,相较于直接根据图像所包含所有像素的颜色通道参数来直接来对图像数据集中的图像进行聚类处理的方式,可以显著降低输入至聚类算法中的每个图像所对应的计算数据的维度,从而有效降低聚类运算的复杂度,减少系统的计算量,节省系统资源。In the technical solution of the embodiment shown in FIG. 3 , the average color channel parameters corresponding to each image in the image data set are calculated separately according to the color channel parameters corresponding to all the pixels contained in each image in the image data set, and then based on the image data set The average color channel parameters corresponding to each image in the data set, and the images in the image data set are clustered, compared to directly clustering the images in the image data set according to the color channel parameters of all pixels contained in the image. The processing method can significantly reduce the dimension of the calculation data corresponding to each image input into the clustering algorithm, thereby effectively reducing the complexity of the clustering operation, reducing the computational load of the system, and saving system resources.
还请继续参考图2,在步骤S220中,从多个图像聚类集中选取图像数量最多的目标图像聚类集,基于目标图像聚类集中各图像的颜色通道参数,计算目标图像聚类集中图像的平均颜色通道参数。Please also continue to refer to Fig. 2, in step S220, select the target image cluster set with the largest number of images from a plurality of image cluster sets, and calculate the image in the target image cluster set based on the color channel parameters of each image in the target image cluster set. The average color channel parameter of .
在一个实施例中,在得到多个图像聚类集后,可以从多个图像聚类集中选取图像数量最多的图像聚类集作为目标图像聚类集,该目标图像聚类集作为最能表征图像数据集中的所有图像所具有的共性色彩特性的图像集合。In one embodiment, after obtaining multiple image clustering sets, the image clustering set with the largest number of images may be selected from the multiple image clustering sets as the target image clustering set, and the target image clustering set is regarded as the most representative image clustering set. An image collection of common color properties shared by all images in an image dataset.
可以理解的是,若存在图像数量相同且图像数量均多于其它图像聚类集的两个图像聚类集时,则可以从这两个图像聚类集中任选一个图像聚类集作为目标图像聚类集。It can be understood that, if there are two image cluster sets with the same number of images and more images than other image cluster sets, one image cluster set can be selected from the two image cluster sets as the target image. cluster set.
在一个实施例中,在确定目标图像聚类集后,则可以基于目标图像聚类集中各图像的颜色通道参数,计算目标图像聚类集中图像的平均颜色通道参数。In one embodiment, after the target image cluster set is determined, the average color channel parameter of the images in the target image cluster set may be calculated based on the color channel parameters of each image in the target image cluster set.
具体的,可以根据目标图像聚类集中每个图像所包含的所有像素对应的颜色通道参数,分别计算图像数据集中每个图像相对应的平均颜色通道参数,换而言之,针对目标图像聚类集中的每个图像,根据该图像所包含的所有像素所对应的颜色通道参数,计算该图像相对应的平均颜色通道参数。在计算得到目标图像聚类集中的每个图像相对应的平均颜色通道参数,则对目标图像聚类集中的每个图像相对应的平均颜色通道参数进行求和,再将求和结果除以目标图像聚类集中的图像个数,计算得到目标图像聚类集中图像的平均颜色通道参数。Specifically, the average color channel parameters corresponding to each image in the image data set can be calculated according to the color channel parameters corresponding to all pixels included in each image in the target image clustering set. In other words, for the target image clustering For each image in the set, calculate the average color channel parameter corresponding to the image according to the color channel parameters corresponding to all the pixels contained in the image. After calculating the average color channel parameters corresponding to each image in the target image cluster set, sum the average color channel parameters corresponding to each image in the target image cluster set, and then divide the summation result by the target The number of images in the image cluster set, and the average color channel parameters of the images in the target image cluster set are calculated.
如前所述,图像在各个颜色通道下的颜色通道参数需要分别进行计算,因而在当图像所对应的色彩模式为单个颜色通道的色彩模式时,所得到的图像相对应的平均颜色通道参数仅为一个,相应的,目标图像聚类集中图像的平均颜色通道参数也仅为一个;而在当图像的色彩模式下为多颜色通道的色彩模式时,所得到的图像相对应的平均颜色通道参数为多个,相应的,目标图像聚类集中图像的平均颜色通道参数也为多个。As mentioned above, the color channel parameters of the image under each color channel need to be calculated separately, so when the color mode corresponding to the image is the color mode of a single color channel, the average color channel parameter corresponding to the obtained image is only is one, correspondingly, the average color channel parameter of the image in the target image cluster set is also only one; and when the color mode of the image is a multi-color channel color mode, the average color channel parameter corresponding to the obtained image Correspondingly, the average color channel parameters of the images in the target image cluster set are also multiple.
在步骤S230中,基于目标图像聚类集中图像的平均颜色通道参数,对待检测图像的颜色通道参数进行校准处理,得到校准后的待检测图像。In step S230, a calibration process is performed on the color channel parameters of the image to be detected based on the average color channel parameters of the images in the target image cluster set to obtain a calibrated image to be detected.
在一个实施例中,在确定目标图像聚类集中图像的平均颜色通道参数后,可以基于目标图像聚类集中图像的平均颜色通道参数,对待检测图像的颜色通道参数进行校准处理,得到校准后的待检测图像。In one embodiment, after determining the average color channel parameters of the images in the target image cluster set, calibration processing may be performed on the color channel parameters of the images to be detected based on the average color channel parameters of the images in the target image cluster set to obtain a calibrated image to be detected.
具体的,可以根据目标图像聚类集中图像的平均颜色通道参数来对待检测图像所包含所有像素的颜色通道参数进行校准处理,以使得待检测图像能调整成具有图像数据集中所有图像的共性色彩特性的图像,作为校准后的待检测图像。Specifically, the color channel parameters of all pixels included in the image to be detected can be calibrated according to the average color channel parameters of the images in the target image cluster set, so that the image to be detected can be adjusted to have the common color characteristics of all images in the image dataset , as the calibrated image to be detected.
相较于将不经过图像校准的待检测图像直接输入至图像缺陷定位模型的方式,通过先对待检测图像进行图像校准的数据预处理,再由图像缺陷定位模型根据校准后的待检测图像来进行缺陷定位检测,使得在当待检测图像为特定颜色模式聚集的液晶面板图像时,图像缺陷定位模型也能进行准确的缺陷定位,提高了图像缺陷定位模型进行缺陷定位的精准度。Compared with the method of directly inputting the image to be inspected without image calibration into the image defect localization model, the data preprocessing of the image to be inspected is firstly performed on the image to be inspected, and then the image defect localization model performs the calibration according to the image to be inspected. The defect location detection enables the image defect location model to perform accurate defect location even when the image to be inspected is an LCD panel image gathered in a specific color mode, which improves the accuracy of the image defect location model for defect location.
参考图4,图4示出了根据本申请的一个实施例的图像处理方法的步骤S230的具体流程图,在该实施例中,步骤S230具体可以包括步骤S410至步骤S430,详细描述如下。Referring to FIG. 4 , FIG. 4 shows a specific flowchart of step S230 of an image processing method according to an embodiment of the present application. In this embodiment, step S230 may specifically include steps S410 to S430 , which are described in detail as follows.
在步骤S410中,基于待检测图像所包含的所有像素的颜色通道参数,确定待检测图像相对应的平均颜色通道参数。In step S410, an average color channel parameter corresponding to the image to be detected is determined based on the color channel parameters of all pixels included in the image to be detected.
在一个实施例中,在基于目标图像聚类集中图像的平均颜色通道参数,对待检测图像的颜色通道参数进行校准处理时,可以先基于待检测图像所包含的所有像素的颜色通道参数,确定待检测图像相对应的平均颜色通道参数。In one embodiment, when calibrating the color channel parameters of the image to be detected based on the average color channel parameters of the images in the target image cluster set, the color channel parameters of all the pixels included in the image to be detected may be first determined to determine the color channel parameters to be detected. The average color channel parameter corresponding to the detection image.
具体的,可以将所有像素的颜色通道参数相加,并除以图像所包含的像素个数,得到该图像相对应的平均颜色通道参数。Specifically, the color channel parameters of all pixels can be added up and divided by the number of pixels included in the image to obtain the average color channel parameter corresponding to the image.
可以理解的是,在当图像所对应的色彩模式为单个颜色通道的色彩模式时,可以根据待检测图像所包含的所有像素对应的单个颜色通道参数相加,并除以该图像所包含的像素个数得到图像相对应的平均颜色通道参数,所得到的待检测图像相对应的平均颜色通道参数仅为一个。It can be understood that when the color mode corresponding to the image is the color mode of a single color channel, the parameters of the single color channel corresponding to all the pixels contained in the image to be detected can be added and divided by the pixels contained in the image. The average color channel parameter corresponding to the image is obtained by the number, and the average color channel parameter corresponding to the obtained image to be detected is only one.
在待检测图像的色彩模式下为多颜色通道的色彩模式时,待检测图像相对应的平均颜色通道参数为多个颜色通道中的颜色通道参数。以RGB色彩模式下的图像为例,可以将待检测图像所包含的所有像素在R颜色通道下的颜色通道参数相加,并除以待检测图像所包含的像素个数,得到待检测图像在R颜色通道下的平均颜色通道参数,同理,可以分别计算得到待检测图像在G颜色通道下的平均颜色通道参数以及在B颜色通道下的平均颜色通道参数,进而计算得到待检测图像分别在R颜色通道、G颜色通道下以及B颜色通道下的平均颜色通道参数,待检测图像在三个不同颜色通道下的平均颜色通道参数构成了待检测图像所对应的平均颜色通道参数。When the color mode of the image to be detected is the color mode of multiple color channels, the average color channel parameter corresponding to the image to be detected is the color channel parameter of the multiple color channels. Taking an image in RGB color mode as an example, the color channel parameters of all pixels contained in the image to be detected under the R color channel can be added, and divided by the number of pixels contained in the image to be detected, to obtain the image to be detected in In the same way, the average color channel parameters of the R color channel can be calculated to obtain the average color channel parameters of the image to be detected in the G color channel and the average color channel parameters of the B color channel. The average color channel parameters of the R color channel, the G color channel, and the B color channel, and the average color channel parameters of the image to be detected under the three different color channels constitute the average color channel parameter corresponding to the image to be detected.
在步骤S420中,基于目标图像聚类集中图像的平均颜色通道参数以及待检测图像相对应的平均颜色通道参数,生成校准参数。In step S420, calibration parameters are generated based on the average color channel parameters of the images in the target image cluster set and the average color channel parameters corresponding to the images to be detected.
在一个实施例中,在根据基于目标图像聚类集中图像的平均颜色通道参数以及待检测图像相对应的平均颜色通道参数,生成校准参数时,具体可以根据目标图像聚类集中图像的平均颜色通道参数与待检测图像相对应的平均颜色通道参数,以及对图像进行校准处理的校准参数与目标图像聚类集中图像的平均颜色通道参数、图像相对应的平均颜色通道参数这两者之间的对应关系,生成对该图像进行校准处理的校准参数,进而实现对待检测图像进行校准处理。In one embodiment, when generating the calibration parameters based on the average color channel parameters of the images in the target image cluster set and the average color channel parameters corresponding to the images to be detected, specifically, the average color channel parameters of the images in the target image cluster set may be based on The parameter corresponds to the average color channel parameter of the image to be detected, and the calibration parameter for calibrating the image, the average color channel parameter of the image in the target image cluster set, and the average color channel parameter corresponding to the image. Correspondence between the two relationship, generate calibration parameters for calibrating the image, and then realize the calibrating process for the image to be detected.
参考图5,图5示出了根据本申请的一个实施例的图像处理方法的步骤S410的具体流程图,在该实施例中,步骤S410具体可以包括步骤S510至步骤S520,详细描述如下。Referring to FIG. 5 , FIG. 5 shows a specific flowchart of step S410 of an image processing method according to an embodiment of the present application. In this embodiment, step S410 may specifically include steps S510 to S520 , which are described in detail as follows.
在步骤S510中,计算目标图像聚类集中图像的平均颜色通道参数与待检测图像相对应的平均颜色通道参数之间的比值。In step S510, the ratio between the average color channel parameter of the images in the target image cluster set and the average color channel parameter corresponding to the image to be detected is calculated.
在一个实施例中,在生成对待检测图像进行校准处理的校准参数时,可以先计算目标图像聚类集中图像的平均颜色通道参数与待检测图像相对应的平均颜色通道参数之间的比值。In one embodiment, when generating the calibration parameters for calibrating the images to be detected, the ratio between the average color channel parameters of the images in the target image cluster set and the average color channel parameters corresponding to the images to be detected may be calculated first.
可以理解的是,在当图像的色彩模式下为多颜色通道的色彩模式时,目标图像聚类集中图像的平均颜色通道参数以及待检测图像相对应的平均颜色通道参数均包括不同颜色通道下的多个平均颜色通道参数,因而需要分别计算图像在不同颜色通道下的平均颜色通道参数之间的比值。It can be understood that, when the color mode of the image is a multi-color channel color mode, the average color channel parameters of the images in the target image cluster set and the average color channel parameters corresponding to the images to be detected both include different color channels. There are multiple average color channel parameters, so it is necessary to calculate the ratio between the average color channel parameters of the image under different color channels.
以RGB色彩模式下的图像为例,目标图像聚类集中图像的平均颜色通道参数包括R颜色通道下的平均颜色通道参数R1、G颜色通道下的平均颜色通道参数G1以及B颜色通道下的平均颜色通道参数B1,待检测图像相对应的平均颜色通道参数包括R颜色通道下的平均颜色通道参数R2、G颜色通道下的平均颜色通道参数G2以及B颜色通道下的平均颜色通道参数B2,则目标图像聚类集中图像的平均颜色通道参数与待检测图像相对应的平均颜色通道参数之间的比值包括R颜色通道对应的G颜色通道对应的以及B颜色通道对应的 Taking the image in RGB color mode as an example, the average color channel parameters of the image in the target image cluster set include the average color channel parameter R1 under the R color channel, the average color channel parameter G1 under the G color channel, and the average color channel parameter G1 under the B color channel. The color channel parameter B1, the average color channel parameter corresponding to the image to be detected includes the average color channel parameter R2 under the R color channel, the average color channel parameter G2 under the G color channel, and the average color channel parameter B2 under the B color channel, then The ratio between the average color channel parameter of the image in the target image cluster set and the average color channel parameter corresponding to the image to be detected includes the corresponding value of the R color channel. Corresponding to the G color channel and the corresponding B color channel
在步骤S520中,基于比值,生成校准参数。In step S520, based on the ratio, calibration parameters are generated.
在一个实施例中,在得到目标图像聚类集中图像的平均颜色通道参数与待检测图像相对应的平均颜色通道参数之间的比值后,基于该比值、比值和校准参数之间的对应关系,生成对待检测图像进行校准处理的校准参数。In one embodiment, after obtaining the ratio between the average color channel parameter of the image in the target image cluster set and the average color channel parameter corresponding to the image to be detected, based on the ratio, the correspondence between the ratio and the calibration parameter, Generate calibration parameters for calibrating the image to be inspected.
可选的,比值和校准参数之间的对应关系可以正相关的线性关系,例如,可以直接将该比值作为对该图像进行校准处理的校准参数。Optionally, the corresponding relationship between the ratio and the calibration parameter may be a positive linear relationship, for example, the ratio may be directly used as a calibration parameter for calibrating the image.
可以理解的是,在当待检测图像的色彩模式下为多颜色通道的色彩模式时,基于比值所生成的校准参数时,需要分别根据两图像在不同颜色通道下的平均颜色通道参数之间的比值确定在不同颜色通道下的校准参数。It can be understood that, when the color mode of the image to be detected is the color mode of multiple color channels, when the calibration parameters are generated based on the ratio, it is necessary to separately calculate the difference between the average color channel parameters of the two images under different color channels. The ratio determines the calibration parameters for the different color channels.
以RGB色彩模式下的图像为例,可以直接将R颜色通道对应的比值作为图像在相应的R颜色通道下的校准参数,用于对R颜色通道下的颜色通道参数进行校准,同理,可以将G颜色通道对应的比值作为图像在相应的G颜色通道下的校准参数以及将B颜色通道对应的比值作为图像在相应的B颜色通道下的校准参数。Taking the image in RGB color mode as an example, you can directly convert the ratio corresponding to the R color channel As the calibration parameter of the image under the corresponding R color channel, it is used to calibrate the color channel parameters under the R color channel. Similarly, the ratio corresponding to the G color channel can be As the calibration parameter of the image under the corresponding G color channel and the ratio corresponding to the B color channel As the calibration parameter of the image under the corresponding B color channel.
还请继续参考图4,在步骤S430中,基于校准参数,对待检测图像所包含的所有像素的颜色通道参数进行校准处理,得到校准后的待检测图像。Please continue to refer to FIG. 4 , in step S430, based on the calibration parameters, calibration processing is performed on the color channel parameters of all pixels included in the image to be detected, to obtain a calibrated image to be detected.
在一个实施例中,在生成对待检测图像进行校准处理的校准参数后,可以根据待检测图像对应的校准参数,对待检测图像所包含的所有像素的颜色通道参数进行校准处理,得到校准后的图像数据集。In one embodiment, after generating calibration parameters for performing calibration processing on the image to be detected, calibration processing may be performed on the color channel parameters of all pixels included in the image to be detected according to the calibration parameters corresponding to the image to be detected, to obtain a calibrated image data set.
具体的,根据待检测图像在每个颜色通道下的校准参数对待检测图像的每个像素在对应的颜色通道下的颜色通道参数进行校准处理。进行校准处理方法具体可以为计算图像在每个颜色通道下的校准参数与该图像的像素在对应的颜色通道下的颜色通道参数之间的乘积,该乘积作为校准后的颜色通道参数,进而实现对图像的每个像素在对应的颜色通道下的颜色通道参数进行校准。Specifically, the calibration process is performed according to the calibration parameters of the image to be detected under each color channel and the color channel parameters of each pixel of the image to be detected under the corresponding color channel. The calibration processing method may specifically be calculating the product of the calibration parameter of the image under each color channel and the color channel parameter of the pixel of the image under the corresponding color channel, and the product is used as the calibrated color channel parameter, and then realize Calibrate the color channel parameters of each pixel of the image under the corresponding color channel.
在该图像所包含的所有像素的颜色通道参数均进行校准处理后,即可得到校准后的待检测图像。After the color channel parameters of all the pixels included in the image are calibrated, the calibrated image to be detected can be obtained.
以上可以看出,通过基于图像数据集中各图像的颜色通道参数,对图像数据集中的图像进行聚类处理,得到多个图像聚类集,并从多个图像聚类集中选取图像数量最多的目标图像聚类集,且基于目标图像聚类集中各图像的颜色通道参数,计算目标图像聚类集中图像的平均颜色通道参数,再基于目标图像聚类集中图像的平均颜色通道参数,对待检测图像的颜色通道参数进行校准处理,得到校准后的待检测图像,通过先对待检测图像进行图像校准的数据预处理,再由图像缺陷定位模型根据校准后的待检测图像来进行缺陷定位检测,相较于将不经过图像校准的数据预处理的待检测图像直接输入至图像缺陷定位模型,使得在当待检测图像为特定颜色模式聚集的液晶面板图像时,图像缺陷定位模型也能进行准确的缺陷定位,提高了图像缺陷定位模型进行缺陷定位的精准度。It can be seen from the above that, based on the color channel parameters of each image in the image dataset, the images in the image dataset are clustered to obtain multiple image cluster sets, and the target with the largest number of images is selected from the multiple image cluster sets. Image clustering set, and based on the color channel parameters of each image in the target image clustering set, calculate the average color channel parameters of the images in the target image clustering set, and then based on the average color channel parameters of the images in the target image clustering set. The color channel parameters are calibrated to obtain the calibrated image to be inspected. First, the image to be inspected is preprocessed for image calibration, and then the image defect location model is used to perform defect location detection according to the calibrated image to be inspected. Compared with The image to be inspected without data preprocessing without image calibration is directly input into the image defect localization model, so that when the image to be inspected is an LCD panel image gathered in a specific color mode, the image defect localization model can also perform accurate defect localization, The accuracy of defect localization by the image defect localization model is improved.
参考图6,图6示出了根据本申请的一个实施例的图像处理方法的流程图,在本申请实施例中的图像处理方法还可以包括步骤S610至步骤S620,详细描述如下。Referring to FIG. 6 , FIG. 6 shows a flowchart of an image processing method according to an embodiment of the present application. The image processing method in the embodiment of the present application may further include steps S610 to S620 , which are described in detail as follows.
在步骤S610中,输入校准后的待检测图像至预训练的图像缺陷定位模型中。In step S610, the calibrated image to be detected is input into the pre-trained image defect localization model.
在一个实施例中,在对液晶面板进行颜色缺陷分析时,可以将液晶面板图像输入至经过训练所得的图像缺陷定位模型,通过图像缺陷定位模型来实现对液晶面板图像进行缺陷定位,该图像缺陷定位模型为对机器学习模型进行训练所得。机器学习模型可以是CNN(Convolutional Neural Network,卷积神经网络)模型,或者也可以是深度神经网络模型等。预训练的图像缺陷定位模型可以对输入的校准后的待检测图像进行缺陷定位处理,以检测待检测图像中的缺陷位置。In one embodiment, when analyzing the color defect of the liquid crystal panel, the image of the liquid crystal panel can be input into the image defect localization model obtained by training, and the image defect localization model can be used to realize the defect localization of the liquid crystal panel image. The localization model is obtained by training the machine learning model. The machine learning model may be a CNN (Convolutional Neural Network, convolutional neural network) model, or a deep neural network model, or the like. The pre-trained image defect localization model can perform defect localization processing on the input calibrated image to be inspected, so as to detect the defect position in the image to be inspected.
在步骤S620中,通过图像缺陷定位模型对校准后的待检测图像进行缺陷定位处理,输出缺陷定位结果。In step S620, a defect localization process is performed on the calibrated image to be detected by using the image defect localization model, and a defect localization result is output.
在一个实施例中,通过图像缺陷定位模型对校准后的待检测图像进行缺陷定位处理,输出缺陷定位结果,该缺陷定位结果则为对校准后的待检测图像进行缺陷位置定位处理所得的缺陷定位信息。In one embodiment, a defect location process is performed on the calibrated image to be inspected by an image defect location model, and a defect location result is output, and the defect location result is the defect location obtained by performing the defect location process on the calibrated image to be inspected. information.
图6所示实施例的技术方案中,通过对待检测图像的颜色通道参数进行校准处理,得到校准后的待检测图像,通过先对待检测图像进行图像校准的数据预处理,再由图像缺陷定位模型根据校准后的待检测图像来进行缺陷定位检测,相较于将不经过图像校准的数据预处理的待检测图像直接输入至图像缺陷定位模型,使得在当待检测图像为特定颜色模式聚集的液晶面板图像时,图像缺陷定位模型也能进行准确的缺陷定位,提高了图像缺陷定位模型进行缺陷定位的精准度。In the technical solution of the embodiment shown in FIG. 6, a calibrated image to be inspected is obtained by calibrating the color channel parameters of the image to be inspected. Defect localization detection is performed according to the calibrated image to be inspected, compared to directly inputting the image to be inspected without image calibration data preprocessing into the image defect localization model, so that when the image to be inspected is a liquid crystal aggregated in a specific color mode When the panel image is used, the image defect location model can also perform accurate defect location, which improves the accuracy of the image defect location model for defect location.
参考图7,图7示出了根据本申请的一个实施例的图像处理方法的流程图,在本申请实施例中的图像处理方法还可以包括步骤S710至步骤S740,详细描述如下。Referring to FIG. 7 , FIG. 7 shows a flowchart of an image processing method according to an embodiment of the present application. The image processing method in the embodiment of the present application may further include steps S710 to S740 , which are described in detail as follows.
在步骤S710中,基于目标图像聚类集中图像的平均颜色通道参数,对图像数据集中的图像的颜色通道参数进行校准处理,得到校准后的图像数据集。In step S710, a calibration process is performed on the color channel parameters of the images in the image data set based on the average color channel parameters of the images in the target image cluster set to obtain a calibrated image data set.
在一个实施例中,在根据图像数据集生成对机器学习模型进行训练的训练样本数据时,可以先基于目标图像聚类集中图像的平均颜色通道参数,对图像数据集中的图像的颜色通道参数进行校准处理,得到校准后的图像数据集。其中,基于目标图像聚类集中图像的平均颜色通道参数,对图像数据集中的每个图像的颜色通道参数进行校准处理的方法与基于目标图像聚类集中图像的平均颜色通道参数,对待检测图像的颜色通道参数进行校准处理的方式一致,在此不再赘述。In one embodiment, when generating the training sample data for training the machine learning model according to the image data set, based on the average color channel parameters of the images in the target image clustering set, the color channel parameters of the images in the image data set can be processed first. The calibration process is performed to obtain a calibrated image dataset. Among them, based on the average color channel parameters of the images in the target image cluster set, the method of calibrating the color channel parameters of each image in the image data set is based on the average color channel parameters of the images in the target image cluster set. The color channel parameters are calibrated in the same way, and will not be repeated here.
在步骤S720中,对校准后的图像数据集中的各图像进行图像缺陷标注处理,得到标注后的图像数据集。In step S720, image defect labeling processing is performed on each image in the calibrated image data set to obtain a labelled image data set.
在一个实施例中,在根据校准后的图像数据集来对图像缺陷定位模型进行训练时,还可以对校准后的图像数据集中的各图像进行图像缺陷标注处理,即预先在各图像的实际缺陷位置进行标注处理。In one embodiment, when the image defect localization model is trained according to the calibrated image data set, image defect labeling processing may also be performed on each image in the calibrated image data set, that is, the actual defects of each image are preliminarily identified. Location is marked.
在步骤S730中,基于标注后的图像数据集,生成训练样本数据。In step S730, training sample data is generated based on the labeled image data set.
在一个实施例中,在对校准后的图像数据集进行标注处理,得到标注后的图像数据集后,可以根据标注后的图像数据集来生成对机器学习模型进行训练的训练样本数据。In one embodiment, after labeling the calibrated image data set to obtain the labelled image data set, training sample data for training the machine learning model may be generated according to the labelled image data set.
参考图8,图8示出了根据本申请的一个实施例的图像处理方法的步骤S720的具体流程图,在本申请实施例中的步骤S720可以包括步骤S810至步骤S830,详细描述如下。Referring to FIG. 8, FIG. 8 shows a specific flowchart of step S720 of an image processing method according to an embodiment of the present application. Step S720 in this embodiment of the present application may include steps S810 to S830, which are described in detail as follows.
在步骤S810中,从标注后的图像数据集,选取目标图像。In step S810, a target image is selected from the marked image data set.
在一个实施例中,在对校准后的图像数据集进行标注处理得到标注后的图像数据集后,为了提高对机器学习模型的效果,还可以从标注后的图像数据集选取部分图像,作为进行数据增强处理的目标图像。In one embodiment, after annotating the calibrated image dataset to obtain the annotated image dataset, in order to improve the effect of the machine learning model, some images may also be selected from the annotated image dataset as The target image for data augmentation processing.
可选的,可以随机从标注后的图像数据集中直接抽取部分图像,作为进行数据增强处理的目标图像。Optionally, part of the images may be directly extracted from the labeled image dataset at random, as the target images for data enhancement processing.
可选的,参考图9,图9示出了根据本申请的一个实施例的图像处理方法的步骤S810的具体流程图,在本申请实施例中的步骤S810可以包括步骤S910至步骤S930,详细描述如下。Optionally, referring to FIG. 9 , FIG. 9 shows a specific flowchart of step S810 of an image processing method according to an embodiment of the present application. Step S810 in this embodiment of the present application may include steps S910 to S930. Described as follows.
在步骤S910中,获取数据增强概率阈值。In step S910, a data enhancement probability threshold is obtained.
在步骤S920中,为标注后的图像数据集中的图像分配随机数。In step S920, random numbers are assigned to the images in the marked image dataset.
在步骤S930中,将分配的随机数小于或等于数据增强概率阈值的图像,确定为目标图像。In step S930, the image whose assigned random number is less than or equal to the data enhancement probability threshold is determined as the target image.
在一个实施例中,从标注后的图像数据集中选取进行数据增强处理的目标图像时,为了保证随机性,可以先预设进行图像选取的数据增强概率阈值,并根据该数据增强概率阈值来进行图像选取,该数据增强概率阈值可以为预设的某个概率参数,例如可以为0.5到0.8之间的某个概率参数。In one embodiment, when a target image for data enhancement processing is selected from the marked image data set, in order to ensure randomness, a data enhancement probability threshold for image selection may be preset, and the data enhancement probability threshold may be preset according to the data enhancement probability threshold. For image selection, the data enhancement probability threshold may be a preset probability parameter, for example, a certain probability parameter between 0.5 and 0.8.
具体的,可以预选为标注后的图像数据集中的各个图像分配一个随机数,该随机数一般为0到1之间的某个参数。Specifically, a random number may be allocated to each image in the marked image dataset in advance, and the random number is generally a parameter between 0 and 1.
将为各个图像所分配的随机数与数据增强概率阈值进行比对,将分配的随机数小于或等于数据增强概率阈值的图像,确定为目标图像,进而实现了可以随机的从标注后的图像数据集中选择需要进行数据增强处理的目标图像。The random number assigned to each image is compared with the data enhancement probability threshold, and the image whose assigned random number is less than or equal to the data enhancement probability threshold is determined as the target image, thereby realizing that the image data can be randomly selected from the labeled image data. Select the target images that need to be augmented centrally.
还请继续参考图8,在步骤S820中,对目标图像进行数据增强处理,得到处理后的图像。Please continue to refer to FIG. 8 , in step S820 , data enhancement processing is performed on the target image to obtain a processed image.
在一个实施例中,在获取目标图像后,可以对所选取的目标图像进行数据增强处理,得到处理后的图像。In one embodiment, after acquiring the target image, data enhancement processing may be performed on the selected target image to obtain a processed image.
具体的,针对所选取的任意一个目标图像,可以对该目标图像执行颜色变换、旋转,缩放以及添加噪声等多种类型的数据增强处理。可以理解的是,针对每一种类型的数据增强处理,可以根据一定的概率来确定每个目标图像是否要执行该类型对应的数据增强处理,因而各个目标图像可能同时执行一个或多个类型的数据增强处理。Specifically, for any selected target image, various types of data enhancement processing such as color transformation, rotation, scaling and adding noise can be performed on the target image. It can be understood that, for each type of data enhancement processing, it can be determined according to a certain probability whether each target image should perform the data enhancement processing corresponding to the type, so each target image may perform one or more types of data enhancement processing at the same time. Data augmentation processing.
在步骤S830中,基于处理后的图像以及标注后的图像数据集,生成训练样本数据。In step S830, training sample data is generated based on the processed image and the labeled image data set.
基于经过数据增强处理后的图像以及未进行数据增强处理的原始图像共同组成用于对机器学习模型进行训练的训练样本数据。The training sample data for training the machine learning model is composed based on the image after data enhancement processing and the original image without data enhancement processing.
图8所示实施例的技术方案中,通过采用未经过数据增强处理的图像以及经过数据增强处理后的图像来共同生成对机器学习模型进行训练的训练样本数据,可以有效提高训练所得的图像缺陷定位模型的泛化能力,提升了图像缺陷定位模型进行图像缺陷定位的性能。In the technical solution of the embodiment shown in FIG. 8 , the training sample data for training the machine learning model is jointly generated by using the images that have not undergone data enhancement processing and the images that have undergone data enhancement processing, which can effectively improve the image defects obtained from training. The generalization ability of the localization model improves the performance of the image defect localization model for image defect localization.
还请继续参考图7,在步骤S740中,基于生成的训练样本数据对机器学习模型进行训练,得到图像缺陷定位模型。Please also continue to refer to FIG. 7 , in step S740, the machine learning model is trained based on the generated training sample data to obtain an image defect localization model.
在一个实施例中,基于生成的训练样本数据对机器学习模型进行训练,得到图像缺陷定位模型,对机器学习模型进行训练的过程是调整机器学习模型对应的网络结构中的各项系数,使得对于输入的待检测图像,经过机器学习模型对应的网络结构中的各项系数运算,输出结果为所确定的缺陷定位信息。In one embodiment, the machine learning model is trained based on the generated training sample data to obtain an image defect localization model, and the process of training the machine learning model is to adjust various coefficients in the network structure corresponding to the machine learning model, so that for The input image to be detected is subjected to various coefficient operations in the network structure corresponding to the machine learning model, and the output result is the determined defect location information.
图7所示实施例的技术方案中,当待检测图像为特定颜色模式聚集的液晶面板图像,通过对图像数据集中各个图像待检测图像进行颜色校准的数据预处理,以使得该图像与校准后的图像数据集中的图像之间的色彩差异性减小,从而使得经过校准后的图像数据集图像来进行训练的图像缺陷定位模型能对特定颜色模式聚集的液晶面板图像实现准确的缺陷定位,提高了图像缺陷定位模型进行缺陷定位的精准度。In the technical solution of the embodiment shown in FIG. 7 , when the image to be detected is a liquid crystal panel image gathered in a specific color mode, data preprocessing for color calibration is performed on each image to be detected in the image data set, so that the image and the calibrated image are preprocessed. The color difference between the images in the image data set is reduced, so that the image defect localization model trained on the calibrated image data set images can achieve accurate defect localization for the LCD panel images gathered in a specific color mode, improve the The accuracy of the image defect localization model for defect localization is improved.
以下介绍本申请的装置实施例,可以用于执行本申请上述实施例中的图像处理方法。对于本申请装置实施例中未披露的细节,请参照本申请上述的图像处理方法的实施例。The apparatus embodiments of the present application are introduced below, which can be used to execute the image processing methods in the above-mentioned embodiments of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the above-mentioned embodiments of the image processing method of the present application.
图10示出了根据本申请的一个实施例的图像处理装置的框图。FIG. 10 shows a block diagram of an image processing apparatus according to an embodiment of the present application.
参照图10所示,根据本申请的一个实施例的图像处理装置1000,包括:聚类单元1010、计算单元1020以及第一校准单元1030。其中,聚类单元1010,用于基于图像数据集中各图像的颜色通道参数,对图像数据集中的图像进行聚类处理,得到多个图像聚类集;计算单元1020,用于从多个图像聚类集中选取图像数量最多的目标图像聚类集,基于目标图像聚类集中各图像的颜色通道参数,计算目标图像聚类集中图像的平均颜色通道参数;第一校准单元1030,用于基于目标图像聚类集中图像的平均颜色通道参数,对待检测图像的颜色通道参数进行校准处理,得到校准后的待检测图像。Referring to FIG. 10 , an
在本申请的一些实施例中,基于前述方案,聚类单元1010被配置为:基于图像数据集中每个图像所包含的所有像素对应的颜色通道参数,分别计算图像数据集中每个图像相对应的平均颜色通道参数;基于图像数据集中每个图像相对应的平均颜色通道参数,对图像数据集中的图像进行聚类处理,得到多个图像聚类集。In some embodiments of the present application, based on the foregoing solution, the
在本申请的一些实施例中,基于前述方案,聚类单元1010被配置为:基于图像数据集中每个图像所包含的所有像素在各个颜色通道下的颜色通道参数,分别计算图像数据集中每个图像在各个颜色通道下的平均颜色通道参数。In some embodiments of the present application, based on the foregoing solution, the
在本申请的一些实施例中,基于前述方案,第一校准单元1030被配置为:基于待检测图像所包含的所有像素的颜色通道参数,确定待检测图像相对应的平均颜色通道参数;基于目标图像聚类集中图像的平均颜色通道参数以及待检测图像相对应的平均颜色通道参数,生成校准参数;基于述校准参数,对待检测图像所包含的所有像素的颜色通道参数进行校准处理,得到校准后的待检测图像。In some embodiments of the present application, based on the aforementioned solution, the
在本申请的一些实施例中,基于前述方案,第一校准单元1030被配置为:计算目标图像聚类集中图像的平均颜色通道参数与待检测图像相对应的平均颜色通道参数之间的比值;基于比值,生成校准参数。In some embodiments of the present application, based on the foregoing solution, the
在本申请的一些实施例中,基于前述方案,图像处理装置,还包括:输入单元,用于输入校准后的待检测图像至预训练的图像缺陷定位模型中;定位单元,用于通过图像缺陷定位模型对校准后的待检测图像进行缺陷定位处理,输出缺陷定位结果。In some embodiments of the present application, based on the foregoing solution, the image processing apparatus further includes: an input unit for inputting the calibrated to-be-detected image into a pre-trained image defect localization model; a localization unit for passing the image defect The localization model performs defect localization processing on the calibrated image to be inspected, and outputs the defect localization result.
在本申请的一些实施例中,基于前述方案,图像处理装置,还包括:第二校准单元,用于基于目标图像聚类集中图像的平均颜色通道参数,对图像数据集中的图像的颜色通道参数进行校准处理,得到校准后的图像数据集;标注单元,用于对校准后的图像数据集中的图像进行图像缺陷标注处理,得到标注后的图像数据集;生成单元,用于基于标注后的图像数据集,生成训练样本数据;训练单元,用于基于生成的训练样本数据对机器学习模型进行训练,得到图像缺陷定位模型。In some embodiments of the present application, based on the foregoing solution, the image processing apparatus further includes: a second calibration unit, configured to perform a calibration on the color channel parameters of the images in the image data set based on the average color channel parameters of the images in the target image cluster set Perform calibration processing to obtain a calibrated image data set; a labeling unit is used to perform image defect labeling processing on the images in the calibrated image data set to obtain a labelled image data set; a generation unit is used to base on the labelled image. The data set is used to generate training sample data; the training unit is used to train the machine learning model based on the generated training sample data to obtain an image defect localization model.
在本申请的一些实施例中,基于前述方案,生成单元被配置为:从标注后的图像数据集,选取目标图像;对目标图像进行数据增强处理,得到处理后的图像;基于处理后的图像以及标注后的图像数据集,生成训练样本数据。In some embodiments of the present application, based on the foregoing solution, the generating unit is configured to: select a target image from the marked image data set; perform data enhancement processing on the target image to obtain a processed image; based on the processed image And the labeled image dataset to generate training sample data.
在本申请的一些实施例中,基于前述方案,生成单元被配置为:获取数据增强概率阈值;为标注后的图像数据集中的图像分配随机数;将分配的随机数小于或等于数据增强概率阈值的图像,确定为目标图像。In some embodiments of the present application, based on the foregoing solution, the generating unit is configured to: obtain a data enhancement probability threshold; assign random numbers to the images in the labeled image dataset; assign the assigned random numbers less than or equal to the data enhancement probability threshold The image is determined as the target image.
图11示出了适于用来实现本申请实施例的电子设备的计算机系统的结构示意图。FIG. 11 shows a schematic structural diagram of a computer system suitable for implementing the electronic device according to the embodiment of the present application.
需要说明的是,图11示出的电子设备的计算机系统1100仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。It should be noted that the
如图11所示,计算机系统1110包括中央处理单元(Central Processing Unit,CPU)1101,其可以根据存储在只读存储器(Read-Only Memory,ROM)1102中的程序或者从储存部分1108加载到随机访问存储器(Random Access Memory,RAM)1103中的程序而执行各种适当的动作和处理,例如执行上述实施例中所述的方法。在RAM 1103中,还存储有系统操作所需的各种程序和数据。CPU 1101、ROM 1102以及RAM 1103通过总线1104彼此相连。输入/输出(Input/Output,I/O)接口1105也连接至总线1104。As shown in FIG. 11 , the
以下部件连接至I/O接口1105:包括键盘、鼠标等的输入部分1106;包括诸如阴极射线管(Cathode Ray Tube,CRT)、液晶显示器(Liquid Crystal Display,LCD)等以及扬声器等的输出部分1107;包括硬盘等的储存部分1108;以及包括诸如LAN(Local AreaNetwork,局域网)卡、调制解调器等的网络接口卡的通信部分1109。通信部分1109经由诸如因特网的网络执行通信处理。驱动器1110也根据需要连接至I/O接口1105。可拆卸介质1111,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器1110上,以便于从其上读出的计算机程序根据需要被安装入储存部分1108。The following components are connected to the I/O interface 1105: an
特别地,根据本申请的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本申请的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的计算机程序。在这样的实施例中,该计算机程序可以通过通信部分1109从网络上被下载和安装,和/或从可拆卸介质1111被安装。在该计算机程序被中央处理单元(CPU)1101执行时,执行本申请的系统中限定的各种功能。In particular, according to embodiments of the present application, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising a computer program for performing the method illustrated in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network via the
需要说明的是,本申请实施例所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、闪存、光纤、便携式紧凑磁盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的计算机程序。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的计算机程序可以用任何适当的介质传输,包括但不限于:无线、有线等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Erasable Programmable Read Only Memory (EPROM), flash memory, optical fiber, portable Compact Disc Read-Only Memory (CD-ROM), optical storage device, magnetic storage device, or any suitable of the above The combination. In this application, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program therein. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device . A computer program embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。其中,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Wherein, each block in the flowchart or block diagram may represent a module, program segment, or part of code, and the above-mentioned module, program segment, or part of code contains one or more executables for realizing the specified logical function instruction. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams or flowchart illustrations, and combinations of blocks in the block diagrams or flowchart illustrations, can be implemented in special purpose hardware-based systems that perform the specified functions or operations, or can be implemented using A combination of dedicated hardware and computer instructions is implemented.
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现,所描述的单元也可以设置在处理器中。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定。The units involved in the embodiments of the present application may be implemented in software or hardware, and the described units may also be provided in a processor. Among them, the names of these units do not constitute a limitation on the unit itself under certain circumstances.
作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该电子设备执行时,使得该电子设备实现上述实施例中所述的方法。As another aspect, the present application also provides a computer-readable medium. The computer-readable medium may be included in the electronic device described in the above embodiments; it may also exist alone without being assembled into the electronic device. middle. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by an electronic device, enables the electronic device to implement the methods described in the above-mentioned embodiments.
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本申请的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。It should be noted that although several modules or units of the apparatus for action performance are mentioned in the above detailed description, this division is not mandatory. Indeed, according to embodiments of the present application, the features and functions of two or more modules or units described above may be embodied in one module or unit. Conversely, the features and functions of one module or unit described above may be further divided into multiple modules or units to be embodied.
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本申请实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、触控终端、或者网络设备等)执行根据本申请实施方式的方法。From the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein may be implemented by software, or may be implemented by software combined with necessary hardware. Therefore, the technical solutions according to the embodiments of the present application may be embodied in the form of software products, and the software products may be stored in a non-volatile storage medium (which may be CD-ROM, U disk, mobile hard disk, etc.) or on the network , which includes several instructions to cause a computing device (which may be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
本领域技术人员在考虑说明书及实践这里公开的实施方式后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。Other embodiments of the present application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses or adaptations of this application that follow the general principles of this application and include common knowledge or conventional techniques in the technical field not disclosed in this application .
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制。It is to be understood that the present application is not limited to the precise structures described above and illustrated in the accompanying drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010733029.6A CN111899239B (en) | 2020-07-27 | 2020-07-27 | Image processing method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010733029.6A CN111899239B (en) | 2020-07-27 | 2020-07-27 | Image processing method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN111899239A true CN111899239A (en) | 2020-11-06 |
| CN111899239B CN111899239B (en) | 2025-07-01 |
Family
ID=73190214
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010733029.6A Active CN111899239B (en) | 2020-07-27 | 2020-07-27 | Image processing method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111899239B (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114596593A (en) * | 2022-05-10 | 2022-06-07 | 慧医谷中医药科技(天津)股份有限公司 | Health-preserving data recommendation method and system based on image processing |
| CN115937153A (en) * | 2022-12-13 | 2023-04-07 | 北京瑞医博科技有限公司 | Model training method, device, electronic equipment and computer storage medium |
| CN116740027A (en) * | 2023-06-15 | 2023-09-12 | 中广核核电运营有限公司 | Fault detection methods, devices and computer equipment for oil immersed equipment |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104573719A (en) * | 2014-12-31 | 2015-04-29 | 国家电网公司 | Mountain fire detection method based on intelligent image analysis |
| CN105844676A (en) * | 2016-03-24 | 2016-08-10 | 上海工程技术大学 | Color cluster analysis device and color cluster analysis method for printed fabric |
| CN106952251A (en) * | 2017-02-28 | 2017-07-14 | 华南理工大学 | A kind of image significance detection method based on Adsorption Model |
| WO2017210603A1 (en) * | 2016-06-03 | 2017-12-07 | Illumina, Inc. | Genotyping polyploid loci |
| CN108510502A (en) * | 2018-03-08 | 2018-09-07 | 华南理工大学 | Melanoma picture tissue segmentation methods based on deep neural network and system |
| CN108986086A (en) * | 2018-07-05 | 2018-12-11 | 福州大学 | The detection of typographical display panel inkjet printing picture element flaw and classification method and its device |
| CN110136214A (en) * | 2019-05-15 | 2019-08-16 | 天津科技大学 | A Color Consistency Description Method for Color Images |
-
2020
- 2020-07-27 CN CN202010733029.6A patent/CN111899239B/en active Active
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104573719A (en) * | 2014-12-31 | 2015-04-29 | 国家电网公司 | Mountain fire detection method based on intelligent image analysis |
| CN105844676A (en) * | 2016-03-24 | 2016-08-10 | 上海工程技术大学 | Color cluster analysis device and color cluster analysis method for printed fabric |
| WO2017210603A1 (en) * | 2016-06-03 | 2017-12-07 | Illumina, Inc. | Genotyping polyploid loci |
| CN106952251A (en) * | 2017-02-28 | 2017-07-14 | 华南理工大学 | A kind of image significance detection method based on Adsorption Model |
| CN108510502A (en) * | 2018-03-08 | 2018-09-07 | 华南理工大学 | Melanoma picture tissue segmentation methods based on deep neural network and system |
| CN108986086A (en) * | 2018-07-05 | 2018-12-11 | 福州大学 | The detection of typographical display panel inkjet printing picture element flaw and classification method and its device |
| CN110136214A (en) * | 2019-05-15 | 2019-08-16 | 天津科技大学 | A Color Consistency Description Method for Color Images |
Non-Patent Citations (2)
| Title |
|---|
| ALWASEELA ABDALLA: "Color Calibration of Proximal Sensing RGB Images of Oilseed Rape Canopy via Deep Learning Combined with K-Means Algorithm", REMOTE SENSING, 13 December 2019 (2019-12-13) * |
| 刘思: "基于显著性和自适应小波阈值的皮肤镜图像分割研究", 中国优秀硕士学位论文全文数据库(信息科技辑), 15 February 2020 (2020-02-15) * |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114596593A (en) * | 2022-05-10 | 2022-06-07 | 慧医谷中医药科技(天津)股份有限公司 | Health-preserving data recommendation method and system based on image processing |
| CN114596593B (en) * | 2022-05-10 | 2022-07-29 | 慧医谷中医药科技(天津)股份有限公司 | Health-preserving data recommendation method and system based on image processing |
| CN115937153A (en) * | 2022-12-13 | 2023-04-07 | 北京瑞医博科技有限公司 | Model training method, device, electronic equipment and computer storage medium |
| CN116740027A (en) * | 2023-06-15 | 2023-09-12 | 中广核核电运营有限公司 | Fault detection methods, devices and computer equipment for oil immersed equipment |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111899239B (en) | 2025-07-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110163080B (en) | Face key point detection method and device, storage medium and electronic equipment | |
| CN113743607A (en) | Training method of anomaly detection model, anomaly detection method and device | |
| WO2020155907A1 (en) | Method and apparatus for generating cartoon style conversion model | |
| US8855411B2 (en) | Opacity measurement using a global pixel set | |
| CN107679466B (en) | Information output method and device | |
| WO2019242416A1 (en) | Video image processing method and apparatus, computer readable storage medium and electronic device | |
| WO2020253127A1 (en) | Facial feature extraction model training method and apparatus, facial feature extraction method and apparatus, device, and storage medium | |
| CN109344752B (en) | Method and apparatus for processing mouth images | |
| CN113409199B (en) | Image processing method, device, electronic equipment and computer readable medium | |
| WO2018099473A1 (en) | Scene analysis method and system, and electronic device | |
| CN111899239A (en) | Image processing method and device | |
| WO2019080702A1 (en) | Image processing method and apparatus | |
| WO2022012179A1 (en) | Method and apparatus for generating feature extraction network, and device and computer-readable medium | |
| CN113516697B (en) | Image registration method, device, electronic equipment and computer readable storage medium | |
| US20090265389A1 (en) | Learned cognitive system | |
| US11516538B1 (en) | Techniques for detecting low image quality | |
| CN112419179B (en) | Method, apparatus, device and computer readable medium for repairing image | |
| TWI879031B (en) | Distributed data processing system and distributed data processing method | |
| CN114677649A (en) | Image recognition method, apparatus, device and medium | |
| CN115239948A (en) | Image processing method, image processing device, storage medium and electronic device | |
| CN115222940A (en) | A semantic segmentation method and system | |
| TWI871681B (en) | System and method for presenting three-dimensional content and three-dimensional content calculation apparatus | |
| Wu et al. | Full reference image quality assessment based on dual-space multi-feature fusion | |
| CN116051931B (en) | Model training method, image classification method, device and electronic equipment | |
| CN116011560B (en) | Model training method, data reconstruction method and electronic equipment |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |