CN112807689A - Game video processing method and device, electronic equipment and storage medium - Google Patents

Game video processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112807689A
CN112807689A CN202110230515.0A CN202110230515A CN112807689A CN 112807689 A CN112807689 A CN 112807689A CN 202110230515 A CN202110230515 A CN 202110230515A CN 112807689 A CN112807689 A CN 112807689A
Authority
CN
China
Prior art keywords
key
sequence
score
image frame
difference value
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.)
Granted
Application number
CN202110230515.0A
Other languages
Chinese (zh)
Other versions
CN112807689B (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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202110230515.0A priority Critical patent/CN112807689B/en
Priority claimed from CN202110230515.0A external-priority patent/CN112807689B/en
Publication of CN112807689A publication Critical patent/CN112807689A/en
Application granted granted Critical
Publication of CN112807689B publication Critical patent/CN112807689B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the invention provides a game video processing method, a game video processing device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring pre-recorded key position information of keys in a game and a key template frame difference value; acquiring a key interframe difference value sequence between adjacent image frames in a game video of the game according to the key position information; generating a key score sequence according to the key interframe difference value sequence and the key template interframe difference value; and determining a target image frame of key state change from the image frames of the game video according to the key score sequence. According to the embodiment of the invention, the target image frame is determined by matching the interframe difference value, so that even if the key and the game background are difficult to distinguish, the target image frame can be determined by the interframe difference value, and the accuracy of the image matching result is ensured.

Description

Game video processing method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of video processing, in particular to a game video processing method, a game video processing device, electronic equipment and a storage medium.
Background
In the field of games, game operation restoration refers to restoring a sequence of operations in a game in real time when resources such as game videos or images of some games are generated based on the resources. For an ordinary player, the restoring technology is helpful for learning high-hand operation and improving the self level; for a game tester, the restoring technology is helpful for restoring the real game operation in the testing process and is also helpful for generating an automatic testing script.
The current method for restoring game operation is mainly an image matching method, and the method mainly comprises the steps of judging whether a key in a certain state is in an image of a game by using image matching, and then restoring a game operation sequence by using an image of change of the key state. However, the image matching method is very easily interfered by the image background of the game, for example, the key is transparent or the key and the background are fused to a high degree, so that the image matching based on the key cannot be accurately performed, and the accuracy of the matching result is seriously affected.
Disclosure of Invention
In view of the above problems, embodiments of the present invention are proposed to provide a game video processing method and a corresponding game video processing apparatus, electronic device, storage medium that overcome or at least partially solve the above problems.
In order to solve the above problem, an embodiment of the present invention discloses a game video processing method, where the method includes:
acquiring pre-recorded key position information of keys in a game and a key template frame difference value;
acquiring a key interframe difference value sequence between adjacent image frames in a game video of the game according to the key position information;
generating a key score sequence according to the key interframe difference value sequence and the key template interframe difference value;
and determining a target image frame of key state change from the image frames of the game video according to the key score sequence.
Optionally, the key interframe difference template includes a pressed template difference value and a released template difference value, and the generating a key score sequence according to the key interframe difference sequence and the key template interframe difference value includes:
calculating the similarity between the key interframe difference value in the key interframe difference value sequence and the pressing template difference value, and combining the similarity as a pressing score to obtain a pressing score sequence;
and calculating the similarity between the key interframe difference value in the key interframe difference value sequence and the loosening template difference value, and combining the similarity as a loosening score to obtain a loosening score sequence.
Optionally, the determining a target image frame of key state change from the image frames of the game video according to the key score sequence includes:
clustering the pressing score sequence and the loosening score sequence to obtain a clustering result;
multiplying the first clustering result by the pressing fraction sequence to obtain a middle pressing fraction sequence, and multiplying the first clustering result by the loosening fraction sequence to obtain a middle loosening fraction sequence;
clustering absolute values of the mid-press score sequence and the mid-release score sequence to obtain a second clustering result, multiplying the second clustering result by the mid-press score sequence to obtain a mid-press new score sequence, and multiplying the second clustering result by the mid-release score sequence to obtain a new release score sequence;
comparing a new press score in the new press score sequence and a new unclamp score in the intermediate unclamp score sequence having the same image frame identification;
and determining a target image frame of key state change from the image frames of the game video according to the comparison result.
Optionally, the determining a target image frame of the key state change from the image frames of the game video according to the comparison result includes:
and when the new pressing score with the same image frame identification is greater than the new loosening score, determining the image frame corresponding to the image frame identification as the image frame pressed by the key.
Optionally, the determining a target image frame of the key state change from the image frames of the game video according to the comparison result includes:
when the new release score with the same image frame identification is smaller than the new release score, determining the image frame corresponding to the image frame identification as a key release image frame.
Optionally, after determining a target image frame of key state change from the image frames of the game video according to the key score sequence, the method further includes:
and generating a game operation sequence of the game video by adopting the target image frame with the changed key state.
Optionally, the key position information includes a position and a size of the key in the image frame.
The embodiment of the invention also discloses a game video processing device, which comprises:
the key information acquisition module is used for acquiring the key position information of the pre-recorded keys in the game and the inter-frame difference value of the key template;
the key interframe difference sequence generating module is used for acquiring a key interframe difference sequence between adjacent image frames in the game video of the game according to the key position information;
the key score sequence generation module is used for generating a key score sequence according to the key interframe difference value sequence and the key template interframe difference value;
and the target image frame determining module is used for determining a target image frame with changed key states from the image frames of the game video according to the key score sequence.
Optionally, the key interframe difference template includes a pressed template difference value and a released template difference value, and the key score sequence generating module is configured to calculate a similarity between a key interframe difference value in the key interframe difference sequence and the pressed template difference value, and combine the similarity as a pressed score to obtain a pressed score sequence; and calculating the similarity between the key interframe difference value in the key interframe difference value sequence and the loosening template difference value, and combining the similarity as a loosening score to obtain a loosening score sequence.
Optionally, the pressing score in the pressing score sequence and the unclamping score in the unclamping score sequence include image frame identifiers, and the target image frame determination module is configured to cluster the pressing score sequence and the unclamping score sequence to obtain a clustering result; multiplying the first clustering result by the pressing fraction sequence to obtain a middle pressing fraction sequence, and multiplying the first clustering result by the loosening fraction sequence to obtain a middle loosening fraction sequence; clustering absolute values of the mid-press score sequence and the mid-release score sequence to obtain a second clustering result, multiplying the second clustering result by the mid-press score sequence to obtain a mid-press new score sequence, and multiplying the second clustering result by the mid-release score sequence to obtain a new release score sequence; comparing a new press score in the new press score sequence and a new unclamp score in the intermediate unclamp score sequence having the same image frame identification; and determining a target image frame of key state change from the image frames of the game video according to the comparison result.
Optionally, the target image frame determining module is configured to determine, when the new pressing score with the same image frame identifier is greater than the new release score, an image frame corresponding to the image frame identifier as a key-pressed image frame.
Optionally, the target image frame determining module is configured to determine, when the new release score having the same image frame identifier is smaller than the new release score, an image frame corresponding to the image frame identifier as a key release image frame.
Optionally, the apparatus further comprises: and the game operation sequence generation module is used for generating the game operation sequence of the game video by adopting the target image frame with the changed key state.
Optionally, the key position information includes a position and a size of the key in the image frame.
The embodiment of the invention discloses electronic equipment, which comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein when the computer program is executed by the processor, the steps of the game video processing method are realized.
The embodiment of the invention discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the game video processing method are realized.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, the key position information of the keys in the game and the inter-frame difference value of the key template are obtained in advance, the inter-frame difference value sequence between the adjacent image frames in the game video of the game is obtained, then the inter-frame difference value sequence of the keys is generated according to the inter-frame difference value sequence and the key position information, the key score sequence is generated according to the inter-frame difference value sequence of the keys and the inter-frame difference value of the key template, and then the target image frame of the key state change is determined from the image frames of the game video according to the key score sequence. According to the embodiment of the invention, the target image frame is determined by matching the interframe difference value, so that even if the key and the game background are difficult to distinguish, the target image frame can be determined by the interframe difference value, and the accuracy of the image matching result is ensured.
Drawings
FIG. 1 is a flow chart of the steps of one embodiment of a game video processing method of the present invention;
FIG. 2 is a schematic flow chart of a game play sequence recovery according to the present invention;
FIG. 3 is a block diagram of a game video processing device according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
The game video processing method in the embodiment of the invention can be operated on the terminal equipment or the server. The terminal device may be a local terminal device. When the game video processing method is operated as a server, the game video processing method can be a cloud game.
In an alternative embodiment, cloud gaming refers to a cloud computing-based gaming mode. In the running mode of the cloud game, the running main body of the game program and the game picture presenting main body are separated, the storage and the running of the game video processing method are completed on a cloud game server, and the cloud game client is used for receiving and sending data and presenting the game picture, for example, the cloud game client can be a display device with a data transmission function close to a user side, such as a mobile terminal, a television, a computer, a palm computer and the like; however, the terminal device performing the game data processing is a cloud game server in the cloud. When a game is played, a player operates the cloud game client to send an operation instruction to the cloud game server, the cloud game server runs the game according to the operation instruction, data such as game pictures and the like are encoded and compressed, the data are returned to the cloud game client through a network, and finally the data are decoded through the cloud game client and the game pictures are output.
In an alternative embodiment, the terminal device may be a local terminal device. The local terminal device stores a game program and is used for presenting a game screen. The local terminal device is used for interacting with the player through a graphical user interface, namely, a game program is downloaded and installed and operated through an electronic device conventionally. The manner in which the local terminal device provides the graphical user interface to the player may include a variety of ways, for example, it may be rendered for display on a display screen of the terminal or provided to the player through holographic projection. For example, the local terminal device may include a display screen for presenting a graphical user interface including a game screen and a processor for running the game, generating the graphical user interface, and controlling display of the graphical user interface on the display screen.
The current commonly used image matching method comprises template-based matching and SIFT (Scale-invariant feature transform) algorithm-based matching, wherein the two matching methods are mainly used for judging whether a large image contains a certain small image (key), and have advantages and disadvantages respectively, wherein the template-based matching method has high matching efficiency, but the small image in the large image is required to be basically as large as a preset small image, otherwise, the large image is difficult to be successfully matched when the resolution of the large image is changed; although the matching method based on the SIFT algorithm can effectively cope with the change of the resolution of a large image, the matching efficiency is low.
Although the image matching methods can be optimized, even after the optimization, the image matching methods are difficult to be applied to the restoration of game operation, because although keys in game video usually have the characteristics of fixed positions, key changes during operation and the like, at present, a great number of operation keys in games are transparent or have high fusion degree with game pictures (backgrounds), and are very easily interfered by the backgrounds based on the existing image matching algorithm, so that the image matching based on the keys cannot be accurately performed, and the accuracy of the matching result is seriously influenced.
In view of the above problems, a core concept of the embodiment of the present invention is to consider that the current image matching scheme is easily subjected to background interference, and by analyzing a game video, based on a characteristic that pixels between image frames of the game video do not change much, the interference of a background is weakened by using a method of inter-frame difference, so that a matching focus is transferred from the image frames to the inter-frame difference. Compared with the method of image matching, the method of matching through the interframe difference improves the accuracy of the matching result.
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a game video processing method according to the present invention is shown, where the embodiment of the present invention may specifically include the following steps:
step 101, obtaining the key position information of the pre-recorded keys in the game and the difference value between the key template frames.
In a specific implementation, the game video may be a video recorded in a game, or a video of a player in the game, or an image resource such as a video recorded in a live game, which is not limited in this embodiment of the present invention.
The inter-frame difference value is an absolute value of an image pixel difference value obtained by performing difference operation on two continuous frames of image frames in the game video. In the embodiment of the invention, for each game, the key position information of the key in the image frame and the key template frame difference value are recorded in advance, wherein the key position information may include the position of the key in the image frame of the game and the size of the key in the image frame; the key template frame difference value is the frame difference value of the image frame of the key state change of the game; the key state change may be a key press or a key release.
As a specific example, the size and position of each key in the game, and the inter-frame difference between an image frame in which the key is pressed and a previous image frame, or the inter-frame difference between an image frame in which the key is released and a next image frame are previously recorded as the key template inter-frame difference.
In the embodiment of the invention, when the game operation is carried out and the game video of the game is restored, the key position information of the key pre-recorded aiming at the game and the difference value between the key template frames are obtained.
And step 102, acquiring a key interframe difference value sequence between adjacent image frames in the game video of the game according to the key position information.
In the embodiment of the invention, the image frames in the game video are traversed, and whether each image frame is a target image frame or not is determined, namely whether each image frame is an image frame capable of reflecting the change of the key state or not is determined. The image frames capable of reflecting the key state changes can be image frames of key pressing or image frames of key releasing.
Specifically, the image frames in the game video are traversed, the key position information of each key is obtained, the key images are extracted from the image frames according to the key position information, and then the inter-frame difference value of the key images of the adjacent image frames is calculated to obtain the inter-frame difference value of the keys. And after obtaining the key interframe difference values of all the image frames of the game video, combining the key interframe difference values into a key interframe difference value sequence in sequence.
And 103, generating a key score sequence according to the key interframe difference value sequence and the key template interframe difference value.
In the embodiment of the invention, the key interframe difference values in the key interframe difference value sequence are compared with the key template interframe difference values to obtain corresponding key scores, and the key scores are combined into the key score sequence in sequence after the key scores of all image frames of the game video are obtained.
And 104, determining a target image frame of key state change from the image frames of the game video according to the key score sequence.
The key score can reflect the change of the key state in the image frame, the higher the key score is, the more obvious the change of the key state is, and conversely, the lower the key score is, the less obvious the change of the key state is. For example, when a key is pressed or released, the state of the key in the image frame will change, and the change in the state of the key in the game screen may appear as a key highlight, a key zoom-in, or the like.
In the embodiment of the invention, the target image frame with changed key state, such as the image frame pressed by the key or the image frame released by the key, is screened out from the image frames of the game video according to the key scores of the image frames in the key score sequence of the game video.
In the game video processing method, the key position information of the pre-recorded keys in the game and the inter-frame difference value of the key template are obtained, the inter-frame difference value sequence between the adjacent image frames in the game video of the game is obtained, then the inter-frame difference value sequence of the keys is generated according to the inter-frame difference value sequence and the key position information, the key score sequence is generated according to the inter-frame difference value sequence of the keys and the inter-frame difference value of the key template, and then the target image frame of the key state change is determined from the image frames of the game video according to the key score sequence. According to the embodiment of the invention, the target image frame is determined by matching the interframe difference value, so that even if the key and the game background are difficult to distinguish, the target image frame can be determined by the interframe difference value, and the accuracy of the image matching result is ensured.
In a preferred embodiment of the present invention, the step 103 of generating a key score sequence according to the key frame difference value sequence and the key template frame difference value may include:
calculating the similarity between the key interframe difference value in the key interframe difference value sequence and the pressing template difference value, and combining the similarity as a pressing score to obtain a pressing score sequence; and calculating the similarity between the key interframe difference value in the key interframe difference value sequence and the loosening template difference value, and combining the similarity as a loosening score to obtain a loosening score sequence.
The key frame difference template comprises a pressed template difference value and a released template difference value, and the pressed template difference value and the released template difference value correspond to a key pressing change state and a key releasing change state respectively. Specifically, for a certain game, the difference between an image frame pressed by a key and a previous image frame is obtained to obtain an interframe difference value, and then the interframe difference value is used as a pressing template difference value; and in the same way, the difference is made between the image frame loosened by the key and the next image frame to obtain the difference value between frames, and then the difference value between the frames is used as the difference value of the loosening template.
As a specific example, the SIMilarity between image frames may be calculated using SSIM (Structural SIMilarity) algorithm. In the embodiment of the invention, after the similarity between each key interframe difference value in the key interframe difference value sequence and the difference value of the pressing template is calculated by adopting an SSIM algorithm, the similarity can be used as the pressing fraction of the image frame, and the pressing fractions of the image frame of the game video are combined into the pressing fraction sequence; similarly, after the similarity between each key interframe difference value in the key interframe difference value sequence and the difference value of the release template is calculated by adopting an SSIM algorithm, the similarity can be used as the release score of the image frame, and the release scores of the image frame of the game video can be combined into a release score sequence.
In the above embodiment, the similarity between the key frame difference value and the key template difference value is used as the key score of the image frame, so that whether the image frame is the target image frame is determined based on the similarity subsequently, and the accuracy of determining the target image frame can be improved.
In a preferred embodiment of the present invention, the pressing score in the pressing score sequence and the release score in the release score sequence include image frame identifications, and the step 104 of determining a target image frame of key state change from the image frames of the game video according to the key score sequence includes:
clustering the pressing score sequence and the loosening score sequence to obtain a clustering result;
multiplying the first clustering result by the pressing fraction sequence to obtain a middle pressing fraction sequence, and multiplying the first clustering result by the loosening fraction sequence to obtain a middle loosening fraction sequence;
clustering absolute values of the mid-press score sequence and the mid-release score sequence to obtain a second clustering result, multiplying the second clustering result by the mid-press score sequence to obtain a mid-press new score sequence, and multiplying the second clustering result by the mid-release score sequence to obtain a new release score sequence;
comparing a new press score in the new press score sequence and a new unclamp score in the intermediate unclamp score sequence having the same image frame identification;
and determining a target image frame of key state change from the image frames of the game video according to the comparison result.
In a specific implementation, the key score sequences are cluttered, so that it cannot be determined whether the image frame is the target image frame directly according to the key scores, and since the key score sequences locally exhibit some reasonable rules: (1) the method comprises the steps of (1) generating a maximum value at a position k when a key interframe difference value is matched with a pressed template difference value, and (2) generating a maximum value at a position k when the key interframe difference value is matched with a released template difference value, but the maximum value is smaller than the maximum value at the position k.
The image frame identifier may be a number or a name of an image frame, and is used to point to a corresponding image frame in the game video. Each key score, i.e., press and release score, has an image frame identification. As an example of the present invention, the image frame identification may be recorded in the form of a subscript in the key score.
As a specific example, the clustering algorithm may use the K-Means clustering algorithm. Specifically, a K-Means clustering algorithm is used for clustering the pressing score sequence and the loosening score sequence to obtain a first clustering result. The first clustering result is a sequence of the same length as the pressing score sequence, for example, assuming that the total number of clusters is 2, each item in the clustering result may be 0 or 1, and then the first clustering result is multiplied by the pressing score sequence and the loosening score sequence, respectively, to obtain an intermediate pressing score sequence and an intermediate loosening score sequence.
The extreme values of key pressing and key releasing need to have enough difference to indicate that the key state switching occurs at the position, so the embodiment of the invention clusters the absolute value of the difference value once again, and finds the image frame of key state switching after multiplication and screening. Specifically, after the depression score sequence and the release score sequence are obtained, clustering is performed again by using the absolute value between the depression score sequence and the release score sequence to obtain a second clustering result, and then the second clustering result is multiplied by the depression score sequence and the release score sequence to obtain a new depression score sequence and a new release score sequence.
And then, comparing the new pressing score and the new loosening score with the same image frame identification, and determining a key pressing image frame and a key loosening image frame with key state change from the image frames of the game video according to the comparison result.
In the embodiment, the similarity among the key scores is determined by clustering the key scores for multiple times, so that the key score with the largest difference is determined to determine the key image frame, and the accuracy of identifying the target image frame is improved.
In a preferred embodiment of the present invention, the step 104 of determining a target image frame of the key state change from the image frames of the game video according to the comparison result may include:
and when the new pressing score with the same image frame identification is greater than the new loosening score, determining the image frame corresponding to the image frame identification as the image frame pressed by the key.
In the embodiment of the invention, if the new pressing score with the same image frame identification is greater than the new loosening score, the image frame corresponding to the image frame identification is more likely to be the image frame pressed by the key. For example, if the new press score with the same image frame identification is 1, the new release score is 0, and the new press score is greater than the new release score, the image frame corresponding to the image frame identification is the key press image frame.
In a preferred embodiment of the present invention, the determining a target image frame of a key state change from image frames of the game video according to a comparison result includes:
when the new release score with the same image frame identification is smaller than the new release score, determining the image frame corresponding to the image frame identification as a key release image frame.
In an embodiment of the present invention, if the new press score with the same image frame identification is less than the new release score, it indicates that the image frame corresponding to the image frame identification is more likely to be a key release image frame. For example, if the new pressing score with the same image frame identification is 0, the new release score is 1, and the new pressing score is less than the new release score, the image frame identification is the corresponding image frame as the key release image frame.
In addition, if the new pressing scores with the same image frame identification are equal to the new release scores, for example, both are equal to 0, it means that the state of the image frame key corresponding to the image frame identification does not change much, and therefore, neither the image frame of key release nor the image frame of key press is included.
As a concrete bodyExample, assume that the template difference T is pressedpushAnd the difference T of the released templatepopFirstly, according to the position of each key, subtracting the previous frame image frame from the current image frame to obtain the key frame difference value of each key, and recording as BcheckThen, using the structure similarity SSIM algorithm to respectively compare the difference values between the key frames with TpushAnd TpopCalculating the similarity, and taking the similarity as the pressing score SpushAnd a loosening fraction SpopTraversing all image frames of the game video can obtain a pressing fraction sequence QpushAnd loosening fraction sequence QpopThese two fractional sequences:
the following fractional sequences:
Figure BDA0002958966090000111
loose score sequence:
Figure BDA0002958966090000112
wherein N is the total number of frames of the image frames of the game video.
Using the Kmeans clustering algorithm, pair (Q)push,Qpop) Clustering the formed tuples to obtain a first clustering result L1, and respectively using the L1 of the clustering result to QpushAnd QpopMultiplying and screening to obtain the fraction sequence
Figure BDA0002958966090000121
And loosening fraction sequence
Figure BDA0002958966090000122
Again using the Kmeans clustering algorithm to the absolute values
Figure BDA0002958966090000123
Clustering to obtain a second clustering result L2, and using the respective pairs of the clustering results L2
Figure BDA0002958966090000124
And
Figure BDA0002958966090000125
multiplying and screening to obtain
Figure BDA0002958966090000126
And
Figure BDA0002958966090000127
set a flag variable flag equal to False, go through
Figure BDA0002958966090000128
There are two cases as follows: 1) when in use
Figure BDA0002958966090000129
When the flag is False (Q represents an element in Q), the key is pressed, the subscript of Q at the moment is recorded to the sequence PUSH, and the flag is set to True; 2) when in use
Figure BDA00029589660900001210
And when the flag is True, the key is released, the subscript of q at the moment is recorded to the sequence POP, and the flag is set to False until the sequence traversal is completed.
In a preferred embodiment of the present invention, after determining a target image frame of key state change from the image frames of the game video according to the key score sequence in step 104, the method may further include:
and generating a game operation sequence of the game video by adopting the target image frame with the changed key state.
Wherein, when the player operates in the game, the key is pressed or released, therefore, the game operation sequence of the game operation of the player can be restored based on the target image frame, namely the pressed image frame and the key release image frame. For example,
in the embodiment of the invention, after the target image frame of the key state change is determined from the game video, namely the pressed image frame and the key release image frame are determined from the game video, the game operation sequence can be generated according to the pressed image frame and the key release image frame.
In the embodiment, the attention point is transferred from the image frame of the game video to the difference value between the image frame and the image frame, so that the characteristics of the game video can be fully utilized and adapted, the change of the background of the transparent key can be ignored to a great extent, the change of the key state can be captured more accurately, and the accuracy of restoring the game operation sequence can be improved.
In order to make the embodiment of the present invention better understood by those skilled in the art, the following describes the process of restoring the game operation sequence by using specific implementation. In this embodiment, the size and position of each focused key are recorded in advance, and the pressed frame difference and the released frame difference of each key are calculated, referring to fig. 2, which is a schematic flow chart showing the game operation sequence restoration of the present invention, and includes the following steps:
step 201, traversing image frames of a game video, and calculating inter-frame difference values between the image frames;
step 202, extracting a key frame difference value of a key part of the image frame;
step 203, calculating the similarity between the difference value between each key frame and the difference value between two key frames of the corresponding key by using an SSIM algorithm to obtain a fractional sequence of the two keysRespectively a key press score sequence and a key release score sequence;
step 204, clustering all sequences by using a Kmeans clustering algorithm, and screening two key score sequences according to a clustering result to form two transitional middle key score sequences;
step 205, clustering the absolute values of the two intermediate key score sequences by using a Kmeans clustering algorithm, and screening the two key score sequences again according to a clustering result to obtain a new key score sequence serving as a final key score sequence;
and step 206, traversing the final key score sequence, calculating to obtain an image frame corresponding to the key pressing and releasing, and restoring the game operation.
In the embodiment, the attention point is transferred from the image frame of the game video to the interframe difference value between the image frame and the image frame, so that the characteristics of the game video are fully utilized and adapted, the condition that the transparent key is equal to the game background fusion can be ignored to a great extent, the change of the key state can be captured more accurately, and the accuracy of the output sequence restored by the game operation can be further improved.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 3, a block diagram of a game video processing apparatus according to an embodiment of the present invention is shown, where the embodiment of the present invention may specifically include the following modules:
a key information obtaining module 301, configured to obtain pre-recorded key position information of a key in a game and a key template inter-frame difference value;
a key interframe difference sequence generating module 302, configured to obtain a key interframe difference sequence between adjacent image frames in a game video of the game according to the key position information;
a key score sequence generation module 303, configured to generate a key score sequence according to the key interframe difference value sequence and the key template interframe difference value;
and a target image frame determining module 304, configured to determine a target image frame with a changed key state from the image frames of the game video according to the key score sequence.
In a preferred embodiment of the present invention, the key frame difference template includes a pressed template difference value and a released template difference value, and the key score sequence generating module 303 is configured to calculate a similarity between a key frame difference value in the key frame difference sequence and the pressed template difference value, and combine the similarity as a pressed score to obtain a pressed score sequence; and calculating the similarity between the key interframe difference value in the key interframe difference value sequence and the loosening template difference value, and combining the similarity as a loosening score to obtain a loosening score sequence.
In a preferred embodiment of the present invention, the press scores in the press score sequence and the unclamp scores in the unclamp score sequence include image frame identifiers, the target image frame determining module 304 is configured to cluster the press scores in the press score sequence and the unclamp scores in the unclamp score sequence to obtain a clustering result, where the press scores in the press score sequence and the unclamp scores in the unclamp score sequence include image frame identifiers; multiplying the first clustering result by the pressing fraction sequence to obtain a middle pressing fraction sequence, and multiplying the first clustering result by the loosening fraction sequence to obtain a middle loosening fraction sequence; clustering absolute values of the mid-press score sequence and the mid-release score sequence to obtain a second clustering result, multiplying the second clustering result by the mid-press score sequence to obtain a mid-press new score sequence, and multiplying the second clustering result by the mid-release score sequence to obtain a new release score sequence; comparing a new press score in the new press score sequence and a new unclamp score in the intermediate unclamp score sequence having the same image frame identification; and determining a target image frame of key state change from the image frames of the game video according to the comparison result.
In a preferred embodiment of the present invention, the target image frame determining module 304 is configured to determine the image frame corresponding to the image frame identifier as the key press image frame when the new press score having the same image frame identifier is greater than the new release score.
In a preferred embodiment of the present invention, the target image frame determining module 304 is configured to determine an image frame corresponding to the image frame identifier as a key release image frame when the new release score having the same image frame identifier is smaller than the new release score.
In a preferred embodiment of the present invention, the apparatus further comprises:
and the game operation sequence generation module is used for generating the game operation sequence of the game video by adopting the target image frame with the changed key state.
In a preferred embodiment of the present invention, the key position information includes the position and size of the key in the image frame.
In the embodiment of the invention, the key position information of the keys in the game and the inter-frame difference value of the key template are obtained in advance, the inter-frame difference value sequence between the adjacent image frames in the game video of the game is obtained, then the inter-frame difference value sequence of the keys is generated according to the inter-frame difference value sequence and the key position information, the key score sequence is generated according to the inter-frame difference value sequence of the keys and the inter-frame difference value of the key template, and then the target image frame of the key state change is determined from the image frames of the game video according to the key score sequence. According to the embodiment of the invention, the target image frame is determined by matching the interframe difference value, so that even if the key and the game background are difficult to distinguish, the target image frame can be determined by the interframe difference value, and the accuracy of the image matching result is ensured.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiment of the invention discloses electronic equipment, which comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein when the computer program is executed by the processor, the steps of the game video processing method embodiment are realized.
The embodiment of the invention discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program is used for realizing the steps of the game video processing method embodiment when being executed by a processor.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The game video processing method, the game video processing apparatus, the electronic device and the storage medium provided by the present invention are described in detail above, and specific examples are applied herein to illustrate the principles and embodiments of the present invention, and the description of the above embodiments is only used to help understanding the method and the core ideas of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A game video processing method, the method comprising:
acquiring pre-recorded key position information of keys in a game and a key template frame difference value;
acquiring a key interframe difference value sequence between adjacent image frames in a game video of the game according to the key position information;
generating a key score sequence according to the key interframe difference value sequence and the key template interframe difference value;
and determining a target image frame of key state change from the image frames of the game video according to the key score sequence.
2. The method of claim 1, wherein the key interframe difference value template comprises a pressed template difference value and a released template difference value, and wherein generating a key score sequence based on the key interframe difference value sequence and the key template interframe difference value comprises:
calculating the similarity between the key interframe difference value in the key interframe difference value sequence and the pressing template difference value, and combining the similarity as a pressing score to obtain a pressing score sequence;
and calculating the similarity between the key interframe difference value in the key interframe difference value sequence and the loosening template difference value, and combining the similarity as a loosening score to obtain a loosening score sequence.
3. The method of claim 2, wherein a press score in the sequence of press scores and a release score in the sequence of release scores comprises an image frame identification, and wherein determining a target image frame of a key state change from image frames of the game video in accordance with the sequence of key scores comprises:
clustering the pressing score sequence and the loosening score sequence to obtain a clustering result;
multiplying the first clustering result by the pressing fraction sequence to obtain a middle pressing fraction sequence, and multiplying the first clustering result by the loosening fraction sequence to obtain a middle loosening fraction sequence;
clustering absolute values of the mid-press score sequence and the mid-release score sequence to obtain a second clustering result, multiplying the second clustering result by the mid-press score sequence to obtain a mid-press new score sequence, and multiplying the second clustering result by the mid-release score sequence to obtain a new release score sequence;
comparing a new press score in the new press score sequence and a new unclamp score in the intermediate unclamp score sequence having the same image frame identification;
and determining a target image frame of key state change from the image frames of the game video according to the comparison result.
4. The method as claimed in claim 3, wherein the determining a target image frame of key state change from the image frames of the game video according to the comparison result comprises:
and when the new pressing score with the same image frame identification is greater than the new loosening score, determining the image frame corresponding to the image frame identification as the image frame pressed by the key.
5. The method as claimed in claim 3, wherein the determining a target image frame of key state change from the image frames of the game video according to the comparison result comprises:
when the new release score with the same image frame identification is smaller than the new release score, determining the image frame corresponding to the image frame identification as a key release image frame.
6. The method of any of claims 1 to 5, wherein after said determining a target image frame of key state changes from image frames of said game video according to said key score sequence, said method further comprises:
and generating a game operation sequence of the game video by adopting the target image frame with the changed key state.
7. The method of claim 1, wherein the key position information comprises a position and a size of a key in an image frame.
8. A game video processing apparatus, the apparatus comprising:
the key information acquisition module is used for acquiring the key position information of the pre-recorded keys in the game and the inter-frame difference value of the key template;
the key interframe difference sequence generating module is used for acquiring a key interframe difference sequence between adjacent image frames in the game video of the game according to the key position information;
the key score sequence generation module is used for generating a key score sequence according to the key interframe difference value sequence and the key template interframe difference value;
and the target image frame determining module is used for determining a target image frame with changed key states from the image frames of the game video according to the key score sequence.
9. An electronic device comprising a processor, a memory and a computer program stored on the memory and capable of running on the processor, the computer program, when executed by the processor, implementing the steps of a game video processing method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of a game video processing method according to any one of claims 1 to 7.
CN202110230515.0A 2021-03-02 Game video processing method, game video processing device, electronic equipment and storage medium Active CN112807689B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110230515.0A CN112807689B (en) 2021-03-02 Game video processing method, game video processing device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110230515.0A CN112807689B (en) 2021-03-02 Game video processing method, game video processing device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112807689A true CN112807689A (en) 2021-05-18
CN112807689B CN112807689B (en) 2024-07-16

