CN118297810A - Luminance weighted self-adaptive paint defect image enhancement method and device - Google Patents
Luminance weighted self-adaptive paint defect image enhancement method and device Download PDFInfo
- Publication number
- CN118297810A CN118297810A CN202410368407.3A CN202410368407A CN118297810A CN 118297810 A CN118297810 A CN 118297810A CN 202410368407 A CN202410368407 A CN 202410368407A CN 118297810 A CN118297810 A CN 118297810A
- Authority
- CN
- China
- Prior art keywords
- target image
- differential
- image
- operator
- fractional
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000007547 defect Effects 0.000 title claims abstract description 60
- 239000003973 paint Substances 0.000 title claims abstract description 53
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000004364 calculation method Methods 0.000 claims abstract description 18
- 230000006870 function Effects 0.000 claims description 44
- 230000003044 adaptive effect Effects 0.000 claims description 43
- 230000014509 gene expression Effects 0.000 claims description 10
- 238000003860 storage Methods 0.000 claims description 10
- 230000002708 enhancing effect Effects 0.000 claims description 5
- 238000004590 computer program Methods 0.000 claims description 4
- 238000005457 optimization Methods 0.000 claims description 4
- 230000004069 differentiation Effects 0.000 claims description 3
- 238000006467 substitution reaction Methods 0.000 claims 1
- 238000001514 detection method Methods 0.000 abstract description 11
- 238000010586 diagram Methods 0.000 description 9
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 2
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 2
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 2
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 2
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 2
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000013178 mathematical model Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005507 spraying Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/11—Complex mathematical operations for solving equations, e.g. nonlinear equations, general mathematical optimization problems
- G06F17/13—Differential equations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Operations Research (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Algebra (AREA)
- Image Processing (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及机器人视觉技术领域,具体涉及一种亮度加权的自适应漆面缺陷图像增强方法及装置。The present invention relates to the field of robot vision technology, and in particular to a brightness-weighted adaptive paint surface defect image enhancement method and device.
背景技术Background technique
高铁车身漆面缺陷检测是实现零缺陷制造的重要手段,面向工业环境下的车身漆面缺陷检测时,漆面存在反光噪声、缺陷特征弱等问题加剧了缺陷检测难度,导致现有检测方法在检测率和准确率方面表现较差。如果漆面存在缺陷,且缺陷在出厂时未被检出,不仅将会减少汽车的经济效益,还会导致后续返厂喷涂时造成更多的资源浪费。因此,为了确保漆面的质量,汽车漆面缺陷检测有很大的研究价值。车身漆面缺陷纹理特征不强,难以提高车身漆面缺陷检测的准确率与召回率。现有技术中存在对车身漆面图像缺陷检测效率低下和准确率不高的技术问题。High-speed rail body paint defect detection is an important means to achieve zero-defect manufacturing. When it comes to body paint defect detection in an industrial environment, the presence of reflective noise and weak defect features on the paint surface exacerbates the difficulty of defect detection, resulting in poor detection rate and accuracy of existing detection methods. If there are defects on the paint surface and the defects are not detected when leaving the factory, it will not only reduce the economic benefits of the car, but also lead to more waste of resources when it is returned to the factory for spraying. Therefore, in order to ensure the quality of the paint surface, automobile paint defect detection has great research value. The texture features of body paint defects are not strong, and it is difficult to improve the accuracy and recall rate of body paint defect detection. There are technical problems in the prior art that the detection of body paint image defects is inefficient and the accuracy is not high.
发明内容Summary of the invention
有鉴于此,有必要提供一种亮度加权的自适应漆面缺陷图像增强方法及装置,用以解决对车身漆面缺陷图像检测效率低下和准确率不高的技术问题。In view of this, it is necessary to provide a brightness-weighted adaptive paint defect image enhancement method and device to solve the technical problems of low efficiency and low accuracy in detecting paint defect images of vehicle bodies.
为了解决上述技术问题,一方面,本发明提供了一种亮度加权的自适应漆面缺陷图像增强方法,包括:In order to solve the above technical problems, on the one hand, the present invention provides a brightness-weighted adaptive paint defect image enhancement method, comprising:
为了实现上述目的,本发明提供了一种,包括:In order to achieve the above object, the present invention provides a method comprising:
获取目标图像的Tiansi算子;Get the Tiansi operator of the target image;
获取目标图像的零元素和相邻元素的权重,基于所述零元素和所述相邻元素的权重对所述Tiansi算子进行零元素替换计算,得到分数阶微分算子;Obtaining weights of zero elements and adjacent elements of the target image, performing zero element replacement calculation on the Tiansi operator based on the weights of the zero elements and the adjacent elements, and obtaining a fractional differential operator;
获取目标图像的图像梯度、信息熵、粗糙度及像素点亮度,基于所述分数阶微分算子、所述目标图像的所述图像梯度、所述信息熵、所述粗糙度及所述像素点亮度得到最优微分阶次;Acquire the image gradient, information entropy, roughness and pixel brightness of the target image, and obtain the optimal differential order based on the fractional differential operator, the image gradient, information entropy, roughness and pixel brightness of the target image;
基于所述最优微分阶次对所述目标图像进行特征增强,得到目标图像的特征增强信息。The target image is feature enhanced based on the optimal differential order to obtain feature enhancement information of the target image.
在一种可能的实现方式中,所述获取目标图像的Tiansi算子,包括:In a possible implementation, obtaining the Tiansi operator of the target image includes:
获取目标图像的偏分数阶微分,基于所述目标图像的偏分数阶微分得到目标图像的Tiansi算子。A partial fractional order differential of a target image is obtained, and a Tiansi operator of the target image is obtained based on the partial fractional order differential of the target image.
在一种可能的实现方式中,所述零元素替换计算公式如下:In a possible implementation, the zero element replacement calculation formula is as follows:
其中:A3为所述分数阶微分算子及A2为差分近似表达式。Wherein: A3 is the fractional-order differential operator and A2 is the difference approximation expression.
在一种可能的实现方式中,所述基于所述分数阶微分算子、所述目标图像的所述图像梯度、所述信息熵、所述粗糙度及所述像素点亮度得到最优微分阶次,包括:In a possible implementation, obtaining the optimal differential order based on the fractional differential operator, the image gradient of the target image, the information entropy, the roughness, and the pixel brightness includes:
基于所述目标图像的所述图像梯度、所述信息熵、所述粗糙度及所述像素点亮度构建微分阶次函数模型,得到微分阶次函数模型,并将所述分数阶微分算子输入至所述微分阶次函数模型,得到最优微分阶次。A differential order function model is constructed based on the image gradient, the information entropy, the roughness and the pixel brightness of the target image to obtain a differential order function model, and the fractional-order differential operator is input into the differential order function model to obtain an optimal differential order.
在一种可能的实现方式中,所述将所述分数阶微分算子输入至所述微分阶次函数模型,得到最优微分阶次,包括:In a possible implementation, the step of inputting the fractional-order differential operator into the differential order function model to obtain an optimal differential order includes:
所述分数阶微分算子输入至所述微分阶次函数模型进行自适应寻优,得到最优微分阶次。The fractional-order differential operator is input into the differential order function model for adaptive optimization to obtain the optimal differential order.
在一种可能的实现方式中,所述基于所述最优微分阶次对所述目标图像进行特征增强,得到目标图像的特征增强信息,包括:In a possible implementation manner, the performing feature enhancement on the target image based on the optimal differential order to obtain feature enhancement information of the target image includes:
基于所述最优微分阶次构建微分阶次函数模型,得到微分阶次函数模型,并将所述目标图像输入至所述微分阶次函数模型,得到目标图像的特征增强信息。A differential order function model is constructed based on the optimal differential order to obtain a differential order function model, and the target image is input into the differential order function model to obtain feature enhancement information of the target image.
在一种可能的实现方式中,所述微分阶次函数模型的表达式如下:In a possible implementation, the differential order function model is expressed as follows:
其中,v(x,y)为所述微分阶次函数模型,x为所述目标图像的像素点的横坐标,y为所述目标图像的像素点的纵坐标,f(x,y)(gray,L)为最优微分阶次,gray为像素点灰度值及L为所述目标图像的灰度等级。Among them, v(x,y) is the differential order function model, x is the horizontal coordinate of the pixel point of the target image, y is the vertical coordinate of the pixel point of the target image, f (x,y) (gray,L) is the optimal differential order, gray is the gray value of the pixel point and L is the gray level of the target image.
另一方面,本发明还提供了一种亮度加权的自适应漆面缺陷图像增强装置,包括:On the other hand, the present invention also provides a brightness-weighted adaptive paint surface defect image enhancement device, comprising:
Tiansi算子获取模块,用于获取目标图像的Tiansi算子;Tiansi operator acquisition module, used to obtain the Tiansi operator of the target image;
零元素计算模块,用于获取目标图像的零元素和相邻元素的权重,基于所述零元素和所述相邻元素的权重对所述Tiansi算子进行零元素替换计算,得到分数阶微分算子;A zero element calculation module, used to obtain the weights of the zero element and the adjacent elements of the target image, and perform zero element replacement calculation on the Tiansi operator based on the weights of the zero element and the adjacent elements to obtain a fractional differential operator;
最优微分阶次计算模块,用于获取目标图像的图像梯度、信息熵、粗糙度及像素点亮度,基于所述分数阶微分算子、所述目标图像的所述图像梯度、所述信息熵、所述粗糙度及所述像素点亮度得到最优微分阶次;An optimal differential order calculation module, used to obtain the image gradient, information entropy, roughness and pixel brightness of the target image, and obtain the optimal differential order based on the fractional differential operator, the image gradient, information entropy, roughness and pixel brightness of the target image;
特征增强模块,用于基于所述最优微分阶次对所述目标图像进行特征增强,得到目标图像的特征增强信息。The feature enhancement module is used to perform feature enhancement on the target image based on the optimal differential order to obtain feature enhancement information of the target image.
另一方面,本发明还提供了一种电子设备,包括存储器和处理器,其中,On the other hand, the present invention also provides an electronic device, including a memory and a processor, wherein:
所述存储器,用于存储程序;The memory is used to store programs;
所述处理器,与所述存储器耦合,用于执行所述存储器中存储的所述程序,以实现如上述任意实现方式中所述的亮度加权的自适应漆面缺陷图像增强方法中的步骤。The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the brightness-weighted adaptive paint defect image enhancement method as described in any of the above implementations.
另一方面,本发明还提供了一种计算机可读存储介质,用于存储计算机可读取的程序或指令,所述程序或指令被处理器执行时能够实现上述任意实现方式中所述的亮度加权的自适应漆面缺陷图像增强方法中的步骤。On the other hand, the present invention also provides a computer-readable storage medium for storing computer-readable programs or instructions, which, when executed by a processor, can implement the steps in the brightness-weighted adaptive paint defect image enhancement method described in any of the above-mentioned implementation methods.
本发明的有益效果是:本发明提供的亮度加权的自适应漆面缺陷图像增强方法,主要是通过获取目标图像的Tiansi算子,获取目标图像的零元素和相邻元素的权重,基于所述零元素和所述相邻元素的权重对所述Tiansi算子进行零元素替换计算,得到分数阶微分算子,获取目标图像的图像梯度、信息熵、粗糙度及像素点亮度,基于所述分数阶微分算子、所述目标图像的所述图像梯度、所述信息熵、所述粗糙度及所述像素点亮度得到最优微分阶次,基于所述最优微分阶次对所述目标图像进行特征增强,得到目标图像的特征增强信息。进一步地,本申请主要通过建立Tiansi算子、零元素替换、构建关于微分阶次的函数模型及实现漆面图像的特征增强这四个步骤,实现提高对车身漆面缺陷图像检测效率和准确率的目的,其中,主要通过将分数阶微分理论引入图像梯度、信息熵、粗糙度及亮度信息应用于缺陷图像增强,会有效强化缺陷区域边缘信息,使缺陷区域纹理更加明显。The beneficial effects of the present invention are as follows: the brightness-weighted adaptive paint defect image enhancement method provided by the present invention mainly obtains the Tiansi operator of the target image, obtains the weights of the zero elements and adjacent elements of the target image, performs zero element replacement calculation on the Tiansi operator based on the weights of the zero elements and the adjacent elements, obtains the fractional differential operator, obtains the image gradient, information entropy, roughness and pixel brightness of the target image, obtains the optimal differential order based on the fractional differential operator, the image gradient, information entropy, roughness and pixel brightness of the target image, performs feature enhancement on the target image based on the optimal differential order, and obtains feature enhancement information of the target image. Further, the present application mainly achieves the purpose of improving the detection efficiency and accuracy of the paint defect image of the vehicle body through the four steps of establishing the Tiansi operator, zero element replacement, constructing a function model about the differential order and realizing feature enhancement of the paint image, wherein the fractional differential theory is mainly introduced into the image gradient, information entropy, roughness and brightness information for defect image enhancement, which will effectively enhance the edge information of the defect area and make the texture of the defect area more obvious.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
图1为本发明提供的亮度加权的自适应漆面缺陷图像增强方法的一个实施例流程示意图;FIG1 is a schematic flow chart of an embodiment of a brightness-weighted adaptive paint defect image enhancement method provided by the present invention;
图2为本发明提供的亮度加权的自适应漆面缺陷图像增强方法的一个实施例原理图;FIG2 is a schematic diagram of an embodiment of a brightness-weighted adaptive paint defect image enhancement method provided by the present invention;
图3为本发明提供的亮度加权的自适应漆面缺陷图像增强方法的一个实施例的Tiansi算子原理图;FIG3 is a schematic diagram of a Tiansi operator according to an embodiment of a brightness-weighted adaptive paint defect image enhancement method provided by the present invention;
图4为本发明提供的亮度加权的自适应漆面缺陷图像增强方法的一个实施例的分数阶微分算子原理图;FIG4 is a schematic diagram of a fractional differential operator of an embodiment of a brightness-weighted adaptive paint defect image enhancement method provided by the present invention;
图5为本发明提供的亮度加权的自适应漆面缺陷图像增强装置的一个实施例的结构示意图;FIG5 is a schematic structural diagram of an embodiment of a brightness-weighted adaptive paint surface defect image enhancement device provided by the present invention;
图6为本发明提供的电子设备的一个实施例结构示意图。FIG. 6 is a schematic diagram of the structure of an embodiment of an electronic device provided by the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
在本发明实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如:A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。In the description of the embodiments of the present invention, unless otherwise specified, "multiple" means two or more. "And/or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and/or B" may mean: A exists alone, A and B exist at the same time, and B exists alone.
本发明实施例中所涉及到的“第一”、“第二”等描述仅用于描述目的,而不能理解为指示或者暗示其相对重要性或者隐含指明所指示的技术特征的数量。因此,限定有“第一”、“第二”的技术特征可以明示或者隐含的包括至少一个该特征。The descriptions of "first", "second", etc. involved in the embodiments of the present invention are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" or "second" may explicitly or implicitly include at least one of the features.
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本发明的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
本发明提供了一种亮度加权的自适应漆面缺陷图像增强方法及装置,以下分别进行说明。The present invention provides a brightness-weighted adaptive paint defect image enhancement method and device, which are described below respectively.
图1为本发明提供的亮度加权的自适应漆面缺陷图像增强方法的一个实施例流程示意图及图2为本发明提供的亮度加权的自适应漆面缺陷图像增强方法的一个实施例原理图,包括:FIG1 is a schematic flow chart of an embodiment of a brightness weighted adaptive paint surface defect image enhancement method provided by the present invention, and FIG2 is a schematic diagram of an embodiment of a brightness weighted adaptive paint surface defect image enhancement method provided by the present invention, including:
S101、获取目标图像的Tiansi算子;S101, obtaining the Tiansi operator of the target image;
S102、获取目标图像的零元素和相邻元素的权重,基于零元素和相邻元素的权重对Tiansi算子进行零元素替换计算,得到分数阶微分算子;S102, obtaining the weights of the zero elements and the adjacent elements of the target image, performing a zero element replacement calculation on the Tiansi operator based on the weights of the zero elements and the adjacent elements, and obtaining a fractional differential operator;
S103、获取目标图像的图像梯度、信息熵、粗糙度及像素点亮度,基于分数阶微分算子、目标图像的图像梯度、信息熵、粗糙度及像素点亮度得到最优微分阶次;S103, obtaining the image gradient, information entropy, roughness and pixel brightness of the target image, and obtaining the optimal differential order based on the fractional differential operator, the image gradient, information entropy, roughness and pixel brightness of the target image;
S104、基于最优微分阶次对目标图像进行特征增强,得到目标图像的特征增强信息。S104, performing feature enhancement on the target image based on the optimal differential order to obtain feature enhancement information of the target image.
需要说明的是,现有技术中在缺陷增强时,目前现有技术中的大多数方法可能会增强反光噪声,这样做会影响后续的漆面缺陷检测,或者还会采用改进的GAN生成对抗网络,基于对抗网络直接生成新的缺陷数据,这种方法往往会导致生成的图片真实性不佳和模式崩塌的问题。本发明主要是将分数阶微分理论应用于缺陷图像增强领域会有效强化缺陷区域边缘信息,使得缺陷区域纹理更加明显。It should be noted that in the prior art, when enhancing defects, most methods in the prior art may enhance reflective noise, which will affect the subsequent paint defect detection, or an improved GAN generative adversarial network will be used to directly generate new defect data based on the adversarial network. This method often leads to problems such as poor authenticity and pattern collapse of the generated images. The present invention mainly applies the fractional differential theory to the field of defect image enhancement, which can effectively enhance the edge information of the defect area and make the texture of the defect area more obvious.
可以理解的是,本发明主要包括如下步骤:It can be understood that the present invention mainly includes the following steps:
步骤1、根据微分的阶数由整数阶扩大到分数阶应用于图像信号f(x,y),得到偏分数阶微分的差分近似表达式;取分数阶微分近似表达式的前三项系数,得到大小为5×5的Tiansi算子;Step 1: According to the order of differentiation, the order is expanded from integer order to fractional order and applied to the image signal f(x, y), and the differential approximate expression of partial fractional differential is obtained; the first three coefficients of the fractional differential approximate expression are taken to obtain the Tiansi operator of size 5×5;
步骤2、根据距离中心像素点的距离的倒数为零元素以及其相邻元素的权重,实现零元素替换,构建出16个方向的分数阶微分算子;Step 2: According to the reciprocal of the distance from the central pixel as the zero element and the weight of its adjacent elements, zero element replacement is achieved to construct fractional differential operators in 16 directions;
步骤3、根据图像梯度、信息熵、粗糙度三种图像的局部信息,以及像素点亮度信息作为加权数构建关于微分阶次函数模型,实现自适应寻求最优微分阶次;Step 3: Based on the local information of three images, namely image gradient, information entropy and roughness, and the brightness information of the pixel points, a differential order function model is constructed as a weighted number to realize adaptive search for the optimal differential order;
步骤4、基于得到自适应微分阶次v(x,y),在三通道上分别对待增强图像三个分量进行特征增强,最后合成RGB图像实现漆面图像的特征增强。Step 4: Based on the adaptive differential order v(x, y), feature enhancement is performed on the three components of the image to be enhanced on three channels respectively, and finally the RGB image is synthesized to achieve feature enhancement of the paint surface image.
图3为本发明提供的亮度加权的自适应漆面缺陷图像增强方法的一个实施例的Tiansi算子原理图,包括:FIG3 is a schematic diagram of a Tiansi operator according to an embodiment of a brightness-weighted adaptive paint defect image enhancement method provided by the present invention, comprising:
获取目标图像的偏分数阶微分,基于目标图像的偏分数阶微分得到目标图像的Tiansi算子。The partial fractional differential of the target image is obtained, and the Tiansi operator of the target image is obtained based on the partial fractional differential of the target image.
需要说明的是,获取目标图像的Tiansi算子的具体步骤如下:It should be noted that the specific steps for obtaining the Tiansi operator of the target image are as follows:
步骤1、根据扩大后的分数阶微分可定义为:Step 1: According to the expanded fractional differential, it can be defined as:
式中:v为分数阶阶次v>0,h为微分步长,为的取整,a为分数阶微分的下限,为Gamma函数。Where: v is the fractional order v>0, h is the differential step size, for , a is the lower limit of fractional differential, is the Gamma function.
步骤2、通过目标图像f(x,y)可得在x和y正方向上的偏分数阶微分的差分近似表达式为:Step 2: Through the target image f(x,y), the differential approximate expression of the partial fractional differential in the positive direction of x and y can be obtained:
式中:x为目标图像的像素点的横坐标,y为目标图像的像素点的纵坐标,v为分数阶次v>0,k代表权重系数。Where: x is the horizontal coordinate of the pixel point of the target image, y is the vertical coordinate of the pixel point of the target image, v is the fractional order v>0, and k represents the weight coefficient.
步骤3、通过目标图像f(y,x)可得x、y负方向,左右对角线方向等六个方向分数阶微分近似表达式。Step 3: The approximate fractional differential expressions in six directions, including the negative directions of x and y, and the left and right diagonal directions, can be obtained through the target image f(y,x).
步骤4、取分数阶微分近似表达式的前三项系数,得到大小为5×5的Tiansi算子。Step 4: Take the first three coefficients of the fractional differential approximation expression to obtain the Tiansi operator of size 5×5.
在本发明的一些实施例中,零元素替换计算公式如下:In some embodiments of the present invention, the zero element replacement calculation formula is as follows:
其中:A3为分数阶微分算子及A2为差分近似表达式。Where: A3 is the fractional differential operator and A2 is the difference approximation expression.
需要说明的是,根据距离中心像素点的距离的倒数为零元素以及其相邻元素的权重,按照如上公式实现零元素替换,可以进一步增强算法精度以及算子的抗旋转性,构建16个方向的分数阶微分算子。It should be noted that, according to the reciprocal of the distance from the center pixel as the zero element and the weight of its adjacent elements, the zero element replacement is implemented according to the above formula, which can further enhance the algorithm accuracy and the anti-rotation ability of the operator, and construct a fractional-order differential operator in 16 directions.
图4为本发明提供的亮度加权的自适应漆面缺陷图像增强方法的一个实施例的分数阶微分算子原理图,包括:FIG4 is a schematic diagram of a fractional differential operator of an embodiment of a brightness-weighted adaptive paint defect image enhancement method provided by the present invention, comprising:
基于目标图像的图像梯度、信息熵、粗糙度及像素点亮度构建微分阶次函数模型,得到微分阶次函数模型,并将分数阶微分算子输入至微分阶次函数模型,得到最优微分阶次。A differential order function model is constructed based on the image gradient, information entropy, roughness and pixel brightness of the target image to obtain the differential order function model, and the fractional order differential operator is input into the differential order function model to obtain the optimal differential order.
需要说明的是,得到最优微分阶次的操作步骤如下:It should be noted that the steps to obtain the optimal differential order are as follows:
步骤一、提取图像梯度以判断空间变化率,根据图像的梯度变化判断图像的纹理信息是否丰富,经归一化的图像梯度定义为:Step 1: Extract image gradient to determine the spatial change rate. According to the image gradient change, determine whether the image texture information is rich. The normalized image gradient defined as:
式中:Ggray(x,y)为像素点(x,y)的灰度值,x,y分别代表像素点的横纵坐标;Where: G gray (x, y) is the gray value of the pixel point (x, y), x, y represent the horizontal and vertical coordinates of the pixel point respectively;
进一步地,further,
式中:fgray(x,y)为像素点(x,y)的灰度值。Where: f gray (x, y) is the gray value of the pixel (x, y).
步骤二、提取图像信息熵以判断平均信息量的大小,熵值越大则所含信息量越多,可知在图像的边缘区域信息熵的值相对较大,经归一化的图像信息熵定义为:Step 2: Extract image information entropy to determine the size of the average amount of information. The larger the entropy value, the more information it contains. It can be seen that the value of information entropy is relatively large in the edge area of the image. The normalized image information entropy defined as:
进一步地,further,
式中:j为像素点(x,y)在N邻域内灰度均值,ggray(i,j)为像素点(x,y)与该点的邻域信息的特征二元组,Pgtay(i,j)为ggray(i,j)在邻域内发生的频率,NBL为图像的灰度等级。Where: j is the gray mean of the pixel (x, y) in the N neighborhoods, g gray (i, j) is the feature binary of the pixel (x, y) and the neighborhood information of the point, P gtay (i, j) is the frequency of g gray (i, j) occurring in the neighborhood, and NBL is the gray level of the image.
步骤三、提取图像粗糙度以判断纹理特征的细腻程度,在光滑区域图像粗糙度较小,在细节丰富区域图像粗糙度较大,图像粗糙度Rgray(x,y)定义为:Step 3: Extract image roughness to determine the fineness of texture features. The image roughness is small in smooth areas and large in areas with rich details. Image roughness R gray (x, y) is defined as:
进一步地,further,
式中:Mgray(x,y)为以像素点(x,y)为中心N为边长的局部窗口内的灰度均值,σ(fgray(x,y)(x,y))2为局部窗口灰度值方差。Where M gray (x, y) is the gray mean in the local window with the pixel point (x, y) as the center and N as the side length, and σ (f gray (x, y) (x, y)) 2 is the gray value variance of the local window.
步骤四、提取图像亮度信息,将亮度信息值作为权值(1-IL)。Step 4: Extract the image brightness information and use the brightness information value as the weight (1-I L ).
步骤五、引入上述三种图像的局部信息以及像素点亮度信息加权数构建关于微分阶次函数模型,实现自适应寻求最优微分阶次,构造的相应数学模型f(x,y)(gray,L)为:Step 5: Introduce the local information of the above three images and the weighted number of pixel brightness information to construct a differential order function model to achieve adaptive search for the optimal differential order. The corresponding mathematical model f (x, y) (gray, L) is:
式中:将像素点(x,y)处的Rgray(x,y)、IL(x,y)分别简写为Rgray、IL及(1-IL)为亮度信息加权。Where: The pixel point (x, y) R gray (x, y) and I L (x, y) are abbreviated as R gray , IL and (1- IL ) are the weights of brightness information.
在本发明的一些实施例中,将分数阶微分算子输入至微分阶次函数模型,得到最优微分阶次,包括:In some embodiments of the present invention, a fractional differential operator is input into a differential order function model to obtain an optimal differential order, including:
分数阶微分算子输入至微分阶次函数模型进行自适应寻优,得到最优微分阶次。The fractional-order differential operator is input into the differential order function model for adaptive optimization to obtain the optimal differential order.
需要说明的是,分数阶微分算子输入至微分阶次函数模型进行自适应寻优,得到最优微分阶次。It should be noted that the fractional-order differential operator is input into the differential order function model for adaptive optimization to obtain the optimal differential order.
在本发明的一些实施例中,基于最优微分阶次对目标图像进行特征增强,得到目标图像的特征增强信息,包括:In some embodiments of the present invention, feature enhancement is performed on a target image based on an optimal differential order to obtain feature enhancement information of the target image, including:
基于最优微分阶次构建微分阶次函数模型,得到微分阶次函数模型,并将目标图像输入至微分阶次函数模型,得到目标图像的特征增强信息。A differential order function model is constructed based on the optimal differential order to obtain a differential order function model, and a target image is input into the differential order function model to obtain feature enhancement information of the target image.
需要说明的是,基于最优微分阶次构建微分阶次函数模型,得到微分阶次函数模型,并将目标图像输入至微分阶次函数模型,得到目标图像的特征增强信息。It should be noted that a differential order function model is constructed based on the optimal differential order to obtain a differential order function model, and the target image is input into the differential order function model to obtain feature enhancement information of the target image.
在本发明的一些实施例中,微分阶次函数模型的表达式如下:In some embodiments of the present invention, the expression of the differential order function model is as follows:
其中,v(x,y)为微分阶次函数模型,x为目标图像的像素点的横坐标,y为目标图像的像素点的纵坐标,f(x,y)(gray,L)为最优微分阶次,gray为像素点灰度值及L为目标图像的灰度等级。Among them, v(x,y) is the differential order function model, x is the horizontal coordinate of the pixel point of the target image, y is the vertical coordinate of the pixel point of the target image, f (x,y) (gray,L) is the optimal differential order, gray is the gray value of the pixel point and L is the gray level of the target image.
需要说明的是,为进一步突出微分阶次随着f(x,y)(gray,L)增加而增加的幅度,构建如上述的微分阶次v(x,y)函数模型。It should be noted that in order to further highlight the increase in the differential order as f (x, y) (gray, L) increases, a differential order v(x, y) function model as described above is constructed.
需要进一步说明的是,微分阶次的范围在0<v(x,y)<1之间,同时f(x,y)(gray,L)∈(0,1),随着频率的逐步增加,微分阶次呈非线性显著增强,综上分析可知,要表征的自适应函数为非线性单调递增函数。It should be further explained that the range of the differential order is between 0<v(x,y)<1. At the same time, f (x,y) (gray,L)∈(0,1), with the gradual increase of frequency, the differential order is significantly enhanced nonlinearly. From the above analysis, it can be seen that the adaptive function to be characterized is a nonlinear monotonically increasing function.
图5为本发明提供的亮度加权的自适应漆面缺陷图像增强装置的一个实施例的结构示意图,包括:FIG5 is a schematic structural diagram of an embodiment of a brightness-weighted adaptive paint surface defect image enhancement device provided by the present invention, comprising:
Tiansi算子获取模块501,用于获取目标图像的Tiansi算子;Tiansi operator acquisition module 501, used to acquire the Tiansi operator of the target image;
零元素计算模块502,用于获取目标图像的零元素和相邻元素的权重,基于零元素和相邻元素的权重对Tiansi算子进行零元素替换计算,得到分数阶微分算子;A zero element calculation module 502 is used to obtain the weights of the zero elements and adjacent elements of the target image, and perform zero element replacement calculation on the Tiansi operator based on the weights of the zero elements and adjacent elements to obtain a fractional differential operator;
最优微分阶次计算模块503,用于获取目标图像的图像梯度、信息熵、粗糙度及像素点亮度,基于分数阶微分算子、目标图像的图像梯度、信息熵、粗糙度及像素点亮度得到最优微分阶次;The optimal differential order calculation module 503 is used to obtain the image gradient, information entropy, roughness and pixel brightness of the target image, and obtain the optimal differential order based on the fractional differential operator, the image gradient, information entropy, roughness and pixel brightness of the target image;
特征增强模块504,用于基于最优微分阶次对目标图像进行特征增强,得到目标图像的特征增强信息。The feature enhancement module 504 is used to perform feature enhancement on the target image based on the optimal differential order to obtain feature enhancement information of the target image.
上述实施例提供的亮度加权的自适应漆面缺陷图像增强装置700可实现上述亮度加权的自适应漆面缺陷图像增强方法实施例中描述的技术方案,上述各模块或单元具体实现的原理可参见上述亮度加权的自适应漆面缺陷图像增强方法实施例中的相应内容,此处不再赘述。The brightness-weighted adaptive paint defect image enhancement device 700 provided in the above embodiment can implement the technical solution described in the above brightness-weighted adaptive paint defect image enhancement method embodiment. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above brightness-weighted adaptive paint defect image enhancement method embodiment, which will not be repeated here.
如图6所示,本发明还相应提供了一种电子设备600。该电子设备600包括处理器601、存储器602及显示器603。图6仅示出了电子设备600的部分组件,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。As shown in FIG6 , the present invention also provides an electronic device 600. The electronic device 600 includes a processor 601, a memory 602, and a display 603. FIG6 shows only some components of the electronic device 600, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
处理器601在一些实施例中可以是一中央处理器(Central Processing Unit,CPU),微处理器或其他数据处理芯片,用于运行存储器602中存储的程序代码或处理数据,例如本发明中的亮度加权的自适应漆面缺陷图像增强方法。In some embodiments, the processor 601 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 602, such as the brightness-weighted adaptive paint defect image enhancement method of the present invention.
在一些实施例中,处理器601可以是单个服务器或服务器组。服务器组可为集中式或分布式的。在一些实施例中,处理器601可为本地的或远程的。在一些实施例中,处理器601可实施于云平台。在一实施例中,云平台可包括私有云、公共云、混合云、社区云、分布式云、内部云、多重云等,或以上的任意组合。In some embodiments, the processor 601 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 601 may be local or remote. In some embodiments, the processor 601 may be implemented in a cloud platform. In one embodiment, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.
存储器602在一些实施例中可以是电子设备600的内部存储单元,例如电子设备600的硬盘或内存。存储器602在另一些实施例中也可以是电子设备600的外部存储设备,例如电子设备600上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。In some embodiments, the memory 602 may be an internal storage unit of the electronic device 600, such as a hard disk or memory of the electronic device 600. In other embodiments, the memory 602 may also be an external storage device of the electronic device 600, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 600.
进一步地,存储器602还可既包括电子设备600的内部储存单元也包括外部存储设备。存储器602用于存储安装电子设备600的应用软件及各类数据。Furthermore, the memory 602 may include both an internal storage unit of the electronic device 600 and an external storage device. The memory 602 is used to store application software installed in the electronic device 600 and various data.
显示器603在一些实施例中可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。显示器603用于显示在电子设备600的信息以及用于显示可视化的用户界面。电子设备600的部件601-603通过系统总线相互通信。In some embodiments, the display 603 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 603 is used to display information on the electronic device 600 and to display a visual user interface. The components 601-603 of the electronic device 600 communicate with each other via a system bus.
在一实施例中,当处理器601执行存储器602中的亮度加权的自适应漆面缺陷图像增强程序时,可实现以下步骤:In one embodiment, when the processor 601 executes the brightness-weighted adaptive paint defect image enhancement program in the memory 602, the following steps may be implemented:
获取目标图像的Tiansi算子;Get the Tiansi operator of the target image;
获取目标图像的零元素和相邻元素的权重,基于零元素和相邻元素的权重对Tiansi算子进行零元素替换计算,得到分数阶微分算子;Obtain the weights of the zero elements and adjacent elements of the target image, perform zero element replacement calculation on the Tiansi operator based on the weights of the zero elements and adjacent elements, and obtain a fractional differential operator;
获取目标图像的图像梯度、信息熵、粗糙度及像素点亮度,基于分数阶微分算子、目标图像的图像梯度、信息熵、粗糙度及像素点亮度得到最优微分阶次;Obtain the image gradient, information entropy, roughness and pixel brightness of the target image, and obtain the optimal differential order based on the fractional differential operator, the image gradient, information entropy, roughness and pixel brightness of the target image;
基于最优微分阶次对目标图像进行特征增强,得到目标图像的特征增强信息。The target image is feature enhanced based on the optimal differential order to obtain feature enhancement information of the target image.
应当理解的是:处理器601在执行存储器602中的亮度加权的自适应漆面缺陷图像增强程序时,除了上面的功能之外,还可实现其它功能,具体可参见前面相应方法实施例的描述。It should be understood that: when the processor 601 executes the brightness-weighted adaptive paint defect image enhancement program in the memory 602, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiment above.
进一步地,本发明实施例对提及的电子设备600的类型不做具体限定,电子设备600可以为手机、平板电脑、个人数字助理(personal digital assistant,PDA)、可穿戴设备、膝上型计算机(laptop)等便携式电子设备。便携式电子设备的示例性实施例包括但不限于搭载IOS、android、microsoft或者其他操作系统的便携式电子设备。上述便携式电子设备也可以是其他便携式电子设备,诸如具有触敏表面(例如触控面板)的膝上型计算机(laptop)等。还应当理解的是,在本发明其他一些实施例中,电子设备600也可以不是便携式电子设备,而是具有触敏表面(例如触控面板)的台式计算机。Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 600 mentioned, and the electronic device 600 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic device may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 600 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).
相应地,本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质用于存储计算机可读取的程序或指令,程序或指令被处理器执行时,能够实现上述各方法实施例提供的亮度加权的自适应漆面缺陷图像增强方法中的步骤或功能。Accordingly, an embodiment of the present application also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, it can implement the steps or functions of the brightness-weighted adaptive paint defect image enhancement method provided in the above-mentioned method embodiments.
本领域技术人员可以理解,实现上述实施例方法的全部或部分流程,可以通过计算机程序来指令相关的硬件(如处理器,控制器等)来完成,计算机程序可存储于计算机可读存储介质中。其中,计算机可读存储介质为磁盘、光盘、只读存储记忆体或随机存储记忆体等。Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
以上对本发明所提供的亮度加权的自适应漆面缺陷图像增强方法及装置进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本发明的限制。The brightness-weighted adaptive paint defect image enhancement method and device provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410368407.3A CN118297810A (en) | 2024-03-28 | 2024-03-28 | Luminance weighted self-adaptive paint defect image enhancement method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410368407.3A CN118297810A (en) | 2024-03-28 | 2024-03-28 | Luminance weighted self-adaptive paint defect image enhancement method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118297810A true CN118297810A (en) | 2024-07-05 |
Family
ID=91684145
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410368407.3A Pending CN118297810A (en) | 2024-03-28 | 2024-03-28 | Luminance weighted self-adaptive paint defect image enhancement method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118297810A (en) |
-
2024
- 2024-03-28 CN CN202410368407.3A patent/CN118297810A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111754515B (en) | Sequential gripping method and device for stacked articles | |
US20210272306A1 (en) | Method for training image depth estimation model and method for processing image depth information | |
US10467777B2 (en) | Texture modeling of image data | |
CN112991180A (en) | Image splicing method, device, equipment and storage medium | |
US9665971B2 (en) | Techniques for multiple pass rendering | |
CN110119733A (en) | Page identification method and device, terminal equipment and computer readable storage medium | |
CN111192312B (en) | Depth image acquisition method, device, equipment and medium based on deep learning | |
TW202117506A (en) | Electronic apparatus and object information recognition method by using touch data thereof | |
CN114627239A (en) | Bounding box generation method, device, equipment and storage medium | |
CN115393251A (en) | Defect detection method and device for printed circuit board, storage medium and electronic equipment | |
CN116797631A (en) | Differential area positioning method, differential area positioning device, computer equipment and storage medium | |
CN114647816A (en) | Method, device and equipment for determining lane line and storage medium | |
CN116681758A (en) | Vehicle attitude estimation method and device, electronic equipment and storage medium | |
EP2792147A1 (en) | Techniques for improving stereo block matching with the pyramid method | |
CN118297810A (en) | Luminance weighted self-adaptive paint defect image enhancement method and device | |
CN114119990A (en) | Method, apparatus and computer program product for image feature point matching | |
CN116758198B (en) | Image reconstruction method, device, equipment and storage medium | |
US20230377252A1 (en) | Terminal apparatus, non-transitory computer readable medium, and image display method | |
CN110782390A (en) | Image correction processing method and device, electronic equipment | |
CN115775283A (en) | Image compression method, device, storage medium and computer equipment | |
WO2023155348A1 (en) | Game data processing method and apparatus, computer device, and storage medium | |
CN117218621A (en) | Three-dimensional object detection method, electronic device and storage medium | |
CN113808050B (en) | Denoising method, device and equipment for 3D point cloud and storage medium | |
CN116168442B (en) | Sample image generation method, model training method and target detection method | |
CN116819544B (en) | Laser positioning method, device, equipment and storage medium |
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 |