Image stitching method, device, electronic device and storage medium

By using the identity identification of the target user to determine his configuration model and using the configuration parameters of the model to splice the images, the problem of complex image stitching in the prior art is solved, and an efficient and personalized image stitching effect is achieved.

CN113935902BActive Publication Date: 2025-04-25NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111235317.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-22
Publication Date
2025-04-25
Estimated Expiration
2041-10-22

AI Technical Summary

Technical Problem

In the prior art, the image stitching process is complex and cumbersome, and cannot meet the personalized needs of users.

Method used

By obtaining the identity of the target user, determining its corresponding target configuration model, using the configuration parameters in the model to stitch the stitched image to generate the stitched image.

Benefits of technology

The image stitching is realized to meet the personalized needs of users, while simplifying the stitching process and improving the stitching efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113935902B_ABST
    Figure CN113935902B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides an image stitching method, device, electronic device and storage medium, which relates to the field of image processing. The method includes: obtaining at least one image to be stitched and an identity identifier of a target user; determining a target configuration model corresponding to the target user according to the identity identifier of the target user, wherein the target configuration model is a model generated by training an initial configuration model based on the historical configuration parameters of the target user; obtaining configuration parameters in the target configuration model; stitching the images to be stitched using the configuration parameters in the target configuration model to generate a stitched image, thereby meeting the personalized needs of the user, simplifying the image stitching process, and improving the stitching efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and more specifically, to an image stitching method, device, electronic device and storage medium. Background Art

[0002] With the improvement of living standards and technology, people's demand for sharing, displaying and collecting is also increasing. On this basis, images, that is, pictures and videos, as a form of expression that can carry rich content, have become an important carrier for people to share, display and collect. However, many social media have limited the number of images that can be published at one time. If users want to publish more images, they need to splice the images themselves.

[0003] In the prior art, the image stitching process is usually that the user first uploads the image, then sets the configuration parameters or selects the stitching template, and finally stitches the images uploaded by the user into one image according to the configuration parameters set by the user or the stitching template selected and then outputs it.

[0004] However, stitching templates are usually designed to meet popular needs and may not be able to meet the personalized stitching needs of users. If the user sets the configuration parameters by himself, the image stitching process will be more complicated and cumbersome. Summary of the invention

[0005] The purpose of the present application is to provide an image stitching method, device, electronic device and storage medium to address the deficiencies in the above-mentioned prior art, which can not only meet the personalized needs of users, but also simplify the image stitching process and improve the stitching efficiency.

[0006] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0007] In a first aspect, an embodiment of the present application provides an image stitching method, the method comprising:

[0008] Obtain at least one image to be stitched and an identity of a target user;

[0009] Determine a target configuration model corresponding to the target user according to the identity identifier of the target user, where the target configuration model is a model generated by training an initial configuration model based on historical configuration parameters of the target user;

[0010] Get the configuration parameters in the target configuration model;

[0011] The images to be stitched are stitched using the configuration parameters in the target configuration model to generate a stitched image.

[0012] Optionally, in a specific implementation, the configuration parameters in the target configuration model include first adjustable parameters and default parameters;

[0013] The configuration parameters in the target configuration model are used to stitch the images to be stitched, generating a stitched image, including:

[0014] Obtaining an adjustment result of the target user for the first adjustable parameter;

[0015] The images to be stitched are stitched using the default parameters and the adjustment results to generate a stitched image.

[0016] Optionally, in a specific implementation, the configuration parameters in the target configuration model include second adjustable parameters and default parameters;

[0017] Before stitching the images to be stitched using the configuration parameters in the target configuration model to generate the stitched images, the method further includes:

[0018] Determine the type of images to be stitched;

[0019] Adjusting the second adjustable parameter according to the type of the image to be stitched;

[0020] The configuration parameters in the target configuration model are used to stitch the images to be stitched, generating a stitched image, including:

[0021] The images to be stitched are stitched using the default parameters and the adjusted second adjustment parameters to generate a stitched image.

[0022] Optionally, in a specific implementation manner, before determining the target configuration model corresponding to the target user according to the identity identifier of the target user, the method further includes:

[0023] Get the historical configuration parameters of the target user;

[0024] Preprocessing the historical configuration parameters to obtain training data and feature values ​​of the training data, wherein the preprocessing includes at least data cleaning and feature value extraction;

[0025] The initial configuration model is trained based on the training data and the feature values ​​to generate a target configuration model corresponding to the target user.

[0026] Optionally, in a specific implementation manner, preprocessing the historical configuration parameters to obtain training data includes:

[0027] Perform data cleaning on historical configuration parameters to obtain training data;

[0028] Determine the weight of each configuration parameter in the training data according to a preset mapping table, wherein the preset mapping table is used to indicate the corresponding relationship between the configuration parameters and the weights;

[0029] The sum of the weights of each configuration parameter in the training data is taken as the feature value of the training data.

[0030] Optionally, in a specific implementation manner, before determining the target configuration model corresponding to the target user according to the identity identifier of the target user, the method further includes:

