Image generation method and device, electronic equipment and storage medium

By performing feature matching and splicing of image frames in cross-operating system scenarios, the problem of being unable to generate long screenshots is solved, and high-quality long screenshots are generated across platforms.

CN118608808APending Publication Date: 2024-09-06BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310191993.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-24
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

In cross-operating system scenarios, long screenshots cannot be generated because the distance and direction of movement between screenshots cannot be confirmed.

Method used

By acquiring the first image frame and the second image frame, perform feature matching to determine similar feature points, determine the movement distance and direction of the second image frame relative to the first image frame based on these feature points, and splice the second image frame to the first image frame. One image frame to generate a long screenshot of the target.

Benefits of technology

It enables accurate generation of long screenshots in cross-platform scenarios without the need for the system to provide scrolling messages, improving the quality of long screenshot generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118608808A
    Figure CN118608808A
Patent Text Reader

Abstract

The embodiment of the invention provides an image generation method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a first image frame and a second image frame, carrying out the feature matching of the first image frame and the second image frame, and obtaining similar feature points; determining a moving distance and a moving direction of the second image frame relative to the first image frame according to the similar feature points; and based on the moving distance and the moving direction, splicing the second image frame to the first image frame to obtain a target long screenshot. Based on the movement relation of the similar feature points in the first image frame and the second image frame, the relative movement distance and the movement direction between the first image frame and the second image frame are determined, splicing between screenshots is achieved, the system does not need to provide a rolling message to determine the movement distance and the movement direction between the two frames of images, and the splicing efficiency is improved. Therefore, the long screenshot is generated in a cross-platform scene, and the generation quality of the long screenshot is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of image processing technology, and in particular to an image generating method, device, electronic device and storage medium. Background Art

[0002] Using screenshots to store, transmit and express information is one of the commonly used technical means. In order to overcome the limitation of device display area, related technologies use multiple screenshots and splicing of the content displayed on the screen to generate a larger long screenshot to achieve better information display.

[0003] In the prior art, the solution of generating long screenshots by scrolling the screen usually requires the support of the operating system, that is, the distance and direction between the screenshots are determined through the scrolling message representing the scrolling event provided by the operating system, thereby realizing the capture and splicing of the screen content.

[0004] However, in a cross-operating system scenario, when the operating system cannot provide scrolling messages, the problem of being unable to confirm the moving distance and direction between screenshots will occur, resulting in an inability to generate long screenshots. Summary of the invention

[0005] The embodiments of the present disclosure provide an image generation method, an apparatus, an electronic device, and a storage medium to overcome the problem that a long screenshot cannot be generated in a cross-operating system scenario.

[0006] In a first aspect, an embodiment of the present disclosure provides an image generation method, including:

[0007] Acquire a first image frame and a second image frame, and perform feature matching on the first image frame and the second image frame to obtain similar feature points; determine a moving distance and a moving direction of the second image frame relative to the first image frame based on the similar feature points; and splice the second image frame to the first image frame based on the moving distance and the moving direction to obtain a target long screenshot.

[0008] In a second aspect, an embodiment of the present disclosure provides an image generating device, including:

[0009] An acquisition module, used to acquire a first image frame and a second image frame, and perform feature matching on the first image frame and the second image frame to obtain similar feature points;

[0010] A processing module, used for determining a moving distance and a moving direction of the second image frame relative to the first image frame according to the similar feature points;

[0011] A splicing module is used to splice the second image frame to the first image frame based on the moving distance and the moving direction to obtain a target long screenshot.

[0012] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:

[0013] A processor, and a memory communicatively connected to the processor;

[0014] The memory stores computer-executable instructions;

[0015] The processor executes the computer-executable instructions stored in the memory to implement the image generating method as described in the first aspect and various possible designs of the first aspect.

[0016] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the image generation method described in the first aspect and various possible designs of the first aspect is implemented.

[0017] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the image generation method described in the first aspect and various possible designs of the first aspect.

[0018] The image generation method, device, electronic device and storage medium provided in the present embodiment obtain a first image frame and a second image frame, and perform feature matching on the first image frame and the second image frame to obtain similar feature points, wherein the similar feature points represent graphic objects that exist in both the first image frame and the second image frame; based on the similar feature points, determine the moving distance and moving direction of the second image frame relative to the first image frame; based on the moving distance and the moving direction, splice the second image frame to the first image frame to obtain a target long screenshot. Similar feature points in the first image frame and the second image frame are determined by feature matching, and then the relative moving distance and moving direction between the first image frame and the second image frame are determined based on the moving relationship of the similar feature points in the first image frame and the second image frame, thereby realizing the splicing between the screenshots and generating a long screenshot, without the system providing a scrolling message to determine the moving distance and direction between the two frames of image, thereby realizing the generation of long screenshots in cross-platform scenarios and improving the generation quality of long screenshots. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0020] Figure 1 An application scenario diagram of the image generation method provided in the embodiment of the present disclosure;

[0021] Figure 2 A schematic diagram of the process of the image generation method provided in the embodiment of the present disclosure Figure 1 ;

[0022] Figure 3 A schematic diagram of similar feature points provided in an embodiment of the present disclosure;

[0023] Figure 4 A schematic diagram of a multi-feature scale provided for an embodiment of the present disclosure;

[0024] Figure 5 for Figure 2 A flowchart of a specific implementation method of step S103 in the illustrated embodiment;

[0025] Figure 6 A schematic diagram of a process for determining a splicing area provided in an embodiment of the present disclosure;

[0026] Figure 7 A schematic diagram of the process of the image generation method provided in the embodiment of the present disclosure Figure 2 ;

[0027] Figure 8 A schematic diagram of a first type of moving area and a non-moving area is provided for an embodiment of the present disclosure;

[0028] Fig. 9 is a flowchart of a specific implementation method of step S2022;

[0029] Fig.10 A schematic diagram of a coordinate difference vector provided by an embodiment of the present disclosure;

[0030] Fig.11 for Figure 7 A flowchart of a specific implementation method of step S203 in the illustrated embodiment;

[0031] Fig.12 A schematic diagram of generating a long screenshot of a target provided by an embodiment of the present disclosure;

[0032] Fig.13 A structural block diagram of an image generating device provided in an embodiment of the present disclosure;

[0033] Fig.14 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure;

[0034] Fig.15 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0036] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0037] The application scenarios of the embodiments of the present disclosure are explained below:

