Image optimization processing methods, apparatus, equipment, and readable storage media
By acquiring and optimizing the optimal target area image in the image and fusing it with the original image, the problem of poor image quality when the optimal target is not in the optimal imaging position is solved, providing better image quality.
Patent Information
- Application Number
- CN202080086940.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-12-13
- Filing Date
- 2020-03-26
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2040-03-26
AI Technical Summary
In existing technologies, the image quality is poor when the optimal target is not in the optimal imaging position.
By obtaining the optimal target from the preset images to be processed, obtaining its corresponding region image and optimizing it, and finally merging the optimized image with the preset images to be processed, the optimal target image is obtained.
It achieves optimal target optimization at any location, providing the best target image that matches the user's preferences, thus improving the photo-taking effect.
Smart Images

Figure CN114930382B_ABST
Abstract
Description
[0001] This application claims priority to Chinese Patent Application No. 201911297408.9, filed on December 13, 2019, entitled “Image Optimization Processing Method, Apparatus, Device and Readable Storage Medium”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of image processing technology, and in particular to an image optimization processing method, apparatus, device, and readable storage medium. Background Technology
[0003] With the rapid development of smart terminals, their camera functions are becoming increasingly powerful. When users take photos, in order to obtain better results, they usually identify and select the optimal target and optimize it. Currently, existing technologies typically guide the photographer to manually move the smart terminal to place the selected target in the optimal imaging position, or use a rotating camera to place the selected target in the optimal imaging position to obtain better results. However, when the optimal target is not in the optimal imaging position, the optimization effect of the selected target will be poor. Therefore, existing technologies have the technical problem of poor optimization effect of the optimal target in the image when taking photos.
[0004] Technical solutions
[0005] The main objective of this application is to provide an image optimization processing method, apparatus, device, and readable storage medium, aiming to solve the technical problem of poor optimization effect of the optimal target in the image when taking pictures in the prior art.
[0006] To achieve the above objectives, this application provides an image optimization processing method, which is applied to an image optimization processing device, and includes:
[0007] Obtain a preset image to be processed, and determine the optimal target in the preset image to be processed;
[0008] Obtain the region image corresponding to the optimal target, and optimize the region image to obtain an optimized image;
[0009] The optimized image is fused with the preset image to be processed to obtain the target optimal image.
[0010] Furthermore, to achieve the above objectives, this application also provides an image optimization processing apparatus, which is applied to an image optimization processing device, and the image optimization processing apparatus includes:
[0011] The determination module is configured to acquire a preset image to be processed and determine the optimal target in the preset image to be processed;
[0012] The optimization processing module is configured to acquire the region image corresponding to the optimal target, and optimize the region image to obtain an optimized image;
[0013] The fusion module is configured to fuse the optimized image with the preset image to be processed to obtain the target optimal image;
[0014] The output module is configured to obtain the target optimal image group corresponding to the optimized image and arrange and output the images in the target optimal image group.
[0015] In addition, to achieve the above objectives, this application also provides an image optimization processing device, which includes: a memory, a processor, and a program for the image optimization processing method stored in the memory and executable on the processor. When the program for the image optimization processing method is executed by the processor, it can implement the steps of the image optimization processing method as described above.
[0016] In addition, to achieve the above objectives, this application also provides a readable storage medium storing a program that implements an image optimization processing method. When the program is executed by a processor, it implements the steps of the image optimization processing method as described above.
[0017] This application obtains a preset image to be processed, determines the optimal target within that image, then obtains an image of the region corresponding to the optimal target, optimizes that region image to obtain an optimized image, and finally merges the optimized image with the preset image to obtain the optimal target image. In other words, when the optimal target is at any position on the image, this application determines the position of the optimal target, obtains the region image, optimizes it, and finally merges it with the preset image to obtain the optimal target image. Specifically, even when the optimal target is not at the optimal imaging position, by obtaining and optimizing the region image, an optimized image can be obtained. This optimized image is then merged with the preset image to obtain the optimal target within the preset image, thus providing the user with a target optimal image that meets their expectations. Therefore, this solves the technical problem in the prior art where the optimization effect of the optimal target in an image is poor when taking a picture. Attached Figure Description
[0018] Figure 1This is a flowchart illustrating the first embodiment of the image optimization processing method of this application;
[0019] Figure 2 This is a schematic diagram of the image output interface in the image optimization processing method of this application;
[0020] Figure 3 This is a flowchart illustrating the second embodiment of the image optimization processing method of this application;
[0021] Figure 4 This is a flowchart illustrating the third embodiment of the image optimization processing method of this application;
[0022] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the method of the embodiments of this application.
[0023] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings.
[0024] Embodiments of the present invention
[0025] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.
[0026] Reference Figure 1 This application provides an image optimization processing method. It should be noted that although the flowchart shows a logical order, in some cases, the steps shown or described may be executed in a different order than that shown here. For ease of description, the execution entity is omitted from the following embodiments.
[0027] The image optimization processing method includes:
[0028] Step S10: Obtain a preset image to be processed, and determine the optimal target in the preset image to be processed;
[0029] In this embodiment, it should be noted that the preset image to be processed can be obtained by taking a picture using the terminal's camera function or by extracting it from the terminal's stored database. The optimal target refers to the target with optimal target features in the preset image to be processed. The optimal target features are pre-input target features, and the optimal targets include targets such as faces, lakes, and mountains. For example, assuming that the optimal target features include square faces, double eyelids, and thin lips, then selected targets including these optimal target features are matched in the preset image to obtain selected targets. If the selected targets include multiple targets, then the multiple targets are filtered through deeper target features included in the optimal target features until the optimal target is obtained. The deeper target features include the specific coordinates of the eyes on the face, the specific coordinates of the lips on the face, etc.
[0030] Specifically, a preset image to be processed and a preset optimal target feature are obtained, and a selected target is found in the preset image to be processed using the preset optimal target feature. If the selected target includes multiple targets, deep target features are obtained, and the selected target is further filtered to obtain a single selected target, that is, the optimal target in the preset image to be processed is determined.
[0031] The step of obtaining a preset image to be processed and determining the optimal target in the preset image to be processed includes:
[0032] Step S11: Obtain a preset image to be processed, and extract features from the candidate targets in the preset image to obtain candidate target features;
[0033] In this embodiment, it should be noted that the candidate target refers to a target of the same type as the optimal target in the preset image to be processed, and the candidate target includes the optimal target.
[0034] Specifically, a preset image to be processed is acquired and input into a preset feature extractor to select suspected targets in the preset image to obtain candidate targets. That is, candidate targets in the preset image are identified, and then features are extracted from the candidate targets to obtain candidate target features. It should be noted that the preset feature extractor is a pre-trained model, and the preset feature extractor is related to the type of the optimal target. For example, if the type of the optimal target is a face, then the preset feature extractor is a face feature extractor; if the optimal target is a stone, then the preset feature extractor is a stone feature extractor.
[0035] Step S12: Compare each candidate target feature with the preset optimal target feature to determine the optimal target in the preset image to be processed.
[0036] In this embodiment, it should be noted that the preset optimal target features include features such as target color features and target shape features, and the preset optimal target features are features of the optimal target that are pre-inputted, while the candidate target features are features extracted by a preset feature extractor.
[0037] Specifically, each candidate target feature is compared with the preset optimal target feature to obtain multiple similarities between each candidate target feature and the preset optimal target feature. It is then determined whether the multiple similarities are greater than a preset similarity threshold. When the similarity is greater than the preset similarity threshold, the candidate target is determined to be a candidate optimal target. If the number of candidate optimal targets is 1, the candidate optimal target is the optimal target. If the number of candidate optimal targets is multiple, the candidate optimal target with the largest similarity value is selected as the optimal target.
[0038] Step S20: Obtain the region image corresponding to the optimal target, and optimize the region image to obtain an optimized image;
[0039] In this embodiment, specifically, based on the size of the optimal target in the preset image to be processed, a corresponding image frame is matched to the size of the optimal target, and the size of the image frame is a preset multiple of the size of the optimal target. Then, the optimal target is selected using the image frame to obtain the selected area of the image frame on the preset image to be processed, that is, the area image corresponding to the optimal target is obtained. Further, the area image is optimized using a preset optimization algorithm to obtain an optimized image. The preset optimization algorithm includes algorithms such as distortion correction algorithms, sharpness adjustment algorithms, and fill light algorithms. Furthermore, combining one or more preset optimization algorithms can obtain various image optimization logics.
[0040] Furthermore, after the step of obtaining the region image corresponding to the optimal target and optimizing the region image to obtain the optimized image, the method further includes:
[0041] Step D10: Obtain the target optimal image group corresponding to the optimized image, and arrange and output the images in the target optimal image group.
[0042] In this embodiment, it should be noted that the optimized image is optimized according to a preset image optimization logic, wherein the preset image optimization logic includes at least a first image optimization logic and a second image optimization logic.
[0043] Specifically, the optimized image is replaced with the selected area in the preset image to be processed. The position and orientation of the optimized image in the preset image to be processed must match the position and orientation of the selected area. Further, a transition zone is set between the optimized image and the unreplaced area of the preset image to be processed. The unreplaced area refers to the image area in the preset image to be processed that does not belong to the selected area. A gradual transition is applied between the optimized image and the unreplaced area. Then, based on a preset gradient algorithm, the optimized image and the preset image to be processed are gradually merged to obtain images in the target optimal image group. If the optimized image is optimized using a first image optimization logic, a first target optimal image is obtained; if the optimized image is optimized using a second image optimization logic, a second target optimal image is obtained. Further, the first and second target optimal images are merged to obtain the target optimal image group. Then, as... Figure 2 The image output interface shown displays the target optimal image group in an arranged manner, with the preview interface showing the target optimal image selected by the user.
[0044] Step S30: The optimized image is fused with the preset image to be processed to obtain the target optimal image.
[0045] In this embodiment, specifically, the optimized image is replaced with the selected area in the preset image to be processed. The position and orientation of the optimized image in the preset image to be processed must be consistent with the position and orientation of the selected area. Further, a transition area is set between the optimized image and the unreplaced area of the preset image to be processed. The unreplaced area refers to an image region in the preset image to be processed that does not belong to the selected area. A gradual transition is applied between the optimized image and the unreplaced area. Then, based on a preset gradient algorithm, the optimized image and the preset image to be processed are merged to obtain the target optimal image.
[0046] The step of fusing the optimized image with the preset image to be processed to obtain the target optimal image includes:
[0047] Step S31: Replace the image region corresponding to the region image in the preset image to be processed with the optimized image;
[0048] In this embodiment, specifically, the optimized image is replaced with the selected area in the preset image to be processed, and the position of the optimized image on the preset image to be processed must be consistent with the position of the selected area.
[0049] Step S32: Gradual fusion is performed between the optimized image and the preset image to be processed, and the unreplaced areas in the preset image to be processed are adjusted based on the image features of the optimized image to obtain the target optimal image.
[0050] In this embodiment, specifically, a transition area is set between the optimized image and the unreplaced area of the preset image to be processed, and a gradual transition is performed between the optimized image and the unreplaced area. Then, based on a preset gradient algorithm, the optimized image and the preset image to be processed are fused to obtain a fused image. Then, based on the image features of the optimized image, including features such as color intensity, exposure, and resolution, the unreplaced area in the preset image to be processed is adjusted so that the image features of the unreplaced area are consistent with the image features of the optimized image, thereby obtaining the target optimal image.
[0051] This embodiment acquires a preset image to be processed, determines the optimal target within that image, acquires the corresponding region image, optimizes the region image to obtain an optimized image, and then merges the optimized image with the preset image to obtain the optimal target image. In other words, when the optimal target is at any position on the image, this embodiment determines the position of the optimal target, acquires the region image, optimizes it, and finally merges it with the preset image to obtain the optimal target image. Specifically, even when the optimal target is not at the optimal imaging position, by acquiring and optimizing the region image, an optimized image can be obtained. Merging this optimized image with the preset image optimizes the optimal target within the preset image, thus providing the user with a target optimal image that meets their preferences. Therefore, this solves the technical problem of poor optimization of the optimal target in existing technologies when taking photos.
[0052] Furthermore, referring to Figure 3 Based on the first embodiment of this application, in another embodiment of the image optimization processing method, the step of obtaining the region image corresponding to the optimal target and optimizing the region image to obtain an optimized image includes:
[0053] Step S21: Obtain the target bounding box corresponding to the optimal target and determine the geometric center of the target bounding box;
[0054] In this embodiment, specifically, the target size of the optimal target on the preset image to be processed is obtained, and a rectangular target box corresponding to the optimal target is matched based on the target size, wherein the optimal target is within the rectangular target box, and the rectangular target box is the smallest rectangular box with the smallest area determined according to the boundary points of the optimal target.
[0055] Step S22: Based on the geometric center, the target box is enlarged by a preset factor to obtain an enlarged target box;
[0056] In this embodiment, specifically, based on the geometric center, the target box is enlarged by a preset factor to obtain an enlarged target box. The geometric center of the enlarged target box is the same as the geometric center of the target box. The preset factor can be set by the user or the system default factor can be used.
[0057] Step S23: Define the optimal target using the magnified target box to obtain a region image;
[0058] In this embodiment, specifically, the optimal target is defined by the magnified target box. It is determined whether the boundary of the magnified target box exceeds the boundary of the preset image to be processed. If the boundary of the magnified target box does not exceed the boundary of the preset image to be processed, the image area defined by the magnified box is the region image. If the boundary of the magnified target box exceeds the boundary of the preset image to be processed, the magnified target box is reduced based on the geometric center until the reduced magnified target box is within the range of the preset image to be processed, and the boundary of the reduced magnified target box coincides with the boundary of the preset image to be processed. Therefore, the area defined by the reduced magnified target box is the region image.
[0059] Step S24: Obtain the actual distortion degree of the region image and compare the actual distortion degree with the preset distortion degree. When the actual distortion degree is greater than the preset distortion degree, perform distortion removal processing on the region image to obtain a distortion-removed image.
[0060] In this embodiment, it should be noted that the distortion refers to the fact that a straight line outside the principal axis in the plane of the object being photographed becomes a curve after being imaged by the optical system. The imaging error of this optical system is called distortion. The distortion includes pincushion distortion, barrel distortion, and linear distortion. The actual degree of distortion of the region image is the degree of curvature of the boundary line of the region image relative to the straight line.
[0061] Specifically, the actual distortion degree of the region image is obtained by acquiring the curvature of the boundary line of the region image relative to a straight line. Further, it is determined whether the actual distortion degree is greater than a preset distortion degree, where the preset distortion degree is a measure of whether the distortion affects the aesthetics of the image. When the actual distortion degree is greater than the preset distortion degree, the region image is subjected to distortion correction processing to obtain a distortion-corrected image. When the actual distortion degree is less than or equal to the preset distortion degree, no distortion correction processing is required for the region image.
[0062] Step S25: Adjust the distortion-reduced image using a preset image optimization algorithm to obtain an optimized image.
[0063] In this embodiment, it should be noted that the preset image optimization algorithm includes algorithms such as sharpness adjustment algorithm and fill light algorithm. Specifically, the distortion-reduced image is optimized and adjusted by the preset image optimization algorithm to achieve the best visual effect and obtain an optimized image.
[0064] The preset image optimization algorithm includes a preferred optimization algorithm and other optimization algorithms.
[0065] The step of adjusting the distortion-reduced image using a preset image optimization algorithm to obtain an optimized image includes:
[0066] Step S251: Obtain the preferred optimization algorithm for the preset image to be processed, and optimize the distortion-free image based on the preferred optimization algorithm to obtain the distortion-free image;
[0067] In this embodiment, specifically, a preferred optimization algorithm for the preset image to be processed is obtained. The preferred optimization algorithm is the optimization algorithm used when the preset image to be processed is captured. Then, the distortion-reduced image is optimized based on the preferred optimization algorithm so that the optimization effect of the preferred optimization algorithm reaches the best, and a distortion-reduced image is obtained.
[0068] Step S252: Obtain other preset optimization algorithms and further optimize the distortion-reduced image to obtain the optimized image.
[0069] In this embodiment, specifically, other preset optimization algorithms besides the preferred optimization algorithm are obtained to further optimize the distortion-reduced image to obtain the optimized image. For example, assuming the optimal target is a face, other preset optimization algorithms, such as the one for skin smoothing, brightening, and eye enlargement, are called.
[0070] The step of obtaining other preset optimization algorithms to further optimize the distortion-reduced image and obtain the optimized image includes:
[0071] Step A10: Obtain other preset optimization algorithms and determine whether the optimal target is occluded;
[0072] In this embodiment, it should be noted that the preset other optimization algorithms include algorithms such as de-occlusion algorithms and target position adjustment algorithms, and the preset other optimization algorithms are pre-set and stored in a preset terminal database. When the preset other optimization algorithms are needed, they can be called from the preset terminal database.
[0073] Specifically, the optimal target is defined to obtain the minimum rectangular target box corresponding to the optimal target. The minimum rectangular target box is determined based on the boundary of the optimal target, that is, all four sides of the minimum rectangular target box intersect with the optimal target. Further, if an occluding object intersects with the optimal target and the area of the occluding object is greater than a preset threshold in proportion to the area of the minimum rectangular target box, then the optimal target is occluded. If the occluding object does not intersect with the optimal target or the area of the occluding object is less than or equal to the preset threshold in proportion to the area of the minimum rectangular target box, then the optimal target is not occluded.
[0074] Step A20: When the optimal target is occluded, the optimal target is de-occluded to obtain a de-occluded image.
[0075] In this embodiment, it should be noted that before image optimization, the target standard features corresponding to the optimal target have been collected and stored in a preset feature database.
[0076] Specifically, when the optimal target is occluded, the target features of the optimal target are extracted, and the target standard features corresponding to the target features are matched in the preset feature database. The occluded optimal target is repaired based on the target standard features to obtain a complete optimal target image. That is, the optimal target is de-occluded to obtain a de-occluded image. When the target is not occluded, the target position of the optimal target is directly optimized.
[0077] Step A30: Optimize the target position of the de-occluded image to obtain the optimized image.
[0078] In this embodiment, it should be noted that in an image, for the same target, the closer the target is to the lens, the larger the target's outline size; the farther the target is from the lens, the smaller the target's outline size.
[0079] Specifically, the optimal target in the de-occluded image is adjusted to an optimal position, which includes a user-specified position, the center of the image, or the position closest to the lens. Further, based on the distance from the optimal target to the lens, the size of the optimal target is adjusted to the outline size corresponding to that distance. That is, the target position of the de-occluded image is optimized to obtain the optimized image. In addition, to make the optimal target more prominent, the outline size of the optimal target can also be directly adjusted, for example, by appropriately enlarging the optimal target and appropriately shrinking other targets, making the optimal target more prominent. However, after adjustment, the size of the optimal target does not correspond to the distance from the optimal target to the lens.
[0080] This embodiment obtains the target bounding box corresponding to the optimal target, determines the geometric center of the target bounding box, and then enlarges the target bounding box by a preset factor based on the geometric center to obtain an enlarged target bounding box. The optimal target is then framed using the enlarged target bounding box to obtain a region image. Further, the actual distortion degree of the region image is obtained and compared with a preset distortion degree. When the actual distortion degree is greater than the preset distortion degree, the region image undergoes distortion correction processing to obtain a distorted image. Finally, the distorted image is adjusted using a preset image optimization algorithm to obtain an optimized image. In other words, this embodiment obtains an enlarged target bounding box, uses it to frame the optimal target, obtains a region image, performs distortion correction processing on the region image, and finally optimizes the distorted image to obtain an optimized image. This embodiment achieves optimization of the optimal target at any position in an image, thus laying the foundation for solving the technical problem of poor optimization effect of the optimal target in an image during photography in the prior art.
[0081] Furthermore, referring to Figure 4 Based on the first and second embodiments of this application, in another embodiment of the image optimization processing method, the step of obtaining a preset image to be processed and determining the optimal target in the preset image to be processed includes:
[0082] Step B10: Determine whether the optimal target is the end user's face. When the optimal target is the end user's face, scan the end user's face using the preset face unlock function to obtain the preset optimal target features.
[0083] In this embodiment, it should be noted that the image optimization processing method is applied to an image optimization processing device, which includes a face unlock function. Specifically, the optimal target is determined to be the terminal user's face based on user input information, including target type, target name, etc. When the type and name of the optimal target are consistent with the type and name of the terminal user's face, the optimal target is determined to be the terminal user's face. Then, the terminal user's face is scanned using a preset face unlock function to obtain the preset optimal target features.
[0084] Step B20: When the optimal target is not the end user's face, obtain the relevant image of the optimal target, and extract multiple image features from the relevant image using a preset feature extractor;
[0085] In this embodiment, specifically, when the optimal target is not the terminal user's face, relevant images of the optimal target are extracted from the terminal's local database, and multiple image features in the relevant images are extracted by a preset feature extractor, wherein each image feature includes multiple target features corresponding to the target in the relevant images.
[0086] Step B30: Classify and filter the multiple image features to obtain the preset optimal target features.
[0087] In this embodiment, it should be noted that each of the image features includes multiple target features corresponding to the target in the relevant image.
[0088] Specifically, target features belonging to the same target among multiple target features in each image feature are grouped into multiple target feature groups. Further, the number of features in each target feature group is obtained, and the target corresponding to the highest number of features is the optimal target. The target feature set corresponding to the optimal target is the optimal feature set. The optimal target feature set includes multiple types of feature sets. For example, assuming the optimal target is a face, the optimal target feature set includes eye-type feature values, nose-type feature values, lip-type feature values, etc. Further, the optimal target feature set is filtered, that is, the range of feature values with the densest distribution of feature values among each type of feature value is obtained as the preset optimal target feature, thus obtaining the preset optimal target feature. For example, assuming the optimal target is a face, the eye-type feature is the proportion of the eye area to the eyes of the face. The eye area proportion of the optimal target is 5% to 6%, and among the eye-type feature values, 90% of the feature values are distributed with an eye area proportion between 5.4% and 5.5%. Therefore, the eye area proportion of 5.4% to 5.5% is used as the preset optimal target feature.
[0089] The step of classifying and filtering the multiple image features to obtain the preset optimal target features includes:
[0090] Step B31: Classify the multiple image features to obtain multiple feature sets, wherein the same target in each of the related images corresponds to one feature set;
[0091] In this embodiment, it should be noted that each of the related images includes multiple image features, and then the image features belonging to the same target are merged to obtain the feature set, wherein the feature set includes all image feature values of a target.
[0092] Specifically, target features belonging to the same target among the multiple target features in each of the image features are grouped together to obtain multiple feature sets.
[0093] Step B32: Obtain the number of feature values in each feature set, and determine the optimal feature set based on the number of feature values;
[0094] In this embodiment, it should be noted that all relevant images include the optimal target. Therefore, the image features corresponding to each relevant image include feature values related to the optimal target. Thus, the number of feature values corresponding to the optimal target is the largest, and the number of relevant images can ensure that the obtained optimal feature set is reliable.
[0095] Specifically, the number of features in each target feature group is obtained, and the target with the largest number of features is the optimal target, and the target feature set corresponding to the optimal target is the optimal feature set.
[0096] Step B33: Analyze the distribution of various feature values in the optimal feature set to obtain the preset optimal target feature.
[0097] In this embodiment, it should be noted that the optimal feature set includes multiple types of feature values. For example, assuming that the optimal target corresponding to the optimal feature set is a human face, the multiple types of feature values include eye feature values, eyebrow feature values, and lip feature values, etc.
[0098] Specifically, the feature value ranges of the feature quantity distribution in each type of feature value are obtained, and the feature value ranges are grouped to obtain multiple feature value range groups. Then, the feature value range group with the densest feature value distribution is obtained, that is, the preset optimal target feature is obtained. For example, assuming the optimal target is a face, the eye feature is the proportion of the eye area occupied by the glasses, and the eyebrow feature is the eyebrow curvature, wherein the eye area proportion of the optimal target is 5% to 6%, and in the eye feature set, 90% of the feature values are distributed in the feature value range of 5.4% to 5.5% for the eye area proportion, and the eyebrow curvature of the optimal target is 20 degrees to 30 degrees, and in the eyebrow feature values, 96% of the feature values are distributed in the feature value range of 22 degrees to 23 degrees for the eyebrow curvature. Therefore, the preset optimal target feature is the eye area proportion of 5.4% to 5.5% and the eyebrow curvature of 22 degrees to 23 degrees.
[0099] In this embodiment, it is first determined whether the optimal target is the end user's face. When the optimal target is the end user's face, the end user's face is scanned using a preset face unlock function to obtain the preset optimal target features. When the optimal target is not the end user's face, a related image of the optimal target is obtained, and multiple image features are extracted from the related image using a preset feature extractor. These multiple image features are then classified and filtered to obtain the preset optimal target features. In other words, this embodiment first determines whether the optimal target is the end user's face. When the optimal target is the end user's face, the preset optimal target features are obtained by scanning the end user's face. When the optimal target is not the end user's face, multiple image features are obtained by extracting related images of the optimal target, and then the preset optimal target features are obtained by classifying and filtering these multiple image features. This embodiment provides two methods for obtaining the preset optimal target features, laying the foundation for determining the optimal target in the preset image to be processed.
[0100] Reference Figure 5 , Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application.
[0101] like Figure 5As shown, the image optimization processing device may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to establish communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM or a stable, non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0102] Optionally, the image optimization processing device may also include a target user interface, a network interface, a camera, RF (Radio Frequency) circuitry, sensors, audio circuitry, a WiFi module, etc. The target user interface may include a display screen and an input unit such as a keyboard; optionally, the target user interface may also include a standard wired interface or a wireless interface. The network interface may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).
[0103] Those skilled in the art will understand that Figure 5 The image optimization processing device structure shown does not constitute a limitation on the image optimization processing device. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0104] like Figure 5 As shown, the memory 1005, as a computer storage medium, may include an operating system, a network communication module, and an image optimization processing program. The operating system is a program that manages and controls the hardware and software resources of the image optimization processing device, supporting the operation of the image optimization processing program and other software and / or programs. The network communication module is used to enable communication between the various components within the memory 1005, as well as communication with other hardware and software in the image optimization processing system.
[0105] exist Figure 5 In the image optimization processing device shown, the processor 1001 is used to execute the image optimization processing program stored in the memory 1005 and perform the following operations:
[0106] Obtain a preset image to be processed, and determine the optimal target in the preset image to be processed;
[0107] Obtain the region image corresponding to the optimal target, and optimize the region image to obtain an optimized image;
[0108] The optimized image is fused with the preset image to be processed to obtain the target optimal image.
[0109] This application embodiment also provides an image optimization processing apparatus, the image optimization processing apparatus comprising:
[0110] This application also provides an image optimization processing apparatus, which is applied to an image optimization processing device, and the image optimization processing apparatus includes:
[0111] The determination module is configured to acquire a preset image to be processed and determine the optimal target in the preset image to be processed;
[0112] The optimization processing module is configured to acquire the region image corresponding to the optimal target, and optimize the region image to obtain an optimized image;
[0113] The fusion module is configured to fuse the optimized image with the preset image to be processed to obtain the target optimal image;
[0114] The output module is configured to obtain the target optimal image group corresponding to the optimized image and arrange and output the images in the target optimal image group.
[0115] Optionally, the optimization processing module includes:
[0116] The determination submodule is configured to obtain the target bounding box corresponding to the optimal target and determine the geometric center of the target bounding box;
[0117] The magnification submodule is configured to magnify the target box by a preset factor based on the geometric center to obtain an magnified target box;
[0118] The framing submodule is configured to frame the optimal target using the magnified target box to obtain a region image;
[0119] The distortion correction submodule is used to obtain the actual distortion degree of the region image and compare the actual distortion degree with the preset distortion degree. When the actual distortion degree is greater than the preset distortion degree, the region image is subjected to distortion correction processing to obtain a distortion-corrected image.
[0120] The optimization submodule is configured to adjust the distortion-reduced image using a preset image optimization algorithm to obtain an optimized image.
[0121] Optionally, the optimization submodule includes:
[0122] The optimization unit is configured to obtain a preferred optimization algorithm for the preset image to be processed, and optimize the distortion-free image based on the preferred optimization algorithm to obtain the distortion-free image;
[0123] The re-optimization unit is configured to acquire other preset optimization algorithms and further optimize the distortion-reduced image to obtain the optimized image.
[0124] Optionally, the re-optimization unit includes:
[0125] The first judgment subunit is configured to obtain other preset optimization algorithms and determine whether the optimal target is occluded;
[0126] The occlusion removal subunit is configured to perform occlusion removal processing on the optimal target when the optimal target is occluded, and obtain an occluded image.
[0127] The second judgment subunit is configured to optimize the target position of the de-occluded image to obtain the optimized image.
[0128] Optionally, the fusion module includes:
[0129] The replacement submodule is configured to replace the region range corresponding to the region image in the preset image to be processed with the optimized image;
[0130] The gradient blending submodule is configured to perform gradient blending between the optimized image and the preset image to be processed, and to adjust the unreplaced areas in the preset image to be processed based on the image features of the optimized image to obtain the target optimal image.
[0131] Optionally, the determining module includes:
[0132] The first feature extraction submodule is configured to acquire a preset image to be processed and extract features from candidate targets in the preset image to obtain candidate target features;
[0133] The comparison submodule is configured to compare the features of each candidate target with the preset optimal target features to determine the optimal target in the preset image to be processed.
[0134] Optionally, the image optimization processing device further includes:
[0135] The second feature extraction module is configured to determine whether the optimal target is the end user's face. When the optimal target is the end user's face, the module scans the end user's face using a preset face unlock function to obtain the preset optimal target features.
[0136] The third feature extraction module is configured to acquire relevant images of the optimal target when the optimal target is not the end user's face, and extract multiple image features from the relevant images using a preset feature extractor.
[0137] The classification and filtering module is configured to classify and filter the multiple image features to obtain the preset optimal target features.
[0138] Optionally, the classification and filtering module includes:
[0139] The classification submodule is configured to classify the multiple image features to obtain multiple feature sets, wherein the same target in each of the related images corresponds to one of the feature sets;
[0140] The filtering submodule is configured to obtain the number of feature values in each feature set and determine the optimal feature set based on the number of feature values.
[0141] The analysis and determination submodule is configured to analyze the distribution of various feature values in the optimal feature set to obtain the preset optimal target feature.
[0142] The specific implementation of the image optimization processing device in this application is basically the same as the embodiments of the image optimization processing method described above, and will not be repeated here.
[0143] This application provides a readable storage medium that stores one or more programs, which can be executed by one or more processors to implement the steps of the image optimization processing method described above.
[0144] The specific implementation of the readable storage medium in this application is basically the same as the embodiments of the above-described image optimization processing method, and will not be repeated here.
[0145] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent scope of this application.
Claims
1. An image optimization processing method, wherein, The image optimization processing method includes: Obtain a preset image to be processed, and determine the optimal target in the preset image to be processed; Obtain the region image corresponding to the optimal target, and optimize the region image to obtain an optimized image; The optimized image is fused with the preset image to be processed to obtain the target optimal image; Before the steps of obtaining a preset image to be processed and determining the optimal target in the preset image to be processed, the following are included: Determine whether the optimal target is the end user's face. When the optimal target is the end user's face, scan the end user's face through a preset face unlock function to obtain the preset optimal target features. When the optimal target is not the end user's face, obtain the relevant image of the optimal target, and extract multiple image features from the relevant image using a preset feature extractor; The multiple image features are classified to obtain multiple feature sets, wherein the same target in each of the related images corresponds to one of the feature sets; Obtain the number of feature values in each of the aforementioned feature sets, and determine the optimal feature set based on the number of feature values; analyze the distribution of various feature values in the optimal feature set to obtain the preset optimal target feature; In the optimized image, the optimal target is in the optimal position, which is obtained by adjusting the optimal target through a target position adjustment algorithm. The optimal position includes a user-specified position, the center position of the image, or the position closest to the lens.
2. The image optimization processing method as described in claim 1, wherein, The steps of obtaining the region image corresponding to the optimal target and optimizing the region image to obtain an optimized image include: Obtain the target bounding box corresponding to the optimal target, and determine the geometric center of the target bounding box; Based on the geometric center, the target box is enlarged by a preset factor to obtain an enlarged target box; The optimal target is defined by the magnified target box to obtain a region image; The actual distortion degree of the region image is obtained, and the actual distortion degree is compared with the preset distortion degree. When the actual distortion degree is greater than the preset distortion degree, the region image is subjected to distortion removal processing to obtain a distortion-removed image. The distortion-reduced image is adjusted using a preset image optimization algorithm to obtain an optimized image.
3. The image optimization processing method as described in claim 2, wherein, The preset image optimization algorithm includes a preferred optimization algorithm and other optimization algorithms. The step of adjusting the distortion-reduced image using a preset image optimization algorithm to obtain an optimized image includes: A preferred optimization algorithm for the preset image to be processed is obtained, and the distortion-reduced image is optimized based on the preferred optimization algorithm to obtain a distortion-reduced image; Other preset optimization algorithms are obtained to further optimize the distortion-reduced image, resulting in the optimized image.
4. The image optimization processing method as described in claim 3, wherein, The step of obtaining other preset optimization algorithms to further optimize the distortion-reduced image and obtain the optimized image includes: Obtain other preset optimization algorithms and determine whether the optimal target is occluded; When the optimal target is occluded, the optimal target is deoccluded to obtain a deoccluded image. The target position of the de-occluded image is optimized to obtain the optimized image.
5. The image optimization processing method as described in claim 1, wherein, The step of fusing the optimized image with the preset image to be processed to obtain the target optimal image includes: Replace the optimized image with the region corresponding to the preset image to be processed; The optimized image is gradually blended with the preset image to be processed, and the unreplaced areas in the preset image to be processed are adjusted based on the image features of the optimized image to obtain the target optimal image.
6. The image optimization processing method as described in claim 1, wherein, The steps of obtaining a preset image to be processed and determining the optimal target in the preset image to be processed include: A preset image to be processed is obtained, and the candidate targets in the preset image to be processed are extracted to obtain the candidate target features; The candidate target features are compared with the preset optimal target features to determine the optimal target in the preset image to be processed.
7. An image optimization processing apparatus, wherein, The image optimization processing device is applied to the image optimization processing equipment, and the image optimization processing device includes: The determination module is used to acquire a preset image to be processed and determine the optimal target in the preset image to be processed; An optimization processing module is used to obtain the region image corresponding to the optimal target, and to optimize the region image to obtain an optimized image; The output module is used to obtain the target optimal image group corresponding to the optimized image, and to arrange and output the images in the target optimal image group. The determination module is further configured to determine whether the optimal target is the end user's face. When the optimal target is the end user's face, the end user's face is scanned using a preset face unlock function to obtain preset optimal target features. When the optimal target is not the end user's face, related images of the optimal target are acquired, and multiple image features are extracted from the related images using a preset feature extractor. The multiple image features are classified to obtain multiple feature sets, wherein the same target in each of the related images corresponds to one feature set. The number of feature values in each feature set is obtained, and the optimal feature set is determined based on the number of feature values. The distribution of various feature values in the optimal feature set is analyzed to obtain the preset optimal target features. In the optimized image, the optimal target is in the optimal position, which is obtained by adjusting the optimal target through a target position adjustment algorithm. The optimal position includes a user-specified position, the center position of the image, or the position closest to the lens.
8. The image optimization processing apparatus as described in claim 7, wherein, The optimization processing module includes: The determination submodule is configured to obtain the target bounding box corresponding to the optimal target and determine the geometric center of the target bounding box; The magnification submodule is configured to magnify the target box by a preset factor based on the geometric center to obtain an magnified target box; The framing submodule is configured to frame the optimal target using the magnified target box to obtain a region image; The distortion correction submodule is used to obtain the actual distortion degree of the region image and compare the actual distortion degree with the preset distortion degree. When the actual distortion degree is greater than the preset distortion degree, the region image is subjected to distortion correction processing to obtain a distortion-corrected image. The optimization submodule is configured to adjust the distortion-reduced image using a preset image optimization algorithm to obtain an optimized image.
9. An image optimization processing device, wherein, The image optimization processing device includes a memory, a processor, and an image optimization processing program stored in the memory and executable on the processor. When the image optimization processing program is executed by the processor, it performs the following steps: Obtain a preset image to be processed, and determine the optimal target in the preset image to be processed; Obtain the region image corresponding to the optimal target, and optimize the region image to obtain an optimized image; The optimized image is fused with the preset image to be processed to obtain the target optimal image; Before the steps of obtaining a preset image to be processed and determining the optimal target in the preset image to be processed, the following are included: Determine whether the optimal target is the end user's face. When the optimal target is the end user's face, scan the end user's face through a preset face unlock function to obtain the preset optimal target features. When the optimal target is not the end user's face, obtain the relevant image of the optimal target, and extract multiple image features from the relevant image using a preset feature extractor; The multiple image features are classified to obtain multiple feature sets, wherein the same target in each of the related images corresponds to one of the feature sets; Obtain the number of feature values in each of the aforementioned feature sets, and determine the optimal feature set based on the number of feature values; analyze the distribution of various feature values in the optimal feature set to obtain the preset optimal target feature; In the optimized image, the optimal target is in the optimal position, which is obtained by adjusting the optimal target through a target position adjustment algorithm. The optimal position includes a user-specified position, the center position of the image, or the position closest to the lens.
10. The image optimization processing device as described in claim 9, wherein, The step of fusing the optimized image with the preset image to be processed to obtain the target optimal image includes: Replace the optimized image with the region corresponding to the preset image to be processed; The optimized image is gradually blended with the preset image to be processed, and the unreplaced areas in the preset image to be processed are adjusted based on the image features of the optimized image to obtain the target optimal image.
11. The image optimization processing device as described in claim 9, wherein, The steps of obtaining a preset image to be processed and determining the optimal target in the preset image to be processed include: A preset image to be processed is obtained, and the candidate targets in the preset image to be processed are extracted to obtain the candidate target features; The candidate target features are compared with the preset optimal target features to determine the optimal target in the preset image to be processed.
12. A readable storage medium, wherein, The readable storage medium stores a program that implements the image optimization processing method, which is executed by a processor to implement the steps of the image optimization processing method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method for correcting face distortion and terminal
CN104994281A
Image processing method and device
CN106204435A