Image processing method, device, equipment and storage medium

By obtaining image feature information and matching the material during special effects shooting, the problem of mismatch between the material and the original image is solved, and the quality of the special effects image is improved.

CN115131877BActive Publication Date: 2025-09-30BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210837560.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-15
Publication Date
2025-09-30
Estimated Expiration
2042-07-15

AI Technical Summary

Technical Problem

When adding special effects to videos using existing technologies, the superimposed material does not match the original image, resulting in poor quality of the special effects image.

Method used

In response to a special effects shooting trigger condition, the original image is acquired and image feature information is extracted, and the target material is matched according to the feature information to perform processing and generate a special effects image.

Benefits of technology

The matching and fit between the target material and the original image are improved, and the overall effect of the special effects image is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115131877B_ABST
    Figure CN115131877B_ABST
Patent Text Reader

Abstract

The disclosed embodiments relate to an image processing method, apparatus, device, and storage medium, wherein the image processing method includes: in response to a target object satisfying a preset special effects shooting trigger condition, obtaining an original image shot of the target object; obtaining image feature information corresponding to the target object based on the original image, wherein the image feature information represents at least one feature of the target object in the original image, including brightness, hue, contrast, and saturation; determining a target material that matches the target object based on the image feature information; and processing the target material and the target object to generate a special effects image. Because the disclosed embodiments can match the material to the target object based on the image feature information when determining the target material, the target material has a higher degree of match and fit with the original image, thereby making the overall effect of the special effects image generated after processing the target material and the target object better, thereby making the special effects higher in quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to an image processing method, apparatus, device, and storage medium. Background Art

[0002] With the development of computer technology and image processing technology, adding special effects to images when taking images with electronic devices has become increasingly popular.

[0003] Currently, special effects are added to videos by overlaying user-selected footage onto the original image during video capture, resulting in a special effects image. However, this method can cause the overlaid footage to mismatch with the original image, resulting in poor quality of the special effects image. Summary of the Invention

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present disclosure provide an image processing method, apparatus, device and storage medium.

[0005] A first aspect of the present disclosure provides an image processing method, the method comprising:

[0006] In response to the target object meeting a preset special effects shooting trigger condition, acquiring an original image shot of the target object;

[0007] Acquiring image feature information corresponding to the target object based on the original image, wherein the image feature information represents at least one feature of the target object in the original image: brightness, hue, contrast, and saturation; and determining a target material matching the target object based on the image feature information;

[0008] Process the target material and target object to generate special effect images.

[0009] A second aspect of the present disclosure provides an image processing apparatus, the apparatus comprising:

[0010] A first acquisition module is configured to acquire an original image captured of the target object in response to the target object satisfying a preset special effects shooting trigger condition;

[0011] A first determination module is configured to obtain image feature information corresponding to a target object based on an original image, wherein the image feature information represents at least one feature of the target object in the original image: brightness, hue, contrast, and saturation; and determine a target material matching the target object based on the image feature information.

[0012] The generation module is used to process the target material and the target object to generate a special effect image.

[0013] A third aspect of an embodiment of the present disclosure provides an electronic device, the server comprising: a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the method of the first aspect above.

[0014] A fourth aspect of an embodiment of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of the first aspect described above can be implemented.

[0015] In a fifth aspect, the present disclosure provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the method of the first aspect is implemented.

[0016] The technical solution provided by the embodiments of the present disclosure has the following advantages over the prior art:

[0017] The disclosed embodiment can obtain an original image captured of the target object in response to the target object satisfying a preset special effects shooting trigger condition, and obtain image feature information corresponding to the target object based on the original image, wherein the image feature information represents at least one feature of the target object in the original image, including brightness, hue, contrast, and saturation. The target material that matches the target object is determined based on the image feature information, and the target material and the target object are processed to generate a special effects image. Through the above technical solution, when determining the target material, the material can be matched to the target object based on the image feature information, so that the target material and the original image have a higher degree of matching and fit, thereby making the overall effect of the special effects image generated after processing the target material and the target object better, thereby making the special effects quality higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0019] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0020] Figure 1 is a flowchart of an image processing method provided by an embodiment of the present disclosure;

[0021] Figure 2 is a flowchart of another image processing method provided by an embodiment of the present disclosure;

[0022] Figure 3 is a schematic diagram of an original image provided by an embodiment of the present disclosure;

[0023] Figure 4 is a schematic diagram of a first image provided by an embodiment of the present disclosure;

[0024] Figure 5 is a schematic diagram of a second image provided by an embodiment of the present disclosure;

[0025] Figure 6 is a schematic diagram of dividing a second image into 3×3 sub-regions provided by an embodiment of the present disclosure;

[0026] Figure 7 is a schematic diagram of a candidate point position provided by an embodiment of the present disclosure;

[0027] Figure 8 is a flowchart of another image processing method provided by an embodiment of the present disclosure;

[0028] Figure 9 is a structural diagram of an image processing device provided by an embodiment of the present disclosure;

[0029] Figure 10 It is a structural diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.

[0031] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0032] Figure 1 This is a flow chart of an image processing method provided by an embodiment of the present disclosure, which can be executed by an electronic device. The electronic device can be exemplarily understood as a device with a page display function such as a mobile phone, tablet computer, laptop computer, desktop computer, smart TV, etc. Figure 1 As shown, the method provided in this embodiment includes the following steps:

[0033] S110 : In response to a target object satisfying a preset special effects shooting trigger condition, obtaining an original image shot of the target object.

[0034] Specifically, the target object can be any object to which special effects are to be added, such as the sky, the earth, flowers, animals, etc., but is not limited thereto.

[0035] Specifically, the original image is an image containing the target object before adding special effects.

[0036] In some embodiments, responding to the target object satisfying a preset special effects shooting trigger condition may include: detecting whether there is a preset trigger action in the shooting picture, and if there is a trigger action, responding to the target object satisfying the preset special effects shooting trigger condition.

