Image resource splicing method and device
By acquiring image and video resources, processing them into multiple images, and generating a target image, the problem of existing technologies that can only stitch together resources of the same type is solved. This enables the mixed stitching of images and videos, meeting the diverse processing needs of users.
Patent Information
- Application Number
- CN202010096105.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-17
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2040-02-17
AI Technical Summary
Existing technologies can only stitch together image resources of the same type, which cannot meet the growing and diverse processing needs of users.
This paper provides an image resource stitching method that acquires image and video resources, processes video resources into multiple image resources, and generates target images based on layout templates. It supports mixed stitching of images and videos.
It enables the splicing of different types of resources, increases the diversity of processing methods, and meets the diverse needs of users.
Smart Images

Figure CN111353936B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of image processing, and particularly relate to an image resource splicing method and device. BACKGROUND
[0002] With the development of Internet technology, people's work and entertainment life are becoming more and more diversified.
[0003] With the development of mobile terminals, when taking pictures or videos, there is no need to carry additional shooting equipment, and mobile terminals can be used. Therefore, taking pictures and videos becomes more and more convenient, and picture and video resources also become more and more abundant. At present, when processing picture and video resources, only resources of the same type can be processed. The common processing process is to splice several pictures into one picture, or only two videos can be spliced together.
[0004] However, the prior art can only splice several pictures into one picture or only splice two videos together for processing, and the processing method is single, which cannot meet the growing processing needs of users. SUMMARY
[0005] Embodiments of the present application provide an image resource splicing method and device to improve the diversity of image resource processing methods.
[0006] In a first aspect, embodiments of the present application provide an image resource splicing method, comprising: acquiring at least one picture resource and at least one video resource; processing the video resource to process the video resource into at least two video picture resources; selecting the picture resource and at least one video picture resource, and generating a target picture.
[0007] Optionally, the method further comprises: selecting a first target layout template according to the picture resource and the video picture resource to generate the target picture.
[0008] Optionally, before generating the target picture, the step of adjusting the video picture resource comprises: selecting the video picture resource to be adjusted, and displaying at least two video picture resources of the video resource.
[0009] Optionally, before generating the target picture, the step of adjusting the video picture resource comprises: selecting the video picture resource to be adjusted, and displaying the video picture resource in the video resource that has not been selected.
[0010] Optionally, the step of selecting the picture resource and at least one video picture resource, and generating the target picture comprises: selecting the picture resource and all video picture resources processed by the video resource to generate the target picture.
[0011] Optionally, the target picture is a static picture and / or a dynamic picture.
[0012] Optionally, after the picture resource and at least one video picture resource are selected, the method further comprises: determining a transcoding mode corresponding to the picture resource and the video picture resource respectively, wherein the picture resource corresponds to a first transcoding mode and the video picture resource corresponds to a second transcoding mode; performing transcoding processing on the picture resource according to the first transcoding mode and performing transcoding processing on the video picture resource according to the second transcoding mode; and generating the target picture according to the transcoded picture resource and video picture resource.
[0013] Optionally, after the picture resource and at least one video picture resource are selected and the target picture is generated, the method further comprises:
[0014] receiving a triggered adjustment request;
[0015] adjusting the target picture according to the adjustment request, wherein the adjustment comprises at least one of adjusting contrast of a picture of the target picture, adjusting resolution of the target picture, and adjusting relative positions of resources in the target picture.
[0016] In a second aspect, an embodiment of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores computer execution instructions, and when a processor executes the computer execution instructions, the image resource splicing method in any one of the first aspect is implemented.
[0017] The image resource splicing method and device provided by the embodiment of the present application can splice the obtained picture type resource and video type resource, and is no longer limited to splicing pictures or splicing videos, so that the processing mode is diversified and the growing processing requirements of users can be met. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiment or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0019] Figure 1a Application scenario diagram of the existing picture splicing;
[0020] Figure 1b Application scenario diagram of the existing video splicing;
[0021] Figure 2 The application scenario diagram of the image resource splicing method provided by the embodiment of the present application is shown.
[0022] Figure 3 The flow diagram of the image resource splicing method provided by the embodiment of the present application is shown.
[0023] Figure 4 The structure diagram of the image resource splicing device provided by the embodiment of the present application is shown.
[0024] Figure 5 The hardware structure diagram of the image resource splicing device provided by the embodiment of the present application is shown. DETAILED DESCRIPTION
[0025] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0026] The terms "first", "second", "third", "fourth" and the like (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0027] As shown in Figure 1a , it is an application scenario diagram of existing picture splicing. After the user selects three pictures, the three pictures are spliced according to a picture layout template, and finally a picture is spliced.
[0028] As shown in Figure 1b , it is an application scenario diagram of existing video splicing. After the user selects a video, the video is laid out according to a video layout template, and finally a GIF format dynamic picture is generated.
[0029] The two existing processing manners can only splice resources of the same type, and cannot splice resources of different types, the processing manner is single, and the increasing processing demand of users cannot be met.
[0030] As Figure 2 shown, an application scenario diagram of image resource splicing provided by an embodiment of the present application is shown, in the embodiment, a user selects three picture resources and a video resource, then the three picture resources and the video resource are typeset according to a template, and finally a GIF dynamic picture containing both picture resources and video resources is generated, the processing manner of resources is increased, and the increasing processing demand of users is met.
[0031] The technical solutions of the present application will be described in detail in the following specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described in some embodiments.
[0032] Figure 3 A flowchart of the image resource splicing method provided by the embodiment of the present application is shown, the method of the embodiment can be executed by an image resource splicing device, and the splicing device can exist in the form of software and / or hardware. As Figure 3 shown, the method of the embodiment can include:
[0033] S301, acquiring at least one picture resource and at least one video resource.
[0034] Specifically, in some resource processing scenarios, for example, when a beauty software processes a picture, when a PPT report makes a picture, and when a subway or elevator display advertisement is made, a scenario of combining a picture and a video for processing can be encountered. In these scenarios, when processing, a picture resource and a video resource triggered by a user are first acquired. In addition, the number of picture type resources and the number of video type resources can be set according to the actual demand of the user.
[0035] Among them, the number of each resource is at least one. In order to improve the clarity of the display effect of the dynamic picture finally spliced, the number of picture type resources can be set to 2-4 at most, and the number of video type resources can be set to 1-2 at most.
[0036] S302, processing the video resource, and processing the video resource into at least two video picture resources.
[0037] Specifically, after the number of resources to be spliced is determined, the video resource can be processed first, and the video resource is processed into at least two video picture resources. For example, the video resource can be intercepted according to frames, and a video picture resource is generated after every several frames are intercepted, and at least two video picture resources are determined. In addition, before the two video picture resources are generated, the video resource can also be subjected to operations such as interception processing and synthesis processing.
[0038] S303, select the picture resource and at least one video picture resource, and generate a target picture.
[0039] Specifically, when the target picture is generated, the selected picture resource and the generated video picture resource can be directly obtained. When the video picture resource is obtained, only one video picture resource can be obtained, and at this time, the generated target picture is a static picture. Two or more video picture resources can also be obtained, and at this time, the generated target picture is a dynamic picture.
[0040] In addition, when the target picture is generated, the user can also determine a target layout template suitable for the resources to be spliced according to the number of picture type resources and the number of video type resources, and then generate the target picture according to the target layout template.
[0041] In addition, when the target picture is generated, the user can also adjust the number of picture type resources and the number of video type resources that can be added in the target layout template, adjust the positions of the resources to be spliced that can be added in the template, adjust the background color in the template, or adjust the decorative picture in the template, and then generate the target picture according to the target layout template after the adjustment.
[0042] After the above scheme is adopted, the obtained picture type resources and video type resources can be spliced, and the splicing is no longer limited to picture and picture or video and video, the processing mode is diversified, and the growing processing needs of users can be met.
[0043] Based on the method, Figure 3 The embodiments of the present specification also provide some specific implementation schemes of the method, which are described below.
[0044] In one specific implementation, the method can further include:
[0045] According to the picture resource and the video picture resource, a first target layout template is selected, and the target picture is generated.
[0046] Specifically, the first target layout template meeting the condition can be determined according to the number of picture resources to be spliced and the number of video resources. For example, there are two picture resources and one video resource, and then there are two positions for placing picture resources and one position for placing video resources in the determined first target layout template. Then, the target picture is generated according to the first target layout template.
[0047] In addition, in addition to automatically determining the target layout template, the target layout template can also be manually determined. That is, the user can manually select the target layout template that the user likes. In order to improve the usability of the template, the user can also adjust the template, so that the template can match the number of picture resources and the number of video resources selected by the user.
[0048] In one specific embodiment, before the target picture is generated, the step of adjusting the video picture resource can include:
[0049] The video picture resource to be adjusted is selected, and at least two video picture resources of the video resource are displayed.
[0050] In one specific embodiment, before the target picture is generated, the step of adjusting the video picture resource can include: selecting the video picture resource to be adjusted, and displaying the video picture resource that has not been selected in the video resource.
[0051] Specifically, a plurality of video picture resources can be generated according to the video resource. Before the target picture is generated, the video picture resource displayed in the target picture can be set. For example, the selected video picture resource can be displayed. In addition, the unselected video picture resource can also be displayed. The display mode of the video picture resource is increased, which provides convenience for user processing.
[0052] In one specific embodiment, the step of selecting the picture resource and at least one video picture resource and generating the target picture includes: selecting the picture resource and all video picture resources processed by the video resource, and generating the target picture.
[0053] Specifically, all video picture resources generated after the video resource is processed and the original picture resource can also be selected at the same time, and the target picture including all video picture resources and picture resources is generated.
[0054] In one specific embodiment, the target picture is a static picture and / or a dynamic picture. The format of the target picture can be a Gif format.
[0055] In one embodiment, after the picture resource and the at least one video picture resource are selected and the target picture is generated, the method further comprises:
[0056] receiving a triggered adjustment request.
[0057] adjusting the target picture according to the adjustment request, wherein the adjustment comprises at least one of adjusting the contrast of the picture, adjusting the resolution of the picture, and adjusting the relative position of the resource in the picture.
[0058] Specifically, after the target picture is generated, the target picture can be adjusted according to actual needs. The adjustment of the contrast of the picture can be increasing the contrast of the picture or reducing the contrast of the initial spliced picture. The adjustment of the resolution of the picture can be adjusting the resolution of the picture according to actual needs of the user, for example, the resolution can be set to 1920*1080, and the resolution can also be set to 640*480. The adjustment of the relative position of the resource in the picture can be adjusting the relative position of the picture resource and the video picture resource.
[0059] In one embodiment, after the picture resource and the at least one video picture resource are selected, the method further comprises:
[0060] determining a transcoding mode corresponding to the picture resource and the video picture resource, respectively, wherein the picture resource corresponds to a first transcoding mode and the video picture resource corresponds to a second transcoding mode.
[0061] transcoding the picture resource according to the first transcoding mode and transcoding the video picture resource according to the second transcoding mode, and generating a target picture according to the transcoded picture resource and the transcoded video picture resource.
[0062] Specifically, different resource types correspond to different transcoding modes. Different transcoding modes can be used to convert different resource types into the same resource type. For example, the format code of the video resource type can be converted into machine code, and the format code of the picture resource type can also be converted into machine code. Then, the target picture is generated according to the converted machine code.
[0063] In one embodiment, the picture resource and the video resource can be obtained through a picker interface. The picker interface does not limit the type of resource and can be compatible with picture resources and video resources.
[0064] Figure 4 The structure diagram of the image resource splicing device provided by the embodiment of the present application is shown in the following figure: Figure 4As shown, the image resource splicing device provided by the embodiment of the present application can realize the above-mentioned image resource splicing method. Figure 3 The image resource splicing method shown can specifically include the following steps.
[0065] The touch module 401 is configured to acquire at least one picture resource and at least one video resource.
[0066] The processing module 402 is configured to process the video resource into at least two video picture resources.
[0067] The processing module 402 is configured to select the picture resource and at least one video picture resource and generate a target picture.
[0068] In one specific embodiment, the processing module 402 is further configured to:
[0069] According to the picture resource and the video picture resource, a first target layout template is selected to generate the target picture.
[0070] In one specific embodiment, the processing module 402 is further configured to:
[0071] The video picture resource to be adjusted is selected, and at least two video picture resources of the video resource are displayed.
[0072] In one specific embodiment, the processing module 402 is further configured to:
[0073] The video picture resource to be adjusted is selected, and the video picture resource of the video resource that has not been selected is displayed.
[0074] In one specific embodiment, the processing module 402 is further configured to: select the picture resource and all the video picture resources processed from the video resource to generate the target picture.
[0075] In one specific embodiment, the target picture is a static picture and / or a dynamic picture.
[0076] In one specific embodiment, the processing module 402 is further configured to:
[0077] A triggered adjustment request is received.
[0078] According to the adjustment request, the target picture is adjusted and processed, wherein the adjustment and processing at least includes one of the following: adjusting the contrast of the picture of the target picture, adjusting the resolution of the target picture, and adjusting the relative position of the resource in the target picture.
[0079] In one specific embodiment, the processing module 402 is further configured to:
[0080] Determine a transcoding mode corresponding to the picture resource and the video picture resource respectively, wherein the picture resource corresponds to a first transcoding mode, and the video picture resource corresponds to a second transcoding mode.
[0081] Transcode the picture resource according to the first transcoding mode, and transcode the video picture resource according to the second transcoding mode. Generate the target picture according to the transcoded picture resource and the transcoded video picture resource.
[0082] Figure 5 A hardware structure schematic diagram of an image resource splicing device provided by an embodiment of the present application is provided. As shown in the figure, Figure 5 The image resource splicing device 500 provided by the embodiment includes at least one processor 501 and a memory 502. The processor 501 and the memory 502 are connected through a bus 503.
[0083] In the specific implementation process, the at least one processor 501 executes the computer execution instructions stored in the memory 502, so that the at least one processor 501 executes the image resource splicing method in the above-mentioned method embodiment.
[0084] The specific implementation process of the processor 501 can refer to the above-mentioned method embodiment, which has similar implementation principles and technical effects, and will not be described here in detail.
[0085] In the above-mentioned Figure 5 In the embodiment shown in the figure, it should be understood that the processor can be a central processing unit (English: Central Processing Unit, for short: CPU), and can also be other general-purpose processors, digital signal processors (English: Digital Signal Processor, for short: DSP), application specific integrated circuits (English: Application Specific Integrated Circuit, for short: ASIC) and the like. The general-purpose processor can be a microprocessor, or the processor can be any conventional processor, etc. The steps of the method disclosed in the application can be directly embodied as the execution of the hardware processor, or executed by the combination of hardware and software modules in the processor.
[0086] The memory can include a high-speed RAM memory, and can also include a non-volatile storage NVM, for example, at least one disk memory.
[0087] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.
[0088] The embodiment of the present application further provides a computer readable storage medium, wherein computer execution instructions are stored in the computer readable storage medium, and when a processor executes the computer execution instructions, an image resource splicing method of the above method embodiment is realized.
[0089] The computer readable storage medium described above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0090] An exemplary readable storage medium is coupled to the processor, so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in the device.
[0091] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The foregoing program can be stored in a computer readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the foregoing storage medium includes ROM, RAM, magnetic disk or optical disk and various storage medium capable of storing program codes.
[0092] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the present application; although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that the technical solutions recorded in the above embodiments can be modified, or some or all of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. An image resource splicing method, characterized in that, The method comprises the following steps: acquiring at least one picture resource and at least one video resource; processing the video resource to convert the video resource into at least two video picture resources; selecting the picture resource and at least one video picture resource, and determining the corresponding transcoding mode of the picture resource and the video picture resource, respectively, wherein the picture resource corresponds to a first transcoding mode, the first transcoding mode is used to convert the format code of the picture resource type into machine code, the video picture resource corresponds to a second transcoding mode, and the second transcoding mode is used to convert the format code of the video resource type into machine code; transcoding the picture resource according to the first transcoding mode and transcoding the video picture resource according to the second transcoding mode to convert the picture resource and the video picture resource into the same resource type; selecting a first target layout template according to the picture resource and the video picture resource, wherein the first target layout template is determined according to the number of picture resources and the number of video resources to be spliced; generating a target picture according to the transcoded picture resource and video picture resource and the first target layout template.
2. The method of claim 1, wherein, Before generating the target picture, the step of adjusting the video picture resource comprises: selecting the video picture resource to be adjusted and displaying at least two video picture resources of the video resource.
3. The method of claim 1, wherein, Before generating the target picture, the step of adjusting the video picture resource comprises: The step of adjusting the video picture resource comprises: selecting the video picture resource to be adjusted and displaying the video picture resources in the video resource that have not been selected.
4. The method of claim 1, wherein, The step of selecting the picture resource and at least one video picture resource and generating the target picture comprises: selecting the picture resource and all the video picture resources processed by the video resource to generate the target picture.
5. The method of claim 1, wherein, The target picture is a static picture and / or a dynamic picture.
6. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer execution instructions, and when the processor executes the computer execution instructions, the image resource splicing method of any one of claims 1 to 5 is realized.
Citation Information
Patent Citations
Method and device for making graphics interchange format chart
CN106657836A
Imaging method based on double cameras, mobile terminal and storage medium
CN106937039A
Shooting method and terminal
CN110086998A