[go: up one dir, main page]

CN114792289A - Image pooling method, apparatus, terminal device and computer-readable storage medium - Google Patents

Image pooling method, apparatus, terminal device and computer-readable storage medium Download PDF

Info

Publication number
CN114792289A
CN114792289A CN202110103168.5A CN202110103168A CN114792289A CN 114792289 A CN114792289 A CN 114792289A CN 202110103168 A CN202110103168 A CN 202110103168A CN 114792289 A CN114792289 A CN 114792289A
Authority
CN
China
Prior art keywords
image
processed
pixel
reference image
pooling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110103168.5A
Other languages
Chinese (zh)
Inventor
徐鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan TCL Group Industrial Research Institute Co Ltd
Original Assignee
Wuhan TCL Group Industrial Research Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan TCL Group Industrial Research Institute Co Ltd filed Critical Wuhan TCL Group Industrial Research Institute Co Ltd
Priority to CN202110103168.5A priority Critical patent/CN114792289A/en
Publication of CN114792289A publication Critical patent/CN114792289A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Image Processing (AREA)

Abstract

本申请实施例提供了一种图像池化方法、装置、终端设备及计算机可读存储介质,方法包括:获取待处理图像;对待处理图像进行第一池化处理,得到参考图像;根据参考图像对待处理图像的像素点赋予对应的权重;根据权重,对待处理图像和参考图像进行第二池化处理,得到目标图像。本申请实施例通过对待处理图像的不同位置像素点根据权重公式赋予权重,根据权重将待处理图像和参考图像进行第二池化处理,来获取最终目标图像,从而保留更多的图像细节,更符合人类视觉的主观感受。

Figure 202110103168

Embodiments of the present application provide an image pooling method, apparatus, terminal device, and computer-readable storage medium. The method includes: acquiring an image to be processed; performing a first pooling process on the image to be processed to obtain a reference image; The pixels of the processed image are given corresponding weights; according to the weights, the second pooling processing is performed on the to-be-processed image and the reference image to obtain the target image. In this embodiment of the present application, the pixels at different positions of the image to be processed are given weights according to the weight formula, and the image to be processed and the reference image are subjected to a second pooling process according to the weights to obtain the final target image, thereby retaining more image details and making more It conforms to the subjective feeling of human vision.

Figure 202110103168

Description

图像池化方法、装置、终端设备及计算机可读存储介质Image pooling method, apparatus, terminal device, and computer-readable storage medium

技术领域technical field

本申请属于图像处理技术领域,尤其涉及一种图像池化方法、装置、终端 设备及计算机可读存储介质。The present application belongs to the technical field of image processing, and in particular, relates to an image pooling method, apparatus, terminal device and computer-readable storage medium.

背景技术Background technique

随着AI技术的不断发展,基于图像的神经网络技术也进入了飞速发展阶段。 当今世界,图像分辨率越来越高,在神经网络的训练过程中,池化层成为了一 种常见的用来降低分辨率的必要网络层。它具有增大感受野、平移不变形、降 低神经网络优化难度等显著特点,是现有神经网络中必不可少的一环,具有重 大的意义。With the continuous development of AI technology, image-based neural network technology has also entered a stage of rapid development. In today's world, the image resolution is getting higher and higher, and the pooling layer has become a common necessary network layer to reduce the resolution during the training process of the neural network. It has significant characteristics such as increasing the receptive field, not deforming in translation, and reducing the difficulty of neural network optimization. It is an indispensable part of the existing neural network and has great significance.

现有池化层包括平均池化,最大值池化和随机池化等,这些池化方法虽然 常见易用,在神经网络中各有特点,但这些现有方法模糊了边缘,会损失很多 细节,从而造成视觉主观感受较差,不能满足人类视觉对于语义信息和边缘细 节的关注需求。The existing pooling layers include average pooling, maximum pooling, and random pooling. Although these pooling methods are common and easy to use, they have their own characteristics in neural networks, but these existing methods blur the edges and lose a lot of details. , resulting in poor visual subjective experience, which cannot meet the human vision's attention to semantic information and edge details.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供了一种图像池化方法、装置、终端设备及计算机可读存 储介质,用于解决现有池化技术中图像细节不足的问题。The embodiments of the present application provide an image pooling method, apparatus, terminal device, and computer-readable storage medium, which are used to solve the problem of insufficient image details in the existing pooling technology.

第一方面,本申请实施例提供了一种图像池化方法,包括:In a first aspect, an embodiment of the present application provides an image pooling method, including:

获取待处理图像;Get the image to be processed;

对待处理图像进行第一池化处理,得到参考图像;Perform a first pooling process on the image to be processed to obtain a reference image;

根据参考图像对待处理图像的像素点赋予对应的权重;Give corresponding weights to the pixels of the image to be processed according to the reference image;

根据权重,对待处理图像和参考图像进行第二池化处理,得到目标图像。According to the weight, the second pooling process is performed on the to-be-processed image and the reference image to obtain the target image.

第二方面,本申请实施例提供了一种图像处理的装置,包括:In a second aspect, an embodiment of the present application provides an image processing apparatus, including:

获取模块,用于获取待处理图像;The acquisition module is used to acquire the image to be processed;

第一池化模块,用于对待处理图像进行第一池化处理,得到参考图像;The first pooling module is used to perform first pooling processing on the image to be processed to obtain a reference image;

权重模块,用于根据参考图像对待处理图像的像素点赋予对应的权重;The weight module is used to assign corresponding weights to the pixels of the image to be processed according to the reference image;

第二池化模块,用于根据权重,对待处理图像和参考图像进行第二池化处 理,得到目标图像。The second pooling module is used to perform a second pooling process on the image to be processed and the reference image according to the weight to obtain the target image.

第三方面,本申请实施例提供了一种终端设备,包括存储器、处理器以及 存储在存储器中并可在处理器上运行的计算机程序,处理器执行计算机程序时 实现上述第一方面中任一项的图像池化方法的步骤。In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, any one of the foregoing first aspects is implemented The steps of the image pooling method for the item.

第四方面,本申请实施例提供了一种计算机可读存储介质,计算机可读存 储介质存储有计算机程序,计算机程序被处理器执行时实现上述第一方面中任 一项的图像池化方法的步骤。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the image pooling method according to any one of the foregoing first aspects is implemented. step.

