WO2021073066A1 - 图像处理方法及装置 - Google Patents

图像处理方法及装置 Download PDF

Info

Publication number
WO2021073066A1
WO2021073066A1 PCT/CN2020/086269 CN2020086269W WO2021073066A1 WO 2021073066 A1 WO2021073066 A1 WO 2021073066A1 CN 2020086269 W CN2020086269 W CN 2020086269W WO 2021073066 A1 WO2021073066 A1 WO 2021073066A1
Authority
WO
WIPO (PCT)
Prior art keywords
motion vector
image frame
target macroblock
feature
macroblock
Prior art date
Application number
PCT/CN2020/086269
Other languages
English (en)
French (fr)
Inventor
赵立立
范志刚
Original Assignee
西安万像电子科技有限公司
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 西安万像电子科技有限公司 filed Critical 西安万像电子科技有限公司
Publication of WO2021073066A1 publication Critical patent/WO2021073066A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/527Global motion vector estimation

Definitions

  • the present disclosure relates to the field of computer image technology, and in particular to image processing methods and devices.
  • the moving image can be divided into several blocks or macroblocks, and try to search for each block or macroblock in the adjacent frame image , And get the relative offset of the space position between the two, the relative offset is usually referred to as the motion vector, and the process of obtaining the motion vector is called motion estimation.
  • the inventor discovered a motion vector recognition method while studying the background technology.
  • the method divides the current frame into multiple strips, and calculates the feature points of each strip and the feature value corresponding to the feature point row by row, and calculates each feature
  • the above scheme has some problems: because each frame of image is subjected to striped feature point detection and feature point matching in a top-down order, matching feature points are obtained, and the motion vector of each matching feature point is calculated according to the preset
  • the threshold determines whether there is a global motion vector in the motion vector with the most occurrences. This method cannot guarantee that the global motion vector is accurately determined in the first image of each frame. This situation is easy to happen: for example, in the middle Or if the global motion vector is determined at a later position, the current and subsequent strips can only be coded according to the determined global motion vector. Since the previous strips have already been processed, they will not be determined based on the subsequent determination. The global motion vector is encoded. Therefore, in this way, the image compression effect cannot be guaranteed.
  • the present disclosure proposes an improved technical solution on the basis of the above-mentioned background art solution, in order to at least partially improve the above-mentioned problem.
  • the embodiments of the present disclosure provide an image processing method and device, which can solve the problem of the slow speed of the existing image processing to calculate the global motion vector.
  • the technical solution is as follows:
  • an image processing method including:
  • the motion vector of the target macroblock line is calculated according to a preset rule, and the motion vector of the target macroblock line is taken as the global motion vector.
  • determining the target macroblock row according to the characteristic points of each macroblock row includes:
  • calculating the motion vector of the target macroblock line according to a preset rule according to the characteristic points of the target macroblock line includes:
  • the global motion vector is determined according to the motion vector of the matching feature point.
  • determining a global motion vector according to the motion vector of the matching feature point includes:
  • the motion vector of the matching feature point with the most occurrences is determined as the global motion vector.
  • the above method further includes: dividing the current image frame into a plurality of strips; and performing macroblock type recognition on the current image frame according to the global motion vector.
  • an image processing device which includes:
  • the first determining module is configured to determine a target macroblock line according to the characteristic points of each macroblock line; wherein the target macroblock line includes N consecutive initial macroblock lines;
  • the second determining module is configured to calculate the motion vector of the target macroblock line according to a preset rule according to the characteristic points of the target macroblock line, and use the motion vector of the target macroblock line as a global motion vector.
  • the first determining module is specifically configured to:
  • the second determining module includes:
  • the first calculation sub-module is used to calculate the feature values of multiple feature points in the reference image frame
  • the second calculation sub-module is used to calculate the characteristic value of each characteristic point in the target macroblock row of the current image frame
  • the comparison sub-module is used to compare the feature value of each feature point in the target macroblock row of the current image frame with the feature value of multiple feature points in the reference image frame;
  • the third calculation submodule is used to calculate the motion vector of each matching feature point in the target macroblock row relative to the matching feature point corresponding to the reference image frame;
  • the determining sub-module is used to determine the global motion vector according to the motion vector of the matching feature point according to a preset rule.
  • the determining submodule is specifically used for:
  • the image processing method provided by the present disclosure is simple and fast, has high accuracy, and has a high image compression rate.
  • Fig. 1 is a flowchart of an image processing method provided by an embodiment of the present disclosure
  • Fig. 2 is a flowchart of determining a global motion vector provided by an embodiment of the present disclosure
  • FIG. 3 is a flowchart of an image processing method provided by an embodiment of the present disclosure.
  • FIG. 4 is a schematic diagram of images before and after translation provided by an embodiment of the present disclosure.
  • FIG. 5 is a schematic diagram of a stripe division provided by an embodiment of the present disclosure.
  • FIG. 6 is an example diagram of an application environment provided by an embodiment of the present disclosure.
  • FIG. 8 is a structural diagram of an image processing device provided by an embodiment of the present disclosure.
  • Fig. 9 is a structural diagram of an image processing device provided by an embodiment of the present disclosure.
  • Fig. 1 is a flowchart of an image processing method provided by an embodiment of the present disclosure. As shown in Fig. 1, the image processing method includes the following steps:
  • Step 101 Acquire multiple initial macroblock lines of a current image frame, and identify the characteristic points of each initial macroblock line; wherein, the current image frame includes multiple initial macroblock lines;
  • the current frame image is first acquired by the image acquisition device, where the current frame image is divided into multiple macroblocks; specifically, the current frame image is divided into multiple macroblocks according to a preset macroblock division method, each of which is The size of a macro block is M ⁇ N, where M can be equal to N. Specifically, the size of each macro block may be 16 ⁇ 16, 8 ⁇ 8, and so on.
  • determining the target macroblock row includes:
  • the feature point refers to a point where the gray value of the image changes drastically or a point with a larger curvature on the edge of the image (ie, the intersection of two edges).
  • the N initial macroblock lines containing the most feature points are taken as target macroblock lines.
  • Step 102 Determine a target macroblock line according to the characteristic points of each initial macroblock line; wherein, the target macroblock line includes N consecutive initial macroblock lines;
  • Step 103 Calculate the motion vector of the target macroblock line according to the characteristic points of the target macroblock line, and use the motion vector of the target macroblock line as a global motion vector.
  • calculating the motion vector of the target macroblock line according to the characteristic points of the target macroblock line, and using the motion vector of the target macroblock line as the global motion vector includes:
  • the reference frame is an image frame that has been coded, all the feature points and their feature values in the reference frame can be obtained.
  • the reference frame not only refers to the previous frame of the current image frame, but can actually refer to any frame of image before the current image.
  • the feature of each feature point can be calculated according to feature extraction algorithms such as Scale-invariant Feature Transform (SIFT), FAST, MSER, STAR, etc. Value; the hash value of the pixel value of the feature point can also be calculated as the feature value.
  • SIFT Scale-invariant Feature Transform
  • FAST FAST
  • MSER MSER
  • STAR STAR
  • hash value of the pixel value of the feature point can also be calculated as the feature value.
  • Step 1032 Calculate the feature value of each feature point in the target macroblock row of the current image frame
  • This step is the same as the method of calculating the feature value of the reference frame in step 1031, and will not be repeated here.
  • Step 1033 Compare the feature value of each feature point in the target macroblock row of the current image frame with the feature value of multiple feature points in the reference image frame;
  • Step 1034 Mark the feature points with the same feature values of the feature points in the target macroblock row of the current image frame and the feature points in the reference frame as matching feature points;
  • Step 1035 Calculate the motion vector of each matching feature point in the target macroblock row relative to the matching feature point corresponding to the reference image frame;
  • the representation of the motion vector of each target feature point relative to its matching feature point is (mv_x, mv_y), where mv_x represents the offset on the x-axis (horizontal), and mv_y represents the y-axis (longitudinal). The offset.
  • Step 1036 Determine a global motion vector according to the motion vector of the matching feature point according to a preset rule.
  • determining a global motion vector according to the motion vector of the matching feature point includes:
  • the motion vector of the matching feature point with the most occurrences is determined as the global motion vector.
  • each feature point in the target macroblock row includes: (mv_x1, mv_y1), (mv_x2, mv_y2) and (mv_x3, mv_y3); among them, (mv_x1, mv_y1) appears 5 times, ( mv_x2, mv_y2) appears 102 times and (mv_x3, mv_y3) 11 times. Therefore, the motion vector (mv_x2, mv_y2) that appears most can be determined as the global motion vector.
  • the method further includes: performing macroblock type recognition on the current image frame according to the global motion vector.
  • the method further includes:
  • Step 104 Divide the current image frame into multiple strips, and perform macroblock type recognition strip by strip according to the determined global motion vector.
  • the current frame image can be divided into multiple strips in a preset manner, and the height of each strip can be equal to the height of one macroblock row or multiple continuous macroblock rows.
  • the strip division method can be set and adjusted according to actual needs.
  • a frame of image can be equally divided into N strips, and the number of N can be set as required.
  • Figure 4 is a schematic diagram of images before and after translation.
  • Figure 5 is a schematic diagram of the stripe division of the right image in Figure 4. Referring to Figure 5, the original image is equally divided into six strips (a)-(f), and the height of each strip is two macros. The height of the block row, the length is equal to the length of seventeen macroblock columns.
  • the macroblock type identification is performed slice by slice from top to bottom.
  • the specific identification steps include:
  • the macroblocks contained in the current slice are compared with the macroblocks in the reference frame one by one, and the macroblock type is identified according to the comparison result.
  • the recognition of the macroblock type according to the comparison result specifically includes:
  • the current comparison macroblock is determined to be a zero-motion macroblock; the current comparison macroblock is moved backward according to the global motion vector (assuming the current comparison The macroblock is the macroblock after moving according to the global motion vector.
  • the so-called reverse motion refers to restoring the current compared macroblock to the initial position before sending the motion), and determine the position of the current compared macroblock after the reverse motion (Ie the initial position); if the macroblock at the corresponding position (initial position) in the reference frame is the same as the currently compared macroblock, the current compared macroblock is determined to be a global motion macroblock.
  • the other macroblocks are considered to have changed the content of the picture, and other encoding rules can be used for encoding (for example, the video can be encoded by H.264).
  • the comparison process is to compare the pixel values of all pixels of the two macroblocks one by one. When the pixels are completely the same, it can be determined that the two macroblocks are the same; otherwise, it can be determined that the two macroblocks are not the same.
  • the above scheme also includes:
  • the motion vector with the most occurrences exceeds one; continue to expand the position of the target macroblock row, such as moving the target macroblock row upward or Extend one line downward, and then perform motion vector calculation for the N+1 continuous macroblock lines after expansion, and determine the motion vector with the most occurrences among the calculated motion vectors as the global motion vector. If the global motion vector with the most occurrences is still not determined, the current N+1 continuous macroblock rows can be extended up or down by one line, and so on, until the most-occurring motion vector is found. When expanding, you can alternate upward and downward expansion.
  • the method may further include:
  • Step 105 For each slice, perform inter-frame coding based on the result of macroblock recognition.
  • pipeline processing is performed in the order of the strips, that is, when a strip is encoded, the strip is transmitted immediately, thereby reducing the delay at the encoding and decoding end.
  • the current frame can be divided into multiple strips, and at the same time, each strip can be matched with the current frame and the offset vector can be calculated, which can improve the processing efficiency and speed up the calculation of the global motion vector to meet the needs of high-definition video real-time Transmission requires high compression efficiency.
  • the present disclosure is mainly aimed at desktop virtualization and cloud desktop scenarios, and is mainly used for motion vector recognition and encoding and decoding of computer images.
  • the so-called computer image is simply the desktop image produced by the user operating the computer.
  • the continuously changing natural image forms a natural image video
  • the continuously changing computer image forms a computer image video.
  • computer image video has more significant characteristics, for example, the motion vector has a certain regularity compared with natural video. This is determined by the way the image is generated. Since computer images are generated by user operations, user operations may or may not generate a motion vector between the two frames. If a motion vector is generated, it is mostly It is generated by the user’s mouse drag operation. In this case, the number of motion vectors is usually one.
  • This motion vector can be called a global motion vector; while the motion vector in natural image video shows irregularities. This is because in natural video, multiple objects may shift in different directions between two frames of images, resulting in multiple motion vectors.
  • the present disclosure mainly studies computer images with relatively simple conditions.
  • Fig. 6 is an example diagram of an application environment of encoding and decoding in the image processing process of the present disclosure.
  • the video signal is encoded in the encoding end, and then transmitted to the decoding end through the network transmission channel.
  • the encoding end is located on the server end; the decoding end is located on the receiving device.
  • the receiving device can be a personal computer, mobile phone, etc., in the desktop virtualization scenario, the receiving device Can be zero terminal.
  • the number of receiving devices may be one or more, which is not limited in the present invention.
  • FIG. 7 is a structural diagram of a first image processing device provided by an embodiment of the present disclosure.
  • the image processing device 70 shown in FIG. 7 includes an acquisition module 701, a first determination module 702, and a second determination module 703, wherein the acquisition module 701 uses To obtain multiple initial macroblock lines of the current image frame, identify the characteristic points of each initial macroblock line; wherein, the current image frame includes multiple initial macroblock lines; the first determining module 702 is configured to The characteristic points of the initial macroblock rows to determine the target macroblock row; wherein the target macroblock row includes N consecutive initial macroblock rows; the second determining module 703 is used to determine the target macroblock row according to the characteristic points of the target macroblock row, Calculate the motion vector of the target macroblock line according to a preset rule, and use the motion vector of the target macroblock line as the global motion vector.
  • the first determining module 702 is specifically configured to determine the target macroblock row of N consecutive initial macroblock behaviors containing the most feature points.
  • FIG. 8 is a structural diagram of a first image processing device provided by an embodiment of the present disclosure.
  • the image processing device 80 shown in FIG. 8 includes an acquisition module 801, a first determination module 802, and a second determination module 803, wherein the second determination module 803 includes:
  • the first calculation sub-module 8031 is used to calculate the feature values of multiple feature points in the reference image frame
  • the second calculation sub-module 8032 is configured to calculate the characteristic value of each characteristic point in the target macroblock row of the current image frame
  • the comparison sub-module 8033 is configured to compare the feature value of each feature point in the target macroblock row of the current image frame with the feature value of multiple feature points in the reference image frame;
  • the identification sub-module 8034 is configured to identify the feature points whose feature values of each feature point in the target macroblock row of the current image frame are the same as the feature values of the feature points in the reference frame as matching feature points;
  • the third calculation sub-module 8035 is configured to calculate the motion vector of each matching feature point in the target macroblock row relative to the matching feature point corresponding to the reference image frame;
  • the determining sub-module 8036 is configured to determine a global motion vector according to the motion vector of the matching feature point according to a preset rule.
  • the determining submodule 8036 is specifically configured to:
  • the motion vector of the matching feature point with the most occurrences is determined as the global motion vector.
  • FIG. 9 is a structural diagram of the first image processing device provided by an embodiment of the present disclosure.
  • the image processing device 90 shown in FIG. 9 includes an acquisition module 901, a first determination module 902, a second determination module 903, and an identification module 904, in which,
  • the recognition module 904 is configured to divide the current image frame into multiple strips, and perform macroblock type recognition on the current image frame according to the global motion vector.
  • the embodiment of the present disclosure also provides a computer-readable storage medium.
  • the non-transitory computer-readable storage medium may be a read-only memory (English: Read Only Memory, ROM), random access memory (English: Random Access Memory, RAM), CD-ROM, magnetic tape, floppy disk and optical data storage device, etc.
  • the storage medium stores computer instructions for executing the image processing method described in the embodiment corresponding to FIG. 1, which will not be repeated here.