[0031] Convert the format of the images to be stitched into a preset format.

[0032] Optionally, in a specific implementation manner, converting the format of the images to be stitched into a preset format includes:

[0033] If the images to be stitched are in an image interchange format, extracting serialized frames of the images to be stitched in the image interchange format, and converting the format of the serialized frames into a preset format;

[0034] If the image to be stitched is in video format, extract key frames from the video to obtain a key frame list, and convert the format of each key frame in the key frame list into a preset format;

[0035] If the image to be stitched is in picture format, the format of the picture is converted into a preset format.

[0036] Optionally, in a specific implementation manner, after stitching the to-be-stitched images using the configuration parameters in the target configuration model to generate the stitched images, the method further includes:

[0037] Obtaining feedback information from target users on the stitched image;

[0038] The configuration parameters in the target configuration model are adjusted according to the feedback information to generate a new target configuration model.

[0039] Optionally, in a specific implementation manner, after stitching the to-be-stitched images using the configuration parameters in the target configuration model to generate the stitched images, the method further includes:

[0040] Obtain output parameters input by the target user for the stitched image, the output parameters including output format and output channel;

[0041] Convert the format of the stitched image to an output format, and compress the stitched image in the output format into a compressed package;

[0042] Output the compressed file through the output channel.

[0043] Optionally, in a specific implementation, the output parameter also includes a communication address;

[0044] Output compressed files through output channels, including:

[0045] Output the compressed package to the communication address through the output channel.

[0046] Optionally, in a specific implementation manner, after converting the format of the images to be stitched into a preset format, the method further includes:

[0047] The images to be stitched and the images to be stitched in a preset format are stored in the distributed unit.

[0048] In a second aspect, an embodiment of the present application provides an image stitching device, the device comprising:

[0049] An image acquisition module, used to acquire at least one image to be stitched and an identity of a target user;

[0050] A model determination module is used to determine a target configuration model corresponding to the target user according to the identity identifier of the target user, where the target configuration model is a model generated by training an initial configuration model based on historical configuration parameters of the target user;

[0051] A parameter acquisition module is used to obtain configuration parameters in the target configuration model;

[0052] The stitching module is used to stitch the images to be stitched using the configuration parameters in the target configuration model to generate a stitched image.

[0053] Optionally, in a specific implementation, the configuration parameters in the target configuration model include first adjustable parameters and default parameters;

[0054] The splicing module is specifically used to: obtain the adjustment result of the target user for the first adjustable parameter;

[0055] The images to be stitched are stitched using the default parameters and the adjustment results to generate a stitched image.

[0056] Optionally, in a specific implementation, the configuration parameters in the target configuration model include second adjustable parameters and default parameters;

[0057] The device also includes: a type determination module, used to determine the type of the image to be spliced;

[0058] An adjustment module, used for adjusting the second adjustable parameter according to the type of the image to be stitched;

[0059] The stitching module is specifically used to stitch the images to be stitched by using the default parameters and the adjusted second adjustment parameters to generate a stitched image.

[0060] Optionally, in a specific embodiment, the device further includes:

[0061] The historical parameter module is used to obtain the historical configuration parameters of the target user;

[0062] A preprocessing module is used to preprocess the historical configuration parameters to obtain training data and feature values ​​of the training data, and the preprocessing includes at least data cleaning and feature value extraction;

[0063] The model training module is used to train the initial configuration model based on the training data and feature values ​​to generate a target configuration model corresponding to the target user.

[0064] Optionally, in a specific implementation manner, the preprocessing module is specifically used to perform data cleaning on historical configuration parameters to obtain training data;

[0065] Determine the weight of each configuration parameter in the training data according to a preset mapping table, wherein the preset mapping table is used to indicate the corresponding relationship between the configuration parameters and the weights;

[0066] The sum of the weights of each configuration parameter in the training data is taken as the feature value of the training data.

[0067] Optionally, in a specific embodiment, the device further includes:

[0068] The format conversion module is used to convert the format of the images to be stitched into a preset format.

[0069] Optionally, in a specific implementation, the format conversion module is specifically used for extracting serialized frames of the images to be spliced ​​in the image interchange format if the images to be spliced ​​are in the image interchange format, and converting the format of the serialized frames into a preset format;

[0070] If the image to be stitched is in video format, extract key frames from the video to obtain a key frame list, and convert the format of each key frame in the key frame list into a preset format;

[0071] If the image to be stitched is in picture format, the format of the picture is converted into a preset format.

[0072] Optionally, in a specific implementation, the device further includes: a feedback module, configured to obtain feedback information of a target user on the stitched image;

[0073] The configuration parameters in the target configuration model are adjusted according to the feedback information to generate a new target configuration model.

[0074] Optionally, in a specific implementation, the device further includes: an output module, used to obtain output parameters input by the target user for the stitched image, the output parameters including an output format and an output channel;

[0075] Convert the format of the stitched image to an output format, and compress the stitched image in the output format into a compressed package;