第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品 在终端设备上运行时,使得终端设备执行上述第一方面中任一项的图像池化方 法的步骤。In a fifth aspect, an embodiment of the present application provides a computer program product that, when the computer program product runs on a terminal device, causes the terminal device to perform the steps of the image pooling method in any one of the above-mentioned first aspects.

可以理解的是,上述第二方面至第五方面的有益效果可以参见上述第一方 面中的相关描述,在此不再赘述。It can be understood that, for the beneficial effects of the foregoing second aspect to the fifth aspect, reference may be made to the relevant description in the foregoing first aspect, which will not be repeated here.

本申请实施例与现有技术相比存在的有益效果是:本申请实施例提供了一 种图像池化方法、装置、终端设备及计算机可读存储介质,方法包括:获取待 处理图像;对待处理图像进行第一池化处理,得到参考图像;根据参考图像对 待处理图像的像素点赋予对应的权重;根据权重,对待处理图像和参考图像进 行第二池化处理,得到目标图像。本申请实施例通过对待处理图像的不同位置 像素点根据权重公式赋予权重,根据权重将待处理图像和参考图像进行第二池 化处理,来获取最终目标图像,从而保留更多的图像细节,更符合人类视觉的 主观感受。Compared with the prior art, the beneficial effects of the embodiments of the present application are as follows: the embodiments of the present application provide an image pooling method, apparatus, terminal device and computer-readable storage medium. The method includes: acquiring an image to be processed; The image is subjected to first pooling processing to obtain a reference image; corresponding weights are given to the pixels of the image to be processed according to the reference image; In this embodiment of the present application, the pixels at different positions of the image to be processed are given weights according to the weight formula, and the image to be processed and the reference image are subjected to a second pooling process according to the weights to obtain the final target image, thereby retaining more image details and making more It conforms to the subjective perception of human vision.

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技 术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅 仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳 动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only for the present application. In some embodiments, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without any creative effort.

图1是本申请实施例提供的图像池化方法的流程示意图;1 is a schematic flowchart of an image pooling method provided by an embodiment of the present application;

图2是本申请实施例提供的图像池化装置的结构示意图;FIG. 2 is a schematic structural diagram of an image pooling apparatus provided by an embodiment of the present application;

图3是本申请实施例提供的终端设备的结构示意图。FIG. 3 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.

具体实施方式Detailed ways

以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术 之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当 清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中, 省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节 妨碍本申请的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures and technologies are set forth in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.

应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括” 指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个 或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It is to be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements and/or components, but does not exclude one or more other The presence or addition of features, integers, steps, operations, elements, components and/or sets thereof.

还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是 指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这 些组合。It should also be understood that, as used in this specification and the appended claims, the term "and/or" refers to and including any and all possible combinations of one or more of the associated listed items.

如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以 依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测 到”。类似地,短语“如果确定”或“如果检测到所描述条件或事件”可以依 据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到所描述 条件或事件”或“响应于检测到所描述条件或事件”。As used in the specification of this application and the appended claims, the term "if" may be contextually interpreted as "when" or "once" or "in response to determining" or "in response to detecting ". Similarly, the phrases "if it is determined" or "if the described condition or event is detected" may be interpreted, depending on the context, to mean "once it is determined" or "in response to the determination" or "once the described condition or event is detected" or " In response to detection of the described condition or event".

另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第 二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the specification of the present application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be construed as indicating or implying relative importance.

在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着 在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特 点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一 些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必 然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除 非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的 变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。References in this specification to "one embodiment" or "some embodiments" and the like mean that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically emphasized otherwise. The terms "including", "including", "having" and their conjugations all mean "including but not limited to" unless specifically emphasized otherwise.

下面对本申请实施例提供的技术方案进行详细阐述。The technical solutions provided by the embodiments of the present application are described in detail below.

参见图1示出的一种图像池化方法的一种流程示意图,该方法可以应用于 终端设备,终端设备可以是手机、平板或电脑等,在此不对终端设备的类型作 限定。该方法可以包括以下步骤:Referring to a schematic flowchart of an image pooling method shown in FIG. 1, the method can be applied to terminal equipment, and the terminal equipment can be a mobile phone, tablet or computer, etc., and the type of the terminal equipment is not limited here. The method may include the following steps:

步骤S101:获取待处理图像I。Step S101: Acquire the image I to be processed.

步骤S102:对待处理图像I进行第一池化处理,得到参考图像,其中,待 处理图像可以是人脸图像、风景图像或者汽车图像等,待处理图像的格式可以 为JPEG、TIFF或者RAW等,本申请对此不进行任何的限定。得到参考图像的方 法包括两种:Step S102: performing the first pooling process on the to-be-processed image I to obtain a reference image, wherein the to-be-processed image can be a face image, a landscape image, or a car image, etc., and the format of the to-be-processed image can be JPEG, TIFF, RAW, etc., This application does not make any limitation on this. There are two ways to get the reference image:

第一种:首先,将待处理图像I进行下采样,得到下采样图像IBThe first type: First, the image I to be processed is down-sampled to obtain the down-sampled image I B .

可使用box filter将待处理图像I进行下采样,得到的下采样图像的尺寸 由目标图像与待处理图像之间的尺寸比例决定,例如为待处理图像长宽尺寸的 1/2或者1/4。可以理解的是,也可以采用最近邻插值,双线性插值,三线性插值 的方法对待处理图像I进行下采样,得到下采样图像。其中目标图像为最终希 望获得的图像。A box filter can be used to downsample the image I to be processed, and the size of the obtained downsampled image is determined by the size ratio between the target image and the image to be processed, such as 1/2 or 1/4 of the length and width of the image to be processed. . It can be understood that the method of nearest neighbor interpolation, bilinear interpolation and trilinear interpolation can also be used to downsample the image I to be processed to obtain a downsampled image. The target image is the final desired image.

本申请实施例通过进行下采样,削弱待处理图像中的高频率分量,得到低 频分量,有利于获得待处理图像的全局信息。In this embodiment of the present application, by performing downsampling, the high-frequency components in the to-be-processed image are weakened to obtain low-frequency components, which is beneficial to obtain global information of the to-be-processed image.

