Image Processing Method, Apparatus and Electronic Device
By replacing the first target image with a high matching second target image during the picture stitching process, the time-consuming and laborious problem of users selecting pictures is solved, and efficient picture stitching and quality assurance are achieved.
Patent Information
- Application Number
- CN202111134460.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-27
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2041-09-27
AI Technical Summary
In the prior art, image splicing technology cannot meet users' needs for image viewing, and users need to select pictures for splicing from a large number of pictures, which is time-consuming and labor-intensive.
By acquiring the target image, receiving user input, replacing the first target image with a second target image with a high matching degree of the stitching template. The second target image is an image in the first target image set, and the matching degree with the stitching template is greater than or equal to the preset matching degree.
While ensuring the quality of the target image, it saves users time to select images and improves user experience.
Smart Images

Figure CN113850722B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technologies. Specifically, it relates to an image processing method, an image processing device, and an electronic device. Background Art
[0002] In related technologies, the picture splicing technology can automatically crop multiple pictures and make a nine-grid picture, but the spliced nine-grid picture may not meet the user's requirements for picture aesthetics. During the picture splicing process, the user still needs to select pictures for splicing from a large number of pictures, which is time-consuming and laborious. Summary of the Invention
[0003] Embodiments of this application provide an image processing method, device, and electronic device, which can save the user's time for selecting images while ensuring the quality of the target image.
[0004] In a first aspect, embodiments of this application provide an image processing method, including:
[0005] Obtain a target image, where the target image is obtained by splicing multiple first images according to a splicing template;
[0006] Receive a first input for a first target image among the multiple first images;
[0007] In response to the first input, replace the first target image with a second target image;
[0008] Wherein, the second target image is a second image in a first target image set, and the matching degree of the second target image with the splicing template is greater than or equal to a preset matching degree.
[0009] In a second aspect, embodiments of this application provide an image processing device, including:
[0010] An obtaining module, configured to obtain a target image, where the target image is obtained by splicing multiple first images according to a splicing template;
[0011] A receiving module, configured to receive a first input for a first target image among the multiple first images;
[0012] A replacing module, configured to replace the first target image with a second target image in response to the first input;
[0013] Wherein, the second target image is an image in a first target image set, and the matching degree of the second target image with the splicing template is greater than or equal to a preset matching degree.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, and a program or instruction stored on the memory and running on the processor. When the program or instruction is executed by the processor, the steps of the image processing method provided in the first aspect are implemented.
[0015] In a fourth aspect, an embodiment of the present application provides an electronic device, including the image processing device provided in the second aspect embodiment.
[0016] In a fifth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the image processing method provided in the first aspect are implemented.
[0017] In a sixth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the image processing method provided in the first aspect.
[0018] In the embodiment of the present application, a target image is obtained, and the target image is obtained by splicing multiple first images according to a splicing template; a first input for a first target image among the multiple first images is received; in response to the first input, the first target image is replaced with a second target image; wherein, the second target image is the second image in a first target image set, and the matching degree of the second target image with the splicing template is greater than or equal to a preset matching degree. Thus, the second target image with a relatively high similarity to the splicing template adopted by the target image in the first target image set is used to replace the first target image selected by the user. Furthermore, a reliable basis for replacing the first image is provided through the matching degree, so that the image quality of the target image can still be guaranteed after replacement, and the time for the user to select the required image can be greatly saved, improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 One of the flowcharts of the image processing method according to an embodiment of the present application is shown;
[0020] Figure 2 Another flowchart of the image processing method according to an embodiment of the present application is shown;
[0021] Figure 3 Another flowchart of the image processing method according to an embodiment of the present application is shown;
[0022] Figure 4 Another flowchart of the image processing method according to an embodiment of the present application is shown;
[0023] Figure 5Shows the fifth flowchart of the image processing method according to an embodiment of the present application;
[0024] Figure 6 Shows the sixth flowchart of the image processing method according to an embodiment of the present application;
[0025] Figure 7 Shows the seventh flowchart of the image processing method according to an embodiment of the present application;
[0026] Figure 8 Shows one of the schematic diagrams of the display of an electronic device according to an embodiment of the present application;
[0027] Figure 9 Shows the second schematic diagram of the display of an electronic device according to an embodiment of the present application;
[0028] Figure 10 Shows the structural block diagram of an image processing apparatus according to an embodiment of the present application;
[0029] Figure 11 Shows the structural block diagram of an electronic device according to an embodiment of the present application;
[0030] Figure 12 Shows the hardware structural block diagram of an electronic device according to an embodiment of the present application. Detailed implementation manners
[0031] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0032] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually of the same category, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally means an "or" relationship between the associated objects before and after.
[0033] Next, refer to Figures 1 to 12 Describe an image processing method, apparatus, and electronic device according to some embodiments of the present application.
[0034] In an embodiment of the present application,Figure 1 FIG. 1 shows one of the flowcharts of the image processing method according to an embodiment of the present application, including:
[0035] Step 102, obtain a target image;
[0036] The target image is obtained by splicing multiple first images according to a splicing template. The number of first images can be one or more. For example, a specified number of first images are spliced using splicing templates such as a three-grid, four-grid, six-grid, or nine-grid to obtain the target image. It can be understood that the target image can be generated by the user's electronic device or obtained by receiving communication with other electronic devices.
[0037] Step 104, receive a first input for a first target image among the multiple first images;
[0038] The first input includes, but is not limited to, click input, key input, fingerprint input, swipe input, and press input. The key input includes, but is not limited to, single-click input, double-click input, long-press input, or combined key input for the power key, volume key, and main menu key of the electronic device. Of course, the first input can also be other operations of the user on the electronic device. The embodiments of the present application do not specifically limit the operation method and can be any implementable method.
[0039] Step 106, in response to the first input, replace the first target image with a second target image.
[0040] The second image set is composed of at least one second image. The second target image is the second image in the second image set, and the matching degree of the second target image with the splicing template is greater than or equal to a preset matching degree, that is, the second target image is the second image with a higher matching degree with the splicing template among all the second images.
[0041] It can be understood that the second image set can be a local image set, such as a set local folder that contains pictures, or a folder for placing photos of a certain activity, such as a folder for travel photos or a folder for wedding photos. Alternatively, the second image set can also be a picture database on the server side. The second image set can include the first image or not, which can be set according to the user's needs. For example, if the user wants to replace the first target image with an image that is the same as other first images, such as swapping the positions of two photos in a nine-grid, then when obtaining the second image set, the second image set includes the first image; if the user wants to replace the first target image with an image that is different from other first images, then when obtaining the second image set, the second image set does not include the first image. Specifically, the matching degree can be calculated according to the index values and corresponding weight values of the index items of the image content information of the second image in different dimensions.
[0042] In this embodiment, the user can trigger the replacement operation of the first target image through the first input. Specifically, the first target image to be replaced is selected through the first input. The system uses the matching degree between the replacement alternative image (the second image in the second image set) and the splicing template to screen out the second target image with a relatively high similarity to the splicing template adopted by the target image, and uses the second target image to replace the first target image selected by the user. Thus, a reliable basis for replacing the first image is provided through the matching degree, so that the image quality of the target image can still be guaranteed after replacement, and the time for the user to select the required image can be greatly saved, improving the user experience.
[0043] Specifically, this image processing method is applicable to electronic devices, including but not limited to mobile terminals, tablet computers, computers, laptop computers, or wearable devices, etc.
[0044] It can be understood that the user can not only replace the first target image through the first input, but also edit parameters such as the size, format, and filter of the first target image through the fourth input to the first target image.
[0045] In an embodiment of the present application, Figure 2 Figure 2 shows the second flowchart of the image processing method according to the embodiment of the present application, including:
[0046] Step 202, obtain preset index items and the corresponding relationship between the image content information and the index values of the preset index items;
[0047] Among them, the preset index items are also the items used to rate the matching degree, which include at least one of the following: image shooting angle, image shooting distance, image clarity, human action, human expression, human background, and light intensity. The preset index items can be reasonably set according to the user's requirements for the style or theme of the target image.
[0048] Step 204, determine the index values of the preset index items corresponding to the second image according to the image content information of the second image and the corresponding relationship;
[0049] Among them, the image content information includes but is not limited to at least one of the following: image shooting angle (such as, front, above, below, side, etc.), image shooting distance (such as, far, near, etc.), image clarity (such as, high, medium, low), human action (such as, walking, running, jumping, waving, and walking, running, jumping while clapping), human expression (such as, happy, ecstatic, surprised, sad, angry, disgusted, etc., positive and negative expressions), human background (such as, beach, sea, passers-by, tent), and light intensity.
[0050] Further, the correspondence between the image content information and the metric values of the preset metric items is also the scoring rule of the image content information with respect to the preset metric items. The metric value of the preset metric item is also the score of the preset metric item for the image content information. For example, first judge the shooting angle of the photo, and then determine the metric value according to the distance of the shooting distance. For photos taken from shooting angles such as the front, below, and side, the closer the shooting distance, the higher the score. For photos taken from above, which are aerial shots, the farther the shooting distance, the higher the score. Another example is that generally, the more positive the expression of the person is recognized, the higher the score. For example, an extremely positive expression such as ecstasy scores 5 points, and a crying expression scores 2 points. For the actions of the person, the score can be based on the expression of the person. If it is determined that the expression of the person in the photo is an ecstatic expression, and then the actions of the person are judged. At this time, the greater the amplitude of the actions of the person, such as running, jumping and other actions with a large amplitude, the higher the score of the preset metric item. If it is judged that the expression of the person is happy, the more relaxed the person is and the smaller the amplitude of the actions, the higher the score.
[0051] It can be understood that for the expressions of people, photos with clear facial features need to be selected first, that is, the clarity needs to be high and the amplitude of the actions is greater. Similarly, for the background of the person, the simpler the recognized background of the person is, the higher the score. For example, if it is recognized that the background of the person has only two elements, the beach and the sea, or if it is recognized that the elements of the background of the person are the beach, the sea, passers-by, and tents, the score of the preset metric item of the former is higher than that of the latter.
[0052] Step 206, determine the preset weight corresponding to the preset metric item according to the splicing template;
[0053] In this embodiment, due to the differences in the template image categories in the splicing template and the different requirements for images of different image categories, different preset weights are configured for each preset metric item according to different splicing templates in advance, so that the generated target image is more in line with the image distribution requirements of the splicing template and meets the user's requirements for the target image.
[0054] Step 208, determine the matching degree of each second image and the splicing template according to the metric value and the preset weight of the preset metric item corresponding to the second image;
[0055] In this embodiment, after scoring the image content information of the second image according to the preset index items, the index values of each preset index item of the second image and the weight values of each preset index item are calculated by weighting, so as to comprehensively evaluate the matching degree between the second image and the splicing template based on at least one preset index item. Thereby, it is convenient to obtain a more comprehensive and accurate evaluation result by using the scores of the image content information in different dimensions, which is beneficial to scientifically and objectively determine the matching degree of the second image. So that the second target image that better meets the user's requirements in terms of quality, aesthetics, clarity, etc. can be screened out through the matching degree, while ensuring the quality of the target image, greatly saving the time required for the user to select images.
[0056] Step 210, use the second image whose matching degree is greater than or equal to the preset matching degree as the second target image.
[0057] Among them, the preset matching degree can be a numerical value of the matching degree preset by the user. For example, 75%, 90% or 95%, etc. The preset matching degree can also be determined according to the matching degree rule. For example, the matching degree rule indicates that the preset matching degree is the matching degree of the Nth second image after sorting all the second images by the matching degree from large to small, where N is a positive integer. Then, the second target image whose matching degree is greater than or equal to the preset matching degree is the first N second images in the sorting order. The second target image may be one or more. In the case of multiple ones, the user can select the required second target image from multiple second target images that meet the preset matching degree to replace the first target image.
[0058] In this embodiment, the second image in all the second images of the second image set whose matching degree with the splicing template is greater than or equal to the preset matching degree is used as the second target image for replacement. Thereby, the image quality of the target image after replacement can still be guaranteed, and the time required for the user to select the required image can be greatly saved, improving the user experience.
[0059] Specifically, taking a nine-grid as an example. Set a default weight for each preset index item in each dimension. Considering that the influence of light intensity on the quality of photos is important, in the judgment of landscape photos without people, the proportion (weight value) of the three preset index items of shooting angle, shooting distance and light intensity is relatively large, and the corresponding weight values of these three preset index items are set to 0.3, 0.3, and 0.4 respectively, and the weight value corresponding to the index item related to people is set to 0; in photos with people, the weight values of the preset index items of shooting angle, shooting distance, people's actions, people's expressions, people's backgrounds, and light intensity are set to 0.15, 0.15, 0.15, 0.15, 0.15, and 0.25 respectively; calculate the matching degree of the selected photo by multiplying and accumulating the weights. The higher the matching degree, the clearer and more beautiful the photo.
[0060] In one embodiment of the present application, Figure 3 FIG. 3 shows a flowchart of an image processing method according to an embodiment of the present application, including:
[0061] Step 302: Determine the template image category of the image position where the first target image is located in the stitching template;
[0062] Among them, the template image category can be understood as the image category required for stitching the target image. The template image category includes the category of the content in the image and / or the image format category. For example, if the template image category of the first picture in the stitching template is the sea, then when stitching the target image, if the first image belongs to the image category of the sea, it can be added to the image position of the first picture in the stitching template to generate the target image. For another example, if the template image category of the first picture in the stitching template is an animated GIF image, then the first image in GIF format can be used to stitch into the target image.
[0063] Step 304: When the image category of the second target image is the same as the template image category, replace the first target image with the second target image.
[0064] It should be noted that the image category of the second target image also includes the category of the content in the image and / or the image format category. Among them, the content category can be determined by image recognition technology. For example, if the proportion of the sea in the second target image is greater than 70%, it is determined that the second target image belongs to the content category of the sea.
[0065] In this embodiment, after the user selects the first target image to be replaced through the first input, the template image category of the image position corresponding to the first target image is recognized, the second target image whose determined template image category corresponding to the first target image belongs to the same image category is selected, and the first image is replaced with the second target image. Thus, the second target image is further screened by the image category, narrowing the range of alternative images available for replacement, which is beneficial for the user to quickly select the required images.
[0066] In one embodiment of the present application, when the number of second target images whose image category is the same as the template image category corresponding to the first target image is multiple, the step of replacing the first target image with the second target image specifically includes the following two methods.
[0067] Method 1: Display the second target image and the matching degree of the second target image; receive the third input for the second target image; in response to the third input, replace the first target image with the second target image corresponding to the third input.
[0068] It is understandable that, in the case where the number of second target images screened out by the image category is large, considering the size of the electronic device screen, in order to ensure that the user can clearly observe the second target image, the thumbnail of the second target image can be displayed. In addition, when displaying the thumbnails of the second target images, the thumbnails of all the second target images can be displayed, or only the thumbnails of the second target images of a preset display number can be displayed, so as to avoid the display of too many second target images affecting the user's viewing of the second target images. Moreover, the thumbnails of the second target images can be sorted according to the preset arrangement rules and matching degrees. The preset arrangement rules can be reasonably set according to the user's habit of selecting images. For example, the preset arrangement order is sorted from high to low by matching degree or from near to far by image shooting time.
[0069] In this embodiment, the user can select the second target image on the target image editing interface as needed through the third input, so as to use the second target image to replace the first target image in the target image. Thus, the function of manually replacing the first target image in the target image by the user is realized, and image selection suggestions are provided to the user by displaying the matching degree, which greatly shortens the time for the user to select an image, has high flexibility, and enhances the human-computer interaction performance.
[0070] It can be understood that, in the case where there is only one second target image, the step of displaying the second target image can be omitted and the replacement can be performed directly, thereby simplifying the operation of replacing the first target image by the user.
[0071] For example, Figure 8 As shown, taking the target image of the nine-grid as an example, the user clicks on the photo to be replaced (the first target image), and identifies that the template image category corresponding to the photo is the sea. At this time, three candidate photos (thumbnails of the second target image) that also belong to the sea category are displayed on the editing interface, and the three photos are arranged in order of matching degree. The user can slide on the photo to select the candidate photo to be replaced according to his or her preferences.
[0072] Method 2: Sort the second target image according to a preset arrangement rule; replace the first target image with the second target image that is at the first place in the sorting result.
[0073] In this embodiment, the second target images are sorted according to a preset sorting rule. The first target image is replaced by the second target image that is at the top of the sorting result, i.e., the image that is most likely to meet the requirements of the splicing template format. Thus, while ensuring the clarity and aesthetics of the target image, the effect of automatic image replacement is achieved, eliminating the need for the user to manually select the desired image, and improving the target image editing speed.
[0074] It is worth mentioning that, considering that the second target image at the top is more in line with the format requirements of the splicing template in terms of the matching degree, it is not necessarily the photo that the user needs. At this time, the user can switch the second target image used for replacement through the fifth input of the replaced target image, thereby increasing the flexibility of image replacement. For example, after replacing the first target image with the second target image at the top of the sorting result, the user is not satisfied with the automatic replacement result and swipes left while holding the target image. At this time, the second target image at the second position in the sorting is used for replacement again.
[0075] In an embodiment of the present application, Figure 4 FIG. 4 shows a flowchart of an image processing method according to an embodiment of the present application, including:
[0076] Step 402, display a template setting interface;
[0077] Among them, the template setting interface includes a splicing template and at least one preset image category. The splicing template includes at least one template image category and the image position of each template image category in the splicing template. The preset image category is the image category other than the template image category adopted in the splicing template among all possible image categories.
[0078] Step 404, receive a second input for the preset image category;
[0079] Step 406, in response to the second input, update the template image category of the image position where the first target image is located in the splicing template according to the preset image category.
[0080] In this embodiment, in response to the first input, that is, after the user selects the first target image to be replaced through the first input, the replacement of the first target image can be realized by modifying the splicing template. Specifically, a template setting interface for editing the splicing template is displayed. The user can select a preset image category through the second input and use the preset image category as the new template image category corresponding to the image position where the first target image to be replaced is located in the splicing template. Then, search for the second target image belonging to the template image category according to the updated template image category and replace the first target image. Thus, during the process of editing the target image, the splicing template can also be modified personalized, and then the first image can be replaced with an image of a different image category, which can generate the required target image more accurately according to the user's preferences.
[0081] It is worth mentioning that after updating the template image category of the position of the first target image in the stitching template, the electronic device can also store the updated stitching template, so as to directly generate the required target image through the updated stitching template next time. The storage method can be to overwrite the stitching template before the update, or store it as a new stitching template.
[0082] For example, as Figure 9 shown, taking the nine-grid target image as an example, in the template setting interface, the theme of the target image displayed is the nine-grid template (stitching template) of the sea. The nine-grid template includes 9 positions where photos can be added. Among them, the image categories (template image categories) of the 3 positions in the left column are set to "sea", the image category of the middle position is set to "group photo", the image categories of the remaining two positions in the top row are set to "single front photo", the image categories of the remaining two positions in the bottom row are set to "selfie", and the image category of the last position is set to "background photo". Below the nine-grid template, other possible category options "beach" and "sky" are also displayed. The user clicks on "beach" in the other options and drags it to the "selfie" position, which can switch the template image category in the nine-grid template from "selfie" to "beach", and then select the photo with the highest matching degree that conforms to the template from the recent photos (for example, photos taken within one day) according to the nine-grid template edited by the user, and replace the photo located at the "selfie" position before modifying the template.
[0083] It can be understood that the user can also change the order of multiple first target images by adjusting the image positions corresponding to the template image categories. For example, select the image frame (image position) where the template image category in the stitching template is located and drag it to swap the order with other image frames in the nine-grid template.
[0084] In an embodiment of the present application, Figure 5 shows the fifth flowchart of the image processing method according to the embodiment of the present application, including:
[0085] Step 502, obtain a stitching template and a preset image set;
[0086] Among them, the preset image set includes multiple third images. The preset image set is used to select the first image, and the preset image set may or may not include the second image set. Step 504, select multiple first images from the multiple third images according to the matching degree between the multiple third images and the stitching template and the number of images indicated by the stitching template;
[0087] Among them, the matching degree between the third image and the stitching template can be calculated by the same method as calculating the matching degree of the second image, based on the index values and corresponding weight values of the index items of the third image's image content information in different dimensions. The number of images indicated by the stitching template is the number of the first images used to stitch the target image. For example, if the target image is a nine-grid image, the number of images is 9; if the target image is a four-grid image, the number of images is 4.
[0088] Step 506: Stitch multiple first images according to the stitching template to generate a target image.
[0089] In this embodiment, the target image needs to be generated first before the editing process of the target image. Specifically, the user first selects the required stitching template and the required preset image set. The electronic device calculates the matching degree between each third image in the preset image set and the stitching template to facilitate image screening. Select the third images with a relatively high matching degree and having the corresponding number of images as the first images. Finally, stitch multiple first images according to the image size and / or image position corresponding to each template image category to generate the final target image. Thus, the first images are automatically combined according to the matching degree, realizing the automatic image stitching function. The user can obtain a beautiful target image without participating in any editing work, greatly saving labor time and being conducive to the batch production of target images.
[0090] Specifically, for example, multiple third images include 2 selfies, 6 landscape photos, 3 group photos, 1 sunrise photo, and 2 stream photos. The user selects a four-grid stitching template, and the template image categories and quantities indicated in the stitching template are one "selfie", one "landscape photo", one "group photo", and one "sunrise photo" each. Calculate the matching degree between the third images belonging to each template image category and the stitching template, and select one image with the highest matching degree from the third images of each template image category as the first image and perform combined stitching. For example, select the one with the highest matching degree from the 6 landscape photos and the one with the highest matching degree from the 2 selfies for stitching.
[0091] In an embodiment of the present application, Figure 6 FIG. 6 shows the sixth flowchart of the image processing method according to the embodiment of the present application, including:
[0092] Step 602: Classify multiple third images to determine the image category of each third image;
[0093] Step 604: Select multiple first images from multiple third images according to the preset time period, the image category of each third image, the matching degree, and the number of images corresponding to the template image category indicated by the stitching template.
[0094] In this embodiment, the image category of the third image in the preset image set may be different from the template image category used in the splicing template. To avoid matching errors. During the process of selecting the first image, the third image is first classified to determine the image category to which each third image belongs, and the third images with the same template image category as indicated by the splicing template are screened out. At the same time, the third images are further screened through a preset time period, and then the first image with the number of associated images of the template image category is selected from the third images that meet the template image category, matching degree, and preset time period. Thus, the first image that can best meet the user's splicing requirements can be automatically screened out from the image set corresponding to the electronic device. The user only needs to select the preset image set to complete the selection of the first image, and further synthesize the target image through the first image.
[0095] Specifically, if the electronic device sets a default image set, then as long as the user needs to synthesize a target image, the electronic device automatically screens and synthesizes images from the default image set, realizing one-key synthesis of the target image. Furthermore, while ensuring the quality of the target image, it greatly saves the time required for the user to select images and improves the production efficiency of the target image.
[0096] In an embodiment of the present application, Figure 7 FIG. 7 shows a flowchart of the image processing method according to an embodiment of the present application, including:
[0097] Step 702, when the image category of any first image is the same as any template image category of the splicing template, add any first image to the image position corresponding to any template image category.
[0098] In this embodiment, after screening out multiple first images, the first images are applied to each image position in the selected splicing template one by one according to the template image category indicated by the splicing template, so as to complete the step of processing multiple first images according to the splicing template, generate the spliced picture, and realize the automatic splicing process of multiple first images, improving the user experience.
[0099] In an embodiment of the present application, as Figure 10 shown, the image processing apparatus 1000 includes: an acquisition module 1002, where the acquisition module 1002 is used to acquire a target image, and the target image is obtained by splicing multiple first images according to a splicing template; a reception module 1004, where the reception module 1004 is used to receive a first input for a first target image among the multiple first images; a replacement module 1006, where the replacement module 1006 is used to respond to the first input and replace the first target image with a second target image; where the second target image is a second image in the first target image set, and the matching degree of the second target image with the splicing template is greater than or equal to a preset matching degree.
[0100] In this embodiment, the second target image in the first target image set, which has a relatively high similarity to the stitching template used by the target image, is used to replace the first target image selected by the user. Furthermore, the matching degree provides a reliable basis for replacing the first image, so that the image quality of the target image can still be guaranteed after replacement, and the time for the user to select the required image can be greatly saved, improving the user experience.
[0101] Optionally, the obtaining module 1002 is further configured to obtain a preset index item and the corresponding relationship between the image content information and the index value of the preset index item; the image processing device 1000 further includes: a first determination module (not shown in the figure), and the first determination module is configured to determine the index value of the preset index item corresponding to the second image according to the image content information of the second image and the corresponding relationship; determine the preset weight of the preset index item according to the stitching template; determine the matching degree between the second image and the stitching template according to the index value and the preset weight of the preset index item corresponding to the second image; use the second image with a matching degree greater than or equal to the preset matching degree as the second target image; wherein, the preset index item includes at least one of the following: image shooting angle, image shooting distance, image clarity, human action, human expression, human background, and light intensity.
[0102] Optionally, the image processing device 1000 further includes: a second determination module (not shown in the figure), and the second determination module is configured to determine the template image category of the image position where the first target image is located in the stitching template; the replacement module 1006 is further configured to replace the first target image with the second target image when the image category to which the second target image belongs is the same as the template image category.
[0103] Optionally, the image processing device 1000 further includes: a display module (not shown in the figure), and the display module is configured to display a template setting interface, and the template setting interface includes a stitching template and a preset image category, and the stitching template includes at least one template image category and the image position of each template image category in the stitching template; the receiving module 1004 is further configured to receive a second input for the preset image category; the image processing device 1000 further includes: an update module (not shown in the figure), and the update module is configured to update the template image category of the image position where the first target image is located in the stitching template according to the preset image category in response to the second input.
[0104] Optionally, the obtaining module 1002 is further configured to obtain a splicing template and a preset image set, where the preset image set includes multiple third images; the image processing apparatus 1000 further includes: a screening module (not shown in the figure), configured to select multiple first images from the multiple third images according to the matching degree between the multiple third images and the splicing template and the number of images indicated by the splicing template; a generating module (not shown in the figure), configured to perform splicing processing on the multiple first images according to the splicing template to generate a target image.
[0105] In this embodiment, when each module of the image processing apparatus 1000 executes its respective function, the steps of the image processing method in any embodiment of the first aspect are implemented. Therefore, the image processing apparatus 1000 also includes all the beneficial effects of the image processing method in any embodiment of the first aspect, which will not be elaborated herein.
[0106] The image processing apparatus in the embodiments of the present application may be a device, or a component, an integrated circuit, or a chip in a terminal. The device may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted electronic device, a smart camera device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and the non-mobile electronic device may be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), or a self-service machine, etc. The embodiments of the present application do not make specific limitations.
[0107] The image processing apparatus in the embodiments of the present application may be a device with an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems. The embodiments of the present application do not make specific limitations.
[0108] In an embodiment of the present application, an electronic device is provided, which includes the image processing apparatus provided in the above embodiment. Therefore, the electronic device includes all the beneficial effects of the image processing apparatus provided in the above embodiment, which will not be elaborated herein.
[0109] In an embodiment of the present application, as Figure 11As shown in the figure, an electronic device 1100 is provided, including: a processor 1101, a memory 1102, and a program or instruction stored in the memory 1102 and running on the processor 1101. When the program or instruction is executed by the processor 1101, the steps of the image processing method provided in any of the above embodiments are implemented. Therefore, the electronic device 1100 includes all the beneficial effects of the image processing method provided in any of the above embodiments, which will not be elaborated here.
[0110] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0111] Figure 12 The following is a schematic diagram of the hardware structure of an electronic device 1200 according to an embodiment of the present application. The electronic device 1200 includes, but is not limited to: a radio frequency unit 1201, a network module 1202, an audio output unit 1203, an input unit 1204, a sensor 1205, a display unit 1206, a user input unit 1207, an interface unit 1208, a memory 1209, and a processor 1210, etc.
[0112] Those skilled in the art can understand that the electronic device 1200 may further include a power supply (such as a battery) for supplying power to each component. The power supply can be logically connected to the processor 1210 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. Figure 12 The structure of the electronic device shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine some components, or have different component arrangements, which will not be elaborated here.
[0113] Among them, the processor 1210 is used to obtain a target image, and the target image is obtained by splicing multiple first images according to a splicing template; the user input unit 1207 is used to receive a first input for a first target image among the multiple first images; the processor 1210 is further used to, in response to the first input, replace the first target image with a second target image; wherein, the second target image is a second image in a first target image set, and the matching degree between the second target image and the splicing template is greater than or equal to a preset matching degree.
[0114] In this embodiment, the first target image selected by the user is replaced with a second target image in the first target image set that has a relatively high similarity to the splicing template used for the target image. Furthermore, the matching degree provides a reliable basis for replacing the first image, so that the replaced target image can still ensure the image quality of the target image, and can also greatly save the time for the user to select the required image, improving the user experience.
[0115] Further, the processor 1210 is further configured to obtain preset metric items, as well as the correspondence between the image content information and the metric values of the preset metric items; determine the metric values of the preset metric items corresponding to the second image according to the image content information of the second image and the correspondence; determine the preset weights of the preset metric items according to the splicing template; determine the matching degree between the second image and the splicing template according to the metric values of the preset metric items corresponding to the second image and the preset weights; use the second image with a matching degree greater than or equal to the preset matching degree as the second target image; wherein, the preset metric items include at least one of the following: image shooting angle, image shooting distance, image clarity, human action, human expression, human background, and light intensity.
[0116] Further, the processor 1210 is further configured to determine the template image category of the image position where the first target image is located in the splicing template; and replace the first target image with the second target image when the image category to which the second target image belongs is the same as the template image category.
[0117] Further, the display unit 1206 is further configured to display a template setting interface, which includes a splicing template and preset image categories, and the splicing template includes at least one template image category and the image position of each template image category in the splicing template; the user input unit 1207 is further configured to receive a second input for the preset image category; and the processor 1210 is further configured to, in response to the second input, update the template image category of the image position where the first target image is located in the splicing template according to the preset image category.
[0118] Further, the processor 1210 is further configured to obtain a splicing template and a preset image set, and the preset image set includes multiple third images; select multiple first images from the multiple third images according to the matching degrees between the multiple third images and the splicing template and the number of images indicated by the splicing template; and perform splicing processing on the multiple first images according to the splicing template to generate a target image.
[0119] It should be understood that in the embodiments of the present application, the input unit 1204 may include a Graphics Processing Unit (GPU) 1241 and a microphone 1242. The GPU 1241 processes the image data of static pictures or videos obtained by an image capturing device (such as a camera) in the video capture mode or the image capture mode. The display unit 1206 may include a display panel 1261, and the display panel 1261 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1207 includes a touch panel 1271 and other input devices 1272. The touch panel 1271 is also called a touch screen. The touch panel 1271 may include two parts: a touch detection device and a touch controller. The other input devices 1272 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here. The memory 1209 may be used to store software programs and various data, including but not limited to application programs and operating systems. The processor 1210 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 1210.
[0120] In an embodiment of the present application, a read storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the image processing method provided in any of the above embodiments are implemented.
[0121] In this embodiment, the read storage medium can implement each process of the image processing method provided in the embodiments of the present application and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0122] Among them, the processor is the processor in the communication device in the above embodiment. The read storage medium includes a computer-readable storage medium, such as a computer Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disc, etc.
[0123] The embodiments of the present application also provide a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run a program or instruction to implement each process of the above embodiment of the image processing method and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0124] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, a system chip, a chip system, or a system-on-chip, etc.
[0125] It should be noted that in this text, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the presence of additional identical elements in the process, method, article or device comprising such element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in a different order from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0126] From the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present application.
[0127] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them fall within the protection scope of the present application.
Claims
1. An image processing method, characterized in that, Including: Obtain a target image, which is obtained by splicing multiple first images according to a splicing template; Receive a first input for a first target image among the multiple first images; In response to the first input, replace the first target image with a second target image; Wherein, the second target image is a second image in a second image set, and the matching degree between the second target image and the splicing template is greater than or equal to a preset matching degree; The replacing the first target image with the second target image includes: Determine the template image category of the image position where the first target image is located in the splicing template; When the image category to which the second target image belongs is the same as the template image category, replace the first target image with the second target image.
2. The image processing method according to claim 1, characterized in that, Also including: Obtain a preset index item and the corresponding relationship between the image content information and the index value of the preset index item; According to the image content information of the second image and the corresponding relationship, determine the index value of the preset index item corresponding to the second image; According to the splicing template, determine the preset weight of the preset index item; According to the index value of the preset index item corresponding to the second image and the preset weight, determine the matching degree between the second image and the splicing template; Use the second image whose matching degree is greater than or equal to the preset matching degree as the second target image; Wherein, the preset index item includes at least one of the following: image shooting angle, image shooting distance, image clarity, person's action, person's expression, person's background, and light intensity.
3. The image processing method according to claim 1, wherein Before determining the template image category of the image position where the first target image is located in the splicing template, it further includes: Display a template setting interface, which includes the splicing template and preset image categories, and the splicing template includes at least one template image category and the image position of each template image category in the splicing template; Receive a second input for the preset image category; In response to the second input, update the template image category of the image position where the first target image is located in the splicing template according to the preset image category.
4. The image processing method according to any one of claims 1 to 3, characterized in that, The obtaining the target image includes: Obtain the splicing template and a preset image set, and the preset image set includes multiple third images; Select the multiple first images from the multiple third images according to the matching degree between the multiple third images and the splicing template and the number of images indicated by the splicing template; Splice and process the multiple first images according to the splicing template to generate the target image.
5. An image processing apparatus, characterized in that, Including: An obtaining module, configured to obtain a target image, which is obtained by splicing multiple first images according to a splicing template; A receiving module, configured to receive a first input for a first target image among the multiple first images; A replacing module, configured to replace the first target image with a second target image in response to the first input; Wherein, the second target image is a second image in a second image set, and the matching degree between the second target image and the splicing template is greater than or equal to a preset matching degree; A second determination module, configured to determine a template image category of the image position where the first target image is located in the stitching template; The replacement module is further configured to, when the image category to which the second target image belongs is the same as the template image category, replace the first target image with the second target image.
6. The image processing apparatus according to claim 5, wherein The acquisition module is further configured to acquire a preset index item and a correspondence between the image content information and the index value of the preset index item; The image processing apparatus further includes: A first determination module, configured to determine an index value of a preset index item corresponding to the second image according to the image content information of the second image and the correspondence; Determine a preset weight of the preset index item according to the stitching template; Determine a matching degree between the second image and the stitching template according to the index value of the preset index item corresponding to the second image and the preset weight; Use the second image whose matching degree is greater than or equal to the preset matching degree as the second target image; Wherein, the preset index item includes at least one of the following: image shooting angle, image shooting distance, image clarity, human action, human expression, human background, and light intensity.
7. The image processing apparatus according to claim 5, wherein It further includes: A display module, configured to display a template setting interface, where the template setting interface includes the stitching template and preset image categories, and the stitching template includes at least one template image category and the image position of each template image category in the stitching template; The receiving module is further configured to receive a third input to the preset image category; An update module, configured to, in response to the third input, update the template image category of the image position where the first target image is located in the stitching template according to the preset image category.
8. The image processing apparatus according to any one of claims 5 to 7, wherein The acquisition module is further configured to acquire the stitching template and a preset image set, and the preset image set includes multiple third images; The image processing apparatus further includes: A screening module, configured to select the multiple first images from the multiple third images according to the matching degree between the multiple third images and the stitching template and the number of images indicated by the stitching template; A generation module, configured to perform stitching processing on the multiple first images according to the stitching template to generate the target image.
9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the image processing method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Picture display method, terminal equipment and storage medium
CN107967341A
A method and apparatus for selecting similar images
CN109241314A