[0037] Specifically, the specific actions of the preset triggering actions can be set in different ways.

[0038] In one example, the preset trigger action may include a preset gesture, i.e., the shape of the user's hand. The preset gesture may include, but is not limited to, a fist, a palm, or the shape of the positional relationship between the fingers of the hand.

[0039] Accordingly, after identifying the user's hand from the captured image, image analysis can be performed on the image content corresponding to the user's hand to determine the user's gesture. If the user's gesture matches the preset gesture, the preset special effects shooting trigger condition is met in response to the target object.

[0040] In another example, the preset trigger action may include a preset gesture action, that is, a hand movement of the user's hand. The preset gesture action may include, for example, snapping fingers, flicking fingers, waving hands, etc., but is not limited thereto.

[0041] Accordingly, after identifying the user's hand from the captured image, the hand shape and hand feature changes can be analyzed to determine the user's gesture. If the user's gesture matches the preset gesture, the preset special effects shooting trigger conditions are met in response to the target object.

[0042] In another example, the preset trigger action may include a preset hand motion trajectory, i.e., the motion trajectory of the user's hand. The preset hand motion trajectory may include, for example, one or a combination of at least two of the following: motion from top to bottom, motion from bottom to top, motion from left to right, motion from right to left, motion from lower left to upper right, motion from upper right to lower left, motion from upper left to lower right, and motion from lower right to upper left, but is not limited thereto. Here, up, down, left, and right may refer to positions relative to the current captured image.

[0043] Accordingly, after identifying the user's hand from the captured image, the identified hand can be tracked to determine the user's hand movement trajectory. If the user's hand movement trajectory matches the preset hand movement trajectory, the preset special effects shooting trigger condition is met in response to the target object.

[0044] In other embodiments, responding to the target object satisfying a preset special effects shooting trigger condition may include: detecting whether a special effects shooting control is turned on, and if the special effects shooting control is turned on, responding to the target object satisfying the preset special effects shooting trigger condition.

[0045] Specifically, the specific method of opening the special effects shooting control can be set in different ways, such as by touch, mouse, keyboard, voice command, etc., but is not limited thereto.

[0046] In some further embodiments, in response to the target object satisfying a preset special effects shooting trigger condition, it may include: detecting whether the captured scene characteristics satisfy the preset special effects shooting characteristics; if the special effects shooting characteristics are satisfied, responding to the target object satisfying the preset special effects shooting trigger condition.

[0047] Specifically, the specific content of the scene features can be set in different ways.

[0048] In one example, a scene feature may include a geographic location of the shooting, i.e., the geographic location of the user when the shooting is performed. A preset special effect shooting feature may include a preset geographic location. The number of preset geographic locations may include one or more, without limitation. The geographic location here may refer to latitude and longitude, a specific location, etc.

[0049] Accordingly, landmark objects, such as buildings and road traffic signs, can be identified from the captured image, and the user's geographical location where the image was taken can be determined based on the location of the landmark objects. If the geographical location of the image matches one of the preset geographical locations, the preset special effects shooting trigger condition is triggered in response to the target object.

[0050] In another example, the scene feature may include a shooting time, that is, the moment when the shooting picture is shot, and the preset special effect shooting feature may include a preset time period.

[0051] Accordingly, the system time when the shooting picture is taken can be determined as the shooting time, or the shooting time can be determined by analyzing the attribute information of the shooting picture. If the shooting time is within the preset time period, it is in response to the target object meeting the preset special effect shooting trigger condition.

[0052] In some embodiments, acquiring the original image captured of the target object may include: capturing the target object to acquire the original image.

[0053] In other embodiments, acquiring the original image captured of the target object may include: reading the original image captured of the target object from a storage device.

[0054] S120. Obtain image feature information corresponding to the target object based on the original image, wherein the image feature information represents at least one feature of the target object in the original image: brightness, hue, contrast, and saturation; and determine a target material that matches the target object based on the image feature information.

[0055] Specifically, after the target object is identified from the original image, image analysis is performed on the image content corresponding to the target object to determine the image feature information of the target object.

[0056] In some embodiments, obtaining image feature information corresponding to the target object may include: identifying the target object from the original image; and obtaining the image feature information corresponding to the target object based on the value of each pixel on the target object.

[0057] Specifically, the target material is a material determined based on image feature information, and the material may include any possible elements such as a background image and a texture image.

[0058] In some embodiments, determining the target material that matches the target object based on image feature information may include: obtaining the original material corresponding to the target object based on the satisfied special effects shooting trigger conditions; performing color processing on the original material based on the image feature information to generate the target material that matches the target object.

[0059] Specifically, the original material is material that has not been color-processed according to image feature information.

[0060] Specifically, there are multiple ways to set the original material corresponding to the target object.

[0061] For example, when the target object is the sky, the corresponding original materials may include meteors, clouds, raindrops, snowflakes, or hail.

[0062] For example, when the target object is the earth, the original material of the object may include grass and the like.

[0063] In one example, obtaining the original material corresponding to the target object according to the satisfied special effects shooting trigger condition may include: obtaining the screen content corresponding to the preset grabbing action from the shooting screen as the original material.

[0064] The specific actions of the preset grabbing action can be set in a variety of ways. The preset grabbing action can, for example, include a preset hand motion trajectory that is different from the preset trigger action. Accordingly, after identifying the user's hand from the captured image, the identified hand can be tracked to determine the image content captured by the user's hand during the movement, thereby obtaining the original material.

[0065] For example, when the target object is the sky, the shooting picture includes an electronic device that displays clouds in full screen. When the user's hand moves from the left side to the right side of the electronic device, the clouds displayed in the full screen of the electronic device can be captured as the original material.

[0066] In another example, acquiring the original material corresponding to the target object according to the satisfied special effects shooting triggering condition may include searching for the original material corresponding to the target object from a storage device.

[0067] Specifically, color processing of the original material based on image feature information may include processing at least one of the original material's brightness, hue, contrast, and saturation. This allows the target object's image feature information to match the target material, resulting in a high degree of conformity between the target image and the original image.