然后,使用滤波器模板对下采样图像IB进行平滑处理,得到参考图像I~。Then, the down-sampled image IB is smoothed using the filter template to obtain the reference image I~.

滤波器模板可以为近似高斯滤波器模板、双边滤波模板或者导向滤波模板。 当采用近似高斯滤波器模板时,可以选择3*3或者5*5矩阵。示例性的选择3*3 的近似高斯滤波器模板时,参考图像的生成公式如下:The filter template can be an approximate Gaussian filter template, a bilateral filter template, or a guided filter template. When using an approximate Gaussian filter template, you can choose a 3*3 or 5*5 matrix. When exemplarily selecting a 3*3 approximate Gaussian filter template, the generation formula of the reference image is as follows:

Figure BDA0002916362090000051
Figure BDA0002916362090000051

第二种:根据可学习参数和待处理图像,得到参考图像,其中得到参考图 像的公式为:The second: obtain a reference image according to the learnable parameters and the image to be processed, and the formula for obtaining the reference image is:

Figure BDA0002916362090000052
Figure BDA0002916362090000052

其中,F(q)代表邻域Ωp上的神经网络的可学习参数。where F(q) represents the learnable parameters of the neural network on the neighborhood Ω p .

在一个实施例中,待处理图像输入到神经网络,生成参考图像,其中神经 网络的可学习参数为F(q),待处理图像通过神经网络将原图上的一个邻域Ωp映 射为参考图像上的一个像素点,从而生成参考图像。In one embodiment, the image to be processed is input into a neural network to generate a reference image, where the learnable parameter of the neural network is F(q), and the image to be processed maps a neighborhood Ω p on the original image as a reference through the neural network A pixel on the image to generate a reference image.

Ωp代表待处理图像上的一个邻域,邻域大小一般为2*2或者3*3,邻域可 包含多个像素点,q代表待处理图像上的一个邻域Ωp内的一个像素点,p代表 参考图像中对应于邻域的像素点,即邻域对应于参考图像上的像素点p,F(q) 代表邻域Ωp上的神经网络的可学习参数。Ω p represents a neighborhood on the image to be processed, the size of the neighborhood is generally 2*2 or 3*3, the neighborhood can contain multiple pixels, and q represents a pixel in a neighborhood Ω p on the image to be processed point, p represents the pixel point in the reference image corresponding to the neighborhood, that is, the neighborhood corresponds to the pixel point p on the reference image, and F(q) represents the learnable parameter of the neural network on the neighborhood Ω p .

根据可学习参数和待处理图像,得到参考图像之前,还包括对神经网络进 行训练,得到神经网络的可学习参数和/或可训练参数,主要包括两个阶段:According to the learnable parameters and the image to be processed, before obtaining the reference image, it also includes training the neural network to obtain the learnable parameters and/or trainable parameters of the neural network, which mainly includes two stages:

前向传播阶段:数据由低层次向高层次传播的阶段,即前向传播阶段。Forward propagation stage: The stage in which data is propagated from low-level to high-level, that is, the forward propagation stage.

反向传播阶段:当前向传播得出的结果与预期不相符时,再将误差从高层 次向低层次进行传播训练,即反向传播阶段。具体训练过程为:Backpropagation stage: When the results obtained by forward propagation are inconsistent with expectations, the error is propagated from high-level to low-level for training, that is, the backpropagation stage. The specific training process is:

第一步:神经网络进行权值的初始化。F(q)的参数全部初始化为0,α,λ初 始化为1,然后在所有参数上都加上一个零均值的高斯扰动,以打破对称性。The first step: the neural network initializes the weights. The parameters of F(q) are all initialized to 0, α and λ are initialized to 1, and then a zero-mean Gaussian perturbation is added to all parameters to break the symmetry.

第二步:输入数据经过卷积层、池化层、全连接层的向前传播得到输出值。 输入数据包括待处理图像,以及任意图像,特征图。Step 2: The input data is forwarded through the convolutional layer, the pooling layer, and the fully connected layer to obtain the output value. The input data includes images to be processed, as well as arbitrary images and feature maps.

第三步:求出神经网络的输出值与目标值之间的误差,其中目标值是人为 自己根据需要设定。Step 3: Find the error between the output value of the neural network and the target value, where the target value is set by people according to their needs.

第四步:当误差大于我们的期望值时,将误差传回网络中,从高层次向低 层次进行传播训练,即反向传播阶段依次求得全连接层,池化层,卷积层的误 差。各层的误差可以理解为对于神经网络的总误差应承担多少。当误差小于或 等于我们的期望值时,根据误差更新权值,结束训练。Step 4: When the error is greater than our expected value, the error is transmitted back to the network, and the training is propagated from the high level to the low level, that is, the error of the fully connected layer, the pooling layer, and the convolutional layer is obtained in turn in the backpropagation stage. . The error of each layer can be understood as how much it should bear for the total error of the neural network. When the error is less than or equal to our expected value, the weights are updated according to the error and the training ends.

步骤S103:根据参考图像对待处理图像的像素点赋予对应的权重。Step S103: Assign corresponding weights to the pixels of the image to be processed according to the reference image.

对待处理图像上的邻域Ωp内不同位置的像素点q赋予不同的权重ωα,λ[p,q], 像素点q的像素值与像素点p的像素值差值越大,像素点q所对应的权重越大, 像素点q的像素值与像素点p的像素值差值越大,像素点q所对应的权重越大, 即

Figure BDA0002916362090000061
与权重成正比,
Figure BDA0002916362090000062
的差值越大权重越大。其中,q代表待 处理图像上的一个邻域Ωp内的一个像素点,p代表参考图像中对应于邻域的像 素点,ωα,λ[p,q]代表像素点q的权重。Different weights ω α, λ [p, q] are assigned to the pixel points q at different positions in the neighborhood Ω p on the image to be processed, and the greater the difference between the pixel value of the pixel point q and the pixel value of the pixel point p, the greater the The greater the weight corresponding to q, the greater the difference between the pixel value of the pixel point q and the pixel value of the pixel point p, and the greater the weight corresponding to the pixel point q, that is,
Figure BDA0002916362090000061
proportional to the weight,
Figure BDA0002916362090000062
The greater the difference, the greater the weight. Among them, q represents a pixel point in a neighborhood Ω p on the image to be processed, p represents the pixel point corresponding to the neighborhood in the reference image, and ω α,λ [p, q] represents the weight of the pixel point q.

