Image splicing method and device

By generating a spliced ​​picture preview frame and processing it according to user operations, real-time adjustment of picture splicing is achieved, solving the problem of poor splicing effect in the existing technology, and improving the user experience and personalization of splicing effect.

CN113870114BActive Publication Date: 2024-12-24SHANGHAI BILIBILI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111187585.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-12
Publication Date
2024-12-24
Estimated Expiration
2041-10-12

AI Technical Summary

Technical Problem

The existing image splicing technology lacks real-time adjustment and preview capabilities, and users are unable to participate in the splicing process, resulting in poor splicing effect and poor user experience.

Method used

Provide a picture splicing method, which obtains the image to be spliced ​​and the target configuration information by receiving user instructions, generates a splicing image preview frame, and processes the preview frame based on the operation information collected by the sensor, realizes user interaction adjustment, and finally generates the target splicing picture.

Benefits of technology

It enriches the splicing method, enhances the user's sense of participation and visual experience, solves problems such as solidification of splicing form and occlusion of content, and improves the personalization of splicing effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113870114B_ABST
    Figure CN113870114B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for stitching pictures, wherein the method comprises: receiving a picture stitching instruction; obtaining a set of pictures to be stitched and target stitching configuration information in response to the picture stitching instruction; stitching the pictures to be stitched in the set of pictures to be stitched based on the target stitching configuration information to generate a stitching picture preview frame; receiving a framework processing instruction for the stitching picture preview frame, wherein the framework processing instruction is determined according to operation information collected by a sensor; processing the stitching picture preview frame based on the framework processing instruction to generate a target stitching picture. Through this method, the problem of the solidification of the picture stitching form is solved, and at the same time, the user's picture processing instruction is added for interactive adjustment, and the final stitching picture effect is achieved according to the user's instruction, enriching the stitching method and improving the user's experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a method for stitching pictures. The present application also relates to a device for stitching pictures, a computing device, and a computer-readable storage medium. Background Art

[0002] With the development of Internet technology, the penetration rate of smart terminals in social life is also increasing, and there are more and more scenarios where users stitch pictures together. In the current multi-picture stitching scenarios on the market, multiple pictures are usually selected or captured, and then stitched or superimposed in sequence based on algorithms alone, and finally the stitched pictures are given to users. The stitching form is relatively simple, and users cannot preview and participate in the stitching process. The stitched pictures may be partially occluded or the content is too exposed, which cannot meet the user's stitching demands and cannot achieve satisfactory results for users. Users have a poor sense of participation and visual experience in picture stitching. Summary of the invention

[0003] In view of this, the embodiment of the present application provides a method for stitching pictures. The present application also relates to a picture stitching device, a computing device, and a computer-readable storage medium to solve the problems in the prior art that the picture stitching method is single, there is no real-time adjustment and preview capability, and the user's participation experience in picture stitching is poor.

[0004] According to a first aspect of an embodiment of the present application, a method for stitching pictures is provided, comprising:

[0005] Receive image stitching instructions;

[0006] Responding to the picture stitching instruction, obtaining a set of pictures to be stitched and target stitching configuration information;

[0007] splicing the pictures to be spliced ​​in the set of pictures to be spliced ​​based on the target splicing configuration information, and generating a spliced ​​picture preview frame;

[0008] Receiving a frame processing instruction for the spliced ​​picture preview frame, wherein the frame processing instruction is determined according to the operation information collected by the sensor;

[0009] The spliced ​​image preview frame is processed based on the frame processing instruction to generate a target spliced ​​image.

[0010] According to a second aspect of an embodiment of the present application, a picture stitching device is provided, including:

[0011] A first receiving module is configured to receive a picture stitching instruction;

[0012] An acquisition module, configured to acquire a set of pictures to be stitched and target stitching configuration information in response to the picture stitching instruction;

[0013] A splicing module, configured to splice the pictures to be spliced ​​in the set of pictures to be spliced ​​based on the target splicing configuration information, and a splicing picture preview frame;

[0014] A second receiving module is configured to receive a frame processing instruction for the spliced ​​picture preview frame, wherein the frame processing instruction is determined according to the operation information collected by the sensor;

[0015] The processing module is configured to process the spliced ​​image preview frame based on the frame processing instruction to generate a target spliced ​​image.

[0016] According to a third aspect of an embodiment of the present application, a computing device is provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the image stitching method when executing the computer instructions.

[0017] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer instructions, and when the computer instructions are executed by a processor, the steps of the image stitching method are implemented.

[0018] The image stitching method provided by the present application receives an image stitching instruction; obtains a set of images to be stitched and target stitching configuration information in response to the image stitching instruction; stitches the images to be stitched in the set of images to be stitched based on the target stitching configuration information to generate a stitching image preview frame; receives a framework processing instruction for the stitching image preview frame, wherein the framework processing instruction is determined based on operation information collected by a sensor; processes the stitching image preview frame based on the framework processing instruction to generate a target stitching image. An embodiment of the present application solves the problem of the solidification of the image stitching form, and at the same time adds the user's image processing instructions for interactive adjustment, realizes the final stitching image effect according to the user's instructions, enriches the stitching method, and improves the user's experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a flow chart of a method for stitching pictures provided in one embodiment of the present application;