[0038] Figure 1 This is an application scenario diagram of the image generation method provided in the embodiment of the present disclosure. The image generation method provided in the embodiment of the present disclosure can be applied to the application scenario of generating long screenshots on multiple platforms. Specifically, Figure 1 As shown, the method provided by the embodiment of the present disclosure can be applied to terminal devices, such as smart phones, personal computers, etc. Among them, applications running in the terminal device, such as browsers, chat software, etc., usually display information in a scrolling display mode on the screen in order to achieve a better information display effect. Figure 1 As shown in , a vertical scroll bar control is provided in the chat window of the chat software, and the user usually drags the scroll bar control to display the chat information of different time in the chat window. At this time, when it is necessary to generate a long screenshot of the large amount of chat information that cannot be displayed in the same window, the usual solution is to take screenshots of the chat windows showing different contents multiple times, and then splice the multiple screenshots to achieve the generation of the long screenshot.

[0039] In the prior art, the generation of the above-mentioned long screenshots usually requires the support of the operating system, that is, the distance and direction between two adjacent frames of screenshots are determined through the scrolling message representing the scrolling event provided by the operating system, thereby realizing the capture and splicing of the screen content. However, in some operating systems, it is impossible to obtain the event message corresponding to the user's operation, such as the drag event message corresponding to the use of the mouse to drag the scroll bar control in the above-mentioned application scenario diagram. Therefore, it is impossible to determine the distance and direction between two adjacent frames of screenshots based on the event message provided by the system, resulting in the problem that a long screenshot cannot be generated. The disclosed embodiment provides an image generation method to solve the above-mentioned problem.

[0040] refer to Figure 2 , Figure 2 A schematic diagram of the process of the image generation method provided in the embodiment of the present disclosure Figure 1 The method of this embodiment can be applied in a terminal device. The image generation method includes:

[0041] Step S101: acquiring a first image frame and a second image frame, and performing feature matching on the first image frame and the second image frame to obtain similar feature points, wherein the similar feature points represent graphic objects existing in both the first image frame and the second image frame.

[0042] Exemplarily, the first image frame and the second image frame may be pictures obtained by screenshot, frame extraction from a video, etc. Specifically, for example, the first image frame is an initial image frame, and the second image frame is an image frame captured adjacent to the first image frame. The sizes of the first image frame and the second image frame may be the same or different. More specifically, refer to Figure 1 Taking the process of generating a long screenshot of a chat window as an example, the first plane screenshot captured is the first image frame, and the second plane screenshot captured after the first plane screenshot is the second image frame. After the first image frame and the second image frame perform subsequent stitching steps, the target long screenshot formed includes all the contents of the first image frame and the second image frame respectively.

[0043] Furthermore, in a possible implementation, the first image frame and the second image frame may be pre-generated, specifically, for example, by reading the first image frame and the second image frame from a plurality of pre-generated orderly arranged frames of images, so as to obtain the first image frame and the second image frame. In another possible implementation, the first image frame and the second image frame may also be generated in real time, for example, after the terminal device receives the first image capture instruction input by the user, it captures the screen or extracts frames from the currently playing video to obtain the first image frame; after the terminal device receives the next image capture instruction input by the user, it captures the screen again or extracts frames from the currently playing video to obtain the second image frame. The specific method for obtaining the first image frame and the second image frame can be set as needed and will not be repeated here.

[0044] Further, exemplarily, after obtaining the second image frame and the first image frame, in order to realize the splicing of the second image frame and the first image frame, it is necessary that at least a part of the content, that is, the graphic object, in the second image frame and the first image frame is the same, so as to determine the movement relationship between the second image frame and the first image frame based on the same graphic object. The above-mentioned graphic objects that exist in both the second image frame and the first image frame are similar feature points. Among them, a graphic object refers to a combination of multiple pixel points that can express a clear shape and meaning. For example, a Chinese character, a sentence, a text box, a user avatar, and a combination thereof can all be graphic objects. And the graphic objects that exist in both the first image frame and the second image frame are similar feature points. Figure 3 A schematic diagram of similar feature points provided in an embodiment of the present disclosure, such as Figure 3 As shown, the second image frame and the first image frame are chat conversations in the chat software captured by the user at different times. The second image frame and the first image frame both contain graphic object #1 and graphic object #2, where graphic object #1 is a set of avatar U1 and sentence A, and graphic object #2 is a set of avatar U2 and sentence B. Graphic object #1 and graphic object #2 are similar feature points.

[0045] Among them, the graphic objects in the second image frame and the first image frame can be represented by pixel features (feature matrix). By comparing the pixel features of the first image frame and the second image frame, similar feature points can be determined. The specific implementation method of comparing the similarity using the feature matrix is ​​existing technology and will not be repeated here.

[0046] In a possible implementation, a specific implementation of obtaining similar feature points in step S101 includes:

[0047] Step S1011: performing feature extraction of multiple feature scales on the first image frame and the second image frame respectively, to obtain at least two first scale features corresponding to the first image frame and at least two second scale features corresponding to the second image frame;

[0048] Step S1012: obtaining feature similarities of corresponding first-scale features and corresponding second-scale features at at least two feature scales respectively;

[0049] Step S1013: According to the feature similarity, the graphic object corresponding to the first scale feature or the second scale feature is determined as a similar feature point.

[0050] Exemplarily, after obtaining the first image frame and the second image frame, feature extraction is performed on the first image frame and the second image frame at multiple feature scales to obtain a feature matrix at the corresponding feature scale, that is, a first scale feature corresponding to the first image frame and at least two second scale features corresponding to the second image frame. The feature scale refers to the scale of image information used to extract image features. The larger the feature scale, the better the global features in the image can be extracted; and the smaller the feature scale, the better the features in the image can be extracted. The first scale features and the second scale features obtained by extracting features from the first image frame and the second image frame at multiple feature scales can express the image features of the first image frame and the second image frame at each scale. Figure 4 A schematic diagram of a multi-feature scale provided by an embodiment of the present disclosure, such as Figure 4As shown, based on the characteristic scales C1, C2 and C3 from small to large, feature extraction is performed on the first image frame and the second image frame respectively. For the first image frame, at least one first scale feature p1_1, at least one first scale feature p1_2 and at least one first scale feature p1_3 (shown as p1_1, p1_2 and p1_3 in the figure) corresponding to the characteristic scales C1, C2 and C3 are obtained; for the second image frame, at least one second scale feature p2_1, at least one first scale feature p2_2 and at least one first scale feature p2_3 (shown as p2_1, p2_2 and p2_3) corresponding to the characteristic scales C1, C2 and C3 are obtained. Among them, each first scale feature represents a graphic object at the corresponding characteristic scale. For example, the first scale feature p1_1 represents a word; the first scale feature p1_2 represents a sentence, and the second scale feature is similar and will not be repeated. Afterwards, at the corresponding scale, the feature similarities of the first scale feature and the second scale feature are calculated to obtain the corresponding similarity arrays T1, T2, and T3, respectively, wherein each similarity array contains at least one feature similarity, and then the feature similarities in each similarity array are arranged, and the graphic objects corresponding to the first N largest feature similarities are similar feature points, wherein N is an integer greater than 0. For example, at the feature scale C1, the user avatar A in the first image frame (that is, the user avatar A in the second image frame) is determined as similar feature point #1; at the feature scale C2, the sentence "Are you at home today" in the first image frame (that is, the sentence "Are you at home today" in the second image frame) is determined as similar feature point #2.