示例性的,权重的公式如下:Exemplarily, the formula for the weight is as follows:

Figure BDA0002916362090000063
Figure BDA0002916362090000063

该公式中,I[q]代表待处理图像中像素点q的像素值,

Figure BDA0002916362090000064
为参考图像中 像素点P的像素值,ε为固定常数,α和λ为神经网络的可训练参数,n为自然 数,ε是一个很小的固定常数,具体数值可根据实际情况确定,α,λ都是可训练 参数,在神经网络训练过程中自适应的调整。通过优化logα和logλ来保证α和λ 都是正数。In this formula, I[q] represents the pixel value of the pixel q in the image to be processed,
Figure BDA0002916362090000064
is the pixel value of the pixel point P in the reference image, ε is a fixed constant, α and λ are the trainable parameters of the neural network, n is a natural number, ε is a small fixed constant, the specific value can be determined according to the actual situation, α, λ are all trainable parameters, which are adaptively adjusted during the neural network training process. Ensure that both α and λ are positive numbers by optimizing logα and logλ.

步骤S104:根据权重,对待处理图像和参考图像进行第二池化处理,得到 目标图像,目标图像为待处理图像的池化图像。Step S104: Perform a second pooling process on the image to be processed and the reference image according to the weight to obtain a target image, where the target image is a pooled image of the image to be processed.

本申请实施例通过根据步骤S103对待处理图像的不同位置像素点赋予的 权重,将待处理图像和参考图像进行第二池化处理,来获取最终目标图像。例 如通过对待处理图像的不同位置像素点q根据像素值赋予权重ωα,λ[p,q],根据 权重ωα,λ[p,q]将待处理图像和参考图像进行第二池化处理,来获取最终目标图 像的输出O(I)[p],其中,O(I)[p]代表目标图像中对应于P像素点位置的像素点 的像素值。像素点q的像素值与像素点p的像素值差值越大,像素点q所对应 的权重越大,即

Figure BDA0002916362090000071
与权重成正比,
Figure BDA0002916362090000072
的差值越大权重越大。像 素值差值越大,图像细节区域的颜色越丰富,本申请实施例通过对细节区域赋 予较大的权重,故图像细节区域对最后输出的目标图像的影响和贡献更大,从 而保留更多的图像细节,更符合人类视觉的主观感受。In this embodiment of the present application, the final target image is obtained by performing a second pooling process on the to-be-processed image and the reference image according to the weights assigned to the pixels at different positions of the to-be-processed image in step S103. For example, by assigning weights ω α, λ [p, q] to the pixel points q at different positions of the image to be processed according to the pixel values, and according to the weights ω α, λ [p, q], the image to be processed and the reference image are subjected to the second pooling process , to obtain the output O(I)[p] of the final target image, where O(I)[p] represents the pixel value of the pixel corresponding to the P pixel position in the target image. The greater the difference between the pixel value of the pixel point q and the pixel value of the pixel point p, the greater the weight corresponding to the pixel point q, that is
Figure BDA0002916362090000071
proportional to the weight,
Figure BDA0002916362090000072
The greater the difference, the greater the weight. The larger the pixel value difference is, the richer the color of the image detail area. By assigning a larger weight to the detail area in this embodiment of the present application, the image detail area has a greater impact and contribution to the final output target image, thereby retaining more The image details are more in line with the subjective perception of human vision.

在一个实施例中,进一步的根据权重确定池化处理公式;根据池化处理公 式,对待处理图像和参考图像进行第二池化处理,得到目标图像。例如对参考 图像和待处理图像输入到神经网络,通过保留细节的池化滤波器(detail preserve pooling filter)进行第二池化处理,得到目标图像。In one embodiment, the pooling processing formula is further determined according to the weight; according to the pooling processing formula, the second pooling processing is performed on the image to be processed and the reference image to obtain the target image. For example, the reference image and the image to be processed are input into the neural network, and the second pooling process is performed through a detail preserve pooling filter to obtain the target image.

其中,可选的,池化处理公式为:Among them, optional, the pooling processing formula is:

Figure BDA0002916362090000073
Figure BDA0002916362090000073

进一步的,本申请实施例通过保留细节的第二池化滤波,进一步保留更多 的图像细节,更符合人类视觉的主观感受,同时也更加有利于进行下一步的图 像处理,例如图像分割、图像分类、图像差分或者图像压缩等。Further, the embodiment of the present application further retains more image details through the second pooling filtering that retains details, which is more in line with the subjective perception of human vision, and is also more conducive to the next image processing, such as image segmentation, image Classification, image difference or image compression, etc.

虽然噪声也因此会被过度增强,但可训练参数α,λ的存在正好限制了噪声 的过渡增强。Although the noise will be over-enhanced, the existence of the trainable parameters α, λ just limits the over-enhancement of the noise.

需要说明的是,本领域技术人员在本发明揭露的技术范围内,可容易想到 的其他排序方案也应在本发明的保护范围之内,在此不一一赘述。It should be noted that those skilled in the art are within the technical scope disclosed by the present invention, and other sorting schemes that can be easily thought of should also be within the protection scope of the present invention, and will not be repeated here.

参见图2,是本申请实施例提供的一种图像池化装置示意图,为了便于说 明,仅示出了与本发明实施例相关的部分,包括:Referring to Fig. 2, it is a schematic diagram of an image pooling apparatus provided by an embodiment of the present application. For the convenience of description, only the part relevant to the embodiment of the present invention is shown, including:

获取模块21,用于获取待处理图像;an acquisition module 21, used for acquiring the image to be processed;

第一池化模块22,用于对待处理图像进行第一池化处理,得到参考图像;The first pooling module 22 is configured to perform a first pooling process on the image to be processed to obtain a reference image;

权重模块23,用于根据参考图像对待处理图像的像素点赋予对应的权重;The weight module 23 is used to assign corresponding weights to the pixels of the image to be processed according to the reference image;

第二池化模块24,用于根据权重,对待处理图像和参考图像进行第二池化 处理,得到目标图像,目标图像为待处理图像的池化图像。The second pooling module 24 is configured to perform a second pooling process on the image to be processed and the reference image according to the weight to obtain a target image, where the target image is a pooled image of the image to be processed.