Abstract

本公开提供一种图像处理方法及装置,涉及计算机图像技术领域,所述方法包括获取当前图像帧的多个初始宏块行,识别每个初始宏块行的特征点;其中,所述当前图像帧包括多个初始宏块行;根据所述每个初始宏块行的特征点,确定目标宏块行;其中,所述目标宏块行包括连续N个初始宏块行;根据所述目标宏块行的特征点,计算所述目标宏块行的运动矢量,并将所述目标宏块行的运动矢量作为全局运动矢量。本公开能够解决现有不能保证图像压缩效果的问题。

Description

图像处理方法及装置 技术领域
本公开涉及计算机图像技术领域,尤其涉及图像处理方法及装置。
背景技术
在帧间预测编码中,由于活动图像邻近帧中的景物存在着一定的相关性,因此,可将活动图像分成若干块或宏块,并设法搜索出每个块或宏块在邻近帧图像中的位置,并得出两者之间的空间位置的相对偏移量,得到的相对偏移量就是通常所指的运动矢量,得到运动矢量的过程被称为运动估计。
运动矢量和经过运动匹配后得到的预测误差共同发送到解码端,在解码端按照运动矢量指明的位置,从已经解码的邻近参考帧图像中找到相应的块或宏块,和预测误差相加后就得到了块或宏块在当前帧中的位置。
发明人在研究背景技术时发现了一种运动向量的识别方法,该方法将当前帧分为多个条带,并逐行计算各条带的特征点和特征点对应的特征值,计算各特征点相对于参考帧中对应特征点的偏移向量;并根据该偏移向量确定该偏移向量为主偏移向量,也就是全局运动矢量。
但是上述方案存在一些问题:由于针对每帧图像按照自上而下的顺序进行条带化的特征点检测和特征点的匹配,得到匹配特征点,计算各个匹配特征点的运动矢量,根据预设阈值确定出现次数最多的运动矢量中是否存在全局运动矢量,这种方式不能保证在每帧图像的第一个图像即准确判断出全局运动矢量,也就很容易发生这种情况:比如,在中间或者偏后位置才确定全局运动矢量的话,则只能根据确定的全局运动矢量对当前和后续的条带进行编码,而前面的条带由于已经处理过了,因此,并不会根据后续确定的全局运动矢量进行编码。因此,这种方式,不能保证图像压缩效果。
发明内容
本公开在上述背景技术的方案基础上提出了一种改进技术方案,以期对上述问题进行至少部分改善。
本公开实施例提供一种图像处理方法及装置,能够解决现有图像处理计算全局运动矢量的速度较慢的问题。所述技术方案如下:
根据本公开实施例的第一方面,提供一种图像处理方法,该方法包括:
获取当前图像帧的多个初始宏块行,识别每个初始宏块行的特征点;其中,所述当前图像帧包括多个初始宏块行;
根据所述每个初始宏块行的特征点,确定目标宏块行;其中,所述目标宏块行包括连续N个初始宏块行;
根据所述目标宏块行的特征点,按照预设规则计算所述目标宏块行的运动矢量,并将所述目标宏块行的运动矢量作为全局运动矢量。
在一个实施例中,根据所述每个宏块行的特征点,确定目标宏块行包括:
确定包含特征点最多的连续N个宏块行为目标宏块行。
在一个实施例中,根据所述目标宏块行的特征点,按照预设规则计算所述目标宏块行的运动矢量包括:
计算参考图像帧中多个特征点的特征值;
计算所述当前图像帧目标宏块行中各个特征点的特征值;
将所述当前图像帧目标宏块行中各个特征点的特征值与参考图像帧中多个特征点的特征值进行比对;
将所述当前图像帧目标宏块行中各个特征点的特征值与参考帧中特征点的特征值相同的特征点标识为匹配特征点;
计算所述目标宏块行中各个匹配特征点相对于参考图像帧对应的匹配特征点的运动矢量;
按照预设规则,根据所述匹配特征点的运动矢量确定全局运动向量。
在一个实施例中,按照预设规则,根据所述匹配特征点的运动矢量确定全局运动向量包括:
确定出现次数最多的匹配特征点的运动矢量作为全局运动矢量。
在一个实施例中,上述方法还包括:将所述当前图像帧划分为多个条带;并根据所述全局运动矢量对当前图像帧进行宏块类型识别。
根据本公开实施例的第二方面,提供一种图像处理装置,该装置包括:
获取模块,用于获取当前图像帧的多个初始宏块行,识别每个初始宏块 行的特征点;其中,所述当前图像帧包括多个初始宏块行;
第一确定模块,用于根据所述每个宏块行的特征点,确定目标宏块行;其中,所述目标宏块行包括连续N个初始宏块行;
第二确定模块,用于根据所述目标宏块行的特征点,按照预设规则计算所述目标宏块行的运动矢量,并将所述目标宏块行的运动矢量作为全局运动矢量。
在一个实施例中,第一确定模块具体用于:
确定包含特征点最多的连续N个宏块行为目标宏块行。
在一个实施例中,第二确定模块包括:
第一计算子模块,用于计算参考图像帧中多个特征点的特征值;
第二计算子模块,用于计算所述当前图像帧目标宏块行中各个特征点的特征值;
比对子模块,用于将所述当前图像帧目标宏块行中各个特征点的特征值与参考图像帧中多个特征点的特征值进行比对;
标识子模块,用于将所述当前图像帧目标宏块行中各个特征点的特征值与参考帧中特征点的特征值相同的特征点标识为匹配特征点;
第三计算子模块,用于计算所述目标宏块行中各个匹配特征点相对于参考图像帧对应的匹配特征点的运动矢量;
确定子模块,用于按照预设规则,根据所述匹配特征点的运动矢量确定全局运动向量。
在一个实施例中,确定子模块具体用于:
确定出现次数最多的匹配特征点的运动矢量作为全局运动矢量。
在一个实施例中,上述装置还包括:识别模块,用于将所述当前图像帧划分为多个条带;并根据所述全局运动矢量对当前图像帧进行宏块类型识别。
本公开所提供的图像处理方法,简单快捷,具有较高的准确度,且图像压缩率高。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性 的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
图1是本公开实施例提供的一种图像处理方法的流程图;
图2是本公开实施例提供的一种确定全局运动矢量流程图;
图3是本公开实施例提供的一种图像处理方法的流程图;
图4是本公开实施例提供的一种平移前和平移后的图像示意图;
图5是本公开实施例提供的一种条带划分示意图;
图6是本公开实施例提供的一种应用环境示例图;
图7是本公开实施例提供的一种图像处理装置的结构图;
图8是本公开实施例提供的一种图像处理装置的结构图;
图9是本公开实施例提供的一种图像处理装置的结构图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。
本公开在上述背景技术方案基础上提出了一种改进技术方案,以期对上述问题进行至少部分改善。
下面对本发明所述方案进行详细阐述。
图1是本公开实施例提供的一种图像处理方法的流程图,如图1所示,该图像处理方法包括以下步骤:
步骤101、获取当前图像帧的多个初始宏块行,识别每个初始宏块行的 特征点;其中,所述当前图像帧包括多个初始宏块行;
该步骤中,可以通过逐行的方式获取当前图像帧的多个初始行宏块,识别每个初始宏块行的特征点。
该步骤中,首先通过图像采集装置获取当前帧图像,其中,当前帧图像划分为多个宏块;具体的,按照预设的宏块划分方式将当前帧图像划分为多个宏块,其中每一个宏块大小为M×N,其中,M可以等于N。具体的,每个宏块大小可以为16×16、8×8等。
根据所述每个初始宏块行的特征点,确定目标宏块行包括:
确定包含特征点最多的连续N个初始宏块行为目标宏块行。
该步骤中,特征点指的是图像灰度值发生剧烈变化的点或者在图像边缘上曲率较大的点(即两个边缘的交点)。
根据连续N个初始宏块行的特征点数量和全局运动矢量出现概率的正相关性,将包含特征点最多的N个初始宏块行作为目标宏块行。
步骤102、根据所述每个初始宏块行的特征点,确定目标宏块行;其中,所述目标宏块行包括连续N个初始宏块行;
目标宏块行需满足的三个条件是:1、包含N个宏块行;2、N个宏块行之间是连续的;3、所述N个连续宏块行包含的特征点最多。
为了找出目标宏块行,需要对所有连续的N个宏块行的特征点数量进行统计,统计数量最多的N个宏块行即为目标宏块行。
N的数据可以根据实际需要进行设置,比如,可以设置为2或3或4等等,这里不做限制。
根据多个连续宏块行中特征点数量和全局运动矢量出现概率的正相关性,我们可以认为:包含特征点最多的连续宏块行可以作为寻找全局运动矢量的目标宏块行。
步骤103、根据所述目标宏块行的特征点,计算所述目标宏块行的运动矢量,并将所述目标宏块行的运动矢量作为全局运动矢量。
如图2所示,根据所述目标宏块行的特征点,计算所述目标宏块行的运动矢量,并将所述目标宏块行的运动矢量作为全局运动矢量包括:
步骤1031、计算参考图像帧中多个特征点的特征值;
该步骤之前,由于参考帧是已经编码过的图像帧,因此,可以获得参考帧中所有的特征点及其特征值。
所述参考帧不仅仅指当前图像帧的前一帧,实际上可以指当前图像之前的任意一帧图像。
具体的,计算特征点的特征值的方案有很多,比如,可以根据如尺度不变特征变换(Scale-invariant feature transform,SIFT),FAST、MSER、STAR等特征提取算法来计算各个特征点的特征值;也可以计算特征点像素值的哈希值来作为特征值。
步骤1032、计算所述当前图像帧目标宏块行中各个特征点的特征值;
该步骤和步骤1031中计算参考帧的特征值方法一致,不再赘述。
步骤1033、将所述当前图像帧目标宏块行中各个特征点的特征值与参考图像帧中多个特征点的特征值进行比对;
步骤1034、将所述当前图像帧目标宏块行中各个特征点的特征值与参考帧中特征点的特征值相同的特征点标识为匹配特征点;
步骤1035、计算所述目标宏块行中各个匹配特征点相对于参考图像帧对应的匹配特征点的运动矢量;
该步骤中,各个目标特征点相对于其匹配特征点的运动矢量的表示方式为(mv_x,mv_y),其中,mv_x代表x轴(横向)上的偏移量,mv_y代表y轴(纵向)上的偏移量。
步骤1036、按照预设规则,根据所述匹配特征点的运动矢量确定全局运动向量。
在一个实施例中,按照预设规则,根据所述匹配特征点的运动矢量确定全局运动向量包括:
确定出现次数最多的匹配特征点的运动矢量作为全局运动矢量。
举例来说,假设目标宏块行中各个特征点的特征值取值包括:(mv_x1,mv_y1)、(mv_x2,mv_y2)和(mv_x3,mv_y3);其中,(mv_x1,mv_y1)出现5次、(mv_x2,mv_y2)出现102次、(mv_x3,mv_y3)11次,因此, 可以将出现最多的运动矢量(mv_x2,mv_y2)确定为全局运动矢量。
在一个实施例中,该方法还包括:根据所述全局运动矢量对当前图像帧进行宏块类型识别。
在一个实施例中,如图3所示,该方法还包括:
步骤104、将所述当前图像帧划分为多个条带,并根据确定出的全局运动矢量,逐条带进行宏块类型识别。
该步骤中,可以按照预设方式将当前帧图像划分为多个条带,每一个条带的高度可以等于一个宏块行或者多个连续宏块行的高度。具体的,条带划分方式可以根据实际需要进行设置和调整。通常可以将一帧图像等分为N个条带,N的个数根据需要进行设定。
图4是平移前和平移后的图像示意图。图5是对图4中右图进行条带划分后的示意图,参照图5,将原图像等分为(a)-(f)共六个条带,每一个条带的高度是两个宏块行的高度,长度则等于十七个宏块列的长度。
具体的,根据上一步确定出的全局运动矢量,自上而下逐条带进行宏块类型识别。具体的识别步骤包括:
将当前条带所包含的宏块,分别与参考帧中的宏块进行逐一比对,根据比对结果进行宏块类型识别。
所述根据比对结果进行宏块类型识别具体包括:
如果当前比对宏块与参考帧中相同位置上的宏块完全相同,则确定当前比对宏块为零运动宏块;将当前比对宏块按照全局运动矢量进行反向运动(假设当前比对宏块是按照全局运动矢量运动后的宏块,所谓反向运动是指将当前比对宏块还原至发送运动之前的初始位置),确定反向运动后当前比对宏块所处的位置(即初始位置);如果参考帧中对应位置(初始位置)上的宏块与当前比对宏块相同,则确定当前比对宏块为全局运动宏块。除上述两种情况之外的其它宏块,则认为图片内容变化,可以采用其它编码规则进行编码(例如视频可以采用H.264编码)。
具体的,对比过程为将两个宏块的所有像素点的像素值逐一进行对比,当像素点完全相同时,可以确定两个宏块相同;反之,则确定两个宏块不相同。
进一步的,上述方案还包括:
如果当前特征点数量最多的目标宏块行中,对特征点所计算的运动矢量中,出现次数最多的运动矢量超过一个;则继续扩大目标宏块行的位置,比如将目标宏块行向上或者向下扩展一行,再针对扩展后的N+1个连续宏块行进行运动矢量计算,将计算得到的运动矢量中出现次数最多的运动矢量确定为全局运动矢量。如果仍未能确定出一个出现次数最多的全局运动矢量,则可以对当前的N+1个连续宏块行继续向上或者向下扩展一行,以此类推,直到找到出现次数最多的一个运动矢量。在进行扩展时,可以交替进行向上和向下的扩展,比如,可以先向上扩展一行,如果未找到,则再向下扩展一行,如果仍未找到,则再向上扩展一行;在扩展过程中,如果某一个方向上无法再进行扩展,比如,已经向上扩展至第一行,则后续如果还需要进行扩展,就可以只向下扩展。
如图3,在一个实施例中,该方法还可以包括:
步骤105、针对每一个条带,基于宏块识别结果,进行帧间编码。
该方案中,在编码过程中,按照条带顺序进行流水线处理,也就是:编码一个条带,则立即对该条带进行传输,从而降低编解码端的时延。
在本申请中,可以将当前帧划分为多个条带,同时将各条带与当前帧进行匹配和计算偏移矢量,可以提高处理效率,加快全局运动矢量的计算速度,以满足高清视频实时传输对压缩效率的高要求。
下面对本公开所述方案的应用场景进行简单阐述。
本公开主要针对桌面虚拟化和云桌面场景,主要用于计算机图像的运动向量识别和编解码。所谓计算机图像,简单来说就是用户操作计算机所产生的桌面图像。连续变化自然图像形成自然图像视频,而连续变化的计算机图像则形成计算机图像视频。相较于自然视频,计算机图像视频有着比较显著的特点,比如,运动矢量相对于自然视频存在一定规律性。这是由图像的产生方式决定的,由于计算机图像是由用户操作产生的,用户的操作有可能使两帧画面之间产生运动向量,也有可能不产生运动向量,如果产生运动向量,则多数是由用户的鼠标拖动操作产生的,这种情况下,运动矢量的个数通常为一个,这一个运动矢量可以被称为全局运动矢量;而自然图像视频中运动 矢量则呈现出不规律性,这是因为自然视频中两帧图像之间可能有多个物体发生不同方向的位移,从而产生多个运动矢量。而本公开主要对情况相对简单的计算机图像进行研究。
图6是本公开图像处理过程中编解码的一种应用环境示例图,参照图1,视频信号在编码端中进行编码,之后,再通过网络传输通道传输至解码端。本领域技术人员能够理解的是,编码端位于服务器端;解码端位于接收设备之上,在云桌面场景下,接收设备可以为个人电脑、移动电话等等,在桌面虚拟化场景下,接收设备可以为零终端。接收设备的数量可以为一个或者多个,本发明对此不做限制。
图7是本公开实施例提供第一种图像处理装置结构图,如图7所示的图像处理装置70包括获取模块701、第一确定模块702和第二确定模块703,其中,获取模块701用于获取当前图像帧的多个初始宏块行,识别每个初始宏块行的特征点;其中,所述当前图像帧包括多个初始宏块行;第一确定模块702用于根据所述每个初始宏块行的特征点,确定目标宏块行;其中,所述目标宏块行包括连续N个初始宏块行;第二确定模块703用于根据所述目标宏块行的特征点,按照预设规则计算所述目标宏块行的运动矢量,并将所述目标宏块行的运动矢量作为全局运动矢量。
在一个实施例中,第一确定模块702具体用于:确定包含特征点最多的连续N个初始宏块行为目标宏块行。
图8是本公开实施例提供第一种图像处理装置结构图,如图8所示的图像处理装置80包括获取模块801、第一确定模块802和第二确定模块803,其中,第二确定模块803包括:
第一计算子模块8031,用于计算参考图像帧中多个特征点的特征值;
第二计算子模块8032,用于计算所述当前图像帧目标宏块行中各个特征点的特征值;
比对子模块8033,用于将所述当前图像帧目标宏块行中各个特征点的特征值与参考图像帧中多个特征点的特征值进行比对;
标识子模块8034,用于将所述当前图像帧目标宏块行中各个特征点的特征值与参考帧中特征点的特征值相同的特征点标识为匹配特征点;
第三计算子模块8035,用于计算所述目标宏块行中各个匹配特征点相对于参考图像帧对应的匹配特征点的运动矢量;
确定子模块8036,用于按照预设规则,根据所述匹配特征点的运动矢量确定全局运动向量。
在一个实施例中,确定子模块8036具体用于:
确定出现次数最多的匹配特征点的运动矢量作为全局运动矢量。
图9是本公开实施例提供第一种图像处理装置结构图,如图9所示的图像处理装置90包括获取模块901、第一确定模块902、第二确定模块903和识别模块904,其中,识别模块904用于将所述当前图像帧划分为多个条带,并根据所述全局运动矢量对当前图像帧进行宏块类型识别。
基于上述图1对应的实施例中所描述的图像处理方法,本公开实施例还提供一种计算机可读存储介质,例如,非临时性计算机可读存储介质可以是只读存储器(英文:Read Only Memory,ROM)、随机存取存储器(英文:Random Access Memory,RAM)、CD-ROM、磁带、软盘和光数据存储装置等。该存储介质上存储有计算机指令,用于执行上述图1对应的实施例中所描述的图像处理方法,此处不再赘述。
本领域技术人员在考虑说明书及实践这里公开的公开后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。

