image processing method and device

文档序号:1708456 发布日期:2019-12-13 浏览:25次 中文

阅读说明:本技术 图像处理方法及装置 (image processing method and device ) 是由 高鹏 范志刚 于 2019-07-16 设计创作,主要内容包括:本公开提供一种图像处理方法及装置,涉及计算机图像技术领域,所述方法包括:获取当前待处理图像帧,检测当前待处理图像帧的页面是否存在滚动条;如果当前待处理图像帧的页面存在滚动条,判断鼠标或键盘对滚动条的操作是否满足预设条件;当鼠标或键盘对滚动条的操作满足预设条件时,对所述当前待处理图像帧作相应的处理。本公开能够解决解决全局运动向量寻找次数过多导致编码效率下降的问题。(the present disclosure provides an image processing method and apparatus, relating to the technical field of computer images, wherein the method comprises: acquiring a current image frame to be processed, and detecting whether a scroll bar exists in a page of the current image frame to be processed; if the page of the current image frame to be processed has the scroll bar, judging whether the operation of the mouse or the keyboard on the scroll bar meets the preset condition; and when the operation of the mouse or the keyboard on the scroll bar meets the preset condition, correspondingly processing the current image frame to be processed. The method and the device can solve the problem that the coding efficiency is reduced due to excessive searching times of the global motion vector.)

1. an image processing method, characterized in that the method comprises:

Acquiring a current image frame to be processed, and detecting whether a scroll bar exists in a page of the current image frame to be processed;

If the page of the current image frame to be processed has the scroll bar, judging whether the operation of the mouse or the keyboard on the scroll bar meets the preset condition;

And when the operation of the mouse or the keyboard on the scroll bar meets the preset condition, correspondingly processing the current image frame to be processed.

2. the image processing method according to claim 1, wherein when the operation of the mouse or the keyboard on the scroll bar satisfies a preset condition, the method comprises:

and when the speed of operating the scroll bar by the mouse is greater than a preset threshold value or when the moving key on the keyboard is detected to be pressed for a long time within a preset time period, judging that the preset condition is met.

3. The method according to any of claims 1 or 2, further comprising obtaining a speed of the mouse-operated scroll bar.

4. The image processing method of claim 3, wherein the obtaining the speed of the mouse-operated scroll bar comprises:

monitoring a first starting time t1 and a first ending time t2 of holding down a left mouse button, and calculating a first time difference delta t 1;

monitoring the coordinates of the mouse in the vertical direction/the horizontal direction, and calculating a first rolling distance s1 according to the coordinates in the vertical direction/the horizontal direction;

According to the first time difference delta t1 and the first scroll distance s1, a first speed v1 of the mouse for operating the scroll bar is calculated.

5. The image processing method of claim 3, wherein the obtaining the speed of the keyboard operation scroll bar comprises:

monitoring a second starting time t3 and a second ending time t4 of the rolling of the mouse wheel, and calculating a second time difference delta t 2;

monitoring a second scroll distance s2 for the mouse scroll wheel to scroll;

and calculating a second speed v2 of the mouse for operating the scroll bar according to the second time difference delta t2 and the second scroll distance s 2.

6. the image processing method according to claim 1, characterized in that the method further comprises: and when the operation of the mouse or the keyboard on the scroll bar does not meet the preset condition, entering a step of motion vector identification.

7. The image processing method according to claim 1, wherein said performing the corresponding processing on the current image frame to be processed comprises:

And (4) not performing motion vector identification, and encoding the current image frame to be processed.

8. an image processing apparatus, characterized in that the apparatus comprises:

the detection module is used for acquiring a current image frame to be processed and detecting whether a scroll bar exists on a page of the current image frame to be processed;

the judging module is used for judging whether the operation of a mouse or a keyboard on a scroll bar meets a preset condition or not if the scroll bar exists on the page of the current image frame to be processed;

and the processing module is used for performing corresponding processing on the current image frame to be processed when the operation of the mouse or the keyboard on the scroll bar meets a preset condition.

9. The image processing apparatus according to claim 8, wherein the determining module is specifically configured to determine that the preset condition is satisfied when a speed at which a mouse or a keyboard operates a scroll bar is greater than a preset threshold or when a moving key on the keyboard is detected to be pressed for a long time within a preset time period.

10. The image processing apparatus according to any one of claims 8 or 9, wherein the apparatus further comprises an acquisition module for acquiring a speed of the mouse-operated scroll bar.