权重模块23还用于对待处理图像上的邻域Ωp内不同位置的像素点q赋予 不同的权重,像素点q的像素值与像素点p的像素值差值越大,像素点q所对 应的权重越大,其中,q代表待处理图像上的一个邻域Ωp内的一个像素点,p 代表参考图像中对应于邻域的像素点。The weight module 23 is also used to assign different weights to the pixel points q at different positions in the neighborhood Ω p on the image to be processed. The greater the weight of , where q represents a pixel in a neighborhood Ω p on the image to be processed, and p represents a pixel in the reference image corresponding to the neighborhood.

可选的,权重的公式为:

Figure BDA0002916362090000081
Optionally, the formula for the weight is:
Figure BDA0002916362090000081

其中,q代表待处理图像上的一个邻域Ωp内的一个像素点,p代表参考图 像中对应于邻域的像素点,ωα,λ[p,q]代表像素点q的权重,I[q]代表待处理图 像中像素点q的像素值,

Figure BDA0002916362090000082
为参考图像中像素点P的像素值,ε为固定常数, α和λ为神经网络的可训练参数,n为自然数。Among them, q represents a pixel point in a neighborhood Ω p on the image to be processed, p represents the pixel point corresponding to the neighborhood in the reference image, ω α,λ [p, q] represents the weight of the pixel point q, I [q] represents the pixel value of the pixel point q in the image to be processed,
Figure BDA0002916362090000082
is the pixel value of the pixel point P in the reference image, ε is a fixed constant, α and λ are the trainable parameters of the neural network, and n is a natural number.

第一池化模块22还用于根据可学习参数和待处理图像,得到参考图像,其 中得到参考图像的公式为:The first pooling module 22 is also used to obtain a reference image according to the learnable parameter and the image to be processed, wherein the formula for obtaining the reference image is:

Figure BDA0002916362090000083
Figure BDA0002916362090000083

其中,F(q)代表邻域Ωp上的神经网络的可学习参数。where F(q) represents the learnable parameters of the neural network on the neighborhood Ω p .

第二池化模块24还用于根据权重确定池化处理公式;根据池化处理公式, 对待处理图像和参考图像进行第二池化处理,得到目标图像;The second pooling module 24 is further configured to determine the pooling processing formula according to the weight; according to the pooling processing formula, the second pooling processing is performed on the image to be processed and the reference image to obtain the target image;

其中,可选的,池化处理公式为:Among them, optional, the pooling processing formula is:

Figure BDA0002916362090000084
Figure BDA0002916362090000084

其中,O(I)[p]代表目标图像中对应于P像素点位置的像素点的像素值。Among them, O(I)[p] represents the pixel value of the pixel point corresponding to the P pixel point in the target image.

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上 述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能 分配由不同的功能单元、模块完成,即将移动终端的内部结构划分成不同的功 能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能模块 可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或 两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现, 也可以采用软件功能单元的形式实现。另外,各功能模块的具体名称也只是为 了便于相互区分,并不用于限制本申请的保护范围。上述移动终端中模块的具 体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated by different functional units and modules as required. , that is, dividing the internal structure of the mobile terminal into different functional units or modules to complete all or part of the functions described above. Each functional module in the embodiment may be integrated in one processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit, and the above-mentioned integrated units may be implemented in the form of hardware. , and can also be implemented in the form of software functional units. In addition, the specific names of each functional module are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present application. For the specific working process of the module in the above-mentioned mobile terminal, reference may be made to the corresponding process in the foregoing method embodiments, which will not be repeated here.

图3是本申请实施例提供的终端设备的示意图。如图3所示,该实施例的 终端设备3包括:处理器30、存储器31以及存储在存储器31中并可在处理器 30上运行的计算机程序32。处理器30执行计算机程序32时实现上述图像池化 方法的步骤,例如图1所示的步骤101至104。或者,处理器30执行计算机程 序32时实现上述各装置实施例中各模块/单元的功能,例如图3所示模块21 至24的功能。FIG. 3 is a schematic diagram of a terminal device provided by an embodiment of the present application. As shown in FIG. 3 , the terminal device 3 of this embodiment includes a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30. When the processor 30 executes the computer program 32, the steps of the above-mentioned image pooling method are realized, such as steps 101 to 104 shown in FIG. 1 . Alternatively, when the processor 30 executes the computer program 32, the functions of the modules/units in the above-mentioned various apparatus embodiments are realized, for example, the functions of the modules 21 to 24 shown in FIG. 3 .

示例性的,计算机程序32可以被分割成一个或多个模块/单元,一个或者 多个模块/单元被存储在存储器31中,并由处理器30执行,以完成本发明。一 个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指 令段用于描述计算机程序32在终端设备3中的执行过程。Exemplarily, the computer program 32 may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 31 and executed by the processor 30 to accomplish the present invention. One or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 32 in the terminal device 3.

终端设备3可以是桌上型计算机、笔记本、掌上电脑等计算设备。终端设 备可包括,但不仅限于,处理器30、存储器31。本领域技术人员可以理解,图 3仅仅是终端设备3的示例,并不构成对终端设备3的限定,可以包括比图示 更多或更少的部件,或者组合某些部件,或者不同的部件,例如终端设备还可 以包括输入输出设备、网络接入设备、总线等。The terminal device 3 may be a computing device such as a desktop computer, a notebook, and a palmtop computer. The terminal device may include, but is not limited to, the processor 30 and the memory 31. Those skilled in the art can understand that FIG. 3 is only an example of the terminal device 3 , and does not constitute a limitation on the terminal device 3 , and may include more or less components than shown, or combine some components, or different components For example, the terminal device may also include an input and output device, a network access device, a bus, and the like.

所称处理器30可以是中央处理单元(Central Processing Unit,CPU),还 可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、 专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可 编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器 件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理 器或者该处理器也可以是任何常规的处理器等。The so-called processor 30 may be a central processing unit (Central Processing Unit, CPU), and may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.