Claims (10)

  1. 一种图像处理方法,其特征在于,所述方法包括:
    获取当前图像帧的多个初始宏块行,识别每个初始宏块行的特征点;其中,所述当前图像帧包括多个初始宏块行;
    根据所述每个初始宏块行的特征点,确定目标宏块行;其中,所述目标宏块行包括连续N个初始宏块行;
    根据所述目标宏块行的特征点,计算所述目标宏块行的运动矢量,并将所述目标宏块行的运动矢量作为全局运动矢量。
  2. 根据权利要求1所述的图像处理方法,其特征在于,所述根据所述每个初始宏块行的特征点,确定目标宏块行包括:
    确定包含特征点最多的连续N个初始宏块行为目标宏块行。
  3. 根据权利要求1所述的图像处理方法,其特征在于,所述根据所述目标宏块行的特征点,按照预设规则计算所述目标宏块行的运动矢量,并将所述目标宏块行的运动矢量作为全局运动矢量包括:
    计算参考图像帧中多个特征点的特征值;
    计算所述当前图像帧目标宏块行中各个特征点的特征值;
    将所述当前图像帧目标宏块行中各个特征点的特征值与参考图像帧中多个特征点的特征值进行比对;
    将所述当前图像帧目标宏块行中各个特征点的特征值与参考帧中特征点的特征值相同的特征点标识为匹配特征点;
    计算所述目标宏块行中各个匹配特征点相对于参考图像帧对应的匹配特征点的运动矢量;
    按照预设规则,根据所述匹配特征点的运动矢量确定全局运动向量。
  4. 根据权利要求3所述的图像处理方法,其特征在于,所述按照预设规则,根据所述匹配特征点的运动矢量确定全局运动向量包括:
    确定出现次数最多的匹配特征点的运动矢量作为全局运动矢量。
  5. 根据权利要求4所述的图像处理方法,其特征在于,所述方法还包括:
    将所述当前图像帧划分为多个条带;
    根据所述全局运动矢量对当前图像帧逐条带进行宏块类型识别。
  6. 一种图像处理装置,其特征在于,所述装置包括:
    获取模块,用于获取当前图像帧的多个初始宏块行,识别每个初始宏块行的特征点;其中,所述当前图像帧包括多个初始宏块行;
    第一确定模块,用于根据所述每个初始宏块行的特征点,确定目标宏块行;其中,所述目标宏块行包括连续N个初始宏块行;
    第二确定模块,用于根据所述目标宏块行的特征点,按照预设规则计算所述目标宏块行的运动矢量,并将所述目标宏块行的运动矢量作为全局运动矢量。
  7. 根据权利要求6所述的图像处理装置,其特征在于,所述第一确定模块具体用于:
    确定包含特征点最多的连续N个初始宏块行为目标宏块行。
  8. 根据权利要求6所述的图像处理装置,其特征在于,所述第二确定模块包括:
    第一计算子模块,用于计算参考图像帧中多个特征点的特征值;
    第二计算子模块,用于计算所述当前图像帧目标宏块行中各个特征点的特征值;
    比对子模块,用于将所述当前图像帧目标宏块行中各个特征点的特征值与参考图像帧中多个特征点的特征值进行比对;
    标识子模块,用于将所述当前图像帧目标宏块行中各个特征点的特征值与参考帧中特征点的特征值相同的特征点标识为匹配特征点;
    第三计算子模块,用于计算所述目标宏块行中各个匹配特征点相对于参考图像帧对应的匹配特征点的运动矢量;
    确定子模块,用于按照预设规则,根据所述匹配特征点的运动矢量确定全局运动向量。
  9. 根据权利要求8所述的图像处理装置,其特征在于,所述确定子模块具体用于:
    确定出现次数最多的匹配特征点的运动矢量作为全局运动矢量。
  10. 根据权利要求9所述的图像处理装置,其特征在于,所述装置还包括:
    识别模块,用于将所述当前图像帧划分为多个条带,并根据所述全局运动矢量对当前图像帧进行宏块类型识别。