[0068] It can be understood that by setting the color processing of the original material according to the image feature information to generate the target material, the target material can be more closely matched with the target, and there is no need to pre-store the target materials corresponding to different image feature information of the target object, which is conducive to saving storage space.

[0069] In other embodiments, determining the target material matching the target object based on the image feature information may include: acquiring multiple candidate materials corresponding to the target object; and selecting a material corresponding to the image feature information from the multiple candidate materials as the target material.

[0070] Specifically, there are multiple ways to set the candidate materials corresponding to the target object.

[0071] In one example, the multiple candidate materials corresponding to the target object correspond to the same thing, but the image feature information of different candidate materials is different, for example, there is a difference in at least one feature of brightness, hue, contrast, and saturation.

[0072] For example, when the target object is the sky, the multiple candidate materials corresponding to the target object are all clouds, but different clouds have different brightness, so that when the brightness of the target object is higher, clouds with higher brightness can be selected as target materials, and when the brightness of the target object is lower, clouds with lower brightness can be selected as target materials.

[0073] In another example, the multiple candidate materials corresponding to the target object correspond to different things.

[0074] For example, when the target object is the sky, the multiple candidate materials corresponding to the target object may include the starry sky, white clouds, etc., so that when the brightness of the target object is high, it can be determined that the shooting time corresponding to the target object is daytime, and the white clouds corresponding to the daytime can be selected as the target material; when the brightness of the target object is low, it can be determined that the shooting time corresponding to the target object is nighttime, and the starry sky corresponding to the nighttime can be selected as the target material. In this way, it is possible to detect whether the shooting time corresponding to the sky is daytime or nighttime according to the brightness of the sky, so that when the shooting time is daytime, target materials matching the daytime scene can be added to the sky, and when the shooting time is nighttime, target materials matching the nighttime scene can be added to the sky, so that the added target materials have a higher matching degree and fit with the sky, reducing the risk of a sense of disharmony after adding the target materials to the sky, improving the coordination and harmony between the target materials and the sky, and thus making the overall effect after adding the target materials to the sky better.

[0075] For example, when the target object is the earth, the multiple candidate materials corresponding to the target object may include grasses of different colors, so that grasses that fit in with the color tone of the target object can be matched.

[0076] It can be understood that by selecting a target material corresponding to the image feature information from a plurality of candidate materials, the method of obtaining the target material can be made simple, fast and easy to implement.

[0077] S130: Process the target material and the target object to generate a special effect image.

[0078] Specifically, the special effect image is an image obtained by adding special effects to the original image based on the target material.

[0079] In some embodiments, processing the target material and the target object to generate the special effect image may include: replacing at least a portion of the target object with the target material to generate the special effect image.

[0080] In other embodiments, processing the target material and the target object to generate the special effect image may include: overlaying the target material on the target object to generate the special effect image.

[0081] The disclosed embodiment can obtain an original image captured of the target object in response to the target object satisfying a preset special effects shooting trigger condition, and obtain image feature information corresponding to the target object based on the original image, wherein the image feature information represents at least one feature of the target object in the original image, including brightness, hue, contrast, and saturation. The target material that matches the target object is determined based on the image feature information, and the target material and the target object are processed to generate a special effects image. Through the above technical solution, when determining the target material, the material can be matched to the target object based on the image feature information, so that the target material and the original image have a higher degree of matching and fit, thereby making the overall effect of the special effects image generated after processing the target material and the target object better, thereby making the special effects quality higher.

[0082] Figure 2 This is a flow chart of another image processing method provided by an embodiment of the present disclosure. This embodiment of the present disclosure is optimized based on the above embodiment, and the embodiment of the present disclosure can be combined with various optional solutions in one or more of the above embodiments.

[0083] like Figure 2 As shown, the image processing method may include the following steps.

[0084] S210 : In response to the target object satisfying a preset special effects shooting trigger condition, obtaining an original image shot of the target object.

[0085] Specifically, S210 is similar to S110 and will not be described again here.

[0086] S220: Determine the key point positions corresponding to the target object in the original image.

[0087] Specifically, the key point position is the position corresponding to the key point on the target object in the original image. The number of key point positions can be one or more, without limitation.

[0088] In some embodiments, S220 may include: identifying a target object from the original image, randomly or uniformly selecting key points on the target object, and obtaining positions of the selected key points.

[0089] Specifically, the target object can be identified in any possible way.

[0090] In other embodiments, S220 may include: performing image segmentation processing on the original image to obtain a first image after segmentation processing; downsampling the first image to generate a second image; sampling the second image to obtain candidate point positions, and determining whether the candidate point positions are mapped to the target area corresponding to the target object in the first image; and using the candidate point positions mapped to the target area as key point positions based on the determination result.

[0091] Specifically, the first image is an image obtained by performing image segmentation processing on the original image.

[0092] Specifically, the image segmentation process is performed on the original image, so that the target object can be separated from other objects in the original image except the target object.

[0093] The specific method of image segmentation can be performed in any possible way.

[0094] For example, Figure 3 is a schematic diagram of an original image provided by an embodiment of the present disclosure, Figure 4 is a schematic diagram of a first image provided by an embodiment of the present disclosure, wherein: Figure 3 The original images shown are copyrighted images. Figure 4 The first image shown is for Figure 3 The image obtained after image segmentation processing of the original image shown. Figure 3 and Figure 4 , the target object is the sky, and the sky and other objects can be separated after image segmentation processing on the original image.

[0095] Specifically, the second image is an image obtained by downsampling the first image.

[0096] For example, Figure 5 is a schematic diagram of a second image provided by an embodiment of the present disclosure, wherein: Figure 5 The second image shown is for Figure 4 The image obtained by downsampling the first image shown.

[0097] Specifically, the candidate point position is the position of a sampling point obtained by sampling the second image.

[0098] The specific sampling method can be performed in any possible manner, as long as the obtained candidate point positions include at least one key point position.