[0020] Figure 2 It is a schematic diagram of the framework of the image stitching method provided in one embodiment of the present application;

[0021] Figure 3 is a processing flow chart of a picture stitching method applied to stitching panoramic pictures provided in one embodiment of the present application;

[0022] Figure 4 is a schematic diagram of image stitching provided by an embodiment of the present application;

[0023] Figure 5 It is a structural schematic diagram of a picture splicing device provided by an embodiment of the present application;

[0024] Figure 6 It is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0025] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.

[0026] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.

[0027] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0028] First, the terms involved in one or more embodiments of the present application are explained.

[0029] Pinch gesture: A pinch gesture on smart terminals, mainly used for zooming in and out, and requires two fingers to perform the operation simultaneously.

[0030] Pan gesture: A drag gesture on smart terminals, mainly used for sliding operations on long lists or beyond the display area, and requires a single finger.

[0031] UICollectionView: A terminal flow layout view component with built-in Pan gesture, which can present different list or collection layouts according to different layout configurations.

[0032] Lazy loading: When the user scrolls the page, the content in the start area is loaded first, and the content in other parts is loaded after entering the visible area, which improves service performance.

[0033] In the current multi-image stitching implementation on the market, multiple images are usually selected and captured, and then stitched or superimposed in order according to the algorithm, and then stitched or drawn on this basis. In the entire stitching process, there is no user interaction, no temporary adjustment, and no preview capability. The final stitching result is directly output to the user. At this time, the stitched images often fail to achieve satisfactory results for users. For example, when stitching image subtitles, the positions of subtitles of different video screenshots in the image are not uniform. The fixed stitching method alone cannot meet the needs of all image stitching, and some subtitles will be blocked. In addition, the usual stitching direction is vertical stitching. For the actual images to be stitched are landscapes in different directions, it is more suitable to stitch horizontally to form a panorama. The usual stitching direction cannot achieve this function of stitching into a panorama. During the image stitching process, the contents of each image are different, and different users have different requirements for the final stitching effect. The general multi-image stitching method is single and does not have the ability to adjust and preview in real time. The stitched images may have partial content obstruction or excessive content exposure, which cannot meet the user's stitching requirements. The user's participation and visual experience in image stitching are poor. In addition, image stitching adopts a traversal calculation method, which requires adjustment of each image before stitching. Temporary insertion, deletion or adjustment of order requires recalculation and layout, which is cumbersome and prone to errors.

[0034] Based on this, in the present application, a picture stitching method is provided. The present application also relates to a picture stitching device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0035] Figure 1 A flowchart of a method for stitching pictures according to an embodiment of the present application is shown, which specifically includes the following steps:

[0036] Step 102: Receive a picture stitching instruction.

[0037] The present application is applied to a terminal, which can be a smart phone, a tablet computer, a smart wearable device, etc. The terminal has the ability to process a picture stitching instruction and complete the picture stitching. The picture stitching instruction specifically refers to an instruction issued by a user to stitch multiple pictures to be stitched into a stitched picture.

[0038] In a specific implementation provided in the present application, taking a smart phone as an example, a user operates the smart phone to issue a picture stitching instruction, and the mobile phone receives the picture stitching instruction issued by the user.

[0039] Step 104: Responding to the picture stitching instruction, obtaining a set of pictures to be stitched and target stitching configuration information.

[0040] In the process of stitching pictures, it is necessary to first determine multiple pictures for stitching pictures. The multiple pictures for stitching pictures are called a set of pictures to be stitched, that is, the pictures in the set of pictures to be stitched are used to stitch together to generate a stitched picture.

[0041] The target stitching configuration information is specifically related configuration information for determining how to stitch the images to be stitched, such as stitching direction, stitching angle, stitching ratio, etc. How to stitch the images to be stitched can be determined based on the target stitching configuration information.

[0042] Specifically, in response to the picture stitching instruction, obtaining a set of pictures to be stitched includes:

[0043] Responding to the picture stitching instruction, obtaining an initial set of pictures to be stitched;

[0044] The pictures in the initial set of pictures to be spliced ​​are filtered according to a preset picture verification rule to obtain a set of pictures to be spliced.

[0045] Usually, after sending the picture stitching instruction, the user will access the photo album of the user's terminal. It should be noted that the operation of accessing the photo album of the user's terminal must be allowed and authorized by the user in advance.

[0046] By accessing the terminal's photo album, select the pictures that the user wants to stitch to form an initial set of pictures to be stitched. The pictures to be stitched in the initial set of pictures to be stitched are unscreened pictures. It should be noted that the pictures selected by the user may be different due to different shooting devices, shooting settings, shooting angles, etc., resulting in different pictures to be stitched in the initial set of pictures to be stitched. For example, picture 1 is shot horizontally, picture 2 is shot vertically, picture 3 is a screenshot of the terminal screen, picture 4 is a panoramic image, and picture 5 is a picture with an abnormal aspect ratio obtained after the user has cropped it. Figure 6 For example, for animated images, different types of images cannot be effectively stitched together. Therefore, it is also necessary to delete and filter the images that do not meet the stitching requirements in the initial set of images to be stitched.