[0076] Output the compressed file through the output channel.

[0077] Optionally, in a specific implementation, the output parameter also includes a communication address;

[0078] The output module is specifically used to output the compressed package to the communication address through the output channel.

[0079] Optionally, in a specific embodiment, the device further includes:

[0080] The storage module is used to store the images to be stitched and the images to be stitched in a preset format in the distributed unit.

[0081] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of any of the aforementioned embodiments.

[0082] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the aforementioned embodiments are executed.

[0083] The image stitching method, device, electronic device and storage medium provided by the present application first train an initial configuration model based on the historical configuration parameters of the target user to generate a target configuration model, and then use the configuration parameters in the target configuration model to stitch the image to be stitched to generate a stitched image, which not only meets the user's personalized stitching needs, but also simplifies the image stitching process and improves the stitching efficiency.

[0084] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0085] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0086] Figure 1 A schematic diagram of a splicing template provided in an embodiment of the present application is shown;

[0087] Figure 2 A flow chart of an image stitching method provided by an embodiment of the present application is shown;

[0088] Figure 3 A schematic diagram of an identity identifier-configuration model correspondence table provided in an embodiment of the present application is shown;

[0089] Figure 4 A flowchart of another image stitching method provided by an embodiment of the present application is shown;

[0090] Figure 5 A flowchart of another image stitching method provided in an embodiment of the present application is shown;

[0091] Figure 6 A flowchart of another image stitching method provided in an embodiment of the present application is shown;

[0092] Figure 7 A flow chart of generating a target configuration model provided by an embodiment of the present application is shown;

[0093] Figure 8 A flowchart of a preprocessing method provided by an embodiment of the present application is shown;

[0094] Fig. 9 A flowchart of another image stitching method provided in an embodiment of the present application is shown;

[0095] Fig.10 A flowchart of format conversion provided by an embodiment of the present application is shown;

[0096] Fig.11 A flow chart of adjusting a target configuration model provided by an embodiment of the present application is shown;

[0097] Fig.12 A flow chart of outputting a spliced ​​image provided by an embodiment of the present application is shown;

[0098] Fig.13 A flowchart of another method of outputting a spliced ​​image provided by an embodiment of the present application is shown;

[0099] Fig.14 A flowchart of another image stitching method provided in an embodiment of the present application is shown;

[0100] Fig.15 A schematic diagram of an image stitching device provided in an embodiment of the present application is shown;

[0101] Fig.16 A schematic diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0102] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0103] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0104] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0105] Before describing the embodiments of the present application, the application background of the present application is first introduced.

[0106] With the improvement of living standards and technology, people's demand for sharing, displaying and collecting is also increasing. On this basis, images, that is, pictures and videos, as a form of expression that can carry rich content, have become an important carrier for people to share, display and collect. However, many social media have limited the number of images that can be published at one time. If users want to publish more images, they need to splice the images themselves.

[0107] In the prior art, the image stitching process is usually that the user first uploads the image, then sets the configuration parameters or selects the stitching template, and finally stitches the images uploaded by the user into one image according to the configuration parameters set by the user or the stitching template selected and then outputs it.

[0108] However, splicing templates are usually designed to meet popular needs and may not meet the user's personalized splicing needs. Figure 1 For example, Figure 1It is a common rectangular stitching template, which includes image area A, image area B, image area C and image area D. Users can upload image a to be stitched to image area A, image b to image area B, image c to area C, and image d to area D to achieve image stitching. It can be seen that the stitching template can only stitch images in fixed positions and shapes. If the user is accustomed to stitching images into other forms, he needs to set the configuration parameters by himself, but this will make the image stitching process more complicated and cumbersome.

[0109] In order to solve this problem, the present application provides an image stitching method, device, electronic device and storage medium, which can not only meet the personalized needs of users, but also simplify the image stitching process and improve the stitching efficiency.

[0110] See also Figure 2 The present application provides an image stitching method, which includes:

[0111] S201: Obtain at least one image to be stitched and an identity of a target user.

[0112] The images in the embodiments of the present application may include pictures, videos, and GIFs (Graphics Interchange Format).

[0113] Among them, the formats of pictures and videos can be multiple. Taking pictures as an example, the formats of pictures can be bmp, jpg, jpg, png, tif, pcx, tga, exif, fpx, svg, psd, cdr, pcd, dxf, ufo, eps, ai, raw, WMF, webp, avif, apng, etc. This application does not limit this.

[0114] In addition, the target user's identity identifier is an identifier that can indicate the target user's identity information, has a unique corresponding relationship with the target user, and can be the target user's account number, nickname, etc., and this application does not make specific limitations on this.

[0115] It should be noted that the image stitching method provided in the embodiment of the present application can be applied to a terminal device or a server. When applied to a terminal device, the at least one image to be stitched can be input by a target user or other users through the terminal device; when applied to a server, the at least one image to be stitched can be uploaded to the server by the target user or other users.

