[go: up one dir, main page]

CN111784734B - Image processing method and device, storage medium and electronic equipment - Google Patents

Image processing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN111784734B
CN111784734B CN202010694132.4A CN202010694132A CN111784734B CN 111784734 B CN111784734 B CN 111784734B CN 202010694132 A CN202010694132 A CN 202010694132A CN 111784734 B CN111784734 B CN 111784734B
Authority
CN
China
Prior art keywords
current
block
matching
blocks
image
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.)
Active
Application number
CN202010694132.4A
Other languages
Chinese (zh)
Other versions
CN111784734A (en
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202010694132.4A priority Critical patent/CN111784734B/en
Publication of CN111784734A publication Critical patent/CN111784734A/en
Application granted granted Critical
Publication of CN111784734B publication Critical patent/CN111784734B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/223Analysis of motion using block-matching
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4023Scaling of whole images or parts thereof, e.g. expanding or contracting based on decimating pixels or lines of pixels; based on inserting pixels or lines of pixels
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4053Scaling of whole images or parts thereof, e.g. expanding or contracting based on super-resolution, i.e. the output image resolution being higher than the sensor resolution
    • 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/20021Dividing image into blocks, subimages or windows
    • 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/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Television Systems (AREA)
  • Image Processing (AREA)

Abstract

本公开提供一种图像处理方法、图像处理装置、存储介质和电子设备,涉及图像处理技术领域。该图像处理方法包括:确定输出图像中包含的当前待插值像素在输入图像中的相邻像素的位置,通过所述相邻像素的位置在所述输入图像中确定当前图像块,并在与当前帧对应的多个参考帧中确定与所述当前图像块对应的所有匹配块;根据所有匹配块中的目标匹配块以及当前图像块进行图像块融合得到多个融合块,并根据多个所述融合块确定所述当前图像块的目标方向;通过所述目标方向对所述当前图像块进行方向性插值,得到所述当前待插值像素的像素值。本公开实施例能够提高图像质量。

The present disclosure provides an image processing method, an image processing device, a storage medium and an electronic device, and relates to the field of image processing technology. The image processing method comprises: determining the position of the neighboring pixels of the current pixel to be interpolated contained in the output image in the input image, determining the current image block in the input image by the position of the neighboring pixels, and determining all matching blocks corresponding to the current image block in multiple reference frames corresponding to the current frame; performing image block fusion according to the target matching blocks in all matching blocks and the current image block to obtain multiple fusion blocks, and determining the target direction of the current image block according to the multiple fusion blocks; performing directional interpolation on the current image block according to the target direction to obtain the pixel value of the current pixel to be interpolated. The embodiments of the present disclosure can improve image quality.

Description

图像处理方法及装置、存储介质和电子设备Image processing method and device, storage medium and electronic device

技术领域Technical Field

本公开涉及图像处理技术领域,具体而言,涉及一种图像处理方法、图像处理装置、计算机可读存储介质和电子设备。The present disclosure relates to the field of image processing technology, and in particular to an image processing method, an image processing device, a computer-readable storage medium, and an electronic device.

背景技术Background technique

为了提高图像分辨率,可以实现低分辨率图像向高分辨率图像的转化。相关技术中在进行转化时,可能由于输入图像的局限性导致插值过程存在误差,使得输出的图像的质量较差。In order to improve the image resolution, the low-resolution image can be converted to a high-resolution image. In the related art, when performing the conversion, there may be errors in the interpolation process due to the limitations of the input image, resulting in poor quality of the output image.

发明内容Summary of the invention

本公开提供一种图像处理方法、图像处理装置、计算机可读存储介质和电子设备,进而至少在一定程度上克服图像质量差的问题。The present disclosure provides an image processing method, an image processing device, a computer-readable storage medium, and an electronic device, thereby overcoming the problem of poor image quality at least to a certain extent.

根据本公开的一个方面,提供了一种图像处理方法,包括:确定输出图像中包含的当前待插值像素在输入图像中的相邻像素的位置,通过所述相邻像素的位置在所述输入图像中确定当前图像块,并在与当前帧对应的多个参考帧中确定与所述当前图像块对应的所有匹配块;根据所有匹配块中的目标匹配块以及当前图像块进行图像块融合得到多个融合块,并根据多个所述融合块确定所述当前图像块的目标方向;通过所述目标方向对所述当前图像块进行方向性插值,得到所述当前待插值像素的像素值。According to one aspect of the present disclosure, an image processing method is provided, comprising: determining positions of neighboring pixels of a current pixel to be interpolated contained in an output image in an input image, determining a current image block in the input image according to the positions of the neighboring pixels, and determining all matching blocks corresponding to the current image block in multiple reference frames corresponding to the current frame; performing image block fusion according to target matching blocks in all matching blocks and the current image block to obtain multiple fused blocks, and determining a target direction of the current image block according to the multiple fused blocks; and performing directional interpolation on the current image block according to the target direction to obtain a pixel value of the current pixel to be interpolated.

根据本公开的一个方面,提供一种图像处理装置,包括:匹配块确定模块,用于确定输出图像中包含的当前待插值像素在输入图像中的相邻像素的位置,通过所述相邻像素的位置在所述输入图像中确定当前图像块,并在与当前帧对应的多个参考帧中确定与所述当前图像块对应的所有匹配块;方向确定模块,用于根据所有匹配块中的目标匹配块以及当前图像块进行图像块融合得到多个融合块,并根据多个所述融合块确定所述当前图像块的目标方向;图像插值模块,用于通过所述目标方向对所述当前图像块进行方向性插值,得到所述当前待插值像素的像素值。According to one aspect of the present disclosure, an image processing device is provided, comprising: a matching block determination module, used to determine the positions of adjacent pixels of a current pixel to be interpolated contained in an output image in an input image, determine the current image block in the input image through the positions of the adjacent pixels, and determine all matching blocks corresponding to the current image block in multiple reference frames corresponding to the current frame; a direction determination module, used to perform image block fusion according to target matching blocks in all matching blocks and the current image block to obtain multiple fused blocks, and determine a target direction of the current image block according to the multiple fused blocks; and an image interpolation module, used to perform directional interpolation on the current image block through the target direction to obtain a pixel value of the current pixel to be interpolated.

根据本公开的一个方面,提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上述任意一项所述的图像处理方法。According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the image processing method as described in any one of the above is implemented.

根据本公开的一个方面,提供一种电子设备,包括:处理器;以及存储器,用于存储所述处理器的可执行指令;其中,所述处理器配置为经由执行所述可执行指令来执行上述任意一项所述的图像处理方法。According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any one of the above-mentioned image processing methods by executing the executable instructions.

在本公开的一些实施例所提供的技术方案中,一方面,由于可以通过运动估计在多个参考帧中确定与当前帧中的当前图像块对应的所有匹配块,对目标匹配块和当前匹配块进行融合以得到当前图像块的目标方向,基于目标方向在当前图像块中进行方向性插值得到当前待插值像素的像素值,通过多帧运动估计以及方向性插值的结合来确定当前待插值像素的像素值。通过匹配策略,进行多帧同区域融合的方向性插值,可以避免相关技术中单帧方向性插值导致的方向误判等问题,避免了局限性,能够全面准确地基于纹理方向确定目标方向。另一方面,通过运动估计以及多帧同区域融合的方向性插值,能够准确地计算当前待插值像素的像素值,提高图像质量,提高图像超分的效果,并且降低了操作复杂度,增加了可操作性。In the technical solutions provided by some embodiments of the present disclosure, on the one hand, since all matching blocks corresponding to the current image block in the current frame can be determined in multiple reference frames through motion estimation, the target matching block and the current matching block are fused to obtain the target direction of the current image block, and the pixel value of the current pixel to be interpolated is obtained by directional interpolation in the current image block based on the target direction, and the pixel value of the current pixel to be interpolated is determined by combining multi-frame motion estimation and directional interpolation. Through the matching strategy, directional interpolation of multi-frame fusion in the same region is performed, which can avoid the problems such as direction misjudgment caused by single-frame directional interpolation in the related technology, avoid limitations, and can comprehensively and accurately determine the target direction based on the texture direction. On the other hand, through motion estimation and directional interpolation of multi-frame fusion in the same region, the pixel value of the current pixel to be interpolated can be accurately calculated, the image quality can be improved, the effect of image super-resolution can be improved, and the operation complexity can be reduced and the operability can be increased.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。在附图中:The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

图1示出了可以应用本公开实施例的图像处理方法或图像处理装置的示例性系统架构的示意图;FIG1 is a schematic diagram showing an exemplary system architecture to which an image processing method or an image processing device according to an embodiment of the present disclosure can be applied;

图2示出了适于用来实现本公开实施例的电子设备的结构示意图;FIG2 is a schematic diagram showing the structure of an electronic device suitable for implementing an embodiment of the present disclosure;

图3示意性示出了根据本公开示例性实施例的图像处理方法的流程图;FIG3 schematically shows a flow chart of an image processing method according to an exemplary embodiment of the present disclosure;

图4示出了本公开实施例中确定匹配块的流程示意图;FIG4 is a schematic diagram showing a process of determining a matching block in an embodiment of the present disclosure;

图5示出了本公开实施例中为当前图像块确定匹配块的示意图;FIG5 is a schematic diagram showing a method of determining a matching block for a current image block in an embodiment of the present disclosure;

图6示出了本公开实施例中确定目标方向的流程示意图;FIG6 is a schematic diagram showing a process of determining a target direction in an embodiment of the present disclosure;

图7示出了本公开实施例中进行方向性插值的流程示意图;FIG7 is a schematic diagram showing a process flow of performing directional interpolation in an embodiment of the present disclosure;

图8示意性示出了本公开示例性实施例中图像处理装置的方框图。FIG. 8 schematically shows a block diagram of an image processing apparatus in an exemplary embodiment of the present disclosure.

具体实施方式Detailed ways

现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。在下面的描述中,提供许多具体细节从而给出对本公开的实施方式的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而省略所述特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知技术方案以避免喧宾夺主而使得本公开的各方面变得模糊。Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

此外,附图仅为本公开的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and/or processor devices and/or microcontroller devices.

附图中所示的流程图仅是示例性说明,不是必须包括所有的步骤。例如,有的步骤还可以分解,而有的步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。另外,下面所有的术语“第一”、“第二”仅是为了区分的目的,不应作为本公开内容的限制。The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to the actual situation. In addition, all the terms "first" and "second" below are only for the purpose of distinction and should not be used as limitations of the present disclosure.

为了解决相关技术中存在的技术问题,本公开实施例中提供了一种图像处理方法。图1示出了可以应用本公开实施例的图像处理方法或图像处理装置的示例性系统架构的示意图。In order to solve the technical problems existing in the related art, an image processing method is provided in an embodiment of the present disclosure. Fig. 1 is a schematic diagram showing an exemplary system architecture to which an image processing method or an image processing device in an embodiment of the present disclosure can be applied.

如图1所示,该系统架构100可以包括第一端101、网络102以及第二端103。其中,第一端101可以是客户端,例如可以为各种能够用于采集图像和展示图像(播放图像)的手持设备(智能手机)、平板电脑、台式计算机、车载设备、可穿戴设备等等。网络102用以在第一端101和第二端103之间提供通信链路的介质,网络102可以包括各种连接类型,例如有线通信链路、无线通信链路等等,在本公开实施例中,第一端101和第二端103之间的网络102可以是有线通信链路,例如可以通过串口连接线提供通信链路,也可以是无线通信链路,通过无线网络提供通信链路。第二端103可以是客户端,例如便携式计算机、台式计算机、智能手机等具有图像处理功能的终端设备,用于进行图像处理。其中,当第一端和第二端均为终端时,二者可以为同一个终端。第二端也可以为服务器,例如本地服务器或者是云服务器等等,此处不做限定。As shown in FIG1 , the system architecture 100 may include a first end 101, a network 102, and a second end 103. The first end 101 may be a client, for example, various handheld devices (smart phones), tablet computers, desktop computers, vehicle-mounted devices, wearable devices, etc. that can be used to collect images and display images (play images). The network 102 is used to provide a medium for a communication link between the first end 101 and the second end 103. The network 102 may include various connection types, such as a wired communication link, a wireless communication link, etc. In the embodiment of the present disclosure, the network 102 between the first end 101 and the second end 103 may be a wired communication link, for example, a communication link may be provided through a serial port connection line, or a wireless communication link, and a communication link may be provided through a wireless network. The second end 103 may be a client, such as a portable computer, a desktop computer, a smart phone, and other terminal devices with image processing functions, for image processing. When the first end and the second end are both terminals, they may be the same terminal. The second end may also be a server, such as a local server or a cloud server, etc., which is not limited here.

本公开实施例中,首先,第一端101可以采集图像或者是将待处理的图像作为输入图像,并将要展示的图像作为输出图像。接下来,第二端103可以将输出图像中的某一个待插值像素作为当前待插值像素,并确定其在输入图像中的相邻像素的位置。进一步地,可以基于相邻像素的位置在输入图像中进行分块并确定一个图像块作为当前图像块,并且可以在与当前图像块所在的当前帧对应的多个参考帧中通过运动估计的方式确定所有匹配块。再次,第二端可以对所有匹配块中的部分或者是全部进行相互融合,并对所有匹配块中的部分或者是全部与当前图像块进行融合得到多个融合块,以便于根据多个融合块来确定当前图像块的目标方向。最后,通过目标方向对当前图像块进行方向性插值,得到所述当前待插值像素的像素值,以完成整个插值操作,得到最终的图像。第二端还可以将最终的图像输出至第一端进行展示或播放。In the embodiment of the present disclosure, first, the first end 101 can capture an image or use the image to be processed as an input image, and use the image to be displayed as an output image. Next, the second end 103 can use a certain pixel to be interpolated in the output image as the current pixel to be interpolated, and determine the position of its adjacent pixels in the input image. Further, the input image can be divided into blocks based on the positions of adjacent pixels and an image block can be determined as the current image block, and all matching blocks can be determined by motion estimation in multiple reference frames corresponding to the current frame where the current image block is located. Thirdly, the second end can fuse part or all of all matching blocks with each other, and fuse part or all of all matching blocks with the current image block to obtain multiple fused blocks, so as to determine the target direction of the current image block according to the multiple fused blocks. Finally, the current image block is directional interpolated according to the target direction to obtain the pixel value of the current pixel to be interpolated, so as to complete the entire interpolation operation and obtain the final image. The second end can also output the final image to the first end for display or playback.

应该理解,图1中的第一端、网络和第二端的数目仅仅是示意性的。根据实现需要,可以具有任意数目的客户端、网络和服务器。It should be understood that the number of first terminals, networks and second terminals in Figure 1 is only for illustration purposes. Any number of clients, networks and servers may be provided as required.

需要说明的是,本公开实施例所提供的图像处理方法可以完全由第二端执行,也可以由第一端执行,此处不做特殊限定。相应地,图像处理装置可设置于第二端103中。It should be noted that the image processing method provided in the embodiment of the present disclosure can be completely executed by the second end or by the first end, and is not specifically limited here. Accordingly, the image processing device can be arranged in the second end 103 .

图2示出了适于用来实现本公开示例性实施方式的一种电子设备的示意图。需要说明的是,图2示出的电子设备仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Fig. 2 is a schematic diagram of an electronic device suitable for implementing the exemplary embodiment of the present disclosure. It should be noted that the electronic device shown in Fig. 2 is only an example and should not bring any limitation to the function and scope of use of the embodiment of the present disclosure.

本公开的电子设备至少包括处理器和存储器,存储器用于存储一个或多个程序,当一个或多个程序被处理器执行时,使得处理器可以实现本公开示例性实施方式的图像处理方法。The electronic device of the present disclosure includes at least a processor and a memory, wherein the memory is used to store one or more programs. When the one or more programs are executed by the processor, the processor can implement the image processing method of the exemplary embodiment of the present disclosure.

具体的,如图2所示,电子设备200可以包括:处理器210、内部存储器221、外部存储器接口222、通用串行总线(Universal Serial Bus,USB)接口230、充电管理模块240、电源管理模块241、电池242、天线1、天线2、移动通信模块250、无线通信模块260、传感器模块280、显示屏290、指示器292、马达293、按键294以及用户标识模块(SubscriberIdentification Module,SIM)卡接口295等。其中传感器模块280可以包括深度传感器、压力传感器、陀螺仪传感器、气压传感器、磁传感器、加速度传感器、距离传感器、接近光传感器、指纹传感器、温度传感器、触摸传感器、环境光传感器及骨传导传感器等。Specifically, as shown in FIG2 , the electronic device 200 may include: a processor 210, an internal memory 221, an external memory interface 222, a Universal Serial Bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, a sensor module 280, a display screen 290, an indicator 292, a motor 293, a button 294, and a Subscriber Identification Module (SIM) card interface 295, etc. The sensor module 280 may include a depth sensor, a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, and a bone conduction sensor, etc.

可以理解的是,本申请实施例示意的结构并不构成对电子设备200的具体限定。在本申请另一些实施例中,电子设备200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件、软件或软件和硬件的组合实现。It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 200. In other embodiments of the present application, the electronic device 200 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(Application Processor,AP)、调制解调处理器、图形处理器(Graphics ProcessingUnit,GPU)、图像信号处理器(Image Signal Processor,ISP)、控制器、视频编解码器、数字信号处理器(Digital Signal Processor,DSP)、基带处理器和/或神经网络处理器(Neural-etwork Processing Unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。另外,处理器210中还可以设置存储器,用于存储指令和数据。The processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor and/or a neural network processor (NPU). Different processing units may be independent devices or integrated into one or more processors. In addition, a memory may be provided in the processor 210 for storing instructions and data.

USB接口230是符合USB标准规范的接口,具体可以是MiniUSB接口,MicroUSB接口,USBTypeC接口等。USB接口230可以用于连接充电器为电子设备200充电,也可以用于电子设备200与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。The USB interface 230 is an interface that complies with the USB standard specification, and specifically can be a MiniUSB interface, a MicroUSB interface, a USB Type C interface, etc. The USB interface 230 can be used to connect a charger to charge the electronic device 200, and can also be used to transfer data between the electronic device 200 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

充电管理模块240用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。电源管理模块241用于连接电池242、充电管理模块240与处理器210。电源管理模块241接收电池242和/或充电管理模块240的输入,为处理器210、内部存储器221、显示屏290和无线通信模块260等供电。The charging management module 240 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. The power management module 241 is used to connect the battery 242, the charging management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and/or the charging management module 240 to power the processor 210, the internal memory 221, the display screen 290 and the wireless communication module 260.

电子设备200的无线通信功能可以通过天线1、天线2、移动通信模块250、无线通信模块260、调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 200 can be implemented through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor, the baseband processor, and the like.

移动通信模块250可以提供应用在电子设备200上的包括2G/3G/4G/5G等无线通信的解决方案。The mobile communication module 250 can provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the electronic device 200 .

无线通信模块260可以提供应用在电子设备200上的包括无线局域网(WirelessLocal Area Networks,WLAN)(如无线保真(Wireless Fidelity,Wi-Fi)网络)、蓝牙(Bluetooth,BT)、全球导航卫星系统(Global Navigation Satellite System,GNSS)、调频(Frequency Modulation,FM)、近距离无线通信技术(Near Field Communication,NFC)、红外技术(Infrared,IR)等无线通信的解决方案。The wireless communication module 260 can provide wireless communication solutions for application in the electronic device 200, including Wireless Local Area Networks (WLAN) (such as Wireless Fidelity (Wi-Fi) network), Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), infrared technology (IR), etc.

电子设备200通过GPU、显示屏290及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏290和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器210可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 200 implements the display function through a GPU, a display screen 290, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 290 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs, which execute program instructions to generate or change display information.

内部存储器221可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器221可以包括存储程序区和存储数据区。外部存储器接口222可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备200的存储能力。The internal memory 221 can be used to store computer executable program codes, which include instructions. The internal memory 221 can include a program storage area and a data storage area. The external memory interface 222 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200.

按键294包括开机键,音量键等。按键294可以是机械按键。也可以是触摸式按键。马达293可以产生振动提示。马达293可以用于来电振动提示,也可以用于触摸振动反馈。指示器292可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口295用于连接SIM卡。电子设备200通过SIM卡和网络交互,实现通话以及数据通信等功能。The button 294 includes a power button, a volume button, etc. The button 294 can be a mechanical button. It can also be a touch button. The motor 293 can generate a vibration prompt. The motor 293 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. The indicator 292 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 295 is used to connect the SIM card. The electronic device 200 interacts with the network through the SIM card to realize functions such as calls and data communications.

本申请还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施例中描述的电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device.

计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。Computer-readable storage media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or components, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination thereof. In the present disclosure, computer-readable storage media may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.

计算机可读存储介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读存储介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。Computer-readable storage media can send, propagate or transmit programs for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

计算机可读存储介质承载有一个或者多个程序,当上述一个或者多个程序被一个该电子设备执行时,使得该电子设备实现如下述实施例中所述的方法。The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiments.

附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现,所描述的单元也可以设置在处理器中。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定。The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not constitute limitations on the units themselves in some cases.

图3示意性示出了本公开的示例性实施方式的图像处理方法的流程图,该图像处理方法可以应用于例如拍摄图像、图像传输或者是图像处理的过程中,或者也可以应用于超分辨率重建场景中。本公开实施例中的方法应用于超分辨率重建场景为例进行说明。超分辨率重建场景中,可以恢复图像或视频在成像、传输等过程中丢失的纹理细节信息。参考图3所示,以终端作为执行主体,该图像处理方法可以包括步骤S310至步骤S330,详细介绍如下:FIG3 schematically shows a flowchart of an image processing method of an exemplary embodiment of the present disclosure, which can be applied, for example, in the process of capturing images, transmitting images, or processing images, or can also be applied to super-resolution reconstruction scenarios. The method in the embodiment of the present disclosure is applied to a super-resolution reconstruction scenario as an example for illustration. In a super-resolution reconstruction scenario, texture detail information lost in an image or video during imaging, transmission, etc. can be restored. Referring to FIG3 , with a terminal as the execution subject, the image processing method can include steps S310 to S330, which are described in detail as follows:

在步骤S310中,确定输出图像中包含的当前待插值像素在输入图像中的相邻像素的位置,通过所述相邻像素的位置在所述输入图像中确定当前图像块,并在与当前帧对应的多个参考帧中确定与所述当前图像块对应的所有匹配块。In step S310, positions of neighboring pixels of a current pixel to be interpolated contained in the output image in the input image are determined, a current image block is determined in the input image according to the positions of the neighboring pixels, and all matching blocks corresponding to the current image block are determined in multiple reference frames corresponding to the current frame.

本公开实施例中,输入图像可以为使用终端拍摄的图像、视频中的某一帧图像,也可以为从其他设备中获取得到的,例如从网上下载的图像或者是视频中的一帧图像。输出图像可以为与输入图像内容相同但是分辨率不同的图像,即可以对输入图像的分辨率进行缩放从而得到输出图像。输出图像的分辨率可以大于输入图像,也可以小于输入图像,具体可以根据使用场景的类型而确定。In the disclosed embodiments, the input image may be an image captured by a terminal, a frame of an image in a video, or may be obtained from other devices, such as an image downloaded from the Internet or a frame of an image in a video. The output image may be an image with the same content as the input image but a different resolution, that is, the resolution of the input image may be scaled to obtain the output image. The resolution of the output image may be greater than or less than the input image, which may be determined specifically according to the type of usage scenario.

在确定输入图像和输出图像之后,可以确定输出图像相对于输入图像的缩放程度,此处的缩放程度可以包括水平缩放程度和垂直缩放程度,且缩放程度具体可以用缩放倍数来表示。输出图像是对输入图像进行插帧得到的,因此输出图像中可能存在多个待插值像素。输出图像中存在的待插值像素的数量可以根据输出图像的分辨率来确定。具体地,当前待插值像素指的是输出图像中所有待插值像素中的任意一个,其在输出图像中的位置可以用(i,j)来表示。相邻像素指的是与当前待插值像素相邻的,且位于输入图像中的多个邻域像素中的一个相邻像素。此处的邻域像素可以为D邻域像素表示的四个相邻的像素,相邻像素指的是位于当前待插值像素的左上角的像素,其位置可以用(x,y)来表示。After determining the input image and the output image, the scaling degree of the output image relative to the input image can be determined. The scaling degree here may include the horizontal scaling degree and the vertical scaling degree, and the scaling degree can be specifically represented by a scaling multiple. The output image is obtained by interpolating the input image, so there may be multiple pixels to be interpolated in the output image. The number of pixels to be interpolated in the output image can be determined according to the resolution of the output image. Specifically, the current pixel to be interpolated refers to any one of all the pixels to be interpolated in the output image, and its position in the output image can be represented by (i, j). The adjacent pixel refers to an adjacent pixel that is adjacent to the current pixel to be interpolated and is located in a plurality of neighborhood pixels in the input image. The neighborhood pixels here can be four adjacent pixels represented by D neighborhood pixels, and the adjacent pixel refers to the pixel located at the upper left corner of the current pixel to be interpolated, and its position can be represented by (x, y).

在此基础上,确定当前待插值像素的相邻像素位置的步骤包括:首先,根据所述当前待插值像素的水平坐标与水平缩放程度的比值,确定所述相邻像素的水平坐标。当前待插值像素的水平坐标指的是其在输出图像中的坐标。水平缩放倍数可以为水平放大倍率,具体用ratiow来表示。相邻像素的水平坐标可以为当前待插值像素的水平坐标与水平放大倍率的比值。进一步地,可以根据所述当前待插值像素的垂直坐标与垂直缩放程度的比值,确定所述相邻像素的垂直坐标。当前待插值像素的垂直坐标指的是其在输出图像中的坐标。垂直缩放倍数可以为垂直放大倍率,具体用ratioh来表示。垂直坐标可以为当前待插值像素的垂直坐标与垂直放大倍率的比值。通过分辨率的缩放程度,能够准确地确定当前待插值像素以及其相邻像素的坐标。水平坐标和垂直坐标可以同时确定,也可以按照顺序来确定,此处不做具体限定。在得到水平坐标和垂直坐标之后,可以基于二者得到相邻像素在输入图像中的位置,具体可以用公式(1)来表示:On this basis, the step of determining the position of the adjacent pixels of the current pixel to be interpolated includes: first, according to the ratio of the horizontal coordinate of the current pixel to be interpolated to the horizontal scaling degree, determining the horizontal coordinate of the adjacent pixels. The horizontal coordinate of the current pixel to be interpolated refers to its coordinate in the output image. The horizontal scaling factor may be a horizontal magnification factor, specifically represented by ratio w . The horizontal coordinate of the adjacent pixels may be a ratio of the horizontal coordinate of the current pixel to be interpolated to the horizontal magnification factor. Further, the vertical coordinate of the adjacent pixels may be determined according to the ratio of the vertical coordinate of the current pixel to be interpolated to the vertical scaling degree. The vertical coordinate of the current pixel to be interpolated refers to its coordinate in the output image. The vertical scaling factor may be a vertical magnification factor, specifically represented by ratio h . The vertical coordinate may be a ratio of the vertical coordinate of the current pixel to be interpolated to the vertical magnification factor. The coordinates of the current pixel to be interpolated and its adjacent pixels can be accurately determined by the scaling degree of the resolution. The horizontal coordinate and the vertical coordinate may be determined simultaneously or in sequence, which is not specifically limited here. After obtaining the horizontal coordinate and the vertical coordinate, the position of the adjacent pixels in the input image can be obtained based on the two, which can be specifically expressed by formula (1):

在得到位于输入图像的相邻像素之后,通过所述相邻像素的位置在所述输入图像中确定当前图像块,并在与当前帧对应的多个参考帧中确定与当前图像块对应的所有匹配块。本公开实施例中,在确定相邻像素在输入图像中的位置后,对于当前待插值像素而言,可以在输入图像中根据相邻像素的位置以及预设图像块大小来对输入图像进行分块操作,确定图像块。具体地,可以相邻像素的位置为中心,按照预设图像块大小在输入图像中确定该当前待插值像素对应的图像块。预设图像块大小可以为4×4或者是其他合适的大小。该图像块的大小可以根据实际需求进行设定,此处不做具体限定。图像块的数量可以为多个,且图像块的大小和图像块的数量负相关。After obtaining the adjacent pixels located in the input image, the current image block is determined in the input image by the positions of the adjacent pixels, and all matching blocks corresponding to the current image block are determined in multiple reference frames corresponding to the current frame. In the disclosed embodiment, after determining the positions of the adjacent pixels in the input image, for the current pixel to be interpolated, the input image can be divided into blocks according to the positions of the adjacent pixels and the preset image block size in the input image to determine the image block. Specifically, the position of the adjacent pixels can be used as the center, and the image block corresponding to the current pixel to be interpolated can be determined in the input image according to the preset image block size. The preset image block size can be 4×4 or other suitable sizes. The size of the image block can be set according to actual needs and is not specifically limited here. The number of image blocks can be multiple, and the size of the image block is negatively correlated with the number of image blocks.

在确定图像块之后,可以将其中正在处理的任意一个图像块作为当前图像块,进而可以在多个参考帧中确定与当前图像块对应的所有匹配块。多个参考帧可以为当前图像块所在的当前帧对应的参考帧,例如与当前帧相邻的多个帧。多个参考帧中的任意一个均可以作为当前参考帧。首先,以一个当前参考帧中的处理过程为例进行说明。具体地,可以采用多帧的运动估计的方式,在所述当前参考帧中确定所述当前帧的当前图像块相对于所述当前参考帧的运动矢量,并基于所述运动矢量在所述当前参考帧中确定与所述当前图像块相似的匹配块。运动估计的基本思想是将图像序列的每一帧分成许多互不重叠的宏块,并认为宏块内所有像素的位移量都相同,然后对每个宏块到参考帧某一给定特定搜索范围内根据一定的匹配准则找出与当前图像块最相似的块,即匹配块,匹配块与当前图像块的相对位移即为运动矢量。视频压缩的时候,只需保存运动矢量和残差数据就可以完全恢复出当前图像块。本公开实施例中,通过多帧运动估计的方式来从其他多帧中查找与当前图像块相似的匹配块,以增加搜索的全面性和准确性,避免了只根据单帧来进行插值时导致的方向错误,通过多帧运动估计提高了插值方向的准确性。After determining the image block, any one of the image blocks being processed can be used as the current image block, and then all matching blocks corresponding to the current image block can be determined in multiple reference frames. The multiple reference frames can be reference frames corresponding to the current frame where the current image block is located, such as multiple frames adjacent to the current frame. Any one of the multiple reference frames can be used as the current reference frame. First, the processing process in a current reference frame is used as an example for explanation. Specifically, a multi-frame motion estimation method can be adopted to determine the motion vector of the current image block of the current frame relative to the current reference frame in the current reference frame, and determine the matching block similar to the current image block in the current reference frame based on the motion vector. The basic idea of motion estimation is to divide each frame of the image sequence into many non-overlapping macroblocks, and assume that the displacement of all pixels in the macroblock is the same, and then find the block most similar to the current image block within a given specific search range of each macroblock to the reference frame according to a certain matching criterion, that is, the matching block, and the relative displacement between the matching block and the current image block is the motion vector. When compressing the video, only the motion vector and residual data need to be saved to completely restore the current image block. In the disclosed embodiment, multi-frame motion estimation is used to search for matching blocks similar to the current image block from other multiple frames to increase the comprehensiveness and accuracy of the search, avoid directional errors caused by interpolation based on only a single frame, and improve the accuracy of the interpolation direction through multi-frame motion estimation.

图4中示意性示出了在当前参考帧中确定匹配块的流程图,参考图4中所示,主要包括以下步骤:FIG4 schematically shows a flow chart of determining a matching block in a current reference frame. Referring to FIG4 , the flow chart mainly includes the following steps:

在步骤S410中,以所述当前图像块的位置为中心,根据搜索窗确定所述当前参考帧的可搜索位置。In step S410, the searchable position of the current reference frame is determined according to a search window with the position of the current image block as the center.

本步骤中,搜索窗可以用于规定搜索过程执行的区域范围。在当前参考帧中,每个图像块的搜索窗可以不一致,搜索窗的大小可以根据搜索窗规则进行设定。搜索窗规则可以包括梯度大小或者是遍历的图像块的数量。举例而言,可以当前图像块的梯度为依据,使得梯度与搜索窗正相关,即梯度越大,搜索窗越大;反之越小。搜索窗的窗口大小也可以随着遍历的图像块的增加,而逐渐增大或逐渐变小。In this step, the search window can be used to specify the area range for executing the search process. In the current reference frame, the search window of each image block may be inconsistent, and the size of the search window can be set according to the search window rule. The search window rule may include the gradient size or the number of traversed image blocks. For example, the gradient of the current image block can be used as a basis so that the gradient is positively correlated with the search window, that is, the larger the gradient, the larger the search window; otherwise, the smaller it is. The window size of the search window can also gradually increase or decrease as the number of traversed image blocks increases.

可搜索位置指的是当前参考帧的可搜索范围,即可能存在匹配块的区域范围,具体可以根据每个图像块的搜索窗的大小而确定。每个参考帧的可搜索位置可能相同或者是不同。The searchable position refers to the searchable range of the current reference frame, that is, the area range where matching blocks may exist, which can be determined based on the size of the search window of each image block. The searchable position of each reference frame may be the same or different.

在步骤S420中,通过固定步长遍历所述可搜索位置,在所述当前参考帧中得到与所述当前图像块大小相同的所有参考块。In step S420, the searchable positions are traversed with a fixed step size to obtain all reference blocks having the same size as the current image block in the current reference frame.

本步骤中,可以通过固定步长(例如几个像素)对可搜索位置进行遍历匹配,以从当前参考帧中获取到与当前图像块大小相同的所有参考块。In this step, the searchable positions may be traversed and matched with a fixed step size (eg, several pixels) to obtain all reference blocks having the same size as the current image block from the current reference frame.

在步骤S430中,将所有参考块与所述当前图像块进行匹配得到匹配度,并根据所述匹配度从所述当前参考帧的所有参考块中确定所述匹配块。In step S430, all reference blocks are matched with the current image block to obtain a matching degree, and the matching block is determined from all reference blocks of the current reference frame according to the matching degree.

本步骤中,可以将所有参考块与当前图像块进行匹配,以得到二者之间的匹配度。具体可以对参考块进行特征提取得到参考特征,对当前图像块进行特征提取得到当前特征,然后基于提取的参考特征和当前特征来计算二者之间的匹配度。匹配度的表现方式可以包括但不限于SAD(Sum of Absolute Differences,绝对误差和算法)、欧式距离、纹理梯度等方式的一种或多种。对于绝对误差和算法而言,平均绝对差越小,表明越相似。In this step, all reference blocks can be matched with the current image block to obtain the degree of match between the two. Specifically, feature extraction can be performed on the reference block to obtain reference features, and feature extraction can be performed on the current image block to obtain current features, and then the degree of match between the two can be calculated based on the extracted reference features and current features. The degree of match can be expressed in one or more ways including but not limited to SAD (Sum of Absolute Differences, absolute error and algorithm), Euclidean distance, texture gradient, etc. For the absolute error and algorithm, the smaller the mean absolute difference, the more similar it is.

在计算出匹配度之后,可以将匹配度最高的参考块作为当前图像块的在当前参考帧中的至少一个匹配块。并且,每个参考帧中存在的匹配块的数量可以相同或不同,具体是根据匹配度的数值来确定的。通过匹配度来选择至少一个匹配块,能够提高匹配块的准确性。After the matching degree is calculated, the reference block with the highest matching degree can be used as at least one matching block of the current image block in the current reference frame. In addition, the number of matching blocks in each reference frame can be the same or different, which is specifically determined according to the value of the matching degree. Selecting at least one matching block based on the matching degree can improve the accuracy of the matching block.

在得到匹配块的同时,可以记录每个匹配块的可信度。此处的可信度用于表示匹配块的匹配程度,以用于插值操作。可信度可以用SAD(Sum of Absolute Differences,绝对误差和算法)来表示,用来确定后续插值过程中的权重,从而影响插值效果。When the matching blocks are obtained, the credibility of each matching block can be recorded. The credibility here is used to indicate the matching degree of the matching blocks for interpolation operations. The credibility can be expressed by SAD (Sum of Absolute Differences), which is used to determine the weight in the subsequent interpolation process, thereby affecting the interpolation effect.

需要说明的是,对于所有参考帧中的所有图像块确定匹配块的方式与图4中的步骤相同,因此此处不再赘述。It should be noted that the method of determining matching blocks for all image blocks in all reference frames is the same as the step in FIG. 4 , and thus will not be described in detail here.

图5中示意性示出了采用多帧的运动估计确定与当前图像块相似的匹配块的示意图。具体地,可以将当前帧FCUR相邻的前一帧FCUR-1作为参考帧以及将相邻的后一帧FCUR+1作为参考帧,也可以将当前帧FCUR相邻的前两帧FCUR-2作为参考帧以及将相邻的后两帧FCUR+2作为参考帧,直至将前M帧FCUR-M以及后N帧FCUR+N作为参考帧为止,以根据二者之间的运动矢量,从其中确定与当前图像块最相似的匹配块。通过多帧的运动估计来确定输入图像中当前图像块最相似的匹配块,能够提高匹配块的准确性。FIG5 schematically shows a schematic diagram of using motion estimation of multiple frames to determine a matching block similar to the current image block. Specifically, the previous frame F CUR-1 adjacent to the current frame F CUR can be used as a reference frame and the next frame F CUR+1 adjacent to the current frame F CUR can be used as a reference frame, or the first two frames F CUR-2 adjacent to the current frame F CUR can be used as reference frames and the next two frames F CUR+2 adjacent to the current frame F CUR can be used as reference frames, until the first M frames F CUR-M and the next N frames F CUR+N are used as reference frames, so as to determine the matching block most similar to the current image block according to the motion vector between the two. Determining the matching block most similar to the current image block in the input image by using motion estimation of multiple frames can improve the accuracy of the matching block.

继续参考图3中所示,在步骤S320中,根据所有匹配块中的目标匹配块以及当前图像块进行图像块融合得到多个融合块,并根据多个所述融合块确定所述当前图像块的目标方向。Continuing to refer to FIG. 3 , in step S320 , image blocks are fused according to the target matching blocks in all matching blocks and the current image block to obtain multiple fused blocks, and the target direction of the current image block is determined according to the multiple fused blocks.

本公开实施例中,在进行图像块融合时,可以选择当前图像块的所有匹配块对应的目标匹配块进行融合。目标匹配块可以为所有匹配块或者是部分匹配块,具体可以根据匹配块的数量而确定。例如,在当前图像块的匹配块的数量大于数量阈值时,则可以选择部分匹配块作为目标匹配块;在当前图像块的匹配块的数量不大于数量阈值时,则可以选择所有匹配块作为目标匹配块。其中,部分匹配块可以为所有匹配块固定帧位置的K个匹配块。固定帧可以为当前帧最相邻的几个帧。In the embodiment of the present disclosure, when performing image block fusion, the target matching blocks corresponding to all matching blocks of the current image block can be selected for fusion. The target matching blocks can be all matching blocks or partial matching blocks, which can be specifically determined according to the number of matching blocks. For example, when the number of matching blocks of the current image block is greater than the number threshold, the partial matching blocks can be selected as the target matching blocks; when the number of matching blocks of the current image block is not greater than the number threshold, all matching blocks can be selected as the target matching blocks. Among them, the partial matching blocks can be K matching blocks with fixed frame positions of all matching blocks. The fixed frames can be the frames that are most adjacent to the current frame.

在此基础上,可以对固定帧位置的K个匹配块与1个当前图像块进行匹配,以执行匹配块与当前图像块以及匹配块与匹配块之间的融合,共融合得到t个融合块。其中,每个融合块所需的匹配块的数量可以不同。具体地,可以根据每个匹配块的权重与每个匹配块的属性参数的乘积之和,与所有匹配块的权重之和的比值,来确定每个融合块的属性参数。此处的属性参数可以为每个融合块在像素级的像素值。其中,每个匹配块可以为4×4,基于此,可以将K个4×4的匹配块与1个当前图像块分别进行融合,将匹配块中相同位置的像素值按照该匹配块对应的权重进行加权平均得到加权平均值,并将加权平均值作为融合块中相同位置的像素值,以确定每个融合块的属性参数。对匹配块以及当前图像块进行融合得到融合块的具体方式可以如公式(2)所示:On this basis, K matching blocks at fixed frame positions can be matched with one current image block to perform fusion between the matching blocks and the current image block and between the matching blocks, and t fusion blocks are obtained by fusion. The number of matching blocks required for each fusion block may be different. Specifically, the attribute parameters of each fusion block can be determined according to the ratio of the sum of the product of the weight of each matching block and the attribute parameter of each matching block to the sum of the weights of all matching blocks. The attribute parameters here can be the pixel values of each fusion block at the pixel level. Each matching block can be 4×4. Based on this, K 4×4 matching blocks can be fused with one current image block respectively, and the pixel values at the same position in the matching block are weighted averaged according to the weight corresponding to the matching block to obtain a weighted average value, and the weighted average value is used as the pixel value at the same position in the fusion block to determine the attribute parameters of each fusion block. The specific method of fusing the matching block and the current image block to obtain the fusion block can be shown in formula (2):

BLK=(w0*BLK0+w1*BLK1+...+wk*BLKk)/(w0+w1+...+wk) 公式(2)BLK=(w 0 *BLK 0 +w 1 *BLK 1 + ... +w k *BLK k )/(w 0 +w 1 + ... +w k ) Formula (2)

其中,w0、w1、wk分别为对应的匹配块的权重,每个匹配块的权重可以为时间距离、匹配可信度以及人工设定等方式中的一种或多种。对于不同的匹配块,其对应的匹配块的权重可以不同,即可以按照匹配块的类型来确定其权重的类型。Among them, w 0 , w 1 , and w k are weights of corresponding matching blocks respectively, and the weight of each matching block can be one or more of time distance, matching credibility, and manual setting, etc. For different matching blocks, the corresponding matching block weights can be different, that is, the type of weight can be determined according to the type of matching block.

本公开实施例中,以匹配块的权重为时间距离为例进行说明。具体而言,可以根据时间距离确定每个匹配块的权重;进而按照每个匹配块的权重将两个目标匹配块进行融合,并按照每个匹配块的权重将目标匹配块与当前图像块进行融合,以得到多个融合块。举例而言,若存在12个匹配块,可以将时间距离最近的两帧的目标匹配块形成一个融合块,从而得到6个融合块。通过将时间距离最近的匹配块形成融合块,能够提高融合块的准确性。In the disclosed embodiment, the weight of the matching block is taken as the time distance for explanation. Specifically, the weight of each matching block can be determined according to the time distance; then the two target matching blocks are fused according to the weight of each matching block, and the target matching block is fused with the current image block according to the weight of each matching block to obtain multiple fused blocks. For example, if there are 12 matching blocks, the target matching blocks of the two frames with the closest time distance can be formed into a fused block, thereby obtaining 6 fused blocks. By forming the matching blocks with the closest time distance into fused blocks, the accuracy of the fused blocks can be improved.

进一步地,在得到多个融合块之后,可以根据多个融合块确定当前图像块的目标方向。目标方向指的是当前图像块的纹理方向。可以根据多个融合块进行方向融合,得到当前图像块的目标方向。Furthermore, after obtaining multiple fusion blocks, the target direction of the current image block can be determined according to the multiple fusion blocks. The target direction refers to the texture direction of the current image block. Direction fusion can be performed according to the multiple fusion blocks to obtain the target direction of the current image block.

图6中示意性示出了确定目标方向的流程图,参考图6中所示,主要包括以下步骤:FIG6 schematically shows a flow chart of determining the target direction. Referring to FIG6 , the flow chart mainly includes the following steps:

在步骤S610中,计算每个融合块在多个方向的梯度,并根据梯度最小的方向确定每个所述融合块的纹理方向;In step S610, the gradient of each fused block in multiple directions is calculated, and the texture direction of each fused block is determined according to the direction with the smallest gradient;

在步骤S620中,根据每个所述融合块的权重对所述纹理方向进行融合,得到所述目标方向。In step S620, the texture directions are fused according to the weight of each fusion block to obtain the target direction.

本公开实施例中,多个方向可以为任意方向,例如可任意包括但不限于水平方向、垂直方向、45度方向和135度方向。具体地,可以计算每个融合块在多个方向中每个方向的梯度。并且,可以将每个融合块的多个方向的梯度进行对比,以确定最小的梯度。进一步地,可以将梯度最小的方向确定为该融合块对应的纹理方向。每个融合块的纹理方向可以相同或者是不同,具体均根据梯度的数值来确定。每个融合块的纹理方向的范围可以为0-359度之间的任意值。举例而言,融合块1的纹理方向为水平方向,融合块2的纹理方向为垂直方向。In the disclosed embodiment, the multiple directions may be any directions, for example, any directions including but not limited to horizontal direction, vertical direction, 45 degree direction and 135 degree direction. Specifically, the gradient of each fusion block in each of the multiple directions may be calculated. Furthermore, the gradients of the multiple directions of each fusion block may be compared to determine the minimum gradient. Further, the direction with the minimum gradient may be determined as the texture direction corresponding to the fusion block. The texture directions of each fusion block may be the same or different, and are specifically determined according to the value of the gradient. The range of the texture direction of each fusion block may be any value between 0 and 359 degrees. For example, the texture direction of fusion block 1 is the horizontal direction, and the texture direction of fusion block 2 is the vertical direction.

在得到每个融合块的纹理方向之后,可以基于每个融合块自身对应的权重来对所有融合块的纹理方向进行融合处理。每个融合块的权重用于表示其重要程度或所占的比例。每个融合块的权重可以相同或者是不同,具可以根据用于形成融合块的原始块的数量而确定。其中,原始块用于组成融合块,且原始块包括匹配块和当前图像块,融合块的权重与组成融合块原始块的数量正相关,即原始块的数量越多,融合块的权重的数值越大。After obtaining the texture direction of each fusion block, the texture directions of all fusion blocks can be fused based on the weight corresponding to each fusion block. The weight of each fusion block is used to indicate its importance or proportion. The weight of each fusion block can be the same or different, and can be determined according to the number of original blocks used to form the fusion block. Among them, the original blocks are used to form the fusion block, and the original blocks include matching blocks and current image blocks. The weight of the fusion block is positively correlated with the number of original blocks that constitute the fusion block, that is, the more the number of original blocks, the greater the value of the weight of the fusion block.

在得到融合块的权重之后,可以根据每个融合块的权重对每个融合块的纹理方向进行加权平均处理,得到目标方向。具体地,可以根据每个融合块的权重与每个融合块的纹理方向的乘积之和,与所有融合块的权重之和的比值,确定目标方向。具体的计算方式可以如公式(3)所示:After obtaining the weight of the fusion block, the texture direction of each fusion block can be weighted averaged according to the weight of each fusion block to obtain the target direction. Specifically, the target direction can be determined according to the ratio of the sum of the product of the weight of each fusion block and the texture direction of each fusion block to the sum of the weights of all fusion blocks. The specific calculation method can be shown in formula (3):

dir=(dir0*u0+dir1*u1+...+dirt*ut)/(u0+u1+...+ut) 公式(3)dir=(dir 0 *u 0 +dir 1 *u 1 + ... +dir t *u t )/(u 0 +u 1 + ... +u t ) Formula (3)

其中,dirt为第t个融合块的纹理方向,ut为第t个融合块的权重。Among them, dir t is the texture direction of the t-th fusion block, and ut is the weight of the t-th fusion block.

本公开实施例中,通过融合块的权重对每个融合块的纹理方向进行融合,能够得到准确的目标方向,避免了只通过一帧图像确定方向时可能导致的误差,提高准确性。In the disclosed embodiment, by fusing the texture direction of each fusion block through the weight of the fusion block, an accurate target direction can be obtained, thereby avoiding errors that may be caused when the direction is determined by only one frame of image, and improving accuracy.

在步骤S330中,通过所述目标方向对所述当前图像块进行方向性插值,得到所述当前待插值像素的像素值。In step S330, directional interpolation is performed on the current image block according to the target direction to obtain a pixel value of the current pixel to be interpolated.

本公开实施例中,方向性插值指的是在一个固定方向上进行插值的方式。在确定目标方向之后,可以根据目标方向对应的参考像素进行方向性插值,以计算当前待插值像素的像素值。参考像素指的是目标方向上已经存在的所有像素。方向性插值可以为均值滤波或者是其他方式。基于此,可以将目标方向上存在的像素的像素值进行均值滤波,根据均值滤波的结果计算当前待插值像素的像素值。均值滤波是指在图像上对目标像素给一个模板,该模板包括了其周围的临近像素(以目标像素为中心的周围8个像素,构成一个滤波模板,即去掉目标像素本身),再用模板中的全体像素的平均值来代替原来像素值。基于此,可以根据目标方向上参考像素的像素值的均值来确定当前待插值像素的像素值。In the disclosed embodiment, directional interpolation refers to a method of interpolating in a fixed direction. After determining the target direction, directional interpolation can be performed based on the reference pixels corresponding to the target direction to calculate the pixel value of the current pixel to be interpolated. The reference pixel refers to all pixels that already exist in the target direction. Directional interpolation can be mean filtering or other methods. Based on this, the pixel values of the pixels existing in the target direction can be mean filtered, and the pixel value of the current pixel to be interpolated is calculated based on the result of the mean filtering. Mean filtering refers to giving a template to the target pixel on the image, which template includes the neighboring pixels around it (8 pixels around the target pixel as the center, forming a filtering template, that is, removing the target pixel itself), and then replacing the original pixel value with the average value of all pixels in the template. Based on this, the pixel value of the current pixel to be interpolated can be determined based on the mean value of the pixel values of the reference pixels in the target direction.

对于输出图像中包含的所有待插值像素而言,均可以采用步骤S310至步骤S330中的方法来计算每一个待插值像素的像素值,直至输出图像中所有的待插值像素均得到对应的像素值为止。在确定出来待插值像素的像素值后,可以根据这些待插值像素的像素值来得到输出图像,以通过该方法实现图像超分辨率重建处理,从而提高超分效果和图像质量。For all pixels to be interpolated included in the output image, the method in step S310 to step S330 can be used to calculate the pixel value of each pixel to be interpolated until all pixels to be interpolated in the output image obtain corresponding pixel values. After the pixel values of the pixels to be interpolated are determined, the output image can be obtained according to the pixel values of these pixels to be interpolated, so as to realize image super-resolution reconstruction processing through this method, thereby improving the super-resolution effect and image quality.

图7中示意性示出了进行方向性插值的流程图,参考图7中所示,主要包括以下步骤:FIG7 schematically shows a flow chart of performing directional interpolation. Referring to FIG7 , the flow chart mainly includes the following steps:

在步骤S710中,计算输出图像相对于输入图像的缩放程度。In step S710, the scaling degree of the output image relative to the input image is calculated.

在步骤S720中,判断当前的输出图像是否插值完成;若是,则结束;若否,则转至步骤S730。In step S720, it is determined whether the interpolation of the current output image is completed; if so, the process ends; if not, the process proceeds to step S730.

在步骤S730中,确定待插值像素在输入图像中的最相邻位置,具体可以为左上角的相邻像素。In step S730, the most adjacent position of the pixel to be interpolated in the input image is determined, which may be the adjacent pixel in the upper left corner.

在步骤S740中,确定输入图像的图像块的大小。In step S740 , the size of the image block of the input image is determined.

在步骤S750中,在参考帧中寻找与所有图像块匹配的匹配块。In step S750, a matching block matching all image blocks is searched in the reference frame.

在步骤S760中,对匹配块进行融合得到融合块。In step S760, the matching blocks are fused to obtain a fused block.

在步骤S770中,确定融合块的纹理方向。In step S770 , the texture direction of the fused block is determined.

在步骤S780中,对融合块的纹理方向进行融合。In step S780, the texture directions of the fusion blocks are fused.

在步骤S790中,进行方向性插值,并返回步骤S720。In step S790, directional interpolation is performed, and the process returns to step S720.

图7中的技术方案,利用相邻帧之间的前景和背景的变化运动特性,采用运动估计的方法,为当前图像块在多个参考帧中寻找对应的多个匹配块,最终综合所有匹配块进行融合得到融合块,进而对融合块进行方向性判定,以确定每个融合块的纹理方向;在得到当前图像块的待插值像素位置的纹理方向后,采用方向性插值滤波器进行插值,得到当前待插值像素。避免了相关技术中,神经网络算法严重依赖训练时的数据集,实际泛化能力差,而且复杂度过高的问题,降低了复杂度,增加了应用范围。也避免了由于输入图像为单帧而产生纹理的错判,避免了局限性,导致方向性插值的错误从而引起的图像的主观问题,提高了图像质量。The technical solution in FIG7 utilizes the changing motion characteristics of the foreground and background between adjacent frames, and adopts the motion estimation method to find corresponding multiple matching blocks for the current image block in multiple reference frames, and finally integrates all matching blocks to obtain a fused block, and then performs directional judgment on the fused block to determine the texture direction of each fused block; after obtaining the texture direction of the pixel position to be interpolated of the current image block, a directional interpolation filter is used for interpolation to obtain the current pixel to be interpolated. It avoids the problem in the related art that the neural network algorithm is heavily dependent on the data set during training, has poor actual generalization ability, and is too complex, reduces complexity, and increases the scope of application. It also avoids the misjudgment of texture due to the input image being a single frame, avoids limitations, and leads to subjective problems of the image caused by errors in directional interpolation, thereby improving image quality.

需要补充的是,本公开实施例中的超分方案也可以用于去噪过程。例如,在视频通路中,可以根据设置多个中间分辨率,采用多次插值得到最终输出分辨率图像,即每一次的输入为上一次的输出,以达到更好的去噪效果。超分方案也可以用于图像修复过程,例如针对视频中某些单帧丢失的细节,可以利用其他帧的进行填补、更正等操作。It should be added that the super-resolution scheme in the embodiment of the present disclosure can also be used in the denoising process. For example, in the video path, multiple intermediate resolutions can be set and multiple interpolations can be used to obtain the final output resolution image, that is, each input is the output of the previous one, so as to achieve a better denoising effect. The super-resolution scheme can also be used in the image restoration process. For example, for the details of some single-frame loss in the video, other frames can be used to fill in, correct, and other operations.

应当注意,尽管在附图中以特定顺序描述了本公开中方法的各个步骤,但是,这并非要求或者暗示必须按照该特定顺序来执行这些步骤,或是必须执行全部所示的步骤才能实现期望的结果。附加的或备选的,可以省略某些步骤,将多个步骤合并为一个步骤执行,以及/或者将一个步骤分解为多个步骤执行等。It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and/or one step may be decomposed into multiple steps, etc.

图8示意性示出了本公开的示例性实施方式的图像处理装置的方框图。参考图8所示,根据本公开的示例性实施方式的图像处理装置800可以包括以下模块:FIG8 schematically shows a block diagram of an image processing apparatus according to an exemplary embodiment of the present disclosure. Referring to FIG8 , an image processing apparatus 800 according to an exemplary embodiment of the present disclosure may include the following modules:

匹配块确定模块801,用于确定输出图像中包含的当前待插值像素在输入图像中的相邻像素的位置,通过所述相邻像素的位置在所述输入图像中确定当前图像块,并在与当前帧对应的多个参考帧中确定与所述当前图像块对应的所有匹配块;A matching block determination module 801 is used to determine positions of neighboring pixels of a current pixel to be interpolated contained in an output image in an input image, determine a current image block in the input image according to the positions of the neighboring pixels, and determine all matching blocks corresponding to the current image block in a plurality of reference frames corresponding to the current frame;

方向确定模块802,用于根据所有匹配块中的目标匹配块以及当前图像块进行图像块融合得到多个融合块,并根据多个所述融合块确定所述当前图像块的目标方向;A direction determination module 802 is used to perform image block fusion according to the target matching block in all matching blocks and the current image block to obtain multiple fused blocks, and determine the target direction of the current image block according to the multiple fused blocks;

图像插值模块803,用于通过所述目标方向对所述当前图像块进行方向性插值,得到所述当前待插值像素的像素值。The image interpolation module 803 is used to perform directional interpolation on the current image block according to the target direction to obtain the pixel value of the current pixel to be interpolated.

在本公开的一种示例性实施例中,匹配块确定模块包括:第一坐标确定模块,用于根据所述当前待插值像素的水平坐标与水平缩放程度的比值,确定所述相邻像素的水平坐标;第二坐标确定模块,用于根据所述当前待插值像素的垂直坐标与垂直缩放程度的比值,确定所述相邻像素的垂直坐标。In an exemplary embodiment of the present disclosure, the matching block determination module includes: a first coordinate determination module, used to determine the horizontal coordinate of the adjacent pixel according to the ratio of the horizontal coordinate of the current pixel to be interpolated to the horizontal scaling degree; and a second coordinate determination module, used to determine the vertical coordinate of the adjacent pixel according to the ratio of the vertical coordinate of the current pixel to be interpolated to the vertical scaling degree.

在本公开的一种示例性实施例中,匹配块确定模块包括:运动估计匹配模块,用于在所述当前参考帧中确定所述当前帧的当前图像块相对于所述当前参考帧的运动矢量,并基于所述运动矢量在所述当前参考帧中确定与所述当前图像块相似的匹配块。In an exemplary embodiment of the present disclosure, the matching block determination module includes: a motion estimation matching module, which is used to determine, in the current reference frame, a motion vector of a current image block of the current frame relative to the current reference frame, and determine, in the current reference frame based on the motion vector, a matching block similar to the current image block.

在本公开的一种示例性实施例中,运动估计匹配模块包括:位置确定模块,用于以所述当前图像块的位置为中心,根据搜索窗确定当前参考帧的可搜索位置;参考块确定模块,用于通过固定步长遍历所述可搜索位置,在所述当前参考帧中得到与所述当前图像块大小相同的所有参考块;匹配块选择模块,用于将所有参考块与所述当前图像块进行匹配得到匹配度,并根据所述匹配度从所述当前参考帧的所有参考块中确定所述匹配块。In an exemplary embodiment of the present disclosure, the motion estimation matching module includes: a position determination module, which is used to determine the searchable position of the current reference frame according to the search window with the position of the current image block as the center; a reference block determination module, which is used to traverse the searchable position with a fixed step size to obtain all reference blocks with the same size as the current image block in the current reference frame; and a matching block selection module, which is used to match all reference blocks with the current image block to obtain a matching degree, and determine the matching block from all reference blocks of the current reference frame according to the matching degree.

在本公开的一种示例性实施例中,匹配块选择模块被配置为:将所有参考块中所述匹配度最高的至少一个参考块,作为所述当前图像块在所述当前参考帧中的所述匹配块。In an exemplary embodiment of the present disclosure, the matching block selection module is configured to: select at least one reference block with the highest matching degree among all reference blocks as the matching block of the current image block in the current reference frame.

在本公开的一种示例性实施例中,方向确定模块包括:权重确定模块,用于根据时间距离确定每个匹配块的权重;匹配块融合模块,用于按照每个所述匹配块的权重将所有匹配块中的目标匹配块之间进行融合,并按照每个所述匹配块的权重将所述目标匹配块与所述当前图像块进行融合,以得到多个融合块。In an exemplary embodiment of the present disclosure, the direction determination module includes: a weight determination module, which is used to determine the weight of each matching block according to the time distance; a matching block fusion module, which is used to fuse the target matching blocks in all the matching blocks according to the weight of each matching block, and fuse the target matching block with the current image block according to the weight of each matching block to obtain multiple fused blocks.

在本公开的一种示例性实施例中,方向确定模块包括:纹理方向确定模块,用于计算每个融合块在多个方向的梯度,并根据梯度最小的方向确定每个所述融合块的纹理方向;方向融合模块,用于根据每个所述融合块的权重对所述纹理方向进行融合,得到所述目标方向。In an exemplary embodiment of the present disclosure, the direction determination module includes: a texture direction determination module, which is used to calculate the gradient of each fusion block in multiple directions, and determine the texture direction of each fusion block according to the direction with the smallest gradient; a direction fusion module, which is used to fuse the texture directions according to the weight of each fusion block to obtain the target direction.

在本公开的一种示例性实施例中,方向融合模块包括:目标方向确定模块,用于根据每个所述融合块的权重对每个融合块的所述纹理方向进行加权平均处理,得到所述目标方向。In an exemplary embodiment of the present disclosure, the direction fusion module includes: a target direction determination module, configured to perform weighted averaging processing on the texture direction of each fusion block according to the weight of each fusion block to obtain the target direction.

在本公开的一种示例性实施例中,图像插值模块被配置为:根据所述目标方向对应的参考像素的像素值,对所述当前图像块进行所述方向性插值,以确定所述当前待插值像素的像素值。In an exemplary embodiment of the present disclosure, the image interpolation module is configured to: perform the directional interpolation on the current image block according to the pixel value of the reference pixel corresponding to the target direction to determine the pixel value of the current pixel to be interpolated.

由于本公开实施方式的图像处理装置的各个功能模块与上述图像处理方法的实施方式中相同,因此在此不再赘述。Since the functional modules of the image processing device in the embodiment of the present disclosure are the same as those in the embodiment of the above-mentioned image processing method, they will not be described in detail here.

通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、终端装置、或者网络设备等)执行根据本公开实施方式的方法。Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