[0047] Specifically, it is necessary to check the data types of the pictures to be spliced ​​in the initial set of pictures to be spliced ​​in turn to determine whether they are of the type that can be spliced. For example, if a GIF animation cannot be spliced, it is necessary to delete the GIF animation in the initial set of pictures to be spliced. It is also necessary to check the image information of the pictures to be spliced ​​to determine whether the image direction, fill mode, aspect ratio, etc. of the pictures to be spliced ​​are consistent. In addition, it is also necessary to process the image resources and compress the images whose size is larger than the preset threshold according to the ratio to avoid the image resources being too large and occupying too much memory, affecting the subsequent display performance.

[0048] After filtering according to the above rules, the pictures to be spliced ​​that do not meet the requirements in the initial set of pictures to be spliced ​​are filtered and deleted, and the pictures to be spliced ​​that meet the rules are retained to obtain a set of pictures to be spliced.

[0049] In addition to selecting a set of images to be spliced, the user also needs to select corresponding splicing configuration information according to his actual needs. The user determines the final splicing row format. Specifically, the image splicing instruction includes a splicing configuration identifier;

[0050] Acquiring target splicing configuration information in response to the picture splicing instruction includes:

[0051] The target splicing configuration information is obtained from a preset configuration information library according to the splicing configuration identifier.

[0052] The splicing configuration identifier specifically refers to an identifier used to uniquely identify the splicing configuration information, and one splicing configuration identifier corresponds to unique splicing configuration information. In actual applications, the splicing configuration information can be displayed in a visual form in the terminal, and the user can select the splicing configuration information they want from the various splicing configuration information displayed in the terminal in the form of a preview, or customize the splicing configuration information in a customized form. For the selected splicing configuration information, the corresponding splicing configuration identifier can be obtained, and the splicing configuration identifier can be sent to the terminal. The terminal obtains the corresponding target splicing configuration information in the preset configuration information library according to the splicing configuration mark. For user-defined splicing configuration information, a new splicing configuration identifier can be created for it and saved in the preset configuration information library, so as to facilitate subsequent modification or deletion of the customized splicing configuration information.

[0053] In a specific implementation provided in the present application, following the above example, three pictures to be spliced ​​are obtained according to the picture splicing instruction to form a picture set to be spliced, and at the same time, target splicing configuration information C is obtained in a preset configuration information library according to the splicing configuration identifier in the picture splicing instruction.

[0054] Step 106: stitching the pictures to be stitched in the set of pictures to be stitched based on the target stitching configuration information to generate a stitched picture preview frame.

[0055] Among them, the stitched picture preview frame refers to a preview frame generated after the pictures to be stitched in the set of pictures to be stitched, which is convenient for users to browse. In actual applications, each picture to be stitched corresponds to a sub-frame, and all sub-frames are combined into a stitched picture preview frame. The pictures to be stitched can be stitched according to the target stitching configuration information to generate the stitched picture preview frame.

[0056] Specifically, stitching the pictures to be stitched in the set of pictures to be stitched based on the target stitching configuration information, and stitching the picture preview framework, including:

[0057] Parsing the target splicing configuration information to generate a preview layout framework;

[0058] The pictures to be spliced ​​in the set of pictures to be spliced ​​are input into the preview layout frame to generate a spliced ​​picture preview frame.

[0059] In actual applications, the target splicing configuration information is first parsed, and a Layout configuration for displaying the preview structure, i.e., a preview layout framework, is generated according to the target splicing configuration information. For example, when the target splicing configuration information is horizontal splicing, the preview layout framework is set horizontally; when the target splicing configuration information is vertical splicing, the preview layout framework is set vertically; when the target splicing configuration information is stacking, the preview layout framework is set stacking; when the target splicing configuration information is arc splicing, the preview layout framework is arc splicing, and so on.

[0060] The number of sub-frames in the preview layout frame is the same as the number of pictures to be spliced ​​in the picture set to be spliced. For example, if there are 5 pictures in the picture set to be spliced, there are 5 sub-frames in the preview layout frame; if there are 10 pictures in the picture set to be spliced, there are 10 sub-frames in the preview layout frame, and each sub-frame corresponds to a picture to be spliced. After the preview layout frame is generated, each picture to be spliced ​​in the picture set to be spliced ​​is input into the corresponding sub-frame of the preview layout frame to generate a corresponding spliced ​​picture preview frame. For example, if the preview layout frame is set vertically and there are 5 pictures to be spliced ​​in the picture set to be spliced, then 5 sub-frames are generated and arranged vertically, and the 5 pictures to be spliced ​​are input into the one-to-one corresponding sub-frames to generate a spliced ​​picture preview frame consisting of 5 pictures to be spliced.