[0099] In some embodiments, determining whether the candidate point position is mapped to the target area corresponding to the target object in the first image may include: determining the contour point position corresponding to the contour line of the target area, and determining whether the candidate point position is mapped to the target area based on the contour point position.

[0100] If the candidate point position is mapped to the target area, the candidate point position is used as the key point position; if the candidate point position is mapped to an area outside the target area, the candidate point position is discarded.

[0101] It can be understood that by performing image segmentation processing, downsampling, sampling to obtain candidate point positions and screening out key point positions from the candidate point positions, the method of determining the key point positions can be made simple and easy to operate, which is conducive to reducing the difficulty of obtaining the key point positions.

[0102] S230. Obtain image feature information corresponding to the target object based on the values ​​of the pixel points corresponding to the key point positions, wherein the image feature information represents at least one feature of the target object in the original image: brightness, hue, contrast, and saturation.

[0103] Specifically, when the image feature information includes brightness, S230 may include calculating the average brightness value of the pixels corresponding to the key point position to obtain the image feature information corresponding to the target object. The same applies when the image feature information includes hue, contrast, or saturation, and will not be further described here.

[0104] S240: Determine a target material that matches the target object according to the image feature information.

[0105] Specifically, the relevant contents in S240 and S120 are similar and will not be repeated here.

[0106] S250: Process the target material and the target object to generate a special effect image.

[0107] Specifically, the relevant contents of S250 and S130 are similar and will not be repeated here.

[0108] In the embodiment of the present disclosure, by setting and determining the key point position corresponding to the target object in the original image, and obtaining the image feature information corresponding to the target object according to the value of the pixel point corresponding to the key point position, there is no need to traverse all the pixel points in the original image, thereby saving the time consumed in obtaining the image feature information and improving the efficiency of obtaining the image feature information, which is beneficial to improving the generation efficiency of special effect images and reducing the risk of freezes when adding special effects to the original image.

[0109] In another embodiment of the present disclosure, when the target object is determined to be the sky based on the acquired information, sampling the second image to obtain the candidate point position may include: dividing the second image into multiple sub-areas, and calculating the pixel brightness values ​​of the sub-areas; if the pixel brightness value of the sub-area is greater than a preset threshold, marking the sub-area as a first identifier; if the pixel brightness value of the sub-area is less than or equal to the threshold, marking the sub-area as a second identifier; sampling the sub-area corresponding to the first identifier according to the preset sampling position to obtain the candidate point position.

[0110] Specifically, the acquired information may include information about the target object selected by the user, and may also include object recognition information obtained after object recognition is performed on the original image, but is not limited thereto.

[0111] Specifically, there are many ways to set the specific number of sub-regions, for example, dividing the second image into 3×3 sub-regions, 4×3 sub-regions, etc., but the present invention is not limited thereto.

[0112] Specifically, the pixel brightness value of the sub-region is used to represent the brightness of the sub-region.

[0113] In some embodiments, calculating the pixel brightness value of the sub-region may include: calculating an average of the pixel brightness values ​​of each pixel in the sub-region to obtain the pixel brightness value of the sub-region.

[0114] In other embodiments, calculating the pixel brightness value of the sub-region may include: determining a maximum value among the pixel brightness values ​​of the pixels in the sub-region, and using the maximum value as the pixel brightness value of the sub-region.

[0115] Specifically, there are multiple setting values ​​for the specific value of the preset threshold, and those skilled in the art can set it according to actual conditions.

[0116] If the pixel brightness value of the sub-region is greater than a preset threshold, it indicates that the sub-region includes at least a portion of the target object.

[0117] If the pixel brightness value of the sub-region is less than or equal to the preset threshold, it indicates that at least part of the target object is not included in the sub-region.

[0118] The first identifier and the second identifier can be any possible identifiers without limitation. For example, the first identifier can be 1 and the second identifier can be 0, but the present invention is not limited thereto.

[0119] For example, Figure 6 Schematic diagram of dividing the second image into 3×3 sub-regions provided by an embodiment of the present disclosure. Figure 6 As shown, the second image is divided into 3×3 sub-regions, among which sub-region 1, sub-region 2, sub-region 3, sub-region 4, sub-region 5, sub-region 6, and sub-region 8 are all sub-regions whose pixel brightness values ​​are greater than the preset threshold value, and are marked with the first identifier 1; sub-region 7 and sub-region 9 are all sub-regions whose pixel brightness values ​​are less than or equal to the preset threshold value, and are marked with the second identifier 0.

[0120] Specifically, there are many ways to set the preset specific sampling position, as long as it is possible to sample each sub-area corresponding to the first identifier to obtain the candidate point position, and no limitation is made here.

[0121] Among the candidate point positions obtained by sampling the sub-region corresponding to the first identifier, the candidate point positions corresponding to the target object are screened out as key point positions.