存储器31可以是终端设备3的内部存储单元,例如终端设备3的硬盘或内 存。存储器31也可以是终端设备3的外部存储设备,例如终端设备3上配备的 插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。进一步地,存储器31还可以既包括终端设 备3的内部存储单元也包括外部存储设备。存储器31用于存储计算机程序以及 终端设备所需的其他程序和数据。存储器31还可以用于暂时地存储已经输出或 者将要输出的数据。The memory 31 may be an internal storage unit of the terminal device 3, such as a hard disk or a memory of the terminal device 3. The memory 31 can also be an external storage device of the terminal device 3, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash memory card (Flash card) equipped on the terminal device 3. Card), etc. Further, the memory 31 may also include both an internal storage unit of the terminal device 3 and an external storage device. The memory 31 is used to store computer programs and other programs and data required by the terminal device. The memory 31 can also be used to temporarily store data that has been output or is to be output.

本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质存 储有计算机程序,计算机程序被处理器执行时实现可实现上述各个方法实施例 中的步骤。Embodiments of the present application further provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented.

本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端 上运行时,使得移动终端执行时实现可实现上述各个方法实施例中的步骤。The embodiments of the present application provide a computer program product, when the computer program product runs on a mobile terminal, so that the steps in the foregoing method embodiments can be implemented when the mobile terminal executes.

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上 述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上 述功能分配由不同的功能单元、模块完成,即将装置的内部结构划分成不同的 功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单 元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可 以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的 形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的 具体名称也只是为了便于相互区分,并不用于限制本发明的保护范围。上述系 统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在 此不再赘述。Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. Module completion means dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated in one processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit, and the above-mentioned integrated units may adopt hardware. It can also be realized in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present invention. For the specific working processes of the units and modules in the above system, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described herein again.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详 述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示 例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来 实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用 和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现 所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the present invention.

在本发明所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法, 可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示 意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可 以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系 统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦 合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯 连接,可以是电性,机械或其它的形式。In the embodiments provided by the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other manners. For example, the apparatus/terminal device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components. May be combined or may be integrated into another system, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, which may be electrical, mechanical or other forms.

作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元 显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可 以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元 来实现本实施例方案的目的。Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元 中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的 形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, and can also be implemented in the form of software functional units.

集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售 或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发 明实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相 关的硬件来完成,的计算机程序可存储于一计算机可读存储介质中,该计算机 程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,计算机程 序包括计算机程序代码,计算机程序代码可以为源代码形式、对象代码形式、 可执行文件或某些中间形式等。计算机可读介质可以包括:能够携带计算机程 序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机 存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random AccessMemory)、电载波信号、电信信号以及软件分发介质等。需要说明的是, 计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行 适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质 不包括是电载波信号和电信信号。The integrated module/unit, if implemented as a software functional unit and sold or used as a stand-alone product, may be stored on a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the methods of the above embodiments, and can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program is in When executed by the processor, the steps of the foregoing method embodiments can be implemented. The computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access Memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to the legislation and patent practice, the computer-readable medium does not include It is an electrical carrier signal and a telecommunication signal.

以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述 实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然 可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进 行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各 实施例技术方案的精神和范围,均应包含在本发明的保护范围之内。The above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The recorded technical solutions are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the present invention. within the scope of protection.

Claims (14)