[0061] In a specific implementation provided in the present application, following the above example, a preview layout framework is generated according to the target stitching configuration information C, wherein the preview layout framework includes three sub-frames, namely sub-frame 1, sub-frame 2 and sub-frame 3, and the three sub-frames are arranged vertically to form a preview layout framework. The three pictures to be stitched are input into the three sub-frames respectively, that is, picture 1 to be stitched is input into sub-frame 1, picture 2 to be stitched is input into sub-frame 2, and picture 3 to be stitched is input into sub-frame 3, thereby generating a stitching picture preview framework consisting of the three pictures to be stitched.

[0062] Step 108: receiving a frame processing instruction for the spliced ​​image preview frame, wherein the frame processing instruction is determined according to the operation information collected by the sensor.

[0063] After the stitching picture preview frame is generated, the user can preview the generated initial stitching picture through the stitching picture preview frame. At this time, the generated initial stitching picture has not been adjusted, and the user still needs to adjust the initial stitching picture, that is, send a frame processing instruction to the stitching picture preview frame.

[0064] It should be noted that in this application, the user directly issues a frame processing instruction for the spliced ​​picture preview frame, rather than processing the initial spliced ​​picture itself. That is, the spliced ​​picture preview frame is adjusted and processed, and the user issues corresponding frame processing instructions to the terminal by performing Pinch gestures and Pan gestures on the terminal, such as enlarging or reducing the spliced ​​picture preview frame through Pinch gestures, dragging the spliced ​​picture preview frame through Pan gestures, and so on. When issuing a frame processing instruction to the spliced ​​picture preview frame, there is no need to consider the number, position, size and other information of the pictures to be spliced. It is only necessary to consider the offset value of the sub-frame to determine the degree of matching of the processing. The picture to be processed is loaded in the sub-frame and can be adjusted with the sub-frame without repeatedly loading the picture to be processed, which reduces the processing pressure of the terminal processor and improves the processing efficiency.

[0065] Specifically, receiving a frame processing instruction for the spliced ​​image preview frame includes:

[0066] Receive frame addition and deletion instructions and / or frame adjustment instructions for the spliced ​​image preview frame.

[0067] Frame processing instructions specifically include frame addition and deletion instructions and frame adjustment instructions. When processing the stitched picture browsing frame, the user can add or delete sub-frames, that is, add or delete pictures to be stitched, and can also adjust the size and position of the sub-frames, that is, adjust the size and position of the pictures to be stitched.

[0068] In a specific implementation provided by the present application, when the user is browsing the preview frame of the stitched picture and finds that one picture is missing, a frame add / delete instruction is issued to add a sub-frame and add a new picture to be stitched; when the user is browsing the preview frame of the stitched picture and finds that one picture is selected more than once, the user selects the picture to be deleted and issues a frame add / delete instruction to delete the sub-frame corresponding to the picture to be stitched; when the user is browsing the preview frame of the stitched picture and finds that the position of the pictures to be stitched needs to be adjusted and the positions of the second picture and the third picture need to be swapped, a frame adjustment instruction is issued to swap the positions of the sub-frame of the second picture and the sub-frame of the third picture; when the user is browsing the preview frame of the stitched picture and finds that the second picture needs to be reduced, a frame adjustment instruction is issued to reduce the sub-frame of the second picture.

[0069] Step 110: Process the stitched image preview frame based on the frame processing instruction to generate a target stitched image.

[0070] After receiving the frame processing instruction for the spliced ​​picture preview frame, corresponding processing is performed on the spliced ​​picture preview frame according to the frame processing instruction to generate a new target spliced ​​picture.

[0071] Specifically, processing the spliced ​​image preview frame based on the frame processing instruction includes:

[0072] When receiving the frame adding and deleting instruction, adding a new sub-frame and adding a new image to be spliced ​​or deleting a sub-frame in the spliced ​​image preview frame according to the frame adding and deleting instruction;

[0073] When the frame adjustment instruction is received, the order of the sub-frames in the spliced ​​picture preview frame is swapped or the sizes of the sub-frames in the spliced ​​picture preview frame are adjusted according to the frame adjustment instruction.

[0074] When a frame addition and deletion instruction is received, it is necessary to perform operations such as adding a new sub-frame and adding a new image to be spliced ​​according to the specific content of the frame addition and deletion instruction, or to perform operations such as deleting a sub-frame in the spliced ​​image preview frame according to the frame addition and deletion instruction.

[0075] In a specific implementation provided in the present application, taking adding sub-frames as an example, when a frame addition and deletion instruction for a spliced ​​image preview frame is received, the instruction is parsed, and the specific content of the instruction is obtained as adding sub-frames. At the same time, at least one newly added image to be spliced ​​is obtained, and a corresponding number of newly added sub-frames are added according to the number of newly added images to be spliced, and each newly added image to be spliced ​​is filled into each newly added sub-frame.

[0076] In a specific implementation provided in the present application, taking the deletion of a sub-frame as an example, when a frame addition and deletion instruction for a spliced ​​image preview frame is received, the instruction is parsed, and the deletion instruction for the target sub-frame in the instruction is obtained, the target sub-frame is determined and deleted, and at the same time, the parameters of each sub-frame in the spliced ​​image preview frame after the target sub-frame is deleted are updated and calculated in real time to display the new spliced ​​image preview frame.