[0051] In this embodiment, by comparing the first image frame and the second image frame from multiple feature scales, similar feature points of the first image frame and the second image frame at different feature scales are obtained, thereby further improving the number of feature similarities. In the subsequent step of determining the moving distance and the moving direction, the accuracy of the moving distance and the moving direction can be improved.

[0052] Step S102: Determine the moving distance and moving direction of the second image frame relative to the first image frame based on the similar feature points.

[0053] Exemplarily, after obtaining similar feature points, the moving distance and moving direction of the second image frame relative to the first image frame are determined based on the position difference of the similar feature points in the two image frames (the first image frame and the second image frame). More specifically, for example, the coordinates in the first image frame and the second image frame are obtained based on the feature similarity, and calculations are performed based on the coordinates to obtain the moving distance and moving direction of the second image frame relative to the first image frame. In a possible implementation, the specific implementation of step S102 includes:

[0054] Step S1021: Obtain corresponding coordinate difference vectors according to the coordinates of similar feature points in the first image frame and the coordinates of similar feature points in the second image frame.

[0055] Step S1022: Determine the moving distance and moving direction of the second image frame relative to the first image frame according to the coordinate difference vector.

[0056] Exemplarily, based on the same coordinate system (e.g., a rectangular coordinate system with the lower left corner of the image as the origin), the coordinates of similar feature points in the first image frame and the second image frame are obtained. For example, the coordinates of similar feature point #1 in the first image frame are co_1(a, m); the coordinates of similar feature point #1 in the second image frame are co_2(a, n), where a, m, and n are, for example, integers. Then the coordinate difference vector is the difference between the two, that is, the coordinate difference vector cov_1=(0, mn). The coordinate difference vector cov_1 indicates that in the first image frame and the second image frame, similar feature point #1 has moved in the vertical direction but has not moved in the horizontal direction. And mn is the distance that similar feature point #1 has moved in the vertical direction, and the sign of mn indicates the direction in which similar feature point #1 has moved in the vertical direction. Of course, it can be understood that in another possible implementation, the coordinate difference vector can also be cov=(0, nm), and the meaning represented by the sign of nm can be adjusted accordingly, which will not be repeated here. Afterwards, the coordinate difference vector. The moving distance and moving direction can be obtained.

[0057] In another possible case, for example, the coordinates of the similar feature point #2 in the first image frame are co_3(m,a); the coordinates of the similar feature point #2 in the second image frame are co_4(n,a). Then the coordinate difference vector cov_2 = (mn,0). The coordinate difference vector cov_2 indicates that in the first image frame and the second image frame, the similar feature point #2 has moved in the horizontal direction but has not moved in the vertical direction.

[0058] In another possible case, for example, the coordinates of the similar feature point #3 in the first image frame are co_5(m,a); the coordinates of the similar feature point #2 in the second image frame are co_6(n,b). Then the coordinate difference vector cov_2 = (mn,ab). The coordinate difference vector cov_2 indicates that the similar feature point #2 has moved in both the horizontal and vertical directions in the first image frame and the second image frame.

[0059] Step S103: splicing the second image frame to the first image frame based on the moving distance and the moving direction to obtain a target long screenshot.

[0060] For example, after obtaining the moving distance and moving direction corresponding to the similar feature points, the difference content between the second image frame and the first image frame is determined based on the moving distance and moving direction, and this difference content is spliced ​​to the first image frame to obtain the target long screenshot. Figure 5 As shown, the specific implementation of step S103 includes:

[0061] Step S1031: determining a stitching area in the second image frame based on the moving distance and the moving direction.

[0062] Step S1032: cropping the second image frame based on the stitching area to obtain a difference image corresponding to the stitching area.

[0063] Step S1033: splicing the difference images at the target end corresponding to the first image frame and the moving direction to generate a target long screenshot.

[0064] Figure 6 A schematic diagram of a process for determining a splicing area provided in an embodiment of the present disclosure is shown in FIG. Figure 6 As shown, exemplarily, after obtaining the moving distance and moving direction, the corresponding target end is first determined based on the moving direction. For example, the moving direction = 1 represents "moving upward", that is, the content of the second image frame moves upward relative to the content of the first image frame. At this time, the stitching area included in the second image frame, that is, the image content not included in the first image frame, is at the bottom of the second image frame, that is, the target end. Afterwards, the moving distance is moved upward from the bottom (target end) to determine the stitching area in the second image frame.

[0065] Furthermore, based on the stitching area in the second image frame, the second image frame is cropped to obtain an image corresponding to the stitching area, i.e., a difference image, and then the difference image is stitched to the target end, i.e., the bottom end, of the first image frame to obtain an image containing the contents of both the first image frame and the second image frame, i.e., a target long screenshot.

[0066] Furthermore, in one possible implementation, if the second image frame and the first image frame only include one similar feature point, the second image frame is cropped based on the moving distance and moving direction corresponding to the unique similar feature point to obtain a partial image not included in the first image frame, i.e., a difference image, and then the difference image is spliced ​​to the first image frame to obtain a target long screenshot. In another possible implementation, if the second image frame and the first image frame include more than one similar feature point, it is necessary to screen them, and the moving distance and moving direction corresponding to the similar feature points that can characterize the movement relationship between the first image frame and the second image frame are used to crop the second image frame to obtain a difference image and splice them. Specifically, for example, the coordinate difference vector corresponding to each similar feature point is obtained, and the similar feature point corresponding to the coordinate difference vector with the largest number of points in the same direction is used as the target similar feature point, and based on the moving distance and moving direction corresponding to the target similar feature point, the second image frame is spliced ​​to the first image frame to obtain a target long screenshot.

[0067] Step S104: Update the first image frame to the target long screenshot, and return to step S101 until the stop condition is met.