[0116] S202: Determine a target configuration model corresponding to the target user according to the identity identifier of the target user, where the target configuration model is a model generated by training an initial configuration model based on historical configuration parameters of the target user.

[0117] See also Figure 3 Optionally, after the initial configuration model is trained based on the user's historical configuration parameters to generate the user's configuration model, a correspondence between the user's identity identifier and the configuration model can be established and stored. In this way, each user has a corresponding configuration model, and an identity identifier-configuration model correspondence table can be generated based on the correspondence between each user's identity identifier and each configuration model.

[0118] exist Figure 3 On the basis of, the above-mentioned step S202 can be specifically as follows: according to the correspondence between the identity identifiers of each user and the configuration models, that is, the above-mentioned identity identifier-configuration model correspondence table, determine the configuration model corresponding to the identity identifier of the target user, and use the configuration model corresponding to the identity identifier of the target user as the target configuration model corresponding to the target user.

[0119] The above-mentioned target configuration model is a model generated by training the initial configuration model based on the historical configuration parameters of the target user. Among them, the initial configuration model adopts an existing trainable configuration model as needed, and can also be set by itself as needed. This application does not make specific restrictions on this. The historical configuration parameters of the target user refer to the configuration parameters set or used by the target user when splicing images before step S202. The historical configuration parameters of the target user can reflect the personalized needs or personal habits of the target user when splicing images. Using the historical configuration parameters of the target user to train the initial configuration model can make the various configuration parameters in the generated target configuration model more in line with the personalized needs or personal habits of the target user, so that the spliced ​​image meets the personalized splicing needs of the user.

[0120] In addition, the configuration parameters in the embodiments of the present application may include but are not limited to position parameters, shape parameters, layer parameters, playback speed parameters, brightness parameters, contrast parameters, resolution parameters, background parameters, filter parameters, etc., wherein the position parameters are used to indicate the positions of the images to be stitched in the stitched image, the shape parameters are used to indicate the shapes of the images to be stitched in the stitched image, the layer parameters are used to indicate the layers where the images to be stitched in the stitched image are located, the playback speed parameters are used to indicate the playback speed when the stitched image is a video, the brightness parameters are used to indicate the brightness of the images to be stitched in the stitched image, the contrast parameters are used to indicate the contrast of the images to be stitched in the stitched image, the resolution parameters are used to indicate the resolution of the images to be stitched in the stitched image, the background parameters are used to indicate the background of the images to be stitched in the stitched image, and the filter parameters are used to indicate the filters of the images to be stitched in the stitched image. Of course, the configuration parameters may also include other parameters, which are only exemplary and do not mean that the present application is limited to this.

[0121] S203: Obtain configuration parameters in the target configuration model.

[0122] S204: stitching the images to be stitched using the configuration parameters in the target configuration model to generate a stitched image.

[0123] The image stitching method provided in the present application uses the configuration parameters in the target configuration model to stitch the images to be stitched to generate a stitched image, wherein the target configuration model is a model generated by training the initial configuration model based on the historical configuration parameters of the target user. It can not only meet the user's personalized stitching needs, but also simplify the image stitching process and improve the stitching efficiency.

[0124] Optionally, in a specific implementation, the configuration parameters in the target configuration model include first adjustable parameters and default parameters.

[0125] Specifically, the first adjustable parameter refers to a parameter that can be adjusted, and the default parameter refers to a parameter that cannot be adjusted.

[0126] Optionally, the default parameter may be the same parameter in multiple historical configuration parameters of the target user. For example, if the historical configuration parameters of the target user show that the brightness parameter set by the target user each time is the same value, the brightness parameter may be used as the default parameter. This is conducive to simplifying the image stitching process and improving stitching efficiency.

[0127] Corresponding to the default parameter, the first adjustable parameter can be a different parameter among multiple historical configuration parameters of the target user. For example, the historical configuration parameters of the target user show that the contrast parameter set by the target user each time is different, so the contrast parameter can be used as the first adjustable parameter. This is conducive to meeting the personalized splicing needs of users.

[0128] Of course, the above examples of default parameters and the first adjustable parameters are only illustrative and do not mean that the present application is limited thereto.

[0129] See also Figure 4 On the basis that the configuration parameters in the target configuration model include the first adjustable parameters and the default parameters, the above step S204 may specifically include:

[0130] S401: Obtaining an adjustment result of a target user for a first adjustable parameter.

[0131] S402: stitching the images to be stitched using default parameters and adjustment results to generate a stitched image.

[0132] Specifically, the target user can adjust the first adjustable parameter. For example, when the first adjustable parameter includes a brightness parameter, the target user can adjust the brightness parameter up or down. In the embodiment of the present application, by obtaining the adjustment result of the target user for the first adjustable parameter and using the default parameters and the adjustment result to stitch the image to be stitched, the generated stitched image can better meet the user's personalized stitching needs.

[0133] Optionally, in a specific implementation, the configuration parameters in the target configuration model include second adjustable parameters and default parameters.