[0077] In actual applications, in addition to adding or deleting subframes in the preview frame of the spliced ​​image, the position and size of the subframes in the preview frame of the spliced ​​image can also be adjusted. For example, when two adjacent subframes are spliced, the subframes can be adjusted so that the repeated parts of the images to be spliced ​​in the subframes overlap, and two consecutive images to be spliced ​​are spliced ​​into a complete image. When multiple subframes overlap, the stacking order of each frame can be determined.

[0078] In a specific implementation provided in the present application, the size of the sub-frame in the stitched image preview frame can also be adjusted. For example, the user can adjust the size of the sub-frame by pinching or separating two fingers on the terminal screen. When the user performs a pinching operation, the size of the sub-frame will be reduced, and when the user performs a separation operation, the size of the sub-frame will be enlarged, so that the stitched image can be changed accordingly according to the user's needs.

[0079] Wherein, adjusting the size of the sub-frame in the spliced ​​image preview frame according to the frame adjustment instruction includes:

[0080] Determining a target subframe in the spliced ​​picture preview frame according to the frame adjustment instruction, and determining a scaling factor of the target subframe;

[0081] The target subframe is resized based on the zoom factor.

[0082] When adjusting the size of a sub-frame in the stitched image preview frame, the target sub-frame, that is, the sub-frame that needs to be adjusted, is determined according to the frame adjustment instruction. The scaling coefficient of the target sub-frame is determined through gesture operation, and then the final size of the target sub-frame after the adjustment instruction can be calculated based on the initial coefficient of the target sub-frame in the stitched image preview frame.

[0083] The image stitching method provided by the present application receives a frame processing instruction for the stitching image preview frame, and processes the stitching image preview frame according to the frame processing instruction. There is no need to process the initial stitching image generated by the images to be stitched, so as to avoid traversing each image to be stitched when adjusting and modifying the initial stitching image, and there is no need to recalculate the layout of the images to be stitched when inserting, deleting, adjusting the order, and adjusting the size. The stitching image preview frame is directly processed, and the stitching operation of the images is converted into the layout operation of the sub-frame, so as to save computing resources and improve the user's interactive experience and visual experience in the process of stitching images.

[0084] In another specific embodiment provided in the present application, the method further comprises:

[0085] The spliced ​​image preview framework is loaded in a lazy loading manner, and the loaded portion of the spliced ​​image preview framework is saved in a cache.

[0086] Lazy loading is a loading method that improves terminal performance. When the user scrolls the page, the content in the start area is loaded first, and the other parts of the content are loaded after entering the visible area, improving service performance. When stitching pictures, the size of the picture usually exceeds the range of the terminal screen. If all the stitched pictures are loaded but the user does not view them, loading resources will be wasted. Therefore, lazy loading is used to load the part that enters the visible area of ​​the terminal, and the loaded part in the preview frame of the stitched picture is added to the cache, which is convenient for reuse in subsequent processing and improves resource utilization.

[0087] Accordingly, after generating the target spliced ​​image, the method further includes:

[0088] Release the stitching image preview frame loaded in the cache.

[0089] After the target stitched image is generated, it means that the processing of the stitched image preview frame has been completed. At this time, there is no need to save the stitched image preview frame. The loaded stitched image preview frame saved in the cache can be deleted to release the corresponding cache control and improve the resource utilization of the terminal.

[0090] In practical applications, after stitching together multiple images to be stitched, the size of the target stitched image obtained will be the sum of the sizes of all the images to be stitched. For example, if the size of one image to be stitched is 3M, if there are 10 images to be stitched, the size of the target stitched image may reach 30M or even higher. Based on this, after generating the target stitched image, the method further includes:

[0091] The target spliced ​​image is processed based on a preset image compression rule to obtain a compressed target spliced ​​image.

[0092] In order to reduce the consumption of terminal memory and improve the availability of the target stitched image, after obtaining the target stitched image, the target stitched image can also be compressed. The specific image compression rules can be based on the actual application, for example, compression based on a preset aspect ratio, compression based on preset pixels, compression based on a preset image size, etc. The image compression rules are not specifically limited in this application.

[0093] In the picture stitching method provided in the present application, a picture stitching instruction is received; a set of pictures to be stitched and target stitching configuration information are obtained in response to the picture stitching instruction; pictures to be stitched in the set of pictures to be stitched are stitched based on the target stitching configuration information to generate a stitching picture preview frame; a frame processing instruction for the stitching picture preview frame is received, wherein the frame processing instruction is determined according to operation information collected by a sensor; the stitching picture preview frame is processed based on the frame processing instruction to generate a target stitching picture. An embodiment of the present application solves the problem of the solidification of the picture stitching form, and at the same time adds the user's picture processing instruction for interactive adjustment, realizes the final stitching picture effect according to the user's instruction, enriches the stitching method, and improves the user's experience.