[0068] Exemplarily, after obtaining the target long screenshot after splicing, the first image frame is updated to the target long screenshot, and then a new second image frame is obtained, for example, the next frame of image is obtained from the ordered multiple frames as the new second image frame, or, in response to the image capture instruction input by the user, the screen is captured or the currently played video is extracted to obtain a new second image frame. The specific implementation method can be referred to the relevant introduction in step S101. Further, using the updated first image frame and the newly generated second image frame, return to step S101, continue to repeat the above steps, splice the first image frame and the second image frame, so as to obtain a target long screenshot of a larger size, that is, a long screenshot. The loop ends until the stop condition is met. Among them, there are many ways to implement the stop condition, for example, when the current second image frame is the last frame of image in the pre-generated ordered multiple frames; or, when the user's stop instruction is received, the loop is stopped, so as to obtain a long screenshot after multiple content splicing.

[0069] In this embodiment, similar feature points are obtained by acquiring the first image frame and the second image frame, and feature matching is performed on the first image frame and the second image frame to obtain the similar feature points, which represent the graphic objects that exist in both the first image frame and the second image frame; based on the similar feature points, the moving distance and moving direction of the second image frame relative to the first image frame are determined; based on the moving distance and moving direction, the second image frame is spliced ​​to the first image frame to obtain the target long screenshot. Similar feature points in the first image frame and the second image frame are determined by feature matching, and then the relative moving distance and moving direction between the first image frame and the second image frame are determined based on the moving relationship of the similar feature points in the first image frame and the second image frame, thereby realizing the splicing between the screenshots and generating a long screenshot, without the system providing a scrolling message to determine the moving distance and direction between the two frames of image, thereby realizing the generation of long screenshots in cross-platform scenarios and improving the generation quality of long screenshots.

[0070] refer to Figure 7 , Figure 7 A schematic diagram of the process of the image generation method provided in the embodiment of the present disclosure Figure 2 In this embodiment Figure 2 On the basis of the embodiment shown, step S103 is further refined, and a step of processing the non-moving area in the image is added. The image generation method includes:

[0071] Step S201: Acquire a first image frame and a second image frame, and perform feature matching on the first image frame and the second image frame to obtain similar feature points, where the similar feature points represent graphic objects that exist in both the first image frame and the second image frame.

[0072] Step S202: Determine the moving area and the non-moving area in the second image frame based on similar feature points, where the moving area is the area where the graphic objects move relative to the first image frame, and the non-moving area is the area where the graphic objects do not move relative to the first image frame.

[0073] For example, after similar feature points are obtained in step S201, the movement relationship between the first image frame and the second image frame, as well as the movement direction and the movement distance can be determined based on the coordinates of the similar feature points. Figure 2 However, in one possible case, when only a part of the area in the second image frame has changed relative to the first image frame, and the other part of the area has not changed relative to the first image frame, further regional processing is required. Among them, the area in the second image frame that has changed relative to the first image frame is the moving area, and the area in the second image frame that has not changed relative to the first image frame is the non-moving area. Figure 8 A schematic diagram of a first type of moving area and a non-moving area is provided for an embodiment of the present disclosure, such as Figure 8As shown, taking the scenario of generating a long screenshot for a chat software as an example, the text display area in the chat window is a mobile area, which changes in real time as the chat progresses; and at least one of the text input area in the chat window, the friend list, and the fixed border of the chat window, for example, is a non-mobile area, which does not change in real time as the chat progresses.

[0074] refer to Figure 8 As shown, firstly, the moving area and the non-moving area in the second image frame are determined according to the similar feature points, and then corresponding processing is performed on the moving area and the non-moving area respectively.

[0075] Exemplarily, the specific implementation of step S202 includes:

[0076] Step S2021: Obtain corresponding coordinate difference vectors according to the coordinates of similar feature points in the first image frame and the coordinates of similar feature points in the second image frame.

[0077] Step S2022: Determine the moving area and the non-moving area in the second image frame according to the coordinate difference vector.

[0078] Exemplarily, firstly, based on the same coordinate system, for example, the coordinates of similar feature points in the first image frame and the coordinates of similar feature points in the second image frame are obtained, for example, co_1(a,m) and co_2(b,n), respectively. Then, based on the coordinate difference of the above two coordinates, a coordinate difference vector is obtained, that is, cov_1=(ab,mn). Then, based on the coordinate difference vector, it is judged whether the similar feature point has moved in the first image frame and the second image frame, that is, if the modulus of the coordinate difference vector cov_1 is 0, that is, ab=0, and mn=0, then the similar feature point has not moved; otherwise, the similar feature point has moved. Then, the area where the similar feature points that have moved are located is determined as the moving area, and the area where the similar feature points that have not moved are located is determined as the non-moving area.

[0079] Exemplarily, when the number of similar feature points is greater than three, the number of coordinate difference vectors is at least three. In this case, Fig. 9 As shown, the specific implementation steps of step S2022 include:

[0080] Step S2022A: Obtain at least two vector groups based on at least three coordinate difference vectors, each vector group including at least one coordinate difference vector with the same direction.

[0081] Step S2022B: Determine a first target vector group according to the number of coordinate difference vectors in each vector group, where the first target vector group is the vector group containing the largest number of non-zero coordinate difference vectors.

[0082] Step S2022C: Determine the second target vector group according to the size of the coordinate difference vector in each vector group, and the size of each coordinate difference vector in the second target vector group is 0.

[0083] Step S2022D: Determine the moving area according to the area where the similar feature points corresponding to each coordinate difference vector in the first target vector group are located; determine the non-moving area according to the area where the similar feature points corresponding to each coordinate difference vector in the second target vector group are located.

[0084] Fig.10 A schematic diagram of a coordinate difference vector provided by an embodiment of the present disclosure, such as Fig.10 As shown, combined Fig.10 The above process is introduced. For example, the second image frame includes similar feature points P1, P2, P3 and P4. According to the coordinates of the similar feature points P1, P2, P3 and P4 in the second image frame and the first image frame, the corresponding coordinate difference vectors C_1 = (a, b), C_2 = (a, b), C_3 = (c, d) and C_4 = (0, 0) can be obtained. The specific implementation process has been introduced in the previous embodiment and will not be repeated here. Afterwards, the coordinate difference vectors C_1, C_2, C_3 and C_4 are grouped, and the same coordinate difference vectors are grouped into one group, and three vector groups are obtained, namely T1 = [C_1, C_2], T2 = [C_3], and T3 = [C_4]. Further, according to the number and vector value of the coordinate difference vectors in each vector group, T1 is determined as the first target vector group and T3 is the second target vector group. Afterwards, the moving area is determined based on the area where similar feature points corresponding to the coordinate difference vectors C_1 and C_2 in T1 are located; and the non-moving area is determined based on the area where similar feature points corresponding to the coordinate difference vector C_4 in T3 are located.