11. The image processing apparatus of claim 10, wherein the acquisition module includes a first monitoring sub-module, a second monitoring sub-module, and a first computation sub-module, wherein,

The first monitoring submodule is used for monitoring a first starting time t1 and a first ending time t2 when the left mouse button is pressed and calculating a first time difference delta t 1;

The second monitoring submodule is used for monitoring the coordinates of the mouse in the vertical direction/the horizontal direction and calculating a first rolling distance s1 according to the coordinates in the vertical direction/the horizontal direction;

The first calculating submodule is used for calculating a first speed v1 of the mouse operation scroll bar according to the first time difference delta t1 and the first scroll distance s 1.

12. The image processing apparatus according to claim 10, wherein the acquisition sub-module includes a third monitoring sub-module, a fourth monitoring sub-module, and a second calculation sub-module, wherein,

The third monitoring submodule is used for monitoring a second starting time t3 and a second ending time t4 of the rolling of the mouse wheel and calculating a second time difference delta t 2;

the fourth monitoring submodule is used for detecting a second rolling distance s2 for the rolling wheel of the mouse to roll;

and the second calculating submodule is used for calculating a second speed v2 of the mouse for operating the scroll bar according to the second time difference delta t2 and the second scroll distance s 2.

13. The image processing apparatus according to claim 8, wherein the processing module is specifically configured to:

and (4) not performing motion vector identification, and encoding the current image frame to be encoded.

Technical Field

The present disclosure relates to the field of computer image technologies, and in particular, to an image processing method and apparatus.

background

Motion estimation is a key step of video compression coding at the present stage, and is a method for realizing reference frame coding, and time redundancy is removed by utilizing the time correlation between a current frame and a reference frame. The reference frame coding can reduce redundancy because there is a great similarity of spatial structure between two frames of a general video sequence, and the difference frame between the two frames can be coded with a much smaller number of bits than that required for intra-frame coding. The basic idea of a motion estimation method based on block matching is to divide each frame of an image sequence into a number of non-overlapping macroblocks, consider the displacement of all pixels in the macroblocks to be the same, then within a given specific range from each macroblock to a reference frame, find the block most similar to the current block, i.e. the matching block, according to a certain matching criterion, and the relative displacement of the matching block and the current block, i.e. the motion vector.

The existing algorithm compares each current frame with a reference frame to find whether a motion vector exists or not, and the coding efficiency is influenced to a great extent.

Disclosure of Invention

The embodiment of the disclosure provides an image processing method and an image processing device, which can solve the problem of complicated calculation in the conventional image processing. The technical scheme is as follows:

according to a first aspect of embodiments of the present disclosure, there is provided an image processing method, including:

Acquiring a current image frame to be processed, and detecting whether a scroll bar exists in a page of the current image frame to be processed; if the page of the current image frame to be processed has the scroll bar, judging whether the operation of the mouse or the keyboard on the scroll bar meets the preset condition; and when the operation of the mouse or the keyboard on the scroll bar meets the preset condition, correspondingly processing the current image frame to be processed.

In one embodiment, when the operation of the mouse or the keyboard on the scroll bar satisfies the preset condition, the operation comprises: and when the speed of operating the scroll bar by the mouse is greater than a preset threshold value or when the moving key on the keyboard is detected to be pressed for a long time within a preset time period, judging that the preset condition is met.

In one embodiment, the method further includes obtaining a speed of the mouse operating the scroll bar.

In one embodiment, obtaining the speed of the mouse-operated scroll bar comprises: monitoring a first starting time t1 and a first ending time t2 of holding down a left mouse button, and calculating a first time difference delta t 1; monitoring the coordinates of the mouse in the vertical direction/the horizontal direction, and calculating a first rolling distance s1 according to the coordinates in the vertical direction/the horizontal direction; according to the first time difference delta t1 and the first scroll distance s1, a first speed v1 of the mouse for operating the scroll bar is calculated.

In one embodiment, obtaining the speed of the keyboard operation scroll bar comprises: acquiring the speed of the keyboard operation scroll bar comprises the following steps: monitoring a second starting time t3 and a second ending time t4 of the rolling of the mouse wheel, and calculating a second time difference delta t 2; monitoring a second scroll distance s2 for the mouse scroll wheel to scroll; and calculating a second speed v2 of the mouse for operating the scroll bar according to the second time difference delta t2 and the second scroll distance s 2.