[0134] For the description of the default parameters, please refer to the aforementioned embodiment and will not be repeated here.

[0135] The second adjustable parameter also refers to an adjustable parameter. Specifically, the second adjustable parameter can be determined according to the type of images to be stitched, and the type of images to be stitched can be determined by the content of the images to be stitched. For example, the images to be stitched can be images of people, images of the night sky, etc. Correspondingly, when the images to be stitched are images of people, the second adjustable parameters may include resolution parameters, filter parameters, etc., and when the images to be stitched are images of the night sky, the second adjustable parameters may include brightness parameters, contrast parameters, etc.

[0136] Of course, this is just an exemplary description, and the corresponding relationship between the type of the image to be stitched and the second adjustable parameter can be set as needed, and this application does not make any specific limitation on this.

[0137] See also Figure 5 On the basis that the configuration parameters in the target configuration model include the second adjustable parameters and the default parameters, before the above step S204, the method further includes:

[0138] S501: Determine the type of images to be stitched.

[0139] S502: Adjust the second adjustable parameter according to the type of the image to be stitched.

[0140] Optionally, a correspondence between the types of images to be stitched and the second adjustable parameters may be pre-established, and the correspondence may indicate a configuration parameter in the second adjustable parameters corresponding to each type of images to be stitched.

[0141] For example, the type of image to be stitched is a night sky image, which is usually darker. The second adjustable parameter corresponding to the night sky image can be set to include a brightness parameter and a contrast parameter. On this basis, the above step S502 can specifically be: increase the brightness parameter and the contrast parameter in the second adjustable parameter by a preset step value.

[0142] The preset step value may be a value set according to needs and is not limited here.

[0143] See also Figure 6 ,exist Figure 5 On the basis of, the above step S204 may specifically include:

[0144] S601: stitching the images to be stitched using the default parameters and the adjusted second adjustment parameters to generate a stitched image.

[0145] In this way, different configuration parameters are used for stitching according to different types of images to be stitched, which is beneficial to improving the display effect of the stitched images.

[0146] See also Figure 7 Optionally, in a specific implementation manner, before the above step S202, the method further includes:

[0147] S701: Obtain historical configuration parameters of the target user.

[0148] S702: Preprocess the historical configuration parameters to obtain training data and feature values ​​of the training data, where the preprocessing at least includes data cleaning and feature value extraction.

[0149] S703: Train the initial configuration model based on the training data and the feature values ​​to generate a target configuration model corresponding to the target user.

[0150] For the description of historical configuration parameters, please refer to the aforementioned embodiment and will not be repeated here.

[0151] Data cleaning can specifically include checking data consistency, processing invalid values ​​and default values, etc. Among them, checking data consistency means checking whether each configuration parameter meets the requirements based on the reasonable value range and mutual relationship of each configuration parameter, and discovering data that exceeds the normal range, is logically unreasonable or contradictory; processing invalid values ​​and default values ​​means supplementing or deleting the entire configuration data corresponding to the invalid value and default value.

[0152] In addition, training the initial configuration model based on the characteristic values ​​of the training data can reduce data redundancy, reduce model calculations, and help improve the efficiency of the training model.

[0153] Here is a method for feature value extraction, see Figure 8 Optionally, in a specific implementation manner, the above step S702 may specifically include:

[0154] S801: Perform data cleaning on historical configuration parameters to obtain training data.

[0155] S802: Determine the weight of each configuration parameter in the training data according to a preset mapping table, where the preset mapping table is used to indicate the corresponding relationship between the configuration parameters and the weights.

[0156] S803: taking the sum of the weights of the configuration parameters in the training data as the feature value of the training data.

[0157] Among them, in the preset mapping table, the corresponding weight of each configuration parameter can be set as needed. For example, the weight of the resolution parameter can be set higher, and the weight of the filter parameter can be set lower. The characteristic value obtained in this way can reflect the clarity to a certain extent. The initial configuration model is trained based on the training data and the characteristic value, and the resolution parameter in the generated target configuration model is also higher. The resolution of the spliced ​​image generated based on the configuration parameters in the target configuration model is also higher.

[0158] See also Fig. 9 Optionally, in a specific implementation manner, before the above step S202, the method further includes:

[0159] S901: Convert the format of the images to be stitched into a preset format.

[0160] The preset format can be png format, which is conducive to reducing the volume of the image to be spliced ​​and improving the compression ratio. Of course, the preset format can also be other formats, and this application does not make specific limitations on this.

[0161] In addition, the image processing library Pillow can be used to convert the format of the image to be stitched into a preset format. Such a conversion process is simple and accurate, which is conducive to improving the efficiency of image stitching.

[0162] See also Fig.10 Optionally, in a specific implementation manner, the above step S901 may specifically include:

[0163] S1001a: If the images to be stitched are in an image interchange format, extracting serialized frames of the images to be stitched in the image interchange format, and converting the format of the serialized frames into a preset format.

[0164] S1001b: If the image to be stitched is in video format, extract key frames from the video to obtain a key frame list, and convert the format of each key frame in the key frame list into a preset format.