此外,上述附图仅是根据本公开示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

本领域技术人员在考虑说明书及实践这里公开的内容后,将容易想到本公开的其他实施例。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing what is disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and embodiments are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限。It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (12)

1. An image processing method, comprising:
Determining the position of a neighboring pixel of a current pixel to be interpolated in an input image, which is contained in an output image, determining a current image block in the input image through the position of the neighboring pixel, and determining all matching blocks corresponding to the current image block in a plurality of reference frames corresponding to the current frame based on a motion estimation mode;
Image block fusion is carried out according to target matching blocks in all the matching blocks and the current image block to obtain a plurality of fusion blocks, and the target direction of the current image block is determined according to the fusion blocks;
and performing directional interpolation on the current image block through the target direction to obtain the pixel value of the current pixel to be interpolated.
2. The image processing method according to claim 1, wherein determining the position of the adjacent pixel of the current pixel to be interpolated included in the output image in the input image includes:
Determining the horizontal coordinates of the adjacent pixels according to the ratio of the horizontal coordinates of the current pixel to be interpolated to the horizontal scaling degree;
And determining the vertical coordinates of the adjacent pixels according to the ratio of the vertical coordinates of the current pixel to be interpolated to the vertical scaling degree.
3. The image processing method according to claim 1, wherein said determining all matching blocks corresponding to the current image block among a plurality of reference frames corresponding to a current frame includes:
A motion vector of a current image block of the current frame relative to the current reference frame is determined in the current reference frame, and a matching block similar to the current image block is determined in the current reference frame based on the motion vector.
4. The image processing method according to claim 3, wherein said determining a motion vector of a current image block of the current frame with respect to the current reference frame in the current reference frame, and determining a matching block similar to the current image block in the current reference frame based on the motion vector, comprises:
the position of the current image block is taken as the center, and the searchable position of the current reference frame is determined according to a search window;
Traversing the searchable position by a fixed step length, and obtaining all reference blocks with the same size as the current image block in the current reference frame;
and matching all the reference blocks with the current image block to obtain a matching degree, and determining the matching block from all the reference blocks of the current reference frame according to the matching degree.
5. The image processing method according to claim 4, wherein said determining the matching block from all reference blocks of the current reference frame according to the matching degree comprises:
And taking at least one reference block with the highest matching degree in all the reference blocks as the matching block of the current image block in the current reference frame.
6. The image processing method according to claim 1, wherein the performing image block fusion according to the target matching block and the current image block in all the matching blocks to obtain a plurality of fusion blocks includes:
determining the weight of each matching block according to the time distance;
fusing target matching blocks in all the matching blocks according to the weight of each matching block, and fusing the target matching block with the current image block according to the weight of each matching block to obtain a plurality of fusion blocks.
7. The image processing method according to claim 1, wherein the determining the target direction of the current image block from the plurality of the fusion blocks includes:
Calculating gradients of each fusion block in multiple directions, and determining the texture direction of each fusion block according to the direction with the smallest gradient;
and fusing the texture directions according to the weight of each fusion block to obtain the target direction.
8. The image processing method according to claim 7, wherein the fusing the texture directions according to the weight of each of the fused blocks to obtain the target direction includes:
And carrying out weighted average processing on the texture direction of each fusion block according to the weight of each fusion block to obtain the target direction.
9. The image processing method according to claim 1, wherein the performing directional interpolation on the current image block by the target direction to obtain a pixel value of the current pixel to be interpolated includes:
And carrying out directional interpolation on the current image block according to the pixel value of the reference pixel corresponding to the target direction so as to determine the pixel value of the current pixel to be interpolated.
10. An image processing apparatus, comprising:
a matching block determining module, configured to determine a position of a neighboring pixel of a current pixel to be interpolated included in an output image in an input image, determine a current image block in the input image by using the position of the neighboring pixel, and determine all matching blocks corresponding to the current image block in a plurality of reference frames corresponding to the current frame based on a motion estimation manner;
the direction determining module is used for carrying out image block fusion according to target matching blocks in all the matching blocks and the current image block to obtain a plurality of fusion blocks, and determining the target direction of the current image block according to the fusion blocks;
and the image interpolation module is used for carrying out directional interpolation on the current image block through the target direction to obtain the pixel value of the current pixel to be interpolated.
11. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the image processing method according to any one of claims 1-9.
12. An electronic device, comprising:
A processor; and
A memory for storing executable instructions of the processor;
wherein the processor is configured to perform the image processing method of any of claims 1-9 via execution of the executable instructions.
CN202010694132.4A 2020-07-17 2020-07-17 Image processing method and device, storage medium and electronic equipment Active CN111784734B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010694132.4A CN111784734B (en) 2020-07-17 2020-07-17 Image processing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010694132.4A CN111784734B (en) 2020-07-17 2020-07-17 Image processing method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111784734A CN111784734A (en) 2020-10-16
CN111784734B true CN111784734B (en) 2024-07-02