[0094] Secondly, the stitched image preview frame is processed according to the framework processing instruction. There is no need to process the initial stitched image generated by the images to be stitched, which avoids traversing each image to be stitched when adjusting and modifying the initial stitched image. There is also no need to recalculate the layout of the images to be stitched when inserting, deleting, adjusting the order, and adjusting the size. The stitched image preview frame is directly processed, and the stitching operation of the images is converted into the layout operation of the sub-frame, which saves computing resources and improves the user's interactive experience and visual experience in the process of stitching images.

[0095] The following combination Figure 2 and attached Figure 3 Taking the application of the image stitching method provided by the present application in stitching panoramic images as an example, the image stitching method is further described. Figure 2 is a schematic diagram of a framework of a method for stitching images provided in an embodiment of the present application. Figure 2 As shown, in the input stage, the initial set of images to be spliced ​​and the target splicing configuration information are input. In the processing stage, the initial images to be spliced ​​are first verified, the set of images to be spliced ​​is screened, and then the splicing image preview frame is generated in combination with the target splicing configuration information. At this time, the input framework processing instruction is received, and the target splicing image is generated. In order to reduce the consumption of terminal memory, the target splicing image needs to be compressed to obtain the compressed target splicing image.

[0096] Figure 3A processing flow chart of a picture stitching method for stitching panoramic pictures provided in an embodiment of the present application is shown, which specifically includes the following steps:

[0097] Step 302: Receive a picture stitching instruction.

[0098] In a specific embodiment provided in the present application, a picture stitching instruction sent by a user is received, and the picture stitching instruction is used to stitch together 5 consecutive horizontally shot pictures to form a new stitched picture.

[0099] Step 304: In response to the picture stitching instruction, a set of pictures to be stitched is obtained, and target stitching configuration information is obtained.

[0100] In a specific embodiment provided by the present application, following the above example, in response to the picture splicing instruction, a set of pictures to be spliced ​​is obtained, see Figure 4 a in which Figure 4 A schematic diagram of image stitching provided by an embodiment of the present application is provided, wherein: Figure 4 a in the figure is a schematic diagram of a set of pictures to be spliced ​​in the embodiment of the present application. While obtaining the set of pictures to be spliced, target splicing configuration information is obtained, specifically "horizontal splicing".

[0101] Step 306: Parse the target splicing configuration information and generate a preview layout framework.

[0102] In a specific embodiment provided in the present application, following the above example, according to the number of pictures to be spliced ​​in the picture set to be spliced, it is determined that 5 sub-frames need to be created. After parsing the target configuration information, it is determined that the splicing form is horizontal splicing, then 5 sub-frames are generated and spliced ​​horizontally to generate a preview layout frame.

[0103] Step 308: input the pictures to be spliced ​​in the set of pictures to be spliced ​​into the preview layout frame to generate a spliced ​​picture preview frame.

[0104] In a specific embodiment provided by the present application, following the above example, 5 images to be spliced ​​in the image set to be spliced ​​are sequentially input into 5 subframes of the preview layout frame to generate a spliced ​​image preview frame, see Figure 4 b in Figure 4 FIG. b shows a schematic diagram of a spliced ​​picture preview framework provided in an embodiment of the present application.

[0105] Step 310: Load the spliced ​​image preview framework in a lazy loading manner, and save the loaded portion of the spliced ​​image preview framework into a cache.

[0106] In a specific embodiment provided in the present application, following the above example, the length of the stitched image preview frame has exceeded the width of the mobile phone screen. In order to improve the processing speed of the mobile phone, only the part of the stitched image preview frame displayed on the mobile phone screen is loaded, and the loaded part of the stitched image preview frame is saved in the cache.

[0107] Step 312: Receive a frame adjustment instruction for the spliced ​​image preview frame.

[0108] In a specific embodiment provided in the present application, following the above example, a frame adjustment instruction for a spliced ​​picture preview frame is received, and the splicing form is adjusted according to user needs.

[0109] Step 314: Process the spliced ​​image preview frame according to the frame adjustment instruction to generate a target spliced ​​image.

[0110] In a specific embodiment provided in the present application, the above example is used to adjust the position of each sub-frame according to the frame adjustment instruction. Figure 4 In c, Figure 4 c in FIG. 1 shows a schematic diagram of a target stitching picture provided in an embodiment of the present application.

[0111] Step 316: compress the target stitched image to obtain the compressed target stitched image, and delete the loaded content in the stitched image preview frame in the cache.

[0112] In a specific embodiment provided in the present application, the above example is followed to compress the target stitched image, obtain the compressed target stitched image for the user to use, and delete the loaded content in the stitched image preview frame in the cache.

[0113] In the picture stitching method provided in the present application, a picture stitching instruction is received; a set of pictures to be stitched and target stitching configuration information are obtained in response to the picture stitching instruction; pictures to be stitched in the set of pictures to be stitched are stitched based on the target stitching configuration information to generate a stitching picture preview frame; a frame processing instruction for the stitching picture preview frame is received, wherein the frame processing instruction is determined according to operation information collected by a sensor; the stitching picture preview frame is processed based on the frame processing instruction to generate a target stitching picture. An embodiment of the present application solves the problem of the solidification of the picture stitching form, and at the same time adds the user's picture processing instruction for interactive adjustment, realizes the final stitching picture effect according to the user's instruction, enriches the stitching method, and improves the user's experience.