[0122] For example, Figure 7 is a schematic diagram of a candidate point position provided by an embodiment of the present disclosure. Figure 7 As shown, sampling is performed in the sub-area corresponding to the first identifier according to the preset sampling position to obtain the candidate point position ( Figure 7 The candidate points are indicated by circles in the figure. The candidate point positions corresponding to each sub-region are obtained as shown in Table 1 below. The key point positions corresponding to the target object are screened from the candidate point positions in Table 1. The average brightness value of the pixel points corresponding to the key point positions is calculated to obtain the image brightness of the target object.

[0123] Table 1

[0124]

[0125]

[0126] It is understandable that by setting the sampling location according to the preset sampling position to be sampled in the sub-area corresponding to the first identifier to obtain the candidate point position, sampling can be performed in the sub-area that includes at least part of the target object, that is, sampling is performed in a targeted manner based on the rough positioning of the target object, thereby increasing the probability that the sampled candidate point position is a key point position, and the proportion of key point positions in the candidate point positions. In this way, the sampling amount can be reduced, the sampling efficiency can be improved, and the time consumed in obtaining image feature information can be further saved, thereby further improving the efficiency of obtaining image feature information. In this way, when the target object is the sky, sampling can be performed in a targeted manner based on the rough positioning of the sky, thereby reducing the sampling amount and improving the sampling efficiency, which is beneficial to saving the time consumed in obtaining the brightness of the sky image, thereby speeding up the speed of detecting whether the shooting time corresponds to daytime or nighttime, and is beneficial to improving the efficiency of special effects generation.

[0127] Figure 8 This is a flow chart of another image processing method provided by an embodiment of the present disclosure. The embodiment of the present disclosure is optimized based on the above embodiment, and the embodiment of the present disclosure can be combined with various optional solutions in one or more of the above embodiments.

[0128] like Figure 8 As shown, the image processing method may include the following steps.

[0129] S810: In response to a target object satisfying a preset special effects shooting trigger condition, an original image shot of the target object is acquired.

[0130] Specifically, S810 is similar to S110 and will not be described in detail here.

[0131] S820. Acquire image feature information corresponding to the target object based on the original image, wherein the image feature information represents at least one feature of the target object in the original image: brightness, hue, contrast, and saturation.

[0132] Specifically, S820 is similar to the relevant content in S120 and S220, and will not be repeated here.

[0133] S830: Obtain scene feature information corresponding to the target object and the corresponding confidence level.

[0134] In some embodiments, S830 may include: acquiring scene feature information corresponding to the target object, querying the association between the scene feature information and the confidence level, and acquiring the confidence level corresponding to the scene feature information corresponding to the target object.

[0135] Specifically, the association between scene feature information and confidence level can be expressed in a variety of forms, such as a preset function, a preset mapping table, a preset curve, and the like.

[0136] S840: Correct the image feature information according to the scene feature information and the corresponding confidence level to generate corrected target object feature information.

[0137] Specifically, the target object feature information is information obtained after correcting the image feature information.

[0138] Specifically, the correction described here refers to modifying the acquired image feature information, such as at least one of brightness, hue, contrast, and saturation, based on the scene feature information and the corresponding confidence level, so that the modified image feature information (i.e., the target object feature information) is closer to the image feature information of the target object actually in the original image.

[0139] In some embodiments, the scene feature information may include the shooting time, and the image feature information may include the brightness corresponding to the target object. Accordingly, the shooting time corresponding to the original image can be obtained, the correlation between the shooting time and the brightness of the reference target object can be queried, the reference target object brightness corresponding to the shooting time can be obtained, the correlation between the reference target object brightness and the confidence level can be queried, and the confidence level corresponding to the reference target object brightness can be obtained. The obtained image brightness corresponding to the target object and the reference target object brightness can be weighted and summed to generate the corrected target object brightness (i.e., target object feature information), wherein the weight corresponding to the reference target object brightness is the confidence level, and the weight of the image brightness corresponding to the target object is the difference between 1 and the confidence level.

[0140] S850: Determine a target material that matches the target object based on the corrected target object feature information.

[0141] In some embodiments, determining the target material that matches the target object based on the target object feature information may include: obtaining the original material corresponding to the target object based on the satisfied special effects shooting trigger conditions; performing color processing on the original material based on the target object feature information to generate the target material that matches the target object.

[0142] In other embodiments, determining the target material matching the target object based on the target object feature information may include: acquiring multiple candidate materials corresponding to the target object; and selecting a material corresponding to the target object feature information from the multiple candidate materials as the target material.

[0143] S860: Process the target material and the target object to generate a special effect image.

[0144] Specifically, S860 is similar to S130 and will not be described in detail here.

[0145] The disclosed embodiment, by setting a correction of the image feature information according to the scene feature information and the corresponding confidence level, generates the corrected target object feature information, and determines the target material that matches the target object according to the corrected target object feature information, can improve the problem of the matching degree between the target material and the target object affected by the large error in the image feature information, thereby obtaining a target material that is more closely aligned with the original image, and thus making the quality of the special effect image higher. In this way, when the target object is the sky, the brightness of the sky image can be corrected according to the scene feature information and the corresponding confidence level, so that the corrected sky brightness is more closely aligned with the sky brightness corresponding to the shooting time, thereby improving the accuracy of the sky brightness-based detection of whether the shooting time corresponds to daytime or nighttime, and thus matching the sky with a target material that is more closely aligned, which is beneficial to improving the quality of special effect generation.

[0146] In another embodiment of the present disclosure, when it is determined that the target object is the sky based on the acquired information, the original image is segmented to determine the sky area, and image feature information corresponding to the target object is acquired based on the sky area, including: acquiring the sky image brightness based on the original image; acquiring scene feature information and the corresponding confidence level corresponding to the target object, and correcting the image feature information based on the scene feature information and the corresponding confidence level, including: acquiring the shooting time corresponding to the original image, querying a preset first function to acquire a reference sky brightness corresponding to the shooting time; querying a preset second function to acquire a reference brightness confidence level corresponding to the reference sky brightness; and correcting the sky image brightness based on the reference sky brightness and the reference brightness confidence level to generate a corrected sky brightness.

[0147] Specifically, the specific implementation method of image segmentation processing on the original image can be found in the previous text and will not be repeated here.

[0148] Specifically, the sky image brightness is the image brightness of the sky in the original image. The specific method for obtaining the sky image brightness can be found in the previous text and will not be repeated here.

[0149] Specifically, the brightness of the sky changes continuously from day to night during a day, and the reference sky brightness is a sky brightness for reference given based on the actual sky brightness corresponding to the shooting time.

[0150] Specifically, there are multiple ways to express the preset first function.

[0151] Optionally, in the preset first function, when the shooting time is within a first preset time period, the reference sky brightness corresponding to the shooting time is a first preset value; when the shooting time is within a second preset time period, the reference sky brightness corresponding to the shooting time is a second preset value; when the shooting time is within a third preset time period, the difference between the shooting time and the first preset moment corresponding to the third preset time period is determined to obtain a first difference, the product of the first difference and a first preset multiple is determined to obtain a first product, the first product is added to the first preset offset value to obtain a first sum value, the first sum value is taken as the inverse and then the difference is made between the sum value and the first preset offset value to obtain the reference sky brightness corresponding to the shooting time; when the shooting time is within a fourth preset time period, the difference between the shooting time and the second preset moment corresponding to the fourth preset time period is determined to obtain a second difference, the product of the second difference and the second preset multiple is determined to obtain a second product, the second product is added to the second preset offset value to obtain a second sum value, the second sum value is taken as the inverse and then the difference is made between the sum value and the second preset offset value to obtain the reference sky brightness corresponding to the shooting time.

[0152] Specifically, the first preset time period is an intersection period of the day determined based on the sunset time at the beginning of the day in a year. Accordingly, the first preset value is used to represent the reference sky brightness corresponding to the daytime. The first preset value is, for example, 1.

[0153] Specifically, the second preset time period is an intersection period of the night determined based on the sunset time at the beginning of the day in a year. Accordingly, the second preset value is used to represent the reference sky brightness corresponding to the night, and the second preset value is, for example, 0.

[0154] Specifically, the third preset time period is a time period before the first preset time period in a day.

[0155] Specifically, the fourth time period is a time period after the first preset time and before the second preset time period in a day.

[0156] Specifically, the specific values ​​of the first preset time, the first preset multiple, and the first preset offset can be set according to actual circumstances and are not limited here. For example, the first preset time is the smaller of the endpoint values ​​of the third time period, the first preset multiple is one-third, and the first preset offset is 0.618, but the present invention is not limited to this.

[0157] Specifically, the specific values ​​of the second preset time, the second preset multiple, and the second preset offset can be set according to actual circumstances and are not limited here. For example, the second preset time is the smaller of the endpoint values ​​of the fourth time period, the second preset multiple is one-fifth, and the second preset offset is 0.618, but the present invention is not limited to this.

[0158] It is understandable that a year usually includes the changing of four seasons, resulting in large differences in the brightness of the sky corresponding to the same time in the early morning and evening periods for different seasons. Therefore, the sunrise and sunset times in the year can be referred to, and the reference sky brightness of the intersection period of the day is set to 1, and the reference sky brightness of the intersection period of the night is set to 0. The reference sky brightness is determined in other periods by means of an interpolation function. Based on the definition of day and night, the brightness critical value of the two falls around 0.3 after measurement, so the interpolation function is nonlinear. In this way, the reference sky brightness determined according to the shooting time can be made to better match the brightness of the actual sky, and the preset first function of the above example can make the reference sky brightness no longer limited to binary values ​​(i.e., neither 0 nor 1), but also include intermediate transition values, so that the reference sky brightness is more matched with the brightness of the actual sky corresponding to the shooting moment.

[0159] Specifically, the reference brightness confidence is used to characterize the credibility of the reference sky brightness.

[0160] Specifically, there are multiple ways to express the preset second function.

[0161] Optionally, in the preset second function, when the shooting time is within the first preset time period or the second preset time period, the reference brightness confidence level corresponding to the shooting time is 1; when the shooting time is within the third preset time period, the difference between the shooting time and the first preset moment corresponding to the third preset time period is determined to obtain a first difference, the product of the first difference and the first preset multiple is determined to obtain a first product, the product of the first product and the third preset multiple is determined to obtain a third product, the third product is subtracted from the third preset offset value to obtain a third difference, and the third difference is raised to the preset first power to obtain the reference brightness confidence level corresponding to the shooting time; when the shooting time is within the fourth preset time period, the difference between the shooting time and the second preset moment corresponding to the fourth preset time period is determined to obtain a second difference, the product of the second difference and the second preset multiple is determined to obtain a second product, the product of the second product and the fourth preset multiple is determined to obtain a fourth product, the fourth product is subtracted from the fourth preset offset value to obtain a fourth difference, and the fourth difference is raised to the preset second power to obtain the reference brightness confidence level corresponding to the shooting time.

[0162] Specifically, the specific values ​​of the third preset multiplier, the third preset offset value, and the exponent corresponding to the preset first exponentiation operation can be set according to actual circumstances and are not limited here. For example, the third preset multiplier can be 2, the third preset offset value can be 1, and the exponent corresponding to the preset first exponentiation operation can be 2, but the present invention is not limited thereto.

[0163] Specifically, the specific values ​​of the fourth preset multiplier, the fourth preset offset value, and the exponent corresponding to the preset second exponentiation operation can be set according to actual circumstances and are not limited here. For example, the fourth preset multiplier can be 2, the fourth preset offset value can be 1, and the exponent corresponding to the preset second exponentiation operation can be 2, but the present invention is not limited thereto.

[0164] It can be understood that, regardless of the season, the intersection of the daytime periods in a year corresponds to daytime, and the reference sky brightness confidence is set to 1, which has a higher reliability. Similarly, the intersection of the nighttime periods in a year corresponds to nighttime, and the reference sky brightness confidence is set to 0, which has a higher reliability. Therefore, the corresponding reference sky brightness confidence can be set higher. The reference sky brightness of other periods is inferred through the interpolation function, and the reliability is relatively low. Therefore, the corresponding reference sky brightness confidence can be set lower. In this way, the reference sky brightness confidence can be more in line with the actual situation.

[0165] In some embodiments, correcting the sky image brightness to generate corrected sky brightness may include: performing weighted summation of the sky image brightness and the reference sky brightness based on a reference sky brightness confidence level to obtain the sky brightness.

[0166] Specifically, the difference between 1 and the reference sky brightness confidence is used as the sky image brightness confidence corresponding to the sky image brightness, and the product of the sky image brightness confidence and the sky image brightness, and the product of the reference sky brightness confidence and the reference sky brightness are added to obtain the sky brightness.

[0167] It can be understood that by setting the query preset first function to obtain the reference sky brightness corresponding to the shooting time, the reference sky brightness that is more matched with the brightness of the actual sky corresponding to the shooting moment can be quickly obtained, which is conducive to the subsequent correction of the sky image brightness based on the reference sky brightness and the reference brightness confidence, so that the sky brightness obtained is more consistent with the brightness of the actual sky corresponding to the shooting moment. In addition, by correcting the sky image brightness, the problem of mismatch between the sky image brightness and the actual sky brightness caused by errors generated by the algorithm can be improved, thereby making the target material fit the original image better, thereby improving the quality of special effects.

[0168] Figure 9 FIG. 1 is a structural diagram of an image processing device provided by an embodiment of the present disclosure. The image processing device can be understood as the above-mentioned electronic device or a part of the functional modules in the above-mentioned electronic device. Figure 9 As shown, the image processing device 900 includes:

[0169] A first acquisition module 910 is configured to acquire an original image of the target object in response to the target object satisfying a preset special effects shooting trigger condition;

[0170] A first determination module 920 is configured to obtain image feature information corresponding to a target object based on the original image, wherein the image feature information represents at least one characteristic of the target object in the original image: brightness, hue, contrast, or saturation, and determine a target material matching the target object based on the image feature information;

[0171] The generation module 930 is used to process the target material and the target object to generate a special effect image.

[0172] The disclosed embodiment can obtain an original image captured of the target object in response to the target object satisfying a preset special effects shooting trigger condition, and obtain image feature information corresponding to the target object based on the original image, wherein the image feature information represents at least one feature of the target object in the original image, including brightness, hue, contrast, and saturation. The target material that matches the target object is determined based on the image feature information, and the target material and the target object are processed to generate a special effects image. Through the above technical solution, when determining the target material, the material can be matched to the target object based on the image feature information, so that the target material and the original image have a higher degree of matching and fit, thereby making the overall effect of the special effects image generated after processing the target material and the target object better, thereby making the special effects quality higher.

[0173] In another embodiment of the present disclosure, the device may further include:

[0174] A first detection module is configured to detect whether there is a preset trigger action in the shooting picture, and if there is a trigger action, responding to the target object meeting the preset special effect shooting trigger condition; or

[0175] The second detection module is used to detect whether the special effect shooting control is turned on. If the special effect shooting control is turned on, in response to the target object meeting the preset special effect shooting trigger condition; or

[0176] The third detection module is used to detect whether the characteristics of the shot scene meet the preset special effects shooting characteristics. If the special effects shooting characteristics are met, the target object meets the preset special effects shooting trigger condition.

[0177] In yet another embodiment of the present disclosure, the first determining module 920 may include:

[0178] The first determination submodule is used to determine the key point position corresponding to the target object in the original image;

[0179] The first acquisition submodule is used to acquire image feature information corresponding to the target object according to the values ​​of the pixel points corresponding to the key point positions.

[0180] In yet another embodiment of the present disclosure, the first determining submodule may include:

[0181] An image segmentation processing unit, configured to perform image segmentation processing on the original image to obtain a first image after segmentation processing;

[0182] a downsampling processing unit, configured to perform downsampling processing on the first image to generate a second image;

[0183] a sampling unit, configured to sample the second image to obtain a candidate point position, and determine whether the candidate point position is mapped into a target area corresponding to the target object in the first image;

[0184] The determination unit is used to use the candidate point positions mapped into the target area as key point positions according to the judgment result.

[0185] In another embodiment of the present disclosure, when it is determined according to the acquired information that the target object is the sky, the sampling unit may include:

[0186] a calculation subunit, configured to divide the second image into a plurality of sub-regions and calculate pixel brightness values ​​of the sub-regions;

[0187] a marking subunit, configured to mark the subregion as a first identification if the pixel brightness value of the subregion is greater than a preset threshold, and mark the subregion as a second identification if the pixel brightness value of the subregion is less than or equal to the threshold;

[0188] The acquisition subunit is configured to perform sampling in the sub-area corresponding to the first identifier according to a preset sampling position to acquire the candidate point position.

[0189] In another embodiment of the present disclosure, the device may further include:

[0190] A second acquisition module is used to acquire scene feature information corresponding to the target object and the corresponding confidence level;

[0191] A correction module, configured to correct the image feature information according to the scene feature information and the corresponding confidence level, and generate corrected target object feature information;

[0192] The generation module 930 may include: a first generation submodule, configured to determine a target material matching the target object according to the corrected target object feature information.

[0193] In another embodiment of the present disclosure, when it is determined according to the acquired information that the target object is the sky, the first determining module 920 may include:

[0194] The second acquisition submodule is used to perform image segmentation on the original image to determine the sky area, and obtain the sky image brightness based on the sky area;

[0195] Correction modules may include:

[0196] A first query submodule is configured to obtain a shooting time corresponding to the original image, and query a preset first function to obtain a reference sky brightness corresponding to the shooting time;

[0197] A second query submodule is used to query a preset second function to obtain a reference brightness confidence corresponding to the reference sky brightness;

[0198] The correction submodule is used to correct the brightness of the sky image based on the reference sky brightness and the reference brightness confidence to generate a corrected sky brightness.

[0199] In yet another embodiment of the present disclosure, the first determining module 920 may include:

[0200] A third acquisition submodule is used to acquire the original material corresponding to the target object according to the satisfied special effects shooting trigger condition;

[0201] The second generation submodule is used to perform color processing on the original material according to the image feature information to generate a target material that matches the target object.

[0202] The device provided in this embodiment can execute the method of any of the above embodiments, and its execution method and beneficial effects are similar, which will not be repeated here.

[0203] In addition to the above methods and apparatus, the embodiments of the present disclosure further provide a computer-readable storage medium storing instructions that, when executed on a terminal device, enable the terminal device to implement the method of any of the above embodiments.

[0204] The embodiments of the present disclosure further provide a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the method of any of the above embodiments is implemented.

[0205] An embodiment of the present disclosure further provides an electronic device, comprising: a memory storing a computer program; and a processor for executing the computer program. When the computer program is executed by the processor, the method of any of the above embodiments can be implemented.

[0206] For example, Figure 10 This is a schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 10 , which shows a schematic structural diagram of an electronic device 1000 suitable for implementing the embodiments of the present disclosure. The electronic device 1000 in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 10 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0207] like Figure 10As shown, the electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003. Various programs and data required for the operation of the electronic device 1000 are also stored in the RAM 1003. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0208] Typically, the following devices may be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange data. Figure 10 The electronic device 1000 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0209] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1009, or installed from the storage device 1008, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0210] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0211] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0212] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0213] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:

[0214] In response to the target object meeting a preset special effects shooting trigger condition, acquiring an original image shot of the target object;

[0215] Acquire image feature information corresponding to the target object based on the original image, and determine a target material matching the target object according to the image feature information;

[0216] Process the target material and target object to generate special effect images.

[0217] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0218] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing 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 than that marked in the accompanying drawings. For example, two boxes represented in succession 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 the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0219] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a unit does not necessarily limit the unit itself.

[0220] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0221] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0222] The embodiments of the present disclosure further provide a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of any of the above embodiments can be implemented. The execution method and beneficial effects are similar and will not be repeated here.

[0223] It should be noted that, in this document, 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 actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0224] The foregoing description is intended only to provide specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments described herein, but rather to be construed in the broadest manner consistent with the principles and novel features disclosed herein.

Claims

1. An image processing method, characterized in that: include: In response to a target object satisfying a preset special effects shooting trigger condition, acquiring an original image shot of the target object; Acquiring image feature information corresponding to the target object based on the original image, wherein the image feature information represents at least one feature of the target object in the original image, including brightness, hue, contrast, and saturation, and determining a target material matching the target object based on the image feature information; Processing the target material and the target object to generate a special effect image; The acquiring of image feature information corresponding to the target object based on the original image includes: performing image segmentation processing on the original image to acquire a first image after the segmentation processing; downsampling the first image to generate a second image; Sampling the second image to obtain candidate point positions, and determining whether the candidate point positions are mapped into a target area corresponding to the target object in the first image; According to the judgment result, the candidate point position mapped to the target area is used as the key point position; Image feature information corresponding to the target object is obtained according to the values ​​of the pixel points corresponding to the key point positions.