PCT/CN2020/086269 2019-10-17 2020-04-23 图像处理方法及装置 WO2021073066A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910986217.7 2019-10-17
CN201910986217.7A CN110933428B (zh) 2019-10-17 2019-10-17 图像处理方法及装置

Publications (1)

Publication Number Publication Date
WO2021073066A1 true WO2021073066A1 (zh) 2021-04-22

Family

ID=69849222

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/086269 WO2021073066A1 (zh) 2019-10-17 2020-04-23 图像处理方法及装置

Country Status (2)

Country Link
CN (1) CN110933428B (zh)
WO (1) WO2021073066A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110933428B (zh) * 2019-10-17 2023-03-17 西安万像电子科技有限公司 图像处理方法及装置
CN111310744B (zh) * 2020-05-11 2020-08-11 腾讯科技(深圳)有限公司 图像识别方法、视频播放方法、相关设备及介质
CN111770334B (zh) * 2020-07-23 2023-09-22 西安万像电子科技有限公司 数据编码方法及装置、数据解码方法及装置
CN112087626A (zh) * 2020-08-21 2020-12-15 西安万像电子科技有限公司 图像处理方法、装置及存储介质

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102763136A (zh) * 2010-02-11 2012-10-31 诺基亚公司 用于提供多线程视频解码的方法和设备
JP2015026922A (ja) * 2013-07-25 2015-02-05 三菱電機株式会社 動画像符号化装置および動画像符号化方法
CN105379279A (zh) * 2013-06-12 2016-03-02 微软技术许可有限责任公司 屏幕映射以及用于屏幕内容编码的基于标准的渐进式编解码器
CN106375771A (zh) * 2016-08-31 2017-02-01 苏睿 图像特征匹配方法和装置
CN106470342A (zh) * 2015-08-14 2017-03-01 展讯通信(上海)有限公司 全局运动估计方法及装置
CN107197278A (zh) * 2017-05-24 2017-09-22 西安万像电子科技有限公司 屏幕图像的全局运动向量的处理方法和装置
US20190116376A1 (en) * 2017-10-12 2019-04-18 Qualcomm Incorporated Motion vector predictors using affine motion model in video coding
CN110933428A (zh) * 2019-10-17 2020-03-27 西安万像电子科技有限公司 图像处理方法及装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008133455A1 (en) * 2007-04-25 2008-11-06 Lg Electronics Inc. A method and an apparatus for decoding/encoding a video signal
US8130277B2 (en) * 2008-02-20 2012-03-06 Aricent Group Method and system for intelligent and efficient camera motion estimation for video stabilization
TR201104918A2 (tr) * 2011-05-20 2012-12-21 Vestel Elektroni̇k Sanayi̇ Ve Ti̇caret A.Ş. Derinlik haritası ve 3d video oluşturmak için yöntem ve aygıt.
CN103517078A (zh) * 2013-09-29 2014-01-15 清华大学深圳研究生院 分布式视频编码中边信息生成方法
CN105263026B (zh) * 2015-10-12 2018-04-17 西安电子科技大学 基于概率统计与图像梯度信息的全局矢量获取方法

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102763136A (zh) * 2010-02-11 2012-10-31 诺基亚公司 用于提供多线程视频解码的方法和设备
CN105379279A (zh) * 2013-06-12 2016-03-02 微软技术许可有限责任公司 屏幕映射以及用于屏幕内容编码的基于标准的渐进式编解码器
JP2015026922A (ja) * 2013-07-25 2015-02-05 三菱電機株式会社 動画像符号化装置および動画像符号化方法
CN106470342A (zh) * 2015-08-14 2017-03-01 展讯通信(上海)有限公司 全局运动估计方法及装置
CN106375771A (zh) * 2016-08-31 2017-02-01 苏睿 图像特征匹配方法和装置
CN107197278A (zh) * 2017-05-24 2017-09-22 西安万像电子科技有限公司 屏幕图像的全局运动向量的处理方法和装置
US20190116376A1 (en) * 2017-10-12 2019-04-18 Qualcomm Incorporated Motion vector predictors using affine motion model in video coding
CN110933428A (zh) * 2019-10-17 2020-03-27 西安万像电子科技有限公司 图像处理方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LAN TIAN, LI YUANYUAN, MURUGI JONAH KIMANI, DING YI, QIN ZHIGUANG: "RUN:Residual U-Net for Computer-Aided Detection of Pulmonary Nodules without Candidate Selection", 30 May 2018 (2018-05-30), XP055802437, Retrieved from the Internet <URL:https://arxivbs/1805.11856v1.org/a> [retrieved on 20210507] *