[0114] Secondly, the stitched image preview frame is processed according to the framework processing instruction. There is no need to process the initial stitched image generated by the images to be stitched, which avoids traversing each image to be stitched when adjusting and modifying the initial stitched image. There is also no need to recalculate the layout of the images to be stitched when inserting, deleting, adjusting the order, and adjusting the size. The stitched image preview frame is directly processed, and the stitching operation of the images is converted into the layout operation of the sub-frame, which saves computing resources and improves the user's interactive experience and visual experience in the process of stitching images.

[0115] Corresponding to the above method embodiment, the present application also provides a picture stitching device embodiment, Figure 5 FIG. 1 is a schematic diagram showing the structure of a picture splicing device provided by an embodiment of the present application. Figure 5 As shown, the device comprises:

[0116] A first receiving module 502 is configured to receive a picture stitching instruction;

[0117] An acquisition module 504 is configured to acquire a set of pictures to be stitched and target stitching configuration information in response to the picture stitching instruction;

[0118] The stitching module 506 is configured to stitch the to-be-stitched pictures in the to-be-stitched picture set based on the target stitching configuration information, and generate a stitched picture preview frame;

[0119] The second receiving module 508 is configured to receive a frame processing instruction for the stitched picture preview frame, wherein the frame processing instruction is determined according to the operation information collected by the sensor;

[0120] The processing module 510 is configured to process the stitched image preview frame based on the frame processing instruction to generate a target stitched image.

[0121] Optionally, the acquisition module 504 is further configured to:

[0122] Responding to the picture stitching instruction, obtaining an initial set of pictures to be stitched;

[0123] The pictures in the initial set of pictures to be spliced ​​are filtered according to a preset picture verification rule to obtain a set of pictures to be spliced.

[0124] Optionally, the picture stitching instruction includes a stitching configuration identifier;

[0125] The acquisition module 504 is further configured to:

[0126] The target splicing configuration information is obtained from a preset configuration information library according to the splicing configuration identifier.

[0127] Optionally, the splicing module 506 is further configured to:

[0128] Parsing the target splicing configuration information to generate a preview layout framework;

[0129] The pictures to be spliced ​​in the set of pictures to be spliced ​​are input into the preview layout frame to generate a spliced ​​picture preview frame.

[0130] Optionally, the second receiving module 508 is further configured to:

[0131] Receive frame addition and deletion instructions and / or frame adjustment instructions for the spliced ​​image preview frame.

[0132] Optionally, the processing module 510 is further configured to:

[0133] When receiving the frame adding and deleting instruction, adding a new sub-frame and adding a new image to be spliced ​​or deleting a sub-frame in the spliced ​​image preview frame according to the frame adding and deleting instruction;

[0134] When the frame adjustment instruction is received, the order of the sub-frames in the spliced ​​picture preview frame is swapped or the sizes of the sub-frames in the spliced ​​picture preview frame are adjusted according to the frame adjustment instruction.

[0135] Optionally, the processing module 510 is further configured to:

[0136] Determining a target subframe in the spliced ​​picture preview frame according to the frame adjustment instruction, and determining a scaling factor of the target subframe;

[0137] The target subframe is resized based on the zoom factor.

[0138] Optionally, the device further comprises:

[0139] The loading cache module is configured to load the spliced ​​image preview framework in a lazy loading manner and save the loaded portion of the spliced ​​image preview framework into a cache.

[0140] Optionally, the device further comprises:

[0141] The release module is configured to release the spliced ​​image preview frame loaded in the cache.

[0142] Optionally, the device further comprises:

[0143] The compression module is configured to process the target spliced ​​image based on a preset image compression rule to obtain a compressed target spliced ​​image.

[0144] In the image stitching device provided by the present application, a picture stitching instruction is received; a set of pictures to be stitched and target stitching configuration information are obtained in response to the picture stitching instruction; pictures to be stitched in the set of pictures to be stitched are stitched based on the target stitching configuration information to generate a stitching picture preview frame; a frame processing instruction for the stitching picture preview frame is received, wherein the frame processing instruction is determined according to operation information collected by a sensor; the stitching picture preview frame is processed based on the frame processing instruction to generate a target stitching picture. An embodiment of the present application solves the problem of the solidification of the picture stitching form, and at the same time adds the user's picture processing instruction for interactive adjustment, realizes the final stitching picture effect according to the user's instruction, enriches the stitching method, and improves the user's experience.

[0145] Secondly, the stitched image preview frame is processed according to the framework processing instruction. There is no need to process the initial stitched image generated by the images to be stitched, which avoids traversing each image to be stitched when adjusting and modifying the initial stitched image. There is also no need to recalculate the layout of the images to be stitched when inserting, deleting, adjusting the order, and adjusting the size. The stitched image preview frame is directly processed, and the stitching operation of the images is converted into the layout operation of the sub-frame, which saves computing resources and improves the user's interactive experience and visual experience in the process of stitching images.