1.一种图像池化方法,其特征在于,包括:1. an image pooling method, is characterized in that, comprises: 获取待处理图像;Get the image to be processed; 对所述待处理图像进行第一池化处理,得到参考图像;performing a first pooling process on the to-be-processed image to obtain a reference image; 根据所述参考图像对所述待处理图像的像素点赋予对应的权重;Assign corresponding weights to the pixels of the to-be-processed image according to the reference image; 根据所述权重,对所述待处理图像和所述参考图像进行第二池化处理,得到目标图像。According to the weight, a second pooling process is performed on the to-be-processed image and the reference image to obtain a target image. 2.如权利要求1所述的方法,其特征在于,所述根据所述参考图像对所述待处理图像的像素点赋予对应的权重,包括:2. The method according to claim 1, wherein, according to the reference image, assigning corresponding weights to the pixels of the to-be-processed image, comprising: 对所述待处理图像上的邻域Ωp内不同位置的像素点q赋予不同的权重,所述像素点q的像素值与像素点p的像素值差值越大,像素点q所对应的权重越大,其中,q代表所述待处理图像上的一个邻域Ωp内的一个像素点,p代表所述参考图像中对应于所述邻域的像素点。Different weights are given to the pixel points q at different positions in the neighborhood Ω p on the image to be processed, and the greater the difference between the pixel value of the pixel point q and the pixel value of the pixel point p, the greater the The larger the weight is, where q represents a pixel point in a neighborhood Ω p on the image to be processed, and p represents a pixel point in the reference image corresponding to the neighborhood. 3.如权利要求1所述的方法,其特征在于,所述根据所述参考图像对所述待处理图像的像素点赋予对应的权重,包括:3. The method according to claim 1, wherein, according to the reference image, assigning corresponding weights to the pixels of the to-be-processed image, comprising:
Figure FDA0002916362080000011
Figure FDA0002916362080000011
其中,q代表所述待处理图像上的一个邻域Ωp内的一个像素点,p代表所述参考图像中对应于所述邻域的像素点,ωα,λ[p,q]代表像素点q的权重,I[q]代表所述待处理图像中像素点q的像素值,I~[p]为所述参考图像中像素点P的像素值,ε为固定常数,α和λ为神经网络的可训练参数,n为自然数。Wherein, q represents a pixel in a neighborhood Ω p on the image to be processed, p represents a pixel in the reference image corresponding to the neighborhood, ω α,λ [p,q] represents a pixel The weight of point q, I[q] represents the pixel value of the pixel point q in the image to be processed, I~[p] is the pixel value of the pixel point P in the reference image, ε is a fixed constant, α and λ are Trainable parameters of the neural network, n is a natural number.
4.如权利要求1所述的方法,其特征在于,根据所述权重,对所述待处理图像和所述参考图像进行第二池化处理,得到目标图像,包括:4. The method according to claim 1, wherein, according to the weight, performing a second pooling process on the to-be-processed image and the reference image to obtain a target image, comprising: 根据所述权重确定池化处理公式;Determine the pooling processing formula according to the weight; 根据所述池化处理公式,对所述待处理图像和所述参考图像进行第二池化处理,得到目标图像;According to the pooling processing formula, a second pooling process is performed on the to-be-processed image and the reference image to obtain a target image; 其中,所述池化处理公式为:Wherein, the pooling processing formula is:
Figure FDA0002916362080000021
Figure FDA0002916362080000021
其中,O(I)[p]代表所述目标图像中对应于P像素点位置的像素点的像素值,q代表所述待处理图像上的一个邻域Ωp内的一个像素点,p代表所述参考图像中对应于所述邻域的像素点,ωα,λ[p,q]代表像素点q的权重,I[q]代表所述待处理图像中像素点q的像素值。Among them, O(I)[p] represents the pixel value of the pixel point corresponding to the P pixel point in the target image, q represents a pixel point in a neighborhood Ω p on the to-be-processed image, and p represents For the pixels in the reference image corresponding to the neighborhood, ω α,λ [p,q] represents the weight of the pixel q, and I[q] represents the pixel value of the pixel q in the image to be processed.
5.如权利要求1所述的方法,其特征在于,对待处理图像进行第一池化处理,得到参考图像包括:5. The method according to claim 1, wherein performing a first pooling process on the image to be processed to obtain a reference image comprises: 根据可学习参数和所述待处理图像,得到参考图像,其中得到参考图像的公式为:According to the learnable parameters and the to-be-processed image, a reference image is obtained, wherein the formula for obtaining the reference image is:
Figure FDA0002916362080000022
Figure FDA0002916362080000022
其中,
Figure FDA0002916362080000023
为所述参考图像中像素点P的像素值,p代表所述参考图像中对应于所述邻域的像素点,F(q)代表邻域Ωp上的神经网络的可学习参数,q代表所述待处理图像上的一个邻域Ωp内的一个像素点,I[q]代表所述待处理图像中像素点q的像素值。
in,
Figure FDA0002916362080000023
is the pixel value of the pixel point P in the reference image, p represents the pixel point in the reference image corresponding to the neighborhood, F(q) represents the learnable parameter of the neural network on the neighborhood Ω p , q represents A pixel point in a neighborhood Ω p on the image to be processed, I[q] represents the pixel value of the pixel point q in the image to be processed.
6.如权利要求5所述的方法,其特征在于,根据可学习参数和所述待处理图像,得到参考图像之前,还包括:6. The method according to claim 5, wherein, before obtaining the reference image according to the learnable parameter and the to-be-processed image, the method further comprises: 对所述神经网络进行训练,得到所述神经网络的可学习参数和/或所述可训练参数。The neural network is trained to obtain learnable parameters of the neural network and/or the trainable parameters. 7.如权利要求1所述的方法,其特征在于,对所述待处理图像进行第一池化处理,得到参考图像包括:7. The method of claim 1, wherein performing a first pooling process on the to-be-processed image to obtain a reference image comprises: 将所述待处理图像进行下采样,得到下采样图像;down-sampling the to-be-processed image to obtain a down-sampled image; 使用滤波器模板对所述下采样图像进行平滑处理,得到参考图像。The downsampled image is smoothed using a filter template to obtain a reference image. 8.一种图像池化装置,其特征在于,包括:8. An image pooling device, comprising: 获取模块,用于获取待处理图像;The acquisition module is used to acquire the image to be processed; 第一池化模块,用于对所述待处理图像进行第一池化处理,得到参考图像;a first pooling module, configured to perform a first pooling process on the to-be-processed image to obtain a reference image; 权重模块,用于根据所述参考图像对所述待处理图像的像素点赋予对应的权重;a weighting module, configured to assign corresponding weights to the pixels of the to-be-processed image according to the reference image; 第二池化模块,用于根据所述权重,对所述待处理图像和所述参考图像进行第二池化处理,得到目标图像。A second pooling module, configured to perform a second pooling process on the to-be-processed image and the reference image according to the weight to obtain a target image. 9.如权利要求8所述的装置,其特征在于,所述权重模块还用于对所述待处理图像上的邻域Ωp内不同位置的像素点q赋予不同的权重,所述像素点q的像素值与像素点p的像素值差值越大,像素点q所对应的权重越大,其中,q代表所述待处理图像上的一个邻域Ωp内的一个像素点,p代表所述参考图像中对应于所述邻域的像素点。9. The apparatus according to claim 8, wherein the weighting module is further configured to assign different weights to pixel points q at different positions in the neighborhood Ωp on the image to be processed, and the pixel points The greater the difference between the pixel value of q and the pixel value of pixel p, the greater the weight corresponding to pixel q, where q represents a pixel in a neighborhood Ω p on the image to be processed, and p represents pixels in the reference image corresponding to the neighborhood. 10.如权利要求8所述的装置,其特征在于,所述权重模块还用于根据所述参考图像对所述待处理图像的像素点赋予对应的权重,其中:10. The apparatus according to claim 8, wherein the weighting module is further configured to assign corresponding weights to the pixels of the to-be-processed image according to the reference image, wherein:
Figure FDA0002916362080000031
Figure FDA0002916362080000031
其中,q代表所述待处理图像上的一个邻域Ωp内的一个像素点,p代表所述参考图像中对应于所述邻域的像素点,ωα,λ[p,q]代表像素点q的权重,I[q]代表所述待处理图像中像素点q的像素值,
Figure FDA0002916362080000032
为所述参考图像中像素点P的像素值,ε为固定常数,α和λ为神经网络的可训练参数,n为自然数。
Wherein, q represents a pixel in a neighborhood Ω p on the image to be processed, p represents a pixel in the reference image corresponding to the neighborhood, ω α,λ [p,q] represents a pixel The weight of the point q, I[q] represents the pixel value of the pixel point q in the image to be processed,
Figure FDA0002916362080000032
is the pixel value of the pixel point P in the reference image, ε is a fixed constant, α and λ are the trainable parameters of the neural network, and n is a natural number.
11.如权利要求8所述的装置,其特征在于,所述第一池化模块还用于根据可学习参数和所述待处理图像,得到参考图像,其中得到参考图像的公式为:11. The apparatus of claim 8, wherein the first pooling module is further configured to obtain a reference image according to the learnable parameter and the to-be-processed image, wherein the formula for obtaining the reference image is:
Figure FDA0002916362080000033
Figure FDA0002916362080000033
其中,
Figure FDA0002916362080000034
为所述参考图像中像素点P的像素值,p代表所述参考图像中对应于所述邻域的像素点,F(q)代表邻域Ωp上的神经网络的可学习参数,q代表所述待处理图像上的一个邻域Ωp内的一个像素点,I[q]代表所述待处理图像中像素点q的像素值。
in,
Figure FDA0002916362080000034
is the pixel value of the pixel point P in the reference image, p represents the pixel point in the reference image corresponding to the neighborhood, F(q) represents the learnable parameter of the neural network on the neighborhood Ω p , q represents A pixel point in a neighborhood Ω p on the image to be processed, I[q] represents the pixel value of the pixel point q in the image to be processed.
12.如权利要求8所述的装置,其特征在于,所述第二池化模块还用于根据所述权重确定池化处理公式;根据所述池化处理公式,对所述待处理图像和所述参考图像进行第二池化处理,得到目标图像;12. The apparatus according to claim 8, wherein the second pooling module is further configured to determine a pooling processing formula according to the weight; The reference image is subjected to a second pooling process to obtain a target image; 其中,所述池化处理公式为:Wherein, the pooling processing formula is:
Figure FDA0002916362080000041
Figure FDA0002916362080000041
其中,O(I)[p]代表所述目标图像中对应于P像素点位置的像素点的像素值,q代表所述待处理图像上的一个邻域Ωp内的一个像素点,p代表所述参考图像中对应于所述邻域的像素点,ωα,λ[p,q]代表像素点q的权重,I[q]代表所述待处理图像中像素点q的像素值。Among them, O(I)[p] represents the pixel value of the pixel point corresponding to the P pixel point in the target image, q represents a pixel point in a neighborhood Ω p on the to-be-processed image, and p represents For the pixels in the reference image corresponding to the neighborhood, ω α,λ [p,q] represents the weight of the pixel q, and I[q] represents the pixel value of the pixel q in the image to be processed.
13.一种终端设备,其特征在于,所述终端设备包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如权利要求1至7任一项所述的图像池化方法的步骤。13. A terminal device, characterized in that the terminal device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the computer program Steps for implementing an image pooling method as claimed in any one of claims 1 to 7. 14.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的图像池化方法的步骤。14. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the image pool according to any one of claims 1 to 7 is realized steps of the method.
CN202110103168.5A 2021-01-26 2021-01-26 Image pooling method, apparatus, terminal device and computer-readable storage medium Pending CN114792289A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110103168.5A CN114792289A (en) 2021-01-26 2021-01-26 Image pooling method, apparatus, terminal device and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110103168.5A CN114792289A (en) 2021-01-26 2021-01-26 Image pooling method, apparatus, terminal device and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN114792289A true CN114792289A (en) 2022-07-26