[0165] S1001c: If the image to be stitched is in a picture format, convert the picture format into a preset format.

[0166] Among them, the image interchange format is the above-mentioned GIF, which usually contains multiple frames. If the image to be spliced ​​is GIF, all frames in the GIF can be extracted. All frames in the GIF constitute serialized frames. The format of each frame in the serialized frame can be converted into a unified preset format to facilitate subsequent splicing.

[0167] The key frame extraction of the video can be specifically carried out by using a shot-based method, a motion analysis-based method, and a video clustering-based method.

[0168] The shot-based method is as follows: first, the video is segmented according to the shot changes, and then the first and last two frames in each shot are selected as key frames. This extraction process is relatively simple, with less calculation and less time consumption, which is conducive to improving the image stitching speed.

[0169] The method based on motion analysis is as follows: the optical flow of the object in the video is analyzed, and each time the video frame with the least optical flow movement in the video lens is selected as the extracted key frame. This can effectively reflect the motion characteristics in the video.

[0170] The method based on video clustering is as follows: initialize a cluster center; determine the reference frame to be classified into a class or the new cluster center of the class by calculating the range between the cluster center and the current frame; select the video frame closest to the cluster center and process it as a key frame. The key frame extracted in this way has less redundancy and can more accurately reflect the video content.

[0171] Of course, this is just an exemplary description, and other methods can also be used to extract key frames from videos, and this application does not limit this.

[0172] See also Fig.11 Optionally, in a specific implementation manner, after the above step S204, the method further includes:

[0173] S1101: Obtaining feedback information from a target user regarding the stitched image.

[0174] S1102: Adjust configuration parameters in the target configuration model according to the feedback information to generate a new target configuration model.

[0175] In the embodiment of the present application, the user can provide feedback on the stitched image. For example, if the target user's feedback information on the stitched image shows that the user thinks the brightness of the stitched image is too high, the brightness parameter in the target configuration model corresponding to the target user can be reduced, and the target configuration model after adjusting the brightness parameter is used as the new target configuration model. Such iterative optimization can make the stitched image generated by the configuration parameters in the new target configuration model more in line with the user's personalized needs.

[0176] See also Fig.12 Optionally, in a specific implementation manner, after the above step S204, the method further includes:

[0177] S1201: Obtain output parameters input by a target user for a stitched image, where the output parameters include an output format and an output channel.

[0178] S1202: Convert the format of the stitched image into an output format, and compress the stitched image in the output format into a compressed package.

[0179] S1203: Output the compressed package through an output channel.

[0180] After the stitched image is generated, the target user can input output parameters for the stitched image. The output parameters may include output format and output channel.

[0181] Output formats include pictures, videos, GIF, etc. The format of the stitched image can be converted to the output format input by the target user. For example, if the output format is GIF, Pillow can be used to convert the stitched image to GIF. After the format conversion, the stitched image is compressed into a compressed package and then output through the output channel, which can save transmission resources and improve transmission efficiency.

[0182] There can be many output channels, such as direct download, SMS, email, social media, etc. If the output channel input by the target user is direct download, the stitched image can be converted into a binary stream and directly output to the client where the target user is located. If the output channel input by the target user is SMS, the stitched image can be stored on the server and sent to the target user's mobile phone via a short link. If the output channel input by the target user is email, the stitched image can be converted into a binary stream, and an email template can be created. After adding the binary stream to the email template, it can be sent to the target user's mailbox through the email server; if the output channel input by the target user is social media, the stitched image can be stored on the server, and a download QR code can be generated according to the server address, and the download QR code can be provided to the target user.

[0183] Optionally, in a specific implementation, the output parameter also includes a communication address.

[0184] The communication address is an address that can establish a communication connection with the target user, such as the mobile phone number and email address of the above-mentioned target user, and this application does not make any specific restrictions on this.

[0185] See also Fig.13 On the basis that the output parameter also includes the communication address, the above step S1203 may specifically include:

[0186] S1301: Output the compressed package to the communication address through the output channel.

[0187] See also Fig.14 Optionally, in a specific implementation manner, after the above step S901, the method further includes:

[0188] S1401: storing the images to be stitched and the images to be stitched in a preset format in the distributed unit.

[0189] In this way, the stability and security of data storage can be guaranteed, making it convenient for target users to obtain the required images at any time as needed.

[0190] See also Fig.15 , the embodiment of the present application provides an image stitching device 1500, the device comprising:

[0191] The image acquisition module 1501 is used to acquire at least one image to be stitched and an identity of a target user;

[0192] A model determination module 1502 is used to determine a target configuration model corresponding to the target user according to the identity identifier of the target user, where the target configuration model is a model generated by training an initial configuration model based on historical configuration parameters of the target user;

[0193] The parameter acquisition module 1503 is used to acquire the configuration parameters in the target configuration model;

[0194] The stitching module 1504 is used to stitch the images to be stitched using the configuration parameters in the target configuration model to generate a stitched image.