[0085] Exemplarily, feature matching is performed on the first image frame and the second image frame based on multiple feature scales, and multiple similar feature points at different feature scales can usually be obtained. While providing more local detail information in the image, multiple similar feature points will also bring in similar feature points that are incorrectly matched, such as the same Chinese characters that appear in different sentences. In the above manner, the vector group with the largest number of coordinate difference vectors is determined as the first target vector group, and the filtering of similar feature points that are incorrectly matched is achieved, thereby improving the accuracy of the coordinate difference vector and the moving area, thereby improving the stitching accuracy during subsequent image stitching, and improving the display effect of the generated long screenshot.

[0086] Step S203: Determine the moving distance and moving direction according to the coordinates of the similar feature points within the moving area.

[0087] Exemplarily, after determining the moving area, the coordinates of similar feature points located in the moving area are obtained, and then the coordinate difference vectors corresponding to the similar feature points are obtained, that is, the coordinate difference vectors in the first target vector group in the above step. Then, based on the size and direction of the coordinate difference vectors, the moving distance and moving direction are determined respectively.

[0088] For example, Fig.11 As shown, the specific implementation of step S203 includes:

[0089] Step S2031: Obtain a first coordinate difference vector corresponding to at least two similar feature points in the moving area.

[0090] Step S2032: Determine the moving distance according to the magnitudes of at least two first coordinate difference vectors.

[0091] Step S2033: Determine the moving direction according to the directions of at least two first coordinate difference vectors.

[0092] Exemplarily, in one possible implementation, the coordinate difference vectors in the first target vector group include at least two, and one coordinate difference vector can be selected from the first target vector group as the first coordinate difference vector, and then based on the size and direction of the first coordinate difference vector, the moving distance and moving direction are determined. The specific implementation method of determining the size (vector modulus) and direction (vector angle) based on the vector is not introduced here. In another possible implementation, at least two coordinate difference vectors in the first target vector group are averaged to obtain an average difference vector, and the average difference vector is used as the first coordinate difference vector, or one or more coordinate difference vectors corresponding to similar feature points obtained based on a small feature scale in the first target vector group are averaged or selected to obtain the first coordinate difference vector, and then the moving distance and moving direction are determined, so as to overcome the problem that the coordinate difference vectors corresponding to similar feature points at a larger feature scale have large errors in the scheme of obtaining similar feature points at multiple feature scales using multiple feature scales, and further improve the accuracy of the moving distance and moving angle.

[0093] Step S204: based on the moving distance and the moving direction, stitching the difference image corresponding to the stitching area of ​​the second image frame to the first image frame to obtain the first image.

[0094] Specifically, after obtaining the moving distance and the moving direction, the second image frame is cropped and spliced ​​to the first image frame based on the moving distance and the moving direction to obtain the first image. For a specific implementation method, see Figure 2 The specific implementation method of obtaining the target long screenshot in step S103 in the illustrated embodiment will not be repeated here.

[0095] Step S205: Acquire similar feature points in the non-moving area in the second image frame.

[0096] Step S206: determining a target spacing between similar feature points in the non-moving area according to the first length of the first image along the moving direction and the number of similar feature points in the non-moving area.

[0097] Step S207: Based on the target spacing, the graphic objects corresponding to the similar feature points in the non-moving area are arranged equidistantly to generate a second image with a first length.

[0098] Step S208: stitching the first image and the second image to obtain a target long screenshot.

[0099] Exemplarily, when the first image frame and the second image frame contain non-moving areas, such as user lists, text input boxes, etc., since the size of the non-moving area does not change, after the image is stitched based on the moving area, the size of the generated first image will change in a certain direction, resulting in size mismatch and the problem that the moving area and the non-moving area cannot be aligned, resulting in overlapping non-moving areas, affecting the display effect of the long screenshot. Therefore, after generating the first image that needs to be stitched with content, for the non-moving areas in the second image frame and the first image frame that cannot be aligned with the first image, first obtain similar feature points in the non-moving area of ​​the second image frame. Since the non-moving areas in the second image frame and the first image frame are the same, the similar feature points in the non-moving area of ​​the second image frame, that is, all graphic objects in the non-moving area of ​​the second image frame, such as the non-moving area corresponds to the user list in the chat interface, then the similar feature points in the non-moving area are the user avatars in the user list. Afterwards, the target spacing, such as the interval between user avatars, is determined based on the first length of the first image along the moving direction and the number of similar feature points in the non-moving area. It can be seen that since the first image is spliced, the first length of the first image along the first direction, such as the vertical direction, will be greater than the original image length of the second image frame and the first image frame itself. Therefore, the target interval between the similar feature points (user avatars) formed is also greater than the original interval between the similar feature points (user avatars) in the non-moving area (user list area) in the second image frame and the first image frame.

[0100] Afterwards, obtain the graphic objects corresponding to the similar feature points in the second image frame or the first image frame, such as user avatars, user names, etc., and arrange the graphic objects equidistantly based on the target interval to generate a second image with the same length as the first image (first length). Then, based on the positional relationship between the first image and the second image, splice the first image and the second image to obtain the target long screenshot. Fig.12A schematic diagram of generating a long screenshot of a target provided by an embodiment of the present disclosure, such as Fig.12 As shown, after the text display area of ​​the first image frame and the second image frame are image-stitched, a first image with a first length is obtained, the first image includes the moving area of ​​the first image frame and the stitching result of the second image frame, that is, the text display area, and the non-moving area that is not affected by the length change of the text display area in the vertical direction, such as the text input area, and then based on the first length and the number of user avatars in the non-moving area, the target interval is determined, and based on the target interval, the user avatars in the user list area of ​​the second image frame are rearranged to obtain a second image with the same first length and a reasonable distribution of user avatars (similar feature points), and the first image and the second image are horizontally spliced ​​to obtain a target long screenshot. In this embodiment, by reshooting the distribution of graphic objects in the non-moving area based on the first length of the first image, the length of the non-moving area is matched with the newly generated first image, the problem of image overlap of graphic objects in the non-moving area is avoided, and the display effect of the long screenshot is improved.

[0101] Step S209: Update the first image frame to the target long screenshot, and return to step S201 until the stop condition is met.