[0146] The above is a schematic scheme of a picture splicing device of this embodiment. It should be noted that the technical scheme of the picture splicing device and the technical scheme of the picture splicing method described above are of the same concept, and the details of the technical scheme of the picture splicing device not described in detail can all be referred to the description of the technical scheme of the picture splicing method described above.

[0147] Figure 6 The block diagram of a computing device 600 according to an embodiment of the present application is shown. The components of the computing device 600 include but are not limited to a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and the database 650 is used to store data.

[0148] The computing device 600 also includes an access device 640 that enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0149] In one embodiment of the present application, the above components of the computing device 600 and Figure 6 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 6 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.

[0150] The computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 600 may also be a mobile or stationary server.

[0151] When the processor 620 executes the computer instructions, the steps of the picture stitching method are implemented.

[0152] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above picture stitching method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above picture stitching method.

[0153] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the image stitching method as described above.

[0154] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above picture stitching method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above picture stitching method.

[0155] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0156] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0157] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0158] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0159] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.

Claims

1. A method for stitching pictures, characterized in that: include: Receive image stitching instructions; Responding to the picture stitching instruction, obtaining a set of pictures to be stitched and target stitching configuration information; splicing the pictures to be spliced ​​in the set of pictures to be spliced ​​based on the target splicing configuration information, and generating a spliced ​​picture preview frame; Receiving a frame processing instruction for the spliced ​​picture preview frame, wherein the frame processing instruction is determined according to the operation information collected by the sensor; The spliced ​​image preview frame is processed based on the frame processing instruction to generate a target spliced ​​image.

2. The image stitching method according to claim 1, characterized in that: Responding to the picture stitching instruction, obtaining a set of pictures to be stitched includes: Responding to the picture stitching instruction, obtaining an initial set of pictures to be stitched; The pictures in the initial set of pictures to be spliced ​​are filtered according to a preset picture verification rule to obtain a set of pictures to be spliced.

3. The image stitching method according to claim 1, characterized in that: The picture stitching instruction includes a stitching configuration identifier; Acquiring target splicing configuration information in response to the picture splicing instruction includes: The target splicing configuration information is obtained from a preset configuration information library according to the splicing configuration identifier.

4. The image stitching method according to claim 1, characterized in that: Splicing the pictures to be spliced ​​in the set of pictures to be spliced ​​based on the target splicing configuration information to generate a spliced ​​picture preview frame, including: Parsing the target splicing configuration information to generate a preview layout framework; The pictures to be spliced ​​in the set of pictures to be spliced ​​are input into the preview layout frame to generate a spliced ​​picture preview frame.

5. The image stitching method according to claim 1, characterized in that: Receiving a frame processing instruction for the spliced ​​image preview frame includes: Receive frame addition and deletion instructions and / or frame adjustment instructions for the spliced ​​image preview frame.

6. The image stitching method according to claim 5, characterized in that: Processing the spliced ​​image preview frame based on the frame processing instruction includes: When receiving the frame adding and deleting instruction, adding a new sub-frame and adding a new image to be spliced ​​or deleting a sub-frame in the spliced ​​image preview frame according to the frame adding and deleting instruction; When the frame adjustment instruction is received, the order of the sub-frames in the spliced ​​picture preview frame is swapped or the sizes of the sub-frames in the spliced ​​picture preview frame are adjusted according to the frame adjustment instruction.

7. The image stitching method according to claim 6, characterized in that: Adjusting the size of the sub-frame in the spliced ​​image preview frame according to the frame adjustment instruction includes: Determining a target subframe in the spliced ​​picture preview frame according to the frame adjustment instruction, and determining a scaling factor of the target subframe; The target subframe is resized based on the zoom factor.

8. The image stitching method according to any one of claims 1 to 7, characterized in that: The method further comprises: The spliced ​​image preview framework is loaded in a lazy loading manner, and the loaded portion of the spliced ​​image preview framework is saved in a cache.

9. The image stitching method according to claim 8, characterized in that: After generating the target spliced ​​image, the method further includes: Release the stitching image preview frame loaded in the cache.

10. The image stitching method according to any one of claims 1 to 7, characterized in that: After generating the target spliced ​​image, the method further includes: The target spliced ​​image is processed based on a preset image compression rule to obtain a compressed target spliced ​​image.

11. A picture splicing device, characterized in that: include: A first receiving module is configured to receive a picture stitching instruction; An acquisition module, configured to acquire a set of pictures to be stitched and target stitching configuration information in response to the picture stitching instruction; A splicing module, configured to splice the pictures to be spliced ​​in the set of pictures to be spliced ​​based on the target splicing configuration information, and a splicing picture preview frame; A second receiving module is configured to receive a frame processing instruction for the spliced ​​picture preview frame, wherein the frame processing instruction is determined according to the operation information collected by the sensor; The processing module is configured to process the spliced ​​image preview frame based on the frame processing instruction to generate a target spliced ​​image.

12. A computing device comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the computer instructions, the steps of the method according to any one of claims 1 to 10 are implemented.

13. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method described in any one of claims 1 to 10 are implemented.

14. A computer program product, comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method described in any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Picture mosaic method, device, electronic device and medium

    CN109146783A