In one embodiment, the method further comprises: and when the operation of the mouse or the keyboard on the scroll bar does not meet the preset condition, entering a step of motion vector identification.

In one embodiment, the processing the current image frame to be processed correspondingly comprises: and (4) not performing motion vector identification, and encoding the current image frame to be processed.

According to a second aspect of the embodiments of the present disclosure, there is provided an image processing apparatus including: the device comprises a detection module, a judgment module and a processing module, wherein the detection module is used for acquiring a current image frame to be processed and detecting whether a scroll bar exists on a page of the current image frame to be processed; the judging module is used for judging whether the operation of a mouse or a keyboard on a scroll bar meets a preset condition or not if the scroll bar exists on the page of the current image frame to be processed; and the processing module is used for performing corresponding processing on the current image frame to be processed when the operation of the mouse or the keyboard on the scroll bar meets a preset condition. In one embodiment, the determining module is specifically configured to determine that the preset condition is met when a speed of operating the scroll bar by the mouse or the keyboard is greater than a preset threshold or when it is detected that a moving key on the keyboard is pressed for a long time within a preset time period.

in one embodiment, the apparatus further includes an obtaining module, configured to obtain a speed of the mouse operating the scroll bar.

in one embodiment, the obtaining module comprises a first monitoring submodule, a second monitoring submodule and a first calculating submodule, wherein the first monitoring submodule is used for monitoring a first starting time t1 and a first ending time t2 of holding down a left mouse button and calculating a first time difference Δ t 1; the second sub-module is used for monitoring the coordinates of the mouse in the vertical direction/the horizontal direction and calculating a first rolling distance s1 according to the coordinates in the vertical direction/the horizontal direction; the calculation submodule is used for calculating a first speed v1 of the mouse operation scroll bar according to the first time difference delta t1 and the first scroll distance s 1.

in one embodiment, the obtaining submodule includes a third monitoring submodule, a fourth monitoring submodule and a second calculating submodule, wherein the third monitoring submodule is configured to monitor a second start time t3 and a second end time t4 of the mouse wheel rolling, and calculate a second time difference Δ t 2; the fourth monitoring submodule is used for detecting a second rolling distance s2 for the rolling wheel of the mouse to roll; and the second calculating submodule is used for calculating a second speed v2 of the mouse for operating the scroll bar according to the second time difference delta t2 and the second scroll distance s 2.

in one embodiment, the processing module is specifically configured to not perform motion vector identification and to encode a current image frame to be processed.

according to the method and the device, the operation behavior of a user on word and other similar software through a mouse and a keyboard is obtained according to an operation system and used as a condition for comparing a current frame with a reference frame, the frequency of searching for a global motion vector can be reduced to a certain extent, and therefore the coding efficiency is improved.

it is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.

Drawings

The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.

Fig. 1 is a flowchart of an image processing method provided by an embodiment of the present disclosure;

Fig. 2 is a flowchart of an image processing method provided by an embodiment of the present disclosure;

FIG. 3 is a flowchart for obtaining the speed of the mouse operating the scroll bar according to the embodiment of the present disclosure;

FIG. 4 is a flowchart for obtaining the speed of the mouse operating the scroll bar according to the embodiment of the present disclosure;

FIG. 5 is a flow chart of motion vector identification provided by an embodiment of the present disclosure;

Fig. 6 is an architecture diagram of an image processing apparatus according to an embodiment of the present disclosure;

fig. 7 is an architecture diagram of an image processing apparatus according to an embodiment of the present disclosure;

fig. 8 is an architecture diagram of an image processing apparatus according to an embodiment of the present disclosure;

Fig. 9 is an architecture diagram of an image processing apparatus according to an embodiment of the present disclosure.

Detailed Description

Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.

An embodiment of the present disclosure provides an image processing method, as shown in fig. 1, the image processing method including the steps of:

Step 101, acquiring a current image frame to be processed, and detecting whether a scroll bar exists on a page of the current image frame to be processed;

Illustratively, the page in which the scroll bar exists includes, but is not limited to, a document browsing page or a web page online browsing page, such as a word document page, or a PDF document browsing page, etc.

In one embodiment, the method further comprises obtaining a speed of the mouse operating the scroll bar.