[0195] Optionally, in a specific implementation, the configuration parameters in the target configuration model include first adjustable parameters and default parameters;

[0196] The splicing module 1504 is specifically used to: obtain the adjustment result of the target user for the first adjustable parameter;

[0197] The images to be stitched are stitched using the default parameters and the adjustment results to generate a stitched image.

[0198] Optionally, in a specific implementation, the configuration parameters in the target configuration model include second adjustable parameters and default parameters;

[0199] The device also includes: a type determination module, used to determine the type of the image to be spliced;

[0200] An adjustment module, used for adjusting the second adjustable parameter according to the type of the image to be stitched;

[0201] The stitching module 1504 is specifically configured to stitch the images to be stitched using the default parameters and the adjusted second adjustment parameters to generate a stitched image.

[0202] Optionally, in a specific embodiment, the device further includes:

[0203] The historical parameter module is used to obtain the historical configuration parameters of the target user;

[0204] A preprocessing module is used to preprocess the historical configuration parameters to obtain training data and feature values ​​of the training data, and the preprocessing includes at least data cleaning and feature value extraction;

[0205] The model training module is used to train the initial configuration model based on the training data and feature values ​​to generate a target configuration model corresponding to the target user.

[0206] Optionally, in a specific implementation manner, the preprocessing module is specifically used to perform data cleaning on historical configuration parameters to obtain training data;

[0207] Determine the weight of each configuration parameter in the training data according to a preset mapping table, wherein the preset mapping table is used to indicate the corresponding relationship between the configuration parameters and the weights;

[0208] The sum of the weights of each configuration parameter in the training data is taken as the feature value of the training data.

[0209] Optionally, in a specific embodiment, the device further includes:

[0210] The format conversion module is used to convert the format of the images to be stitched into a preset format.

[0211] Optionally, in a specific implementation, the format conversion module is specifically used for extracting serialized frames of the images to be spliced ​​in the image interchange format if the images to be spliced ​​are in the image interchange format, and converting the format of the serialized frames into a preset format;

[0212] If the image to be stitched is in video format, extract key frames from the video to obtain a key frame list, and convert the format of each key frame in the key frame list into a preset format;

[0213] If the image to be stitched is in picture format, the format of the picture is converted into a preset format.

[0214] Optionally, in a specific implementation, the device further includes: a feedback module, configured to obtain feedback information of a target user on the stitched image;

[0215] The configuration parameters in the target configuration model are adjusted according to the feedback information to generate a new target configuration model.

[0216] Optionally, in a specific implementation, the device further includes: an output module, used to obtain output parameters input by the target user for the stitched image, the output parameters including an output format and an output channel;

[0217] Convert the format of the stitched image to an output format, and compress the stitched image in the output format into a compressed package;

[0218] Output the compressed file through the output channel.

[0219] Optionally, in a specific implementation, the output parameter also includes a communication address;

[0220] The output module is specifically used to output the compressed package to the communication address through the output channel.

[0221] Optionally, in a specific embodiment, the device further includes:

[0222] The storage module is used to store the images to be stitched and the images to be stitched in a preset format in the distributed unit.

[0223] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0224] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0225] The above modules can be connected or communicated with each other via a wired connection or a wireless connection. The wired connection may include a metal cable, an optical cable, a hybrid cable, etc., or any combination thereof. The wireless connection may include a connection in the form of a LAN, a WAN, Bluetooth, a ZigBee, or NFC, or any combination thereof. Two or more modules may be combined into a single module, and any one module may be divided into two or more units. Those skilled in the art will clearly understand that for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application.

[0226] It should be noted that the above modules can be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program codes. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0227] See also Fig.16 An embodiment of the present application provides an electronic device 1600, which includes: a processor 1601, a storage medium 1602 and a bus 1603. The storage medium 1602 stores machine-readable instructions executable by the processor 1601. When the electronic device 1600 is running, the processor 1601 communicates with the storage medium 1602 through the bus 1603, and the processor 1601 executes the machine-readable instructions to perform the steps of any of the aforementioned embodiments.

[0228] Finally, an embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the aforementioned embodiments are executed.

[0229] The image stitching method, device, electronic device and storage medium provided by the present application first train an initial configuration model based on the historical configuration parameters of the target user to generate a target configuration model, and then use the configuration parameters in the target configuration model to stitch the image to be stitched to generate a stitched image, which not only meets the user's personalized stitching needs, but also simplifies the image stitching process and improves the stitching efficiency.