2. The method according to claim 1, characterized in that The step of responding to the target object satisfying a preset special effects shooting trigger condition includes: Detecting whether there is a preset trigger action in the shooting picture, and if there is the trigger action, responding to the target object meeting the preset special effect shooting trigger condition; or, detecting whether a special effects shooting control is turned on, and if the special effects shooting control is turned on, responding to the target object satisfying a preset special effects shooting trigger condition; or It is detected whether the characteristics of the shot scene meet the preset special effect shooting characteristics. If the special effect shooting characteristics are met, it is responded that the target object meets the preset special effect shooting trigger condition.

3. The method according to claim 1, characterized in that When it is determined according to the acquired information that the target object is the sky, sampling the second image to acquire the candidate point position includes: Dividing the second image into a plurality of sub-regions, and calculating pixel brightness values ​​of the sub-regions; If the pixel brightness value of the sub-region is greater than a preset threshold, the sub-region is marked as a first identification; if the pixel brightness value of the sub-region is less than or equal to the threshold, the sub-region is marked as a second identification; Sampling is performed in the sub-area corresponding to the first identifier according to a preset sampling position to obtain the candidate point position.

4. The method according to claim 1, wherein Also includes: Acquiring scene feature information corresponding to the target object and a corresponding confidence level; Correcting the image feature information according to the scene feature information and the corresponding confidence level to generate corrected target object feature information; The determining of a target material matching the target object according to the image feature information includes: A target material matching the target object is determined according to the corrected target object feature information.