Family

ID=72763085

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010694132.4A Active CN111784734B (en) 2020-07-17 2020-07-17 Image processing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111784734B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112508783B (en) * 2020-11-19 2024-01-30 西安全志科技有限公司 Image processing method based on direction interpolation, computer device and computer readable storage medium
CN112804526B (en) * 2020-12-31 2022-11-11 紫光展锐(重庆)科技有限公司 Image data storage method and equipment, storage medium, chip and module equipment
CN113240609A (en) * 2021-05-26 2021-08-10 Oppo广东移动通信有限公司 Image denoising method and device and storage medium
CN113838095B (en) * 2021-08-30 2023-12-29 天津港集装箱码头有限公司 Personnel tracking ball machine control method based on speed control
CN114007134B (en) * 2021-10-25 2024-06-11 Oppo广东移动通信有限公司 Video processing method, device, electronic equipment and storage medium
CN113689362B (en) * 2021-10-27 2022-02-22 深圳市慧鲤科技有限公司 Image processing method and device, electronic equipment and storage medium
CN114119423B (en) * 2021-12-08 2025-08-26 上海肇观电子科技有限公司 Image processing method, device, electronic device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102075760A (en) * 2010-10-27 2011-05-25 无锡中星微电子有限公司 Quick movement estimation method and device
CN110730344A (en) * 2019-09-18 2020-01-24 浙江大华技术股份有限公司 Video coding method and device and computer storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7609765B2 (en) * 2004-12-02 2009-10-27 Intel Corporation Fast multi-frame motion estimation with adaptive search strategies
CN110505479B (en) * 2019-08-09 2023-06-16 东华大学 Video compressed sensing reconstruction method with same measurement rate frame by frame under time delay constraint

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102075760A (en) * 2010-10-27 2011-05-25 无锡中星微电子有限公司 Quick movement estimation method and device
CN110730344A (en) * 2019-09-18 2020-01-24 浙江大华技术股份有限公司 Video coding method and device and computer storage medium

