CN107330858B - Picture processing method and device, electronic equipment and storage medium - Google Patents

Picture processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN107330858B
CN107330858B CN201710524699.5A CN201710524699A CN107330858B CN 107330858 B CN107330858 B CN 107330858B CN 201710524699 A CN201710524699 A CN 201710524699A CN 107330858 B CN107330858 B CN 107330858B
Authority
CN
China
Prior art keywords
picture
pictures
spliced
weight
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710524699.5A
Other languages
Chinese (zh)
Other versions
CN107330858A (en
Inventor
陈克强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jupiter Technology Co ltd
Original Assignee
Beijing Lemi Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Lemi Technology Co Ltd filed Critical Beijing Lemi Technology Co Ltd
Priority to CN201710524699.5A priority Critical patent/CN107330858B/en
Publication of CN107330858A publication Critical patent/CN107330858A/en
Application granted granted Critical
Publication of CN107330858B publication Critical patent/CN107330858B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4038Scaling the whole image or part thereof for image mosaicing, i.e. plane images composed of plane sub-images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/32Indexing scheme for image data processing or generation, in general involving image mosaicing

Abstract

The embodiment of the invention discloses a picture processing method, a picture processing device, electronic equipment and a storage medium, wherein the method comprises the following steps: identifying at least one category to which at least two pictures to be spliced belong; determining a splicing layout according to the at least one category, wherein the number of the lattices for placing the pictures in the splicing layout is the same as the number of the pictures of the at least two pictures; and placing the at least two pictures into the splicing layout according to the weight of each grid in the splicing layout to obtain the spliced picture. By implementing the embodiment of the invention, the picture splicing efficiency can be effectively improved.

Description

Picture processing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing an image, an electronic device, and a storage medium.
Background
With the popularity of social networks, the spreading of pictures is more and more common, and the popularization of various mobile terminals (e.g., mobile phones) with shooting functions makes the pictures easier to obtain, so that the sharing of pictures on social networks has become a common way for vast users to share trends. To share more pictures simultaneously, picture stitching techniques have emerged. By splicing a plurality of pictures into one picture, a user can share more stories belonging to the user with one picture.
When a plurality of pictures are spliced in the prior art, the size and the shape of each grid in the layout may not be the same as those of the pictures placed in the grid, so that the efficiency of making the spliced pictures by a user is too low.
Disclosure of Invention
The embodiment of the invention provides a picture processing method and device, electronic equipment and a storage medium, which can solve the problem that the efficiency of making and splicing pictures by a user is too low.
In a first aspect, an embodiment of the present invention provides an image processing method, where the method includes:
identifying at least one category to which at least two pictures to be spliced belong;
determining a splicing layout according to the at least one category, wherein the number of the lattices for placing the pictures in the splicing layout is the same as the number of the pictures of the at least two pictures;
and placing the at least two pictures into the splicing layout according to the weight of each grid in the splicing layout to obtain the spliced picture.
The identifying at least one category to which the at least two pictures to be spliced belong comprises:
identifying a main body in each of at least two pictures to be spliced;
and determining the category of each picture according to the main body in each picture.
Wherein, before the at least two pictures are placed in the splicing layout according to the weight of each grid in the splicing layout to obtain the spliced picture, the method further comprises:
identifying a subject in each of the pictures;
determining the weight of each picture according to the category to which each picture belongs and the position and proportion of the main body in each picture;
the step of respectively placing the at least two pictures into the splicing layout according to the weight of each grid in the splicing layout to obtain spliced pictures comprises the following steps:
and respectively placing the at least two pictures into the splicing layout according to the weight of each picture in the at least two pictures and the weight of each grid in the splicing layout to obtain the spliced pictures.
Wherein the method further comprises:
and processing the pictures according to the positions and proportions of the main bodies in the pictures in the lattices of the pictures to obtain the processed pictures, and placing the processed pictures at the positions of the pictures.
Wherein the method further comprises:
displaying the spliced picture;
receiving a target picture selected from the spliced pictures, wherein the target picture is any one of the spliced pictures;
when the dragging operation aiming at the target picture is detected, acquiring the position to which the target picture is dragged;
and exchanging the position of the picture dragged to the position with the position of the target picture to obtain an exchanged spliced picture.
Wherein the method further comprises:
determining and recording a target category to which the target picture belongs and the weight of the position to which the target picture is dragged;
and adjusting the weight of each picture of the target category according to the weight of the position to which the target picture is dragged.
In a second aspect, an embodiment of the present invention provides an image processing apparatus, where the apparatus includes:
the identification module is used for identifying at least one type of at least two pictures to be spliced;
a determining module, configured to determine a splicing layout according to the at least one category, where the number of the lattices for placing the pictures in the splicing layout is the same as the number of the pictures in the at least two pictures;
and the processing module is used for placing the at least two pictures in the splicing layout according to the weight of each grid in the splicing layout to obtain the spliced picture.
Wherein the identification module comprises:
the identification unit is used for identifying a main body in each of at least two pictures to be spliced;
and the determining unit is used for determining the category of each picture according to the main body in each picture.
The identification module is further used for identifying the main body in each picture;
the determining module is further configured to determine a weight of each picture according to a category to which the each picture belongs, and a position and a proportion of a main body in the each picture;
the processing module is specifically configured to place the at least two pictures in the mosaic layout respectively according to the weight of each of the at least two pictures and the weight of each grid in the mosaic layout, so as to obtain a mosaic picture.
The processing module is further configured to, for each of the spliced pictures, process the picture according to the position and the proportion of the main body in the picture in the lattice where the picture is located, obtain the processed picture, and place the processed picture at the position where the picture is located.
Wherein the apparatus further comprises:
the display module is used for displaying the spliced pictures;
the receiving module is used for receiving a target picture selected from the spliced pictures, wherein the target picture is any one of the spliced pictures;
the acquisition module is used for acquiring the position to which the target picture is dragged when the dragging operation aiming at the target picture is detected;
the processing module is further configured to exchange the position of the dragged picture with the position of the target picture to obtain an exchanged spliced picture.
Wherein the apparatus further comprises:
the execution module is used for determining and recording the target category to which the target picture belongs and the weight of the position to which the target picture is dragged;
the processing module is further configured to adjust the weight of each picture of the target category according to the weight of the position to which the target picture is dragged.
In a third aspect, an embodiment of the present invention provides an electronic device, including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface are connected through the communication bus and complete mutual communication; the memory stores executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute a picture processing method; wherein the method comprises the following steps:
identifying at least one category to which at least two pictures to be spliced belong;
determining a splicing layout according to the at least one category, wherein the number of the lattices for placing the pictures in the splicing layout is the same as the number of the pictures of the at least two pictures;
and placing the at least two pictures into the splicing layout according to the weight of each grid in the splicing layout to obtain the spliced picture.
In a fourth aspect, an embodiment of the present invention provides a computer program product, where instructions in the computer program product, when executed by a processor, perform the picture processing method according to the first aspect.
In a fifth aspect, an embodiment of the present invention provides a storage medium, where instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the picture processing method according to the first aspect.
According to the embodiment of the invention, at least one type of at least two pictures to be spliced is firstly identified, then the splicing layout is determined according to the at least one type, and finally the at least two pictures are placed in the splicing layout according to the weight of each grid in the splicing layout to obtain the spliced pictures. Therefore, by implementing the embodiment of the invention, the splicing layout can be automatically determined according to the type of the pictures, and the pictures of different types can be placed in the grids with different weights in the splicing layout, so that the splicing efficiency of the pictures can be effectively improved compared with the mode that the user manually makes the spliced pictures.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a picture processing method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart diagram of a picture processing method according to another embodiment of the present invention;
FIG. 3 is a schematic block diagram of a picture processing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic block diagram of an electronic device provided in an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described below with reference to the accompanying drawings.
The image processing method provided by the embodiment of the invention can be realized by intelligent terminals with image processing functions, such as smart phones (e.g., Android phones, iOS phones, Windows Phone phones, etc.), tablet computers, Mobile Internet Devices (MID), wearable Devices, cameras, etc.
Fig. 1 is a schematic flowchart of a picture processing method according to an embodiment of the present invention. One picture processing method as shown in fig. 1 includes, but is not limited to, the following steps:
s101, the terminal identifies at least one type of at least two pictures to be spliced.
In the embodiment of the invention, firstly, the terminal receives at least two pictures selected from the picture source by a user, and determines the received at least two pictures as the pictures to be spliced. The picture source may be a picture database of the terminal, such as an album and a gallery of the terminal; the image source may also be an image database at the server side, such as a cloud album or a cloud disk at the server side. The at least two received pictures may be all pictures in a picture database of the terminal, may also be all pictures in a picture database of the server, may also be a part of pictures in picture data of the terminal, and another part of pictures in a picture database of the server, which is not limited in the embodiment of the present invention.
Then, the terminal identifies a main body in each picture by using an image identification technology aiming at each picture in the at least two pictures, wherein the main body in the picture is a main part of the picture for expressing the theme idea, is the center of the picture structure and occupies the remarkable position of the picture, and the main body of the picture can be one object or a group of objects. And finally, the terminal determines the picture category of each picture according to the identified main body in each picture. The picture category may be, for example, a figure map, a food map, a landscape map, or the like. The at least two pictures to be spliced can be pictures of the same category, or pictures of different categories, or a part of the pictures can be pictures of the same category, and another part can be pictures of other categories.
In some possible embodiments, after determining the category to which each of the at least two pictures to be stitched belongs, the number of pictures of each category may be further recorded. Optionally, the size and the picture shape of each of the at least two pictures to be stitched can be recorded, and the picture shape includes a horizontal picture and a vertical picture.
S102, the terminal determines a splicing layout according to the at least one type, and the number of the lattices for placing the pictures in the splicing layout is the same as the number of the pictures of the at least two pictures.
In the embodiment of the present invention, the terminal determines the splicing layout according to the category to which each of the at least two pictures to be spliced belongs, for example, the terminal may select a suitable splicing layout from a plurality of splicing layout templates preset by the terminal according to the at least one category, or may obtain a suitable splicing layout from the server according to the at least one category. The splicing layout template preset by the terminal and the splicing layout template at the server end comprise a plurality of lattices, the lattices are separated by frames, each lattice corresponds to a specific weight, and the weight of each lattice is determined according to the position and the occupied proportion of the lattice in the mosaic layout to which the lattice belongs. And the number of the lattices for placing the pictures in the determined splicing layout is the same as the number of the pictures of the at least two pictures.
In some possible embodiments, the terminal may automatically generate a suitable mosaic layout according to the category to which each of the at least two pictures belongs, the number of pictures recorded for each category of pictures, the size of each of the at least two pictures recorded, and the picture shape. Similarly, the number of the lattices for placing the pictures in the automatically generated splicing layout is the same as the number of the pictures of the at least two pictures, and each lattice also corresponds to a specific weight.
S103, the terminal places the at least two pictures in the splicing layout according to the weight of each grid in the splicing layout to obtain the spliced pictures.
In the embodiment of the invention, the terminal firstly identifies the main body in each of the at least two pictures and determines the position and the proportion of the main body in each picture. And then determining the weight of each picture in the at least two pictures according to the category to which each picture belongs, the position and the proportion of the main body in each picture. Specifically, the terminal presets the corresponding relation between various picture types and the first weight, the corresponding relation between a plurality of position areas of the picture and the second weight, and the corresponding relation between a plurality of proportion sections of the main body in the picture and the third weight. Determining a first weight value of each picture according to the picture category of each picture, and acquiring a second weight value corresponding to a second position area according to a position of a main body in each picture; and determining a second proportion interval corresponding to the proportion of the main body in each picture, and acquiring a value of a third weight corresponding to the second proportion interval. The weight of each picture is determined according to the value of the first weight, the value of the second weight, and the value of the third weight, and may be obtained by multiplying or adding the value of the first weight, the value of the second weight, and the value of the third weight, for example.
And finally, respectively placing the at least two pictures into the splicing layout according to the weight of each picture in the at least two pictures and the weight of each grid in the splicing layout to obtain the spliced picture. Specifically, the at least two pictures are sorted from big to small according to the weight of each picture in the at least two pictures; and then, placing the sequenced nth picture in the at least two pictures into a grid with a large weight nth in the splicing layout to obtain a spliced picture, wherein n is a positive integer and is less than or equal to the number of the at least two pictures.
In some possible embodiments, after the stitched pictures are obtained, for each of the stitched pictures, processing each picture according to the position and the proportion of the main body in the grid where each picture is located in the stitched picture, obtaining each processed picture, and placing each processed picture at the position where each picture is located. The processing of each picture comprises the steps of amplifying, reducing, cutting and the like of each picture, so that when each picture is placed in a corresponding grid in the splicing layout, the pictures are more attractive and harmonious.
In some possible embodiments, each of the stitched pictures may be further processed according to a preset or user-selected image processing manner. The image processing method may be, for example, adjusting brightness, contrast, color temperature, and saturation of an image, or performing filter processing on an image, and performing whitening, buffing, and the like on a face region in the image. It will be appreciated that other image processing approaches are possible.
For example, the at least two pictures include a person image and four landscape images, and the weight of the person image is greater than that of the landscape images, and the person image includes a prominent face. Firstly, five pictures to be spliced are obtained, the categories of the five pictures can be identified as a character picture and a scene picture through an image identification technology, the five pictures can be further distinguished into a category with a face in the pictures, and the other category without the face in the pictures. Then, the position and the proportion of the main body in each picture are identified, for example, the position and the size of the face in the figure picture are identified, the weight of each picture is determined, and since the weight of the figure picture is larger than that of the landscape picture and the figure picture comprises a prominent face, the weight of the picture containing the prominent face is larger than that of other pictures. And then selecting a proper splicing layout for the character graph and the landscape graph according to the category to which the five pictures belong, wherein the number of the grids for placing the pictures in the splicing layout is five, each grid corresponds to a specific weight, the weight of each grid is determined according to the size and the position of the grid in the splicing layout to which the grid belongs, and the grid with higher weight shows that the position of the grid in the splicing layout is more obvious. And then, placing the figure image with the obvious human face on a grid with a larger weight in the splicing layout according to the weight of the image, and placing the landscape image on a grid with a smaller weight in the splicing layout to obtain the spliced image. And finally, processing the picture according to the position and the size of the main body in the corresponding picture, such as the position and the size of the face in the corresponding picture, wherein the processing comprises cutting, amplifying, reducing and the like. By adopting the mode, a main body in the picture, such as a human face, can be prevented from being cut, the picture with high weight can be placed at the remarkable position in the splicing layout, and the obtained picture is more attractive and harmonious, so that the picture can be spliced more easily, the picture splicing efficiency is effectively improved, and the picture splicing effect is effectively improved.
In some possible embodiments, after obtaining the spliced picture, the spliced picture may be saved to a gallery, an album, a cloud album, and/or a cloud disk, or may be sent to a social network such as a circle of friends.
According to the embodiment of the invention, at least one type of at least two pictures to be spliced is firstly identified, then the splicing layout is determined according to the at least one type, and finally the at least two pictures are placed in the splicing layout according to the weight of each grid in the splicing layout to obtain the spliced pictures. Therefore, by implementing the embodiment of the invention, the splicing layout can be automatically determined according to the type of the pictures, and the pictures of different types can be placed in the grids with different weights in the splicing layout, so that the splicing efficiency of the pictures can be effectively improved compared with the mode that the user manually makes the spliced pictures.
Fig. 2 is a schematic flowchart of a picture processing method according to another embodiment of the present invention. One picture processing method as shown in fig. 2 includes, but is not limited to, the following steps:
s201, the terminal identifies at least one category to which at least two pictures to be spliced belong.
S202, the terminal determines a splicing layout according to the at least one type, and the number of the lattices for placing the pictures in the splicing layout is the same as the number of the pictures of the at least two pictures.
S203, the terminal places the at least two pictures in the splicing layout according to the weight of each grid in the splicing layout to obtain the spliced pictures.
The relevant descriptions of steps S201 to S203 refer to the relevant descriptions of steps S101 to S103 in the above method embodiments, and are not repeated herein.
And S204, the terminal displays the spliced picture.
In the embodiment of the invention, after the spliced picture is obtained, the obtained spliced picture can be displayed on a screen of the terminal, so that a user can conveniently view the effect of the obtained spliced picture. If the terminal receives a storage instruction input by a user aiming at the spliced picture, directly storing the spliced picture into a gallery, an album, a cloud album and/or a cloud disk; or if the terminal receives a sharing instruction input by the user aiming at the spliced picture, the spliced picture is directly sent to social networks such as a friend circle and the like. If the terminal receives the adjustment instruction input by the user for the stitched picture, step S205 is executed.
S205, the terminal receives a target picture selected from the spliced pictures, wherein the target picture is any one of the spliced pictures.
In the embodiment of the invention, the terminal can be in an editable state when displaying the spliced picture, or the terminal can adjust the displayed spliced picture to be in the editable state when receiving an adjusting instruction input by a user aiming at the spliced picture. The target picture selected by the user is any one of the spliced pictures, and the user can select the target picture in a long-press mode or a double-click mode.
S206, when the terminal detects the dragging operation aiming at the target picture, acquiring the dragged position of the target picture.
In the embodiment of the invention, after the user selects the target picture from the spliced pictures displayed on the terminal screen, the target picture can be dragged, so that the terminal can detect the dragging operation of the user for the target picture. In the process that a user drags a target picture, a terminal acquires a dragging track of the target picture, determines the dragged position of the target picture according to the dragging track of the target picture after the user finishes dragging operation of the target picture, further determines a target grid in a splicing layout corresponding to the dragged position of the target picture, and acquires a first picture placed by the target grid.
And S207, the terminal exchanges the position of the dragged picture with the position of the target picture to obtain an exchanged spliced picture.
Specifically, the terminal exchanges the target picture with the first picture, places the target picture in the target grid, and places the first picture in the grid placed before the target picture is dragged to obtain the exchanged picture. After the exchanged picture is obtained, the target picture can be cut and/or reduced according to the position and the proportion of the main body in the target grid, and the processed target picture is obtained; and cutting and/or scaling the first picture according to the position and the proportion of the main body in the exchanged grid of the first picture to obtain a processed first picture, and placing the processed first picture and the target picture in respective grids. By adopting the mode, the user can correspondingly adjust the spliced picture according to the own requirements, and the user experience is better.
In some possible embodiments, in the process of adjusting the spliced picture by the user, the target category to which the target picture belongs and the weight of the position to which the target picture is dragged are determined and recorded, and the weight of each picture of the target category is adjusted according to the weight of the position to which the target picture is dragged. Optionally, the weight of the position where the target picture is dragged may also be recorded, and the weight of each picture in the target category is adjusted by combining the weight of the position where the target picture is dragged and the weight of the position where the target picture is dragged.
Specifically, after the terminal acquires the spliced picture, if it is detected that the user has an adjustment operation for the spliced picture, determining and recording a target type to which the target picture belongs, a weight of a position to which the target picture is dragged, and a weight of a position where the target picture is located before the target picture is dragged during the adjustment of the spliced picture by the user for each adjustment operation of the user, so as to form a record. After the recording result is obtained every time, the current recording result and the previous recording results are combined for comparative analysis, the habitual placement position of the user for the pictures of the same type as the target picture is analyzed according to the type of the dragged target picture recorded every time and the change condition of the weight of the position where the target picture is located before and after dragging, and then the weight of each picture of the type to which the target picture belongs is adjusted according to the weight of the habitual placement position. In some possible embodiments, all the recorded results may be analyzed at fixed time intervals, or all the recorded results within the time intervals may be analyzed, and the weight of each picture of the category to which the target picture belongs may be adjusted according to the analysis result. The embodiments of the present invention are not limited.
For example, taking the example in the above method embodiment as an example, a picture including a prominent face may be placed in a prominent position in the mosaic layout by using the above method, where the weight is the greatest, and a landscape picture is placed in a grid with a low weight; when similar spliced pictures are obtained through analysis, a user always adjusts the pictures including the remarkable faces from the grids with large weights to the grids with small weights in the spliced pictures, and then the terminal can correspondingly reduce the weights of the pictures of the category to which the pictures including the remarkable faces belong. Similarly, when similar spliced pictures are obtained through analysis, the user always adjusts the landscape pictures in the spliced pictures from the grids with small weight to the grids with large weight, and then the terminal can correspondingly increase the weight of each picture belonging to the landscape pictures.
According to the embodiment of the invention, the splicing layout can be automatically determined according to the category of the pictures, the pictures of different categories can be placed in the lattices with different weights in the splicing layout, and compared with the situation that a user manually makes the spliced pictures, the splicing efficiency of the pictures can be effectively improved.
Referring to fig. 3, which is a schematic block diagram of a picture processing apparatus according to an embodiment of the present invention, where the apparatus may be disposed on a smart terminal with an image processing function, such as a smart phone, a tablet, a mobile internet device, a wearable device, and a camera, for example, the picture processing apparatus described in the embodiment of the present invention includes:
the identifying module 301 is configured to identify at least one category to which at least two pictures to be stitched belong.
A determining module 302, configured to determine a splicing layout according to the at least one category, where the number of the lattices in which the pictures are placed in the splicing layout is the same as the number of the pictures in the at least two pictures.
And the processing module 303 is configured to place the at least two pictures in the mosaic layout according to the weight of each grid in the mosaic layout, so as to obtain a mosaic picture.
In this embodiment of the present invention, the identification module 301 includes:
the identification unit 3011 is configured to identify a subject in each of at least two pictures to be stitched.
A determining unit 3012, configured to determine, according to a main body in each picture, a category to which the each picture belongs.
In some possible embodiments, the identification module 301 is further configured to identify a subject in each picture.
The determining module 302 is further configured to determine a weight of each picture according to the category to which the each picture belongs, and a position and a proportion of a subject in the each picture.
The processing module 303 is specifically configured to place the at least two pictures in the mosaic layout respectively according to the weight of each of the at least two pictures and the weight of each grid in the mosaic layout, so as to obtain a mosaic picture.
In some possible embodiments, the processing module 303 is further configured to, for each of the spliced pictures, process the picture according to a position and a proportion of a main body in the picture in a lattice where the picture is located, obtain the processed picture, and place the processed picture at the position where the picture is located.
And a display module 304, configured to display the stitched picture.
A receiving module 305, configured to receive a target picture selected from the stitched pictures, where the target picture is any one of the stitched pictures.
An obtaining module 306, configured to obtain, when a dragging operation for the target picture is detected, a position to which the target picture is dragged.
The processing module 303 is further configured to exchange the position of the dragged picture with the position of the target picture to obtain an exchanged spliced picture.
The executing module 307 is configured to determine and record a target category to which the target picture belongs and a weight of a position to which the target picture is dragged.
The processing module 303 is further configured to adjust the weight of each picture of the target category according to the weight of the position to which the target picture is dragged.
It should be noted that the functions of each functional module and unit of the image processing apparatus according to the embodiment of the present invention can be specifically implemented according to the methods of the first embodiment and the second embodiment in the image processing method embodiment, and the specific implementation process may refer to the related description of the method embodiment, which is not described herein again.
According to the embodiment of the invention, the identification module 301 identifies at least one type to which at least two pictures to be spliced belong, the determination module 302 is triggered to determine the splicing layout according to the at least one type, and the processing module 303 is triggered to place the at least two pictures into the splicing layout according to the weight of each grid in the splicing layout to obtain the spliced pictures.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. The electronic device as depicted in fig. 4, comprising: the user interface 401, the display 402, the processor 403, the communication interface 404, the memory 405, the user interface 401, the display 402, the processor 403, the communication interface 404, and the memory 405 may be connected by a bus, or may be connected in other ways.
The processor 403 may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP. The processor 403 may also be a core in a multi-core CPU or a multi-core NP for implementing the communication identification binding.
The processor 403 may be a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
The communication interface 404 may be used for transceiving information or signaling interaction, and receiving and transmitting signals, and particularly, the communication interface 404 may communicate with a network and a signal transmitting apparatus through wireless communication and receive data of the signal transmitting apparatus. The Wireless communication may use any communication standard or protocol, including but not limited to Wireless Fidelity (WiFi), GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.
The user interface 401 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user interface 401 may include a touch panel and other input devices. The touch panel, also called a touch screen, may collect touch operations of a user (for example, operations of the user on or near the touch panel using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a preset program.
Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor, and can receive and execute commands sent by the processor. In addition, the touch panel may be implemented in various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to a touch panel, user interface 401 may include other input devices. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display screen 402 may be used to display information entered by or provided to the user as well as various menus for the electronic device. The Display screen 402 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, a touch panel in the user interface 401 may overlay the display screen 402, and when the touch panel detects a touch operation thereon or nearby, the touch panel transmits the touch operation to the processor to determine the type of the touch event, and then the processor provides a corresponding visual output on the display screen 402 according to the type of the touch event. Although in FIG. 4, the touch panel and the display screen 402 are shown as two separate components to implement the input and output functions of the electronic device, in some embodiments, the touch panel may be integrated with the display screen 402 to implement the input and output functions of the electronic device.
The memory 405 may mainly include a program storage area and a data storage area, where the program storage area may store an operating system, and a storage program required by at least one function (e.g., a text storage function, a location storage function, etc.); the storage data area may store data (such as image data, text data) created according to the use of the electronic device, etc., and may include a network communication module, a user interface module, an application storage program, etc. The network communication module may be configured to store a network communication program, and the communication interface 404 may implement the function of communicating externally or internally by calling the network communication program of the network communication module. The user interface module may be configured to store a human-computer interaction program for implementing touch, pressing, and the like of the user on the electronic device, and the user interface 401 may implement an input function of a user signal by calling the human-computer interaction program of the user interface module. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The memory 405 is also used to store program instructions. The processor 403 may call the program instructions stored in the memory 405 to implement the method for detecting the state of the signal transmitting apparatus according to the embodiment of the present invention.
Specifically, the processor 403 calls the program instructions stored in the memory 405 to execute the following steps:
identifying at least one category to which at least two pictures to be spliced belong;
determining a splicing layout according to the at least one category, wherein the number of the lattices for placing the pictures in the splicing layout is the same as the number of the pictures of the at least two pictures;
and placing the at least two pictures into the splicing layout according to the weight of each grid in the splicing layout to obtain the spliced picture.
The method executed by the processor 403 in the embodiment of the present invention is described from the perspective of the processor 403, and it is understood that the cooperation of other hardware structures is required for the processor 403 to execute the method in the embodiment of the present invention. The embodiments of the present invention are not described or limited in detail for the specific implementation process.
In some possible embodiments, the processor 403 is specifically configured to identify a subject in each of the at least two pictures to be stitched.
The processor 403 is specifically configured to determine a category to which each picture belongs according to a main body in each picture.
In some possible embodiments, the processor 403 is further configured to identify the subject in each picture.
The processor 403 is further configured to determine a weight of each picture according to the category to which the each picture belongs, and a position and a proportion of the main body in the each picture.
The processor 403 is further configured to place the at least two pictures in the mosaic layout according to the weight of each of the at least two pictures and the weight of each grid in the mosaic layout, so as to obtain a mosaic picture.
In some possible embodiments, the processor 403 is further configured to, for each of the spliced pictures, process the picture according to a position and a proportion of a main body in the picture in a lattice where the picture is located, obtain the processed picture, and place the processed picture at the position where the picture is located.
In some possible embodiments, the display screen 402 is used for displaying the stitched image.
The user interface 401 is further configured to receive a target picture selected from the stitched pictures, where the target picture is any one of the stitched pictures.
The processor 403 is further configured to, when a drag operation is detected for the target picture, obtain a location to which the target picture is dragged.
The processor 403 is further configured to exchange the position of the dragged picture with the position of the target picture, so as to obtain an exchanged spliced picture.
In some possible embodiments, the processor 403 is further configured to determine and record a target category to which the target picture belongs and a weight of a position to which the target picture is dragged;
the processor 403 is further configured to adjust the weight of each picture of the target category according to the weight of the position to which the target picture is dragged.
In a specific implementation, the user interface 401, the display screen 402, the processor 403, the communication interface 404, and the memory 405 described in this embodiment of the present application may execute the implementation described in the picture processing method provided in this embodiment of the present application, and may also execute the implementation described in the picture processing apparatus provided in fig. 3 in this embodiment of the present application, which is not described herein again.
According to the embodiment of the invention, the splicing layout can be automatically determined according to the category of the pictures, the pictures of different categories can be placed in the lattices with different weights in the splicing layout, and compared with the situation that a user manually makes the spliced pictures, the splicing efficiency of the pictures can be effectively improved.
The present invention also provides a computer-readable storage medium, which stores instructions that, when executed on a computer, cause the computer to execute the image processing method described in the above method embodiment.
The present invention also provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the picture processing method described in the above method embodiments.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs.
The modules in the device provided by the embodiment of the invention can be combined, divided and deleted according to actual needs.
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the examples of this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms "first", "second", "third", etc. may be used to describe various connection ports and identification information, etc. in the embodiments of the present application, these connection ports and identification information, etc. should not be limited to these terms. These terms are only used to distinguish the connection port and the identification information and the like from each other. For example, the first connection port may also be referred to as a second connection port, and similarly, the second connection port may also be referred to as a first connection port, without departing from the scope of embodiments of the present application.
The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In the several embodiments provided in the present application, it should be understood that the disclosed electronic device, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A picture processing method, characterized in that the method comprises:
identifying a main body in each of at least two pictures to be spliced;
determining the category of each picture according to the main body in each picture;
determining a splicing layout according to the at least one category, wherein the number of the lattices for placing the pictures in the splicing layout is the same as the number of the pictures of the at least two pictures;
identifying a subject in each of the pictures;
determining the weight of each picture according to the category to which each picture belongs and the position and proportion of the main body in each picture;
and respectively placing the at least two pictures into the splicing layout according to the weight of each picture in the at least two pictures and the weight of each grid in the splicing layout to obtain the spliced pictures.
2. The method of claim 1, further comprising:
and processing each picture in the spliced pictures according to the position and the proportion of a main body in the pictures in the grid where the pictures are located to obtain the processed pictures, and placing the processed pictures at the positions where the pictures are located.
3. The method of claim 1, further comprising:
displaying the spliced picture;
receiving a target picture selected from the spliced pictures, wherein the target picture is any one of the spliced pictures;
when the dragging operation aiming at the target picture is detected, acquiring the position to which the target picture is dragged;
and exchanging the position of the picture dragged to the position with the position of the target picture to obtain an exchanged spliced picture.
4. The method of claim 3, further comprising:
determining and recording a target category to which the target picture belongs and the weight of the position to which the target picture is dragged;
and adjusting the weight of each picture of the target category according to the weight of the position to which the target picture is dragged.
5. A picture processing apparatus, characterized in that the apparatus comprises:
the identification module is used for identifying at least one type of at least two pictures to be spliced;
a determining module, configured to determine a splicing layout according to the at least one category, where the number of the lattices for placing the pictures in the splicing layout is the same as the number of the pictures in the at least two pictures;
the processing module is used for placing the at least two pictures into the splicing layout according to the weight of each grid in the splicing layout to obtain spliced pictures;
the identification module comprises:
the identification unit is used for identifying a main body in each of at least two pictures to be spliced;
the determining unit is used for determining the category of each picture according to the main body in each picture;
the identification module is further used for identifying the main body in each picture;
the determining module is further configured to determine a weight of each picture according to a category to which the each picture belongs, and a position and a proportion of a main body in the each picture;
the processing module is specifically configured to place the at least two pictures in the mosaic layout respectively according to the weight of each of the at least two pictures and the weight of each grid in the mosaic layout, so as to obtain a mosaic picture.
6. The apparatus of claim 5,
the processing module is further configured to, for each of the spliced pictures, process the picture according to the position and the proportion of the main body in the picture in the lattice where the picture is located, obtain the processed picture, and place the processed picture at the position where the picture is located.
7. The apparatus of claim 5, further comprising:
the display module is used for displaying the spliced pictures;
the receiving module is used for receiving a target picture selected from the spliced pictures, wherein the target picture is any one of the spliced pictures;
the acquisition module is used for acquiring the position to which the target picture is dragged when the dragging operation aiming at the target picture is detected;
the processing module is further configured to exchange the position of the dragged picture with the position of the target picture to obtain an exchanged spliced picture.
8. The apparatus of claim 7, further comprising:
the execution module is used for determining and recording the target category to which the target picture belongs and the weight of the position to which the target picture is dragged;
the processing module is further configured to adjust the weight of each picture of the target category according to the weight of the position to which the target picture is dragged.
9. An electronic device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface are connected through the communication bus and complete mutual communication; the memory stores executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for performing the picture processing method of claims 1 to 4.
10. A computer-readable storage medium having stored therein instructions which, when run on a computer, cause the computer to execute the picture processing method according to any one of claims 1 to 4.
CN201710524699.5A 2017-06-30 2017-06-30 Picture processing method and device, electronic equipment and storage medium Active CN107330858B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710524699.5A CN107330858B (en) 2017-06-30 2017-06-30 Picture processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710524699.5A CN107330858B (en) 2017-06-30 2017-06-30 Picture processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN107330858A CN107330858A (en) 2017-11-07
CN107330858B true CN107330858B (en) 2020-12-04

Family

ID=60198729

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710524699.5A Active CN107330858B (en) 2017-06-30 2017-06-30 Picture processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN107330858B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107967341A (en) * 2017-12-08 2018-04-27 广东欧珀移动通信有限公司 A kind of image display method, terminal device and storage medium
CN108459620B (en) * 2018-03-25 2021-06-04 东莞市华睿电子科技有限公司 Flight control method of multi-rotor unmanned aerial vehicle
CN109146783B (en) * 2018-07-23 2023-06-20 北京乐蜜科技有限责任公司 Picture stitching method and device, electronic equipment and medium
CN109740649A (en) * 2018-12-21 2019-05-10 创新奇智(重庆)科技有限公司 A kind of long commodity on shelf recognition methods, storage medium and identifying system
CN110223225B (en) * 2019-04-30 2023-01-31 北京云迹科技股份有限公司 Data processing method and device for picture combination
CN111223045B (en) * 2019-11-15 2023-06-30 Oppo广东移动通信有限公司 Jigsaw method and device and terminal equipment
CN111008933B (en) * 2019-12-17 2022-07-12 荣耀终端有限公司 Picture processing method and device, electronic equipment and storage medium
CN111161149B (en) * 2019-12-30 2023-11-17 上海连尚网络科技有限公司 Image display method and device
CN112667835A (en) * 2020-12-23 2021-04-16 北京达佳互联信息技术有限公司 Work processing method and device, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102930522A (en) * 2012-11-12 2013-02-13 北京奇虎科技有限公司 Device achieving picture splicing and method achieving same
CN104587669A (en) * 2015-01-30 2015-05-06 北京视博云科技有限公司 Customization method of virtual peripheral
CN105068984A (en) * 2015-08-04 2015-11-18 时代新媒体出版社有限责任公司 Automatic puzzling and typesetting method
CN105808100A (en) * 2016-02-29 2016-07-27 北京金山安全软件有限公司 Picture sorting method and device and electronic equipment
CN106126686A (en) * 2016-06-29 2016-11-16 北京金山安全软件有限公司 Picture combination method and device and electronic equipment
CN106296580A (en) * 2015-06-03 2017-01-04 无锡天脉聚源传媒科技有限公司 A kind of method and device of image mosaic
CN106296622A (en) * 2015-05-27 2017-01-04 阿里巴巴集团控股有限公司 The pattern splicing method of a kind of autoplacement and device
CN106530233A (en) * 2016-12-20 2017-03-22 维沃移动通信有限公司 Picture splicing method and mobile terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060277466A1 (en) * 2005-05-13 2006-12-07 Anderson Thomas G Bimodal user interaction with a simulated object
CN105225212B (en) * 2014-06-27 2018-09-28 腾讯科技(深圳)有限公司 A kind of image processing method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102930522A (en) * 2012-11-12 2013-02-13 北京奇虎科技有限公司 Device achieving picture splicing and method achieving same
CN104587669A (en) * 2015-01-30 2015-05-06 北京视博云科技有限公司 Customization method of virtual peripheral
CN106296622A (en) * 2015-05-27 2017-01-04 阿里巴巴集团控股有限公司 The pattern splicing method of a kind of autoplacement and device
CN106296580A (en) * 2015-06-03 2017-01-04 无锡天脉聚源传媒科技有限公司 A kind of method and device of image mosaic
CN105068984A (en) * 2015-08-04 2015-11-18 时代新媒体出版社有限责任公司 Automatic puzzling and typesetting method
CN105808100A (en) * 2016-02-29 2016-07-27 北京金山安全软件有限公司 Picture sorting method and device and electronic equipment
CN106126686A (en) * 2016-06-29 2016-11-16 北京金山安全软件有限公司 Picture combination method and device and electronic equipment
CN106530233A (en) * 2016-12-20 2017-03-22 维沃移动通信有限公司 Picture splicing method and mobile terminal

Also Published As

Publication number Publication date
CN107330858A (en) 2017-11-07

Similar Documents

Publication Publication Date Title
CN107330858B (en) Picture processing method and device, electronic equipment and storage medium
US10796133B2 (en) Image processing method and apparatus, and electronic device
US10366519B2 (en) Operating method for image and electronic device supporting the same
EP3512192B1 (en) Electronic device and method for image processing
US20190073099A1 (en) Method and device for launching application and electronic device
US20160364888A1 (en) Image data processing method and electronic device supporting the same
US20150286897A1 (en) Automated techniques for photo upload and selection
CN107172346B (en) Virtualization method and mobile terminal
EP2890105B1 (en) Method, apparatus and terminal for generating thumbnail of image
KR20170019823A (en) Method for processing image and electronic device supporting the same
US20150121535A1 (en) Managing geographical location information for digital photos
US10585498B2 (en) Apparatus and method for identifying object
WO2022247181A1 (en) Game scene processing method and apparatus, storage medium, and electronic device
CN114153344A (en) Group creation method and device, electronic equipment and storage medium
KR20150079387A (en) Illuminating a Virtual Environment With Camera Light Data
KR20170046496A (en) Electronic device having camera and image processing method of the same
KR20180111242A (en) Electronic device and method for providing colorable content
EP2993596A1 (en) Method and apparatus for index processing
CN113837181B (en) Screening method, screening device, computer equipment and computer readable storage medium
CN113271379B (en) Image processing method and device and electronic equipment
WO2015039567A1 (en) Method and user apparatus for window coloring
CN113473012A (en) Virtualization processing method and device and electronic equipment
CN113271377B (en) Image processing method, device, electronic equipment and medium
US20230297209A1 (en) Content sharing methods and apparatus, terminal, storage medium
CN113794943A (en) Video cover setting method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20201119

Address after: Room 115, area C, 1 / F, building 8, yard 1, yaojiayuan South Road, Chaoyang District, Beijing

Applicant after: Beijing LEMI Technology Co.,Ltd.

Address before: 100085 Beijing City, Haidian District Road 33, two floor East Xiaoying

Applicant before: BEIJING KINGSOFT INTERNET SECURITY SOFTWARE Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230926

Address after: 100000 3870A, 3rd Floor, Building 4, No. 49 Badachu Road, Shijingshan District, Beijing

Patentee after: Beijing Jupiter Technology Co.,Ltd.

Address before: Room 115, area C, 1 / F, building 8, yard 1, yaojiayuan South Road, Chaoyang District, Beijing

Patentee before: Beijing LEMI Technology Co.,Ltd.

TR01 Transfer of patent right