Family

ID=82460080

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110103168.5A Pending CN114792289A (en) 2021-01-26 2021-01-26 Image pooling method, apparatus, terminal device and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN114792289A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110033119A1 (en) * 2009-02-11 2011-02-10 Rezazadeh Soroosh Method and system for determining a quality measure for an image using a variable number of multi-level decompositions
CN111292251A (en) * 2019-03-14 2020-06-16 展讯通信(上海)有限公司 Image color cast correction method, device and computer storage medium
CN111783774A (en) * 2020-06-22 2020-10-16 联想(北京)有限公司 Image processing method, device and storage medium
CN112164076A (en) * 2020-09-24 2021-01-01 济南大学 Hardened cement water cement ratio prediction method and system based on cement microstructure image

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110033119A1 (en) * 2009-02-11 2011-02-10 Rezazadeh Soroosh Method and system for determining a quality measure for an image using a variable number of multi-level decompositions
CN111292251A (en) * 2019-03-14 2020-06-16 展讯通信(上海)有限公司 Image color cast correction method, device and computer storage medium
CN111783774A (en) * 2020-06-22 2020-10-16 联想(北京)有限公司 Image processing method, device and storage medium
CN112164076A (en) * 2020-09-24 2021-01-01 济南大学 Hardened cement water cement ratio prediction method and system based on cement microstructure image

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
QI WANG 等: "《Improving cross-dimensional weighting pooling with multi-scale feature fusion for image retrieval》", 《NEUROCOMPUTING》, 21 October 2019 (2019-10-21) *

Similar Documents

Publication Publication Date Title
CN110473141B (en) Image processing method, device, storage medium and electronic equipment
WO2022160980A1 (en) Super-resolution method and apparatus, terminal device, and storage medium
CN110660066A (en) Network training method, image processing method, network, terminal equipment and medium
WO2020233010A1 (en) Image recognition method and apparatus based on segmentable convolutional network, and computer device
CN111402170B (en) Image enhancement method, device, terminal and computer readable storage medium
TWI769725B (en) Image processing method, electronic device and computer readable storage medium
CN108447036A (en) A kind of low light image Enhancement Method based on convolutional neural networks
CN112614110B (en) Method and device for evaluating image quality and terminal equipment
CN111950723A (en) Neural network model training method, image processing method, device and terminal equipment
CN115115540B (en) Unsupervised low-light image enhancement method and device based on illumination information guidance
CN113033448A (en) Remote sensing image cloud-removing residual error neural network system, method and equipment based on multi-scale convolution and attention and storage medium
CN114359048A (en) Image data enhancement method, device, terminal device and storage medium
CN117474818A (en) Underwater image enhancement method and device based on non-parameter Bayesian depth of field estimation
CN118674664A (en) Image enhancement method, device and storage medium
CN111951171A (en) HDR image generation method, device, readable storage medium and terminal device
CN115170581A (en) Portrait segmentation model generation method, portrait segmentation model and portrait segmentation method
CN115049717B (en) A depth estimation method and device
CN111340722A (en) Image processing method, processing device, terminal device and readable storage medium
JP2024525151A (en) Image quality adjustment method, device, equipment, and medium
CN107844541A (en) Image duplicate checking method and device
CN113920023B (en) Image processing method and device, computer readable medium and electronic device
TW202240535A (en) Method and system for image processing
CN113240720A (en) Three-dimensional surface reconstruction method and device, server and readable storage medium
CN112949348B (en) Image processing method, device, electronic equipment and computer readable storage medium
CN114792289A (en) Image pooling method, apparatus, terminal device and computer-readable 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