102, if the page of the current image frame to be processed has a scroll bar, judging whether the operation of a mouse or a keyboard on the scroll bar meets a preset condition;

When the operation of the mouse or the keyboard on the scroll bar meets the preset conditions, the method comprises the following steps:

and when the speed of operating the scroll bar by the mouse is greater than a preset threshold value or when the mobile key on the keyboard is detected to be pressed for a long time within a preset time period, judging that the preset condition is met.

The mobile keys comprise four mobile keys which are arranged on the keyboard and are upwards, downwards, leftwards and rightwards.

alternatively, the preset threshold may be adaptively set according to the requirements of image transmission.

for example, when it is detected that a down key on the keyboard is pressed for a long time within 3s, it is determined that the preset condition is satisfied. At this time the word document is rapidly scrolled down.

and 103, when the operation of the mouse or the keyboard on the scroll bar meets a preset condition, correspondingly processing the current image frame to be processed.

In one embodiment, the processing the current image frame to be processed correspondingly comprises: and (4) not performing motion vector identification, and encoding the current image frame to be processed.

in one embodiment, the method further comprises: and when the operation of the mouse or the keyboard on the scroll bar does not meet the preset condition, entering a step of motion vector identification.

in one embodiment, after entering the step of motion vector identification, the method further comprises: entering the step of macro block type identification.

Fig. 2 is a flowchart of an image processing method provided in an embodiment of the present disclosure, where the image processing method shown in fig. 2 includes:

Step 201, acquiring a current image frame to be processed, and detecting whether a scroll bar exists on a page of the current image frame to be processed;

if the scroll bar exists, the step 202 is entered to obtain the speed of the mouse for operating the scroll bar; if no scroll bar exists, the step of motion vector identification is entered in step 205;

Step 202, acquiring the speed of the mouse to operate the scroll bar;

Step 203, judging whether the operation of the mouse or the keyboard on the scroll bar meets a preset condition;

When the operation of the mouse or the keyboard on the scroll bar meets the preset condition, entering the step 206 of image coding; when the operation of the mouse or the keyboard on the scroll bar does not meet the preset condition, the step 202 of motion vector identification is entered.

and 204, performing corresponding processing on the current image frame to be processed, and ending the process.

the macro block types of the image frame generally include an invariant macro block, a left copy macro block, an upper copy macro block, a text macro block, a picture macro block, a motion vector matching macro block and the like.

when the operation of the mouse or the keyboard on the scroll bar meets the preset condition, the macro block types are generally character macro blocks and picture macro blocks, can be distinguished by two characteristics of basic color number and high gradient pixel number, and need to use a character encoder and a picture encoder to respectively perform character encoding or picture encoding.

Step 205, motion vector identification.

Judging the macro block type according to the result of the motion vector identification, if the macro block type is a character macro block or a picture macro block, entering step 204, and if the macro block type is an invariant macro block, a left copy macro block, an upper copy macro block or an MV matching macro block, entering step 206.

Step 206, reference frame encoding step, and the process ends.

The difference between the reference frame coding, the text macro block coding and the picture macro block coding is not great from the prior art, and the detailed description is omitted in the present disclosure.

Fig. 3 is a flowchart of acquiring a speed of a mouse operating scroll bar according to an embodiment of the present disclosure, and as shown in fig. 3, acquiring the speed of the mouse operating scroll bar includes the following steps:

step 2021, monitoring a first start time t1 and a first end time t2 of holding down the left button of the mouse, and calculating a first time difference Δ t 1;

step 2022, monitoring the coordinates of the mouse in the vertical direction/horizontal direction, and calculating a first rolling distance s1 according to the coordinates in the vertical direction/horizontal direction;

Step 2023, calculating a first speed v1 of the mouse operating the scroll bar according to the first time difference and the first scroll distance.

fig. 4 is a flowchart of acquiring a speed of a mouse operating scroll bar according to an embodiment of the present disclosure, and as shown in fig. 3, acquiring the speed of the keyboard operating scroll bar includes the following steps:

Step 202a, monitoring a second starting time t3 and a second ending time t4 of the rolling of the mouse wheel, and calculating a second time difference delta t 2;

Step 202b, monitoring a second rolling distance s2 of the rolling wheel of the mouse;

and 202c, calculating a second speed v2 of the mouse for operating the scroll bar according to the second time difference delta t2 and the second scroll distance s 2.