[0102] In this embodiment, the specific implementation of step S201 and step S209 is the same as Figure 2 The specific implementation methods of step S101 and step S104 in the embodiment shown are consistent. For details, please refer to Figure 2 The relevant introduction in the illustrated embodiment will not be repeated here.

[0103] Corresponding to the image generation method of the above embodiment, Fig.13 This is a structural block diagram of an image generation device provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown.

[0104] Reference Fig.13 , the image generating device 3 comprises:

[0105] An acquisition module 31 is used to acquire a first image frame and a second image frame, and perform feature matching on the first image frame and the second image frame to obtain similar feature points, where the similar feature points represent graphic objects that exist in both the first image frame and the second image frame.

[0106] A processing module 32, used to determine the moving distance and moving direction of the second image frame relative to the first image frame according to the similar feature points;

[0107] The stitching module 33 is used to stitch the second image frame to the first image frame based on the moving distance and the moving direction to obtain a target long screenshot.

[0108] In one embodiment of the present disclosure, the processing module 32 is specifically used to: determine a moving area and a non-moving area in the second image frame based on similar feature points, the moving area being the area where the graphic objects that have moved relative to the first image frame are located, and the non-moving area being the area where the graphic objects that have not moved relative to the first image frame are located; determine a moving distance and a moving direction based on the coordinates of similar feature points located in the moving area.

[0109] In one embodiment of the present disclosure, when the processing module 32 determines the moving area and the non-moving area in the second image frame based on the similar feature points, it is specifically used to: obtain the corresponding coordinate difference vector according to the coordinates of the similar feature points in the first image frame and the coordinates of the similar feature points in the second image frame; determine the moving area and the non-moving area in the second image frame according to the coordinate difference vector.

[0110] In one embodiment of the present disclosure, the number of coordinate difference vectors is at least three. When the processing module 32 determines the moving area and the non-moving area in the second image frame according to the coordinate difference vectors, it is specifically used to: obtain at least two vector groups according to the at least three coordinate difference vectors, and each vector group contains at least one coordinate difference vector with the same direction; determine a first target vector group according to the number of coordinate difference vectors in each vector group, and the first target vector group is the vector group containing the largest number of non-zero coordinate difference vectors; determine a second target vector group according to the size of the coordinate difference vector in each vector group, and the size of each coordinate difference vector in the second target vector group is 0; determine the moving area according to the area where similar feature points corresponding to each coordinate difference vector in the first target vector group are located; determine the non-moving area according to the area where similar feature points corresponding to each coordinate difference vector in the second target vector group are located.

[0111] In one embodiment of the present disclosure, when the processing module 32 determines the moving distance and the moving direction based on the coordinates of similar feature points located in the moving area, it is specifically used to: obtain the first coordinate difference vectors corresponding to at least two similar feature points in the moving area; determine the moving distance based on the sizes of the at least two first coordinate difference vectors; determine the moving direction based on the directions of the at least two first coordinate difference vectors.

[0112] In one embodiment of the present disclosure, when the acquisition module 31 performs feature matching on the first image frame and the second image frame to obtain similar feature points, it is specifically used to: perform feature extraction on the first image frame and the second image frame at multiple feature scales to obtain at least two first scale features corresponding to the first image frame and at least two second scale features corresponding to the second image frame; obtain feature similarities of the corresponding first scale features and the corresponding second scale features at at least two feature scales; and determine, according to the feature similarities, the graphic objects corresponding to the first scale features or the second scale features as similar feature points.

[0113] In one embodiment of the present disclosure, when the stitching module 33 stitches the second image frame to the first image frame based on the moving distance and the moving direction to obtain a target long screenshot, it is specifically used to: determine the stitching area in the second image frame based on the moving distance and the moving direction; crop the second image frame based on the stitching area to obtain a difference image corresponding to the stitching area; and stitch the difference image at the target end corresponding to the first image frame and the moving direction to generate a target long screenshot.

[0114] In one embodiment of the present disclosure, the second image frame includes a non-moving area, and the non-moving area is an area where a graphic object that has not moved relative to the first image frame is located. The processing module 32 is also used to: obtain similar feature points in the non-moving area in the second image frame; the stitching module 33 is specifically used to: stitch the difference image corresponding to the stitching area of ​​the second image frame to the first image frame based on the moving distance and the moving direction to obtain the first image; determine the target spacing of the similar feature points in the non-moving area according to the first length of the first image along the moving direction and the number of similar feature points in the non-moving area; based on the target spacing, arrange the graphic objects corresponding to the similar feature points in the non-moving area equidistantly to generate a second image with a first length; stitch the first image and the second image to obtain a target long screenshot.

[0115] The acquisition module 31, the processing module 32 and the splicing module 33 are connected in sequence. The image generation device 3 provided in this embodiment can implement the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.

[0116] Fig.14 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure is shown in FIG. Fig.14 As shown, the electronic device 4 includes:

[0117] A processor 41, and a memory 42 communicatively connected to the processor 41;

[0118] The memory 42 stores computer executable instructions;

[0119] The processor 41 executes the computer execution instructions stored in the memory 42 to implement the following Figure 2-Figure 12 The image generation method in the illustrated embodiment.

[0120] Optionally, the processor 41 and the memory 42 are connected via a bus 43 .

[0121] For related instructions, please refer to Figure 2-Figure 12 The relevant descriptions and effects corresponding to the steps in the corresponding embodiments can be understood, and no further elaboration is made here.

[0122] The present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, which are used to implement the present invention when executed by a processor. Figure 2-Figure 12 The image generation method provided by any one of the corresponding embodiments.

[0123] refer to Fig.15 , which shows a schematic diagram of the structure of an electronic device 900 suitable for implementing the embodiment of the present disclosure, and the electronic device 900 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.15 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0124] like Fig.15 As shown, the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 to a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0125] Typically, the following devices may be connected to the I / O interface 905: input devices 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 908 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.15The electronic device 900 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0126] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0127] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0128] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0129] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0130] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0131] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0132] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".

[0133] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0134] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0135] In a first aspect, according to one or more embodiments of the present disclosure, there is provided an image generation method, comprising:

[0136] Acquire a first image frame and a second image frame, and perform feature matching on the first image frame and the second image frame to obtain similar feature points, wherein the similar feature points represent graphic objects that exist in both the first image frame and the second image frame; determine a moving distance and a moving direction of the second image frame relative to the first image frame based on the similar feature points; and splice the second image frame to the first image frame based on the moving distance and the moving direction to obtain a target long screenshot.