5. The method according to claim 4, characterized in that When it is determined according to the acquired information that the target object is the sky, acquiring image feature information corresponding to the target object based on the original image includes: Performing image segmentation on the original image to determine a sky area, and obtaining sky image brightness based on the sky area; The acquiring scene feature information and the corresponding confidence level corresponding to the target object, and correcting the image feature information according to the scene feature information and the corresponding confidence level, includes: Obtaining a shooting time corresponding to the original image, and querying a preset first function to obtain a reference sky brightness corresponding to the shooting time; querying a preset second function to obtain a reference brightness confidence corresponding to the reference sky brightness; Based on the reference sky brightness and the reference brightness confidence, the sky image brightness is corrected to generate a corrected sky brightness.

6. The method according to any one of claims 1 to 5, characterized in that: The determining of a target material matching the target object according to the image feature information includes: Acquiring original material corresponding to the target object according to the satisfied special effects shooting trigger condition; Color processing is performed on the original material according to the image feature information to generate a target material that matches the target object.

7. An image processing device, characterized in that: include: A first acquisition module is configured to acquire an original image captured of the target object in response to the target object satisfying a preset special effects shooting trigger condition; a first determining module configured to obtain image feature information corresponding to the target object based on the original image, wherein the image feature information represents at least one feature of the target object in the original image, including brightness, hue, contrast, and saturation, and the image feature information is obtained by performing image visual feature analysis on the image content corresponding to the target object, and determine a target material matching the target object based on the image feature information; A generating module, configured to process the target material and the target object to generate a special effect image; The first determining module includes: an image segmentation processing unit, configured to perform image segmentation processing on the original image to obtain a first image after segmentation processing; a downsampling processing unit, configured to perform downsampling processing on the first image to generate a second image; a sampling unit, configured to sample the second image to obtain a candidate point position, and determine whether the candidate point position is mapped into a target area corresponding to the target object in the first image; a determination unit, configured to determine, based on a determination result, the candidate point positions mapped into the target area as key point positions; The first acquisition submodule is used to acquire image feature information corresponding to the target object according to the values ​​of the pixel points corresponding to the key point positions.

8. An electronic device, characterized in that: include: A processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program / instructions, which implement the method according to any one of claims 1 to 6 when executed by a processor.