Fig. 5 is a flowchart of motion vector identification provided in an embodiment of the present disclosure, and as shown in fig. 5, the motion vector identification includes:

Step 2051, extracting feature points of the current frame and the reference frame and calculating feature values;

for each pixel point in the image, if the pixel values of the four points in the neighborhood are the same and different from the pixel values of the four points in the neighborhood, the pixel point and the next 31 points form the defined feature, and the obtained feature is represented by 32 pixel points. Two data structures are defined: and the feature structure and the hash structure are used for recording information such as the positions, hash values, offsets and the like of the features.

step 2052, identifying feature points with the same feature value in the current frame and the reference frame as matching feature points;

If the hash values of two features are the same, the two features are matched, and the offset of the two features, i.e. the offset vector, is recorded.

step 2053, calculating offset vectors according to the feature values of the current frame and the reference frame corresponding to the matched feature points;

Step 2054, counts the number of occurrences of each offset vector.

If there is some offset vector whose number is greater than half of the number of matched features, the offset vector is taken as the main offset, i.e. the global motion vector.

Fig. 6 is an architecture diagram of an image processing apparatus provided in an embodiment of the present disclosure, and the image processing apparatus 60 shown in fig. 6 includes a detecting module 601, a determining module 602, and a processing module 603, where the detecting module 601 is configured to acquire a current image frame to be processed, and detect whether a scroll bar exists on a page of the current image frame to be processed; the judging module 602 is configured to, if a scroll bar exists in a page of a current image frame to be processed, judge whether an operation of a mouse or a keyboard on the scroll bar meets a preset condition; the processing module 603 is configured to perform corresponding processing on the current image frame to be processed when the operation of the mouse or the keyboard on the scroll bar meets a preset condition.

in an embodiment, the determining module 602 is specifically configured to determine that the preset condition is met when a speed of operating the scroll bar by the mouse or the keyboard is greater than a preset threshold or when it is detected that a moving key on the keyboard is pressed for a long time within a preset time period.

In one embodiment, the processing module 603 is specifically configured to not perform motion vector identification and encode the current image frame to be processed.

Fig. 7 is an architecture diagram of an image processing apparatus according to an embodiment of the present disclosure, and the image processing apparatus 70 shown in fig. 7 includes a detection module 701, a determination module 702, a processing module 703, and an acquisition module 704, where the acquisition module 704 is configured to acquire a speed of the mouse operating scroll bar.

Fig. 8 is an architecture diagram of an image processing apparatus according to an embodiment of the present disclosure, where the image processing apparatus 80 shown in fig. 8 includes a detection module 801, a determination module 802, a processing module 803, and an acquisition module 804, where the acquisition module 804 includes a first monitoring submodule 8041, a second monitoring submodule 8042, and a first calculation submodule 8043, where the first monitoring submodule 8041 is configured to monitor a first start time t1 and a first end time t2 of holding a left mouse button, and calculate a first time difference Δ t 1; the second monitoring submodule 8042 is configured to monitor coordinates of the mouse in the vertical direction/the horizontal direction, and calculate a rolling distance s1 according to the coordinates in the vertical direction/the horizontal direction; the first calculating submodule 8043 is configured to calculate a first speed v1 of the mouse operating scroll bar according to the first time difference Δ t1 and the first scroll distance s 1.

Fig. 9 is an architecture diagram of an image processing apparatus according to an embodiment of the present disclosure, where the image processing apparatus 90 shown in fig. 9 includes a detecting module 901, a determining module 902, a processing module 903, and an obtaining module 904, where the obtaining module 904 includes a third monitoring submodule 9041, a fourth monitoring submodule 9042, and a second calculating submodule 9043, where the third monitoring submodule 9041 is configured to monitor a second start time t3 and a second end time t4 of a mouse wheel rolling, and calculate a second time difference Δ t 2; the fourth monitoring submodule 9042 is configured to detect a second rolling distance s2 of the mouse rolling wheel; the second calculating submodule 9043 is configured to calculate a second speed v2 of the mouse to operate the scroll bar according to the second time difference Δ t2 and the second scroll distance s 2.

Based on the image processing method described in the embodiment corresponding to fig. 1, an embodiment of the present disclosure further provides a computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a Read Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The storage medium stores computer instructions for executing the image processing method described in the embodiment corresponding to fig. 1, which is not described herein again.

other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:在线教学方法、装置、存储介质及电子设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类