Also Published As

Publication number Publication date
CN111784734A (en) 2020-10-16

Similar Documents

Publication Publication Date Title
CN111784734B (en) Image processing method and device, storage medium and electronic equipment
CN111784614B (en) Image denoising method and device, storage medium and electronic device
CN112269851B (en) Map data updating method, device, storage medium and electronic device
CN113077397B (en) Image beautification processing method, device, storage medium and electronic device
CN112270755B (en) Three-dimensional scene construction method and device, storage medium and electronic equipment
CN113096185B (en) Visual positioning method, visual positioning device, storage medium and electronic equipment
CN111580765A (en) Screen projection method, screen projection device, storage medium, screen projection equipment and screen projection equipment
CN112927271B (en) Image processing method, image processing device, storage medium and electronic device
CN111445392B (en) Image processing method and device, computer readable storage medium and electronic equipment
WO2021233032A1 (en) Video processing method, video processing apparatus, and electronic device
CN111696039B (en) Image processing method and device, storage medium and electronic equipment
CN111652933B (en) Repositioning method and device based on monocular camera, storage medium and electronic equipment
CN113538274B (en) Image beautification processing method, device, storage medium and electronic device
CN112233041B (en) Image beautifying processing method and device, storage medium and electronic equipment
CN113409203A (en) Image blurring degree determining method, data set constructing method and deblurring method
CN113344820B (en) Image processing method and device, computer readable medium, and electronic device
CN113409209B (en) Image deblurring method, device, electronic device and storage medium
CN112950515B (en) Image processing method and device, computer readable storage medium and electronic equipment
CN117135455B (en) Image processing method and electronic equipment
KR102460123B1 (en) Electronic device for compressing image using compression attributes generated in image acquisition process using image sensor and method for operating thefeof
CN113781336B (en) Image processing methods, devices, electronic equipment and storage media
KR20250013217A (en) Image processing method and apparatus, and device and medium
CN113706598B (en) Image processing method, model training method and device, medium and electronic equipment
CN112911186A (en) Image storage method and device, electronic equipment and storage medium
CN113989146B (en) Image processing method and device, electronic device, 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
GR01 Patent grant