Also Published As

Publication number Publication date
CN110933428A (zh) 2020-03-27
CN110933428B (zh) 2023-03-17

Similar Documents

Publication Publication Date Title
WO2021073066A1 (zh) 图像处理方法及装置
US9852511B2 (en) Systems and methods for tracking and detecting a target object
US6380986B1 (en) Motion vector search method and apparatus
JP2000050281A (ja) 動きベクトル検出方法および装置、記録媒体
CN109688407B (zh) 编码单元的参考块选择方法、装置、电子设备及存储介质
CN101120594B (zh) 全局运动估计
WO2019072248A1 (zh) 运动估计方法、装置、电子设备及计算机可读存储介质
KR102080694B1 (ko) 곡면 모델링을 통한 깊이 영상 부호화에서 움직임 추정 방법 및 장치와 비일시적 컴퓨터 판독가능 기록매체
JP2005354528A (ja) 動きベクトル検出装置及び方法
WO2018230294A1 (ja) 動画像処理装置、表示装置、動画像処理方法、および制御プログラム
US8509303B2 (en) Video descriptor generation device
US20240080439A1 (en) Intra-frame predictive coding method and system for 360-degree video and medium
JP2011041275A (ja) 画像処理方法、データ処理方法、コンピューター読み取り可能な媒体、およびデータ処理装置
CN110839157B (zh) 图像处理方法及装置
JP2014110020A (ja) 画像処理装置、画像処理方法および画像処理プログラム
CN110493599B (zh) 图像识别方法及装置
KR101541077B1 (ko) 텍스쳐 기반 블록 분할을 이용한 프레임 보간 장치 및 방법
CN114040209A (zh) 运动估计方法、装置、电子设备及存储介质
CN110780780B (zh) 图像处理方法及装置
US20110228851A1 (en) Adaptive search area in motion estimation processes
CN113810692A (zh) 对变化和移动进行分帧的方法、图像处理装置及程序产品
JP5173946B2 (ja) 符号化前処理装置、符号化装置、復号装置及びプログラム
KR101925785B1 (ko) 해시 정보 기반의 화면 내 예측 기술에 관한 영상 부호화 방법
KR100451184B1 (ko) 모션 벡터 탐색 방법
US10063880B2 (en) Motion detecting apparatus, motion detecting method and program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20877008

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20877008

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20877008

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 14-10-2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20877008

Country of ref document: EP

Kind code of ref document: A1