[0230] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0231] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0232] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0233] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. An image stitching method, characterized in that: The method comprises: Obtain at least one image to be stitched and an identity of a target user; Determine a target configuration model corresponding to the target user according to the identity identifier of the target user, wherein the target configuration model is a model generated by training an initial configuration model based on historical configuration parameters of the target user; Obtaining configuration parameters in the target configuration model; Using the configuration parameters in the target configuration model to stitch the images to be stitched, to generate a stitched image; The configuration parameters in the target configuration model include second adjustable parameters and default parameters; Before stitching the images to be stitched using the configuration parameters in the target configuration model to generate a stitched image, the method further includes: Determining the type of the image to be stitched; the type of the image to be stitched is determined according to the content of the image to be stitched; The second adjustable parameter is adjusted according to the type of the image to be stitched; the method includes: pre-establishing a correspondence between the type of the image to be stitched and the second adjustable parameter, wherein the correspondence is used to indicate a configuration parameter in the second adjustable parameter corresponding to each type of the image to be stitched; The step of using the configuration parameters in the target configuration model to stitch the images to be stitched to generate a stitched image includes: Using the default parameters and the adjusted second adjustment parameters to stitch the images to be stitched, to generate a stitched image; Before determining the target configuration model corresponding to the target user according to the identity identifier of the target user, the method further includes: Obtaining historical configuration parameters of the target user; Performing data cleaning on the historical configuration parameters to obtain training data; Determining the weight of each configuration parameter in the training data according to a preset mapping table, wherein the preset mapping table is used to indicate the corresponding relationship between the configuration parameters and the weights; Taking the sum of the weights of the configuration parameters in the training data as the characteristic value of the training data; The initial configuration model is trained based on the training data and the feature value to generate the target configuration model corresponding to the target user.

2. The method according to claim 1, characterized in that The configuration parameters in the target configuration model include first adjustable parameters and default parameters; The step of using the configuration parameters in the target configuration model to stitch the images to be stitched to generate a stitched image includes: Acquire an adjustment result of the target user for the first adjustable parameter; The images to be stitched are stitched using the default parameters and the adjustment results to generate a stitched image.

3. The method according to claim 1, characterized in that Before determining the target configuration model corresponding to the target user according to the identity identifier of the target user, the method further includes: The format of the images to be stitched is converted into a preset format.

4. The method according to claim 3, characterized in that The converting the format of the image to be stitched into a preset format includes: If the image to be stitched is in an image interchange format, extracting serialized frames of the image to be stitched in the image interchange format, and converting the format of the serialized frames into a preset format; If the image to be stitched is in video format, extract key frames from the video to obtain a key frame list, and convert the format of each key frame in the key frame list into a preset format; If the image to be stitched is in a picture format, the format of the picture is converted into a preset format.

5. The method according to claim 1, characterized in that After the configuration parameters in the target configuration model are used to stitch the images to be stitched to generate a stitched image, the method further includes: Obtaining feedback information from the target user regarding the stitched image; The configuration parameters in the target configuration model are adjusted according to the feedback information to generate a new target configuration model.

6. The method according to claim 1, characterized in that After the configuration parameters in the target configuration model are used to stitch the images to be stitched to generate a stitched image, the method further includes: Acquire output parameters input by the target user for the stitched image, wherein the output parameters include an output format and an output channel; Converting the format of the stitched image into the output format, and compressing the stitched image in the output format into a compressed package; The compressed package is output through the output channel.

7. The method according to claim 6, characterized in that The output parameters also include a communication address; Outputting the compressed package through the output channel includes: The compressed package is output to the communication address through the output channel.

8. An image stitching device, characterized in that: include: An image acquisition module, used to acquire at least one image to be stitched and an identity of a target user; A model training module, used to determine a target configuration model corresponding to the target user according to the identity identifier of the target user, wherein the target configuration model is a model generated by training an initial configuration model based on historical configuration parameters of the target user; A parameter acquisition module, used to acquire configuration parameters in the target configuration model; A stitching module, used to stitch the images to be stitched using the configuration parameters in the target configuration model to generate a stitched image; The configuration parameters in the target configuration model include second adjustable parameters and default parameters; The device further comprises: a type determination module, which is used to determine the type of the image to be spliced; the type of the image to be spliced ​​is determined according to the content of the image to be spliced; An adjustment module is used to adjust the second adjustable parameter according to the type of the image to be stitched; the adjustment module includes: pre-establishing a correspondence between the type of the image to be stitched and the second adjustable parameter, wherein the correspondence is used to indicate a configuration parameter in the second adjustable parameter corresponding to each type of the image to be stitched; The stitching module is specifically used to stitch the images to be stitched using the default parameters and the adjusted second adjustment parameters to generate a stitched image; The device also includes: a historical parameter module, used to obtain historical configuration parameters of the target user; The preprocessing module is used to clean the historical configuration parameters to obtain training data; determine the weight of each configuration parameter in the training data according to a preset mapping table, the preset mapping table is used to indicate the corresponding relationship between the configuration parameters and the weight; and use the sum of the weights of each configuration parameter in the training data as the characteristic value of the training data; The model training module is used to train the initial configuration model based on the training data and feature values ​​to generate a target configuration model corresponding to the target user.

9. An electronic device, characterized in that: The electronic device comprises: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of any method as claimed in claims 1-7.

10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any method according to claim 1 are executed.

Citation Information

Patent Citations

  • Hair style preview method, storage medium and electronic equipment

    CN112785500A