Family

ID=

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108635851A (en) * 2018-05-16 2018-10-12 网易(杭州)网络有限公司 A kind for the treatment of method and apparatus of game picture
CN108965989A (en) * 2018-07-13 2018-12-07 腾讯科技(深圳)有限公司 A kind for the treatment of method and apparatus and storage medium of interactive application scene
JP2020162807A (en) * 2019-03-29 2020-10-08 サミー株式会社 Game machine
CN112100065A (en) * 2020-09-08 2020-12-18 完美世界(重庆)互动科技有限公司 Game scene data processing method, device and equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108635851A (en) * 2018-05-16 2018-10-12 网易(杭州)网络有限公司 A kind for the treatment of method and apparatus of game picture
CN108965989A (en) * 2018-07-13 2018-12-07 腾讯科技(深圳)有限公司 A kind for the treatment of method and apparatus and storage medium of interactive application scene
JP2020162807A (en) * 2019-03-29 2020-10-08 サミー株式会社 Game machine
CN112100065A (en) * 2020-09-08 2020-12-18 完美世界(重庆)互动科技有限公司 Game scene data processing method, device and equipment

Similar Documents

Publication Publication Date Title
KR102354692B1 (en) Rule-based video importance analysis
CN112990191B (en) Shot boundary detection and key frame extraction method based on subtitle video
US10685460B2 (en) Method and apparatus for generating photo-story based on visual context analysis of digital content
CN104618803B (en) Information-pushing method, device, terminal and server
JP5420199B2 (en) Video analysis device, video analysis method, digest automatic creation system and highlight automatic extraction system
US8195038B2 (en) Brief and high-interest video summary generation
US11438510B2 (en) System and method for editing video contents automatically technical field
US20220172476A1 (en) Video similarity detection method, apparatus, and device
CN102214304A (en) Information processing apparatus, information processing method and program
CN105872717A (en) Video processing method and system, video player and cloud server
US20230353828A1 (en) Model-based data processing method and apparatus
KR101812103B1 (en) Method and program for setting thumbnail image
KR20140045897A (en) Device and method for media stream recognition based on visual image matching
WO2019047663A1 (en) Video format-based end-to-end automatic driving data storage method and device
Liu et al. Reference-guided texture and structure inference for image inpainting
CN112807689A (en) Game video processing method and device, electronic equipment and storage medium
CN112807689B (en) Game video processing method, game video processing device, electronic equipment and storage medium
CN115243073A (en) Video processing method, device, equipment and storage medium
CN116264606A (en) Method, apparatus and computer program product for processing video
CN114500879A (en) Video data processing method, device, equipment and storage medium
CN114170470A (en) Sample generation method, device, equipment and storage medium
Wan et al. A video forensic technique for detecting frame integrity using human visual system-inspired measure
JP6148785B1 (en) Information processing system, information processing apparatus, and program
CN113117341B (en) Picture processing method and device, computer readable storage medium and electronic equipment
EP2136314A1 (en) Method and system for generating multimedia descriptors

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