[0137] According to one or more embodiments of the present disclosure, the moving distance and moving direction of the second image frame relative to the first image frame are determined based on the similar feature points; including: determining a moving area and a non-moving area in the second image frame based on the similar feature points, the moving area being an area where graphic objects that have moved relative to the first image frame are located, and the non-moving area being an area where graphic objects that have not moved relative to the first image frame are located; determining the moving distance and moving direction based on the coordinates of the similar feature points located in the moving area.

[0138] According to one or more embodiments of the present disclosure, the moving area and the non-moving area in the second image frame are determined based on the similar feature points, including: obtaining a corresponding coordinate difference vector based on the coordinates of the similar feature points in the first image frame and the coordinates of the similar feature points in the second image frame; and determining the moving area and the non-moving area in the second image frame based on the coordinate difference vector.

[0139] According to one or more embodiments of the present disclosure, the number of the coordinate difference vectors is at least three, and the moving area and the non-moving area in the second image frame are determined based on the coordinate difference vectors, including: obtaining at least two vector groups based on at least three coordinate difference vectors, each of the vector groups containing at least one coordinate difference vector with the same direction; determining a first target vector group based on the number of coordinate difference vectors in each of the vector groups, the first target vector group being the vector group containing the largest number of non-zero coordinate difference vectors; determining a second target vector group based on the size of the coordinate difference vectors in each of the vector groups, the size of each coordinate difference vector in the second target vector group being 0; determining the moving area based on the area where similar feature points corresponding to each coordinate difference vector in the first target vector group are located; determining the non-moving area based on the area where similar feature points corresponding to each coordinate difference vector in the second target vector group are located.

[0140] According to one or more embodiments of the present disclosure, the moving distance and the moving direction are determined according to the coordinates of similar feature points located in the moving area, including: obtaining first coordinate difference vectors corresponding to at least two similar feature points in the moving area; determining the moving distance according to the sizes of at least two of the first coordinate difference vectors; and determining the moving direction according to the directions of at least two of the first coordinate difference vectors.

[0141] According to one or more embodiments of the present disclosure, the performing feature matching on the first image frame and the second image frame to obtain similar feature points includes: performing feature extraction on the first image frame and the second image frame at multiple feature scales to obtain at least two first scale features corresponding to the first image frame and at least two second scale features corresponding to the second image frame; obtaining feature similarities of the corresponding first scale features and the corresponding second scale features at at least two feature scales; and determining, based on the feature similarities, the graphic objects corresponding to the first scale features or the second scale features as the similar feature points.

[0142] According to one or more embodiments of the present disclosure, the second image frame is spliced ​​to the first image frame based on the moving distance and the moving direction to obtain a target long screenshot, including: determining a stitching area in the second image frame based on the moving distance and the moving direction; cropping the second image frame based on the stitching area to obtain a difference image corresponding to the stitching area; and stitching the difference image at the target end corresponding to the first image frame and the moving direction to generate the target long screenshot.

[0143] According to one or more embodiments of the present disclosure, the second image frame includes a non-moving area, and the non-moving area is an area where a graphic object that has not moved relative to the first image frame is located, and also includes: obtaining similar feature points in the non-moving area in the second image frame; splicing the second image frame to the first image frame based on the moving distance and the moving direction to obtain a target long screenshot, including: splicing the difference image corresponding to the splicing area of ​​the second image frame to the first image frame based on the moving distance and the moving direction to obtain a first image; determining a target spacing between similar feature points in the non-moving area according to a first length of the first image along the moving direction and the number of similar feature points in the non-moving area; based on the target spacing, equidistantly arranging the graphic objects corresponding to the similar feature points in the non-moving area to generate a second image with the first length; splicing the first image and the second image to obtain the target long screenshot.

[0144] In a second aspect, according to one or more embodiments of the present disclosure, there is provided an image generating device, comprising:

[0145] an acquisition module, configured to acquire a first image frame and a second image frame, and perform feature matching on the first image frame and the second image frame to obtain similar feature points, wherein the similar feature points represent graphic objects that exist in both the first image frame and the second image frame;

[0146] A processing module, used for determining a moving distance and a moving direction of the second image frame relative to the first image frame according to the similar feature points;

[0147] A splicing module is used to splice the second image frame to the first image frame based on the moving distance and the moving direction to obtain a target long screenshot.

[0148] According to one or more embodiments of the present disclosure, the processing module is specifically used to: determine a moving area and a non-moving area in the second image frame based on the similar feature points, the moving area being an area where a graphic object that has moved relative to the first image frame is located, and the non-moving area being an area where a graphic object that has not moved relative to the first image frame is located; determine the moving distance and moving direction based on the coordinates of the similar feature points located in the moving area.

[0149] According to one or more embodiments of the present disclosure, when the processing module determines the moving area and the non-moving area in the second image frame based on the similar feature points, it is specifically used to: obtain the corresponding coordinate difference vector according to the coordinates of the similar feature points in the first image frame and the coordinates of the similar feature points in the second image frame; determine the moving area and the non-moving area in the second image frame according to the coordinate difference vector.

[0150] According to one or more embodiments of the present disclosure, the number of the coordinate difference vectors is at least three, and when the processing module determines the moving area and the non-moving area in the second image frame according to the coordinate difference vectors, it is specifically used to: obtain at least two vector groups according to at least three coordinate difference vectors, each of the vector groups containing at least one coordinate difference vector with the same direction; determine a first target vector group according to the number of coordinate difference vectors in each of the vector groups, the first target vector group being the vector group containing the largest number of non-zero coordinate difference vectors; determine a second target vector group according to the size of the coordinate difference vectors in each of the vector groups, the size of each coordinate difference vector in the second target vector group being 0; determine the moving area according to the area where similar feature points corresponding to each coordinate difference vector in the first target vector group are located; determine the non-moving area according to the area where similar feature points corresponding to each coordinate difference vector in the second target vector group are located.

[0151] According to one or more embodiments of the present disclosure, when the processing module determines the moving distance and the moving direction based on the coordinates of similar feature points located in the moving area, it is specifically used to: obtain the first coordinate difference vectors corresponding to at least two similar feature points in the moving area; determine the moving distance based on the sizes of at least two of the first coordinate difference vectors; determine the moving direction based on the directions of at least two of the first coordinate difference vectors.

[0152] According to one or more embodiments of the present disclosure, when the acquisition module performs feature matching on the first image frame and the second image frame to obtain similar feature points, the acquisition module is specifically used to: perform feature extraction on the first image frame and the second image frame at multiple feature scales to obtain at least two first scale features corresponding to the first image frame and at least two second scale features corresponding to the second image frame; obtain feature similarities of the corresponding first scale features and the corresponding second scale features at at least two feature scales; and determine, based on the feature similarities, the graphic objects corresponding to the first scale features or the second scale features as the similar feature points.

[0153] According to one or more embodiments of the present disclosure, when the stitching module stitches the second image frame to the first image frame based on the moving distance and the moving direction to obtain a target long screenshot, the stitching module is specifically used to: determine a stitching area in the second image frame based on the moving distance and the moving direction; crop the second image frame based on the stitching area to obtain a difference image corresponding to the stitching area; and stitch the difference image at the target end corresponding to the first image frame and the moving direction to generate the target long screenshot.

[0154] According to one or more embodiments of the present disclosure, the second image frame includes a non-moving area, and the non-moving area is an area where a graphic object that has not moved relative to the first image frame is located. The processing module is also used to: obtain similar feature points in the non-moving area in the second image frame; the stitching module is specifically used to: stitch the difference image corresponding to the stitching area of ​​the second image frame to the first image frame based on the moving distance and the moving direction to obtain a first image; determine the target spacing of the similar feature points in the non-moving area according to the first length of the first image along the moving direction and the number of similar feature points in the non-moving area; based on the target spacing, arrange the graphic objects corresponding to the similar feature points in the non-moving area equidistantly to generate a second image with the first length; stitch the first image and the second image to obtain the target long screenshot.

[0155] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0156] The memory stores computer-executable instructions;

[0157] The processor executes the computer-executable instructions stored in the memory to implement the image generating method as described in the first aspect and various possible designs of the first aspect.

[0158] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer execution instructions. When a processor executes the computer execution instructions, the image generation method described in the first aspect and various possible designs of the first aspect is implemented.

[0159] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the image generation method described in the first aspect and various possible designs of the first aspect.

[0160] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0161] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0162] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. An image generation method, characterized in that: include: Acquire a first image frame and a second image frame, and perform feature matching on the first image frame and the second image frame to obtain similar feature points; Determining a moving distance and a moving direction of the second image frame relative to the first image frame according to the similar feature points; Based on the moving distance and the moving direction, the second image frame is spliced ​​to the first image frame to obtain a target long screenshot.

2. The method according to claim 1, characterized in that The step of determining the moving distance and moving direction of the second image frame relative to the first image frame according to the similar feature points comprises: Determine a moving area and a non-moving area in the second image frame according to the similar feature points, wherein the moving area is an area where a graphic object that has moved relative to the first image frame is located, and the non-moving area is an area where a graphic object that has not moved relative to the first image frame is located; The moving distance and the moving direction are determined according to the coordinates of similar feature points located in the moving area.

3. The method according to claim 2, characterized in that Determining a moving area and a non-moving area in the second image frame based on the similar feature points includes: Obtaining a corresponding coordinate difference vector according to the coordinates of the similar feature points in the first image frame and the coordinates of the similar feature points in the second image frame; A moving area and a non-moving area in the second image frame are determined according to the coordinate difference vector.

4. The method according to claim 3, characterized in that The number of the coordinate difference vectors is at least three, and determining the moving area and the non-moving area in the second image frame according to the coordinate difference vectors includes: According to at least three of the coordinate difference vectors, at least two vector groups are obtained, each of the vector groups includes at least one coordinate difference vector with the same direction; Determining a first target vector group according to the number of coordinate difference vectors in each of the vector groups, wherein the first target vector group is a vector group containing the largest number of non-zero coordinate difference vectors; Determine a second target vector group according to the magnitude of the coordinate difference vectors in each of the vector groups, wherein the magnitude of each coordinate difference vector in the second target vector group is 0; Determine the moving area according to the area where similar feature points corresponding to each coordinate difference vector in the first target vector group are located; The non-moving area is determined according to the area where similar feature points corresponding to each coordinate difference vector in the second target vector group are located.

5. The method according to claim 2, characterized in that: Determining the moving distance and the moving direction according to the coordinates of similar feature points located in the moving area includes: Obtaining a first coordinate difference vector corresponding to at least two similar feature points in the moving area; determining the moving distance according to the magnitudes of at least two of the first coordinate difference vectors; The moving direction is determined according to directions of at least two of the first coordinate difference vectors.

6. The method according to claim 1, characterized in that The performing feature matching on the first image frame and the second image frame to obtain similar feature points includes: Performing feature extraction of multiple feature scales on the first image frame and the second image frame respectively to obtain at least two first scale features corresponding to the first image frame and at least two second scale features corresponding to the second image frame; At least two feature scales, respectively obtaining feature similarities of corresponding first-scale features and corresponding second-scale features; According to the feature similarity, a graphic object corresponding to the first scale feature or the second scale feature is determined as the similar feature point.

7. The method according to claim 1, characterized in that The step of splicing the second image frame to the first image frame based on the moving distance and the moving direction to obtain a target long screenshot includes: Determine a stitching area in the second image frame based on the moving distance and the moving direction; Cropping the second image frame based on the stitching area to obtain a difference image corresponding to the stitching area; The difference image is spliced ​​at the target end corresponding to the first image frame and the moving direction to generate the target long screenshot.

8. The method according to claim 1, characterized in that The second image frame includes a non-moving area, where the non-moving area is an area where a graphic object that has not moved relative to the first image frame is located, and further includes: Acquire similar feature points in the non-moving area in the second image frame; The step of splicing the second image frame to the first image frame based on the moving distance and the moving direction to obtain a target long screenshot includes: Based on the moving distance and the moving direction, stitching the difference image corresponding to the stitching area of ​​the second image frame to the first image frame to obtain a first image; determining a target spacing of similar feature points in the non-moving area according to a first length of the first image along the moving direction and the number of similar feature points in the non-moving area; Based on the target spacing, equidistantly arrange the graphic objects corresponding to the similar feature points in the non-moving area to generate a second image having the first length; The first image and the second image are stitched together to obtain the target long screenshot.

9. An image generating device, characterized in that: include: An acquisition module, used to acquire a first image frame and a second image frame, and perform feature matching on the first image frame and the second image frame to obtain similar feature points; A processing module, used for determining a moving distance and a moving direction of the second image frame relative to the first image frame according to the similar feature points; A splicing module is used to splice the second image frame to the first image frame based on the moving distance and the moving direction to obtain a target long screenshot.

10. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the image generating method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the image generation method according to any one of claims 1 to 8 is implemented.

12. A computer program product, characterized in that The invention comprises a computer program, which implements the image generating method according to any one of claims 1 to 8 when being executed by a processor.