WO2022121701A1 - Image processing method and apparatus, electronic device, and storage medium - Google Patents

Image processing method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2022121701A1
WO2022121701A1 PCT/CN2021/133246 CN2021133246W WO2022121701A1 WO 2022121701 A1 WO2022121701 A1 WO 2022121701A1 CN 2021133246 W CN2021133246 W CN 2021133246W WO 2022121701 A1 WO2022121701 A1 WO 2022121701A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
processed
similar
image processing
storage area
Prior art date
Application number
PCT/CN2021/133246
Other languages
French (fr)
Chinese (zh)
Inventor
吴佳涛
郭彦东
李亚乾
杨林
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2022121701A1 publication Critical patent/WO2022121701A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present application relates to the field of computer technology, and more particularly, to an image processing method, apparatus, electronic device, and storage medium.
  • the electronic device can perform further beautification processing, so that the visual effect of the image can be improved.
  • the present application proposes an image processing method, apparatus, electronic device and storage medium to improve the above problems.
  • the present application provides an image processing method, which is applied to an electronic device, the method comprising: acquiring an image to be processed; searching for a similar image to the image to be processed in a specified storage area based on the characteristics of the image to be processed to obtain similar images, wherein the images in the designated storage area correspond to image processing parameters; acquire image processing parameters corresponding to the similar images; and perform image processing on the to-be-processed images based on the image processing parameters.
  • the present application provides an image processing method, which is applied to a server.
  • the method includes: receiving an image to be processed sent by an electronic device; Process images with similar images to obtain similar images, wherein the images in the designated storage area correspond to image processing parameters; obtain image processing parameters corresponding to the similar images; perform processing on the to-be-processed images based on the image processing parameters Image processing to obtain a processed image; and returning the processed image to the electronic device.
  • the present application provides an image processing apparatus, which runs on an electronic device, and the apparatus includes: an image acquisition unit for acquiring an image to be processed; an image search unit for Searching for an image similar to the image to be processed in the designated storage area, and obtaining a similar image, wherein, the image in the designated storage area corresponds to an image processing parameter; a parameter obtaining unit is used to obtain the image processing corresponding to the similar image. parameters; an image processing unit configured to perform image processing on the to-be-processed image based on the image processing parameters.
  • the present application provides an image processing apparatus, running on a server, the apparatus comprising: a data communication unit for receiving an image to be processed sent by an electronic device; an image search unit for based on the image to be processed The feature of the specified storage area is to search for an image similar to the image to be processed to obtain a similar image, wherein the image in the specified storage area corresponds to an image processing parameter; a parameter acquisition unit is used to obtain the corresponding image of the similar image. the image processing parameters; the image processing unit is used to perform image processing on the to-be-processed image based on the image processing parameters to obtain the processed image; the data communication unit is also used to return the processed image to to the electronic device.
  • the present application provides an electronic device including a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the above method.
  • the present application provides a computer-readable storage medium, where a program code is stored in the computer-readable storage medium, wherein the above-mentioned method is executed when the program code is executed by a startup controller.
  • FIG. 1 shows a schematic diagram of an application scenario of an image processing method proposed by an embodiment of the present application
  • FIG. 2 shows a schematic diagram of an application scenario of an image processing method proposed by an embodiment of the present application
  • FIG. 3 shows a flowchart of an image processing method proposed by an embodiment of the present application
  • FIG. 4 shows a schematic diagram of an image being selected in an image management program according to an embodiment of the present application
  • FIG. 5 shows a schematic diagram of an editing interface in an embodiment of the present application
  • FIG. 6 shows a schematic diagram of determining similar images in an embodiment of the present application
  • FIG. 7 shows a flowchart of another image processing method proposed by an embodiment of the present application.
  • FIG. 8 shows a flowchart of interface jumping based on link information proposed by an embodiment of the present application
  • FIG. 9 shows a schematic diagram of triggering interface jumping proposed by an embodiment of the present application.
  • FIG. 10 shows a flowchart of still another image processing method proposed by an embodiment of the present application.
  • FIG. 11 shows a flowchart of obtaining a global feature and a local feature map in an embodiment of the present application
  • FIG. 12 shows a schematic diagram of obtaining a global feature in an embodiment of the present application.
  • FIG. 13 shows a schematic diagram of a feature set corresponding to a position in an initial feature map in an embodiment of the present application
  • FIG. 14 shows a schematic diagram of obtaining a local feature map in an embodiment of the present application.
  • FIG. 15 shows a schematic diagram of position correspondence in an embodiment of the present application
  • FIG. 16 shows a flowchart of an image processing method proposed by another embodiment of the present application.
  • FIG. 17 shows a structural block diagram of an image processing apparatus proposed by an embodiment of the present application.
  • FIG. 18 shows a structural block diagram of an image processing apparatus proposed by another embodiment of the present application.
  • FIG. 19 shows a structural block diagram of an image processing apparatus proposed by still another embodiment of the present application.
  • FIG. 20 shows a structural block diagram of an electronic device of the present application for executing the image processing method according to an embodiment of the present application
  • FIG. 21 is a storage unit for storing or carrying a program code for implementing the image processing method according to the embodiment of the present application according to an embodiment of the present application.
  • image processing can be performed on an image to enhance the visual effect of the image.
  • the inventor found in the research that the related image beautification processing methods still have the problems of low degree of intelligence and poor beautification efficiency.
  • the parameters to be processed are usually selected manually by the user, and because of the differences in the user's own image processing experience, the parameter selection process needs to consume a lot of Time, resulting in low processing efficiency, and does not have better intelligence.
  • the inventor proposes an image processing method, device, electronic device, and storage medium in the present application that can improve the above-mentioned problems. Describe the image similar to the image to be processed, and obtain the similar image, wherein, the image in the designated storage area corresponds to the image processing parameter, and then the similar image can also be obtained while obtaining the image processing parameter corresponding to the similar image, and then based on the similar image Perform image processing on the to-be-processed image with the image processing parameters.
  • the method of acquiring the image processing parameters of the image similar to the image to be processed can be obtained by query, so that the image processing parameters of the image similar to the image to be processed can be directly obtained based on the similarity of the image to be processed.
  • the image processing parameters of the image to be processed are used to process the image to be processed, thereby improving the degree of intelligence in the image processing process.
  • the efficiency of image processing is also improved.
  • the image processing method provided by the embodiments of the present application may be executed in electronic devices such as mobile phones and tablet computers, and may also be executed in a server.
  • the server can be a single physical server, or a server cluster or distributed system composed of multiple physical servers, and can also provide cloud services, cloud computing, cloud storage, CDN (Content Delivery Network, Content Delivery Network), And cloud servers for basic cloud computing services such as artificial intelligence platforms.
  • the image processing method provided by the embodiment of the present application is performed by an electronic device alone, or can be performed by an electronic device and a server cooperatively, or can be performed cooperatively by a server cluster or a distributed system composed of multiple physical servers.
  • the acquisition of the to-be-processed image may be completed by the client 110 in the electronic device, and
  • the subsequent search for a similar image corresponding to the to-be-processed image and an image processing unit corresponding to the similar image, and subsequent image processing on the to-be-processed image based on the image processing parameters may be performed by the server 120 .
  • the acquisition of the to-be-processed image may be performed by the server 130 alone, and the subsequent search for a similar image corresponding to the to-be-processed image and an image processing unit corresponding to the similar image, and based on the image processing parameters Image processing on the to-be-processed image may be performed by the server 140 .
  • an image processing method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
  • the image processing method provided in this embodiment may operate in various scenarios, and correspondingly, the images to be processed obtained in different scenarios are different.
  • the image processing method provided in this embodiment may be executed in an image management program (eg, a photo album).
  • an image selected by the user from the image management program may be used as an image to be processed.
  • an image a, an image b, an image c, an image d, an image e, an image f, an image g, an image h, and an image i are displayed on the image display interface 10 .
  • the image enlargement display interface 11 corresponding to the image a on the right side in FIG. 4 is triggered to be displayed.
  • the image magnification display interface 11 the image a will be enlarged and displayed, and an editing control will be displayed.
  • the editing interface 12 shown in FIG. 5 will be displayed by triggering.
  • the beautification operation control is displayed in the . If it is detected that the beautification operation control is touched, it will enter the beautification editing mode, and at the same time, the image a will be used as the image to be processed, and the subsequent image will be directly executed after the image a is used as the image to be processed. , and then realize one-click beautification of the image to be processed.
  • the manner of determining the image to be processed as shown in FIG. 4 and FIG. 5 is only an exemplary manner, and there may be other manners to trigger the determination of the image to be processed.
  • the editing interface 12 shown in FIG. 5 can also be directly triggered by long-pressing the image in the image display interface 10 .
  • entry into the corresponding beautification editing mode in the editing interface 12 can also be directly triggered by long-pressing the image in the image display interface 10 .
  • the image processing method provided in this embodiment may also be run in a network information search scenario.
  • the user can input an image, and then search for images similar to the input image.
  • the image input by the user can be used as the image to be processed.
  • S120 Search for an image similar to the image to be processed in a designated storage area based on the feature of the image to be processed, to obtain a similar image, wherein the image in the designated storage area corresponds to an image processing parameter.
  • the features of the image can be used to characterize the content of the image.
  • the content of the image to be processed can be characterized based on the feature vector.
  • the feature vector may be inputting the image to be processed into the target neural network model, and then acquiring the feature vector output by the neural network model as a feature representing the content of the image to be processed.
  • the images in the designated storage area also have their own characteristics, so in the process of determining similar images, the characteristics of the images to be processed can be compared with the characteristics of the images in the designated storage area, and then obtain to similar images.
  • the feature vector as an example, as shown in Figure 6, for the image to be processed and the image currently being compared with the object to be processed in the specified storage area, it can be input into the CNN (Convolutional Neural Networks) model respectively to obtain the respective features. vector, and then calculate the distance between the respective feature vectors of the image to be processed and the image currently being compared. If the distance is less than the distance threshold, it is determined that the image to be processed is similar to the image currently being compared with the object to be processed. , and then determined to be similar images.
  • CNN Convolutional Neural Networks
  • the similar images in the embodiments of the present application may be IND (identical ND images) similar images, or may be NIND (non-identical ND images) similar images
  • the image in the designated storage area may correspondingly store image processing parameters.
  • the image processing parameter is an image processing parameter that enables the image of the designated storage area to exhibit the current visual effect.
  • the image processing parameters corresponding to image j include the gamma value when performing gamma correction and the saturation value when performing saturation enhancement. degree enhancement parameter.
  • the acquired image processing parameters will include the gamma value corresponding to the image j for gamma correction, and the gamma value used for saturation enhancement.
  • the saturation enhancement parameter of of .
  • S140 Perform image processing on the to-be-processed image based on the image processing parameter.
  • the to-be-processed images may be processed based on the image processing parameters corresponding to the similar images.
  • the aforementioned image j is determined to be a similar image, and the image processing parameters corresponding to the image j include a gamma value for gamma correction and a saturation enhancement parameter for saturation enhancement, and then the object to be processed is processed.
  • the gamma correction will be performed on the image to be processed based on the gamma value
  • the saturation enhancement will be performed on the image to be processed based on the saturation enhancement parameter.
  • an image processing method After acquiring an image to be processed, an image similar to the image to be processed is searched in a designated storage area based on the characteristics of the image to be processed, so as to obtain a similar image, wherein, in The images in the designated storage area correspond to image processing parameters, and then the image processing parameters corresponding to the similar images can be obtained while the similar images are obtained, and then image processing is performed on the to-be-processed images based on the image processing parameters of the similar images.
  • the method of acquiring the image processing parameters of the image similar to the image to be processed can be obtained by query, so that the image processing parameters of the image similar to the image to be processed can be directly obtained based on the similarity of the image to be processed.
  • the image processing parameters of the image to be processed are used to process the image to be processed, thereby improving the degree of intelligence in the image processing process.
  • the efficiency of image processing is also improved.
  • an image processing method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
  • S220 Search for an image similar to the to-be-processed image in a designated storage area based on the feature of the to-be-processed image, to obtain a similar image, wherein the image in the designated storage area corresponds to an image processing parameter.
  • the designated storage area in this embodiment may be a local storage area of the electronic device, or may be a storage area in a server. If the storage area is a storage area in the server, the electronic device may implement S120 by sending a search instruction to the server where the storage area is located.
  • an image to be processed may be carried in the sending search instruction, and after receiving the image to be processed, the server needs to first acquire the features of the image to be processed, and then search for similar images based on the acquired features.
  • the electronic device can also obtain the feature (for example, a feature vector) of the image to be processed locally, and directly carry the feature vector in the search instruction, so that the server can directly obtain the feature of the image to be processed. vector, and then search for similar images faster.
  • the electronic device may determine, in real time, the data content carried in the search instruction according to the currently available processing resources or network resources.
  • the electronic device detects that the current remaining available processing resources meet the resource threshold condition, it will locally acquire the characteristics of the image to be processed, and send a search instruction that carries the characteristics of the image to be processed (that is, when searching for the image to be processed).
  • the instruction does not carry the image to be processed), so that the server that receives the search instruction directly searches for images similar to the image to be processed in the specified storage area according to the features in the search instruction to obtain similar images.
  • the electronic device is still stuck locally, which is caused by acquiring the feature.
  • the resource threshold condition may include that the remaining available processing resources are greater than the specified resource threshold.
  • the processing resource may be CPU availability.
  • the CPU availability rate may be 1 minus the current load rate of the CPU.
  • the load rate of the CPU can be the ratio of the CPU's currently running threads to the total supported threads.
  • the electronic device detects that the current network resource meets the specified network conditions, it can add the image to be processed to the search instruction, and then directly send the image to be processed to the server through the search instruction, so that the server can first obtain the characteristics of the image to be processed and then , and then search for images similar to the to-be-processed image in the designated storage area based on the characteristics of the to-be-processed image to obtain a similar image.
  • the current network resources can be more effectively utilized, and the effective utilization rate of the network resources can be improved.
  • the specified network conditions may include at least one of the following conditions: the Internet is currently accessed based on WIFI communication; and the network transmission rate satisfies the specified efficiency.
  • the network transmission efficiency can be understood as the number of bits of binary numbers transmitted per second.
  • detection can be triggered based on different ways.
  • the electronic device can trigger the detection of whether the resource threshold condition and the specified network condition are met at the same time. It should be noted that whether the resource threshold conditions are met and the specified network conditions need to obtain certain data for calculation, and the calculation will consume time, then trigger the detection of whether the resource threshold conditions and the specified network conditions are met at the same time. Under the following conditions, the results of the detection of the two conditions may be returned in sequence, and in this embodiment of the present application, the generation method of the search instruction may be determined based on the detection result returned first.
  • the electronic device can trigger the simultaneous detection of whether the resource threshold condition and the specified network condition are satisfied.
  • the corresponding steps when the resource threshold conditions are met, and the subsequent detection results of whether the specified network conditions are met are ignored. If the detection result for the resource threshold condition is obtained first, but it is detected that the resource threshold condition is not met, it will wait for the subsequent detection result for the specified network condition, and execute the corresponding steps according to the subsequent detection result for the specified network condition .
  • the detection result for the specified network condition is obtained first, and it is detected that the specified network condition is met, the aforementioned steps corresponding to when the specified network condition is met are performed, and the subsequent detection of whether the resource threshold condition is met is ignored. If the detection result for the specified network condition is obtained first, and it is detected that the specified network condition is not satisfied, the subsequent detection result for the resource threshold condition is waited for, and corresponding steps are performed according to the detection result for the resource threshold condition.
  • the resource threshold condition is met. If the resource threshold condition is met, the aforementioned steps corresponding to the resource threshold condition are directly executed. If the resource threshold condition is not met, then the detection is triggered The specified network conditions are met.
  • the electronic device will provide randomly acquired image processing parameters, so as to process images based on the randomly acquired image processing parameters. Parameters to process the image to be processed.
  • the randomly acquired image processing parameters may be randomly acquired from locally pre-stored image processing parameters, or may be randomly acquired from the aforementioned image processing parameters in the designated storage area.
  • the found multiple similar images may be displayed.
  • the similar images have been processed by their corresponding image processing parameters, and when the similar images are displayed, the user can perceive the visual effects processed by the corresponding image processing parameters.
  • S240 Acquire a target similar image determined from the plurality of similar images.
  • S260 Perform image processing on the to-be-processed image based on the image processing parameter corresponding to the target similar image.
  • the method further includes: acquiring a reference similar image, where the reference similar image is a similar image detected to be subjected to a specified touch operation among the plurality of similar images.
  • the preview effect of the image to be processed after image processing based on the image processing parameters corresponding to the reference similar image is displayed. If it is detected that the designated touch operation ends, the preview effect is canceled.
  • the specified touch operation may include a pressing operation whose duration satisfies the specified duration or a pressing operation whose pressing area satisfies the specified area.
  • the image in the designated storage area also corresponds to link information of the display interface; the search for the image to be processed in the designated storage area based on the characteristics of the image to be processed is related to the image to be processed.
  • Similar images after obtaining similar images, also include:
  • the link information in this embodiment may be a link address of a display interface corresponding to the similar image.
  • the aforementioned designated storage area may be the resource storage area corresponding to the image download platform or the theme download platform, then in this case, after the similar image is obtained, the similar image can also be displayed by triggering the electronic device.
  • the similar images are displayed on the display interface in the image download platform or the theme download platform, thereby facilitating traffic flow for the image download platform or the theme download platform.
  • the electronic device displays the similar image on the display interface in the image download platform or theme download platform, it can search for other types of images or themes in the image download platform or theme download platform.
  • the electronic device may jump to the display interface corresponding to the link information based on the link information in response to the user's touch operation.
  • a similar image k and a similar image m are displayed in the interface shown in FIG. 9 .
  • the menu interface 13 in the right image in FIG. 9 can be displayed.
  • the menu interface 13 includes the option of using image processing parameters and the option of jumping to the corresponding platform. If it is detected that the option of jumping to the corresponding platform is selected, the electronic device can trigger jumping to the display interface in the image download platform or the theme download platform to display the similar image k.
  • the method of obtaining image processing parameters of an image similar to the image to be processed can be obtained by querying , so that the image to be processed can be directly processed based on the image processing parameters of the image similar to the image to be processed, thereby improving the degree of intelligence in the image processing process.
  • the efficiency of image processing is also improved.
  • the preview effect of the corresponding image processing can also be triggered by triggering a designated touch operation on a plurality of similar images, which is beneficial for the user to select the image processing parameters required by himself, and further The convenience of image processing is improved.
  • an image processing method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
  • S320 Based on the global feature and the local feature map of the image to be processed, search for an image similar to the image to be processed in a designated storage area, and obtain a similar image, wherein the image in the designated storage area corresponds to image processing parameter.
  • the global feature can be understood as the feature that characterizes the image content as a whole, and correspondingly, the local feature can be understood as the feature that characterizes the image content from the part of the image.
  • the obtaining of the global feature and the local feature map includes:
  • the target neural network can be a CNN (Convolutional Neural Networks) network.
  • the target neural network in this embodiment may be a model that has been trained in other tasks, such as a classification model, a segmentation model, and the like.
  • S322 Perform global average pooling processing on the initial feature map to obtain global features.
  • global average pooling can be performed based on the following formula, which is:
  • F(i,j) represents the feature vector at position (i,j)
  • w represents the width of the initial feature map
  • h represents the height of the initial feature map.
  • the initial feature map F of size w*h*d can be processed by global average pooling to obtain global image feature G with size 1*d as global feature.
  • S323 Acquire feature sets corresponding to multiple positions in the initial feature map, where the feature sets corresponding to each position include features of each position and features of adjacent positions of each position.
  • the plurality of locations may be each location in the initial feature map.
  • the initial feature map may correspond to a channel dimension
  • the information of each position (i, j) includes the color information of each channel.
  • the initial feature map 20 shown in FIG. 13 is exemplarily shown as position a to position i (the initial feature map 20 may also include positions other than position a to position i) other positions), wherein, for position a, adjacent positions include position b, position e and position d, for example, for position e, adjacent positions include position a, position b, position c, position f , position i, position h, position g, position d.
  • S324 Perform averaging processing on the feature sets corresponding to each of the positions to obtain local features corresponding to each of the positions.
  • S325 Obtain the local feature map based on the local features corresponding to each of the positions.
  • an initial feature map F with a size of w*h*d can be obtained, and then the position (i, j ) of the feature set, and then average the local domain of the feature set at the position (i, j) (that is, average processing), you can obtain a local feature of size 1*d, and then the size corresponding to each position is 1
  • the local feature map corresponding to the to-be-processed image of size W*H*3 can be obtained.
  • the local feature corresponding to each position can also be understood as the local feature vector of each position.
  • the local feature vector of each position can be calculated by the following formula. The formula is: :
  • F(u, v) represents the feature vector at the position (u, v)
  • M represents the number of adjacent positions corresponding to the position (u, v).
  • searching for an image similar to the to-be-processed image in a designated storage area to obtain a similar image including:
  • the corresponding global feature and the global feature of the image to be processed satisfy the first similarity condition
  • the corresponding local feature map and the local feature map of the image to be processed satisfy the second similarity condition images as similar images.
  • the global feature of the image to be processed may be used as the first global feature
  • the local feature map of the image to be processed may be used as the first local feature map.
  • the global feature of the image that is currently compared with the image to be processed in the specified storage area can be used as the second global feature
  • the local feature map of the image that is currently compared with the image to be processed in the specified storage area can be used as the second local feature. picture.
  • the distance between the first global feature and the second global feature is less than a first distance threshold, it is determined that the first global feature and the second global feature satisfy a first similarity condition.
  • the distance between the first global feature and the second global feature may be calculated based on the Euclidean distance or the cosine distance.
  • the distance between the first global feature and the second global feature can be calculated based on the following formula, where the formula is:
  • D G represents the calculated distance between the first global feature and the second global feature
  • G 1 represents the first global feature
  • G 2 represents the second global feature
  • calculating whether the first local feature map and the second local feature map satisfy the second similarity condition may include:
  • the first local feature is the local feature included in the first local feature map
  • the second local feature is the second local feature The local features included in the feature map.
  • the first local feature map is obtained by combining local features corresponding to multiple positions in the aforementioned first initial feature map.
  • the second local feature map is obtained by combining local features corresponding to multiple positions in the aforementioned second initial feature map.
  • the positions in the first initial feature map and the second initial feature map may be identified based on coordinates, and then positions with the same corresponding coordinates may be used as mutually corresponding positions.
  • the coordinates of the position (i 1 , j 1 ) of the first local feature map and the position (i 1 , j 1 ) of the second local feature map are both (i 1 , j 1 ), then the first local The position (i 1 , j 1 ) in the feature map and the position (i 1 , j 1 ) in the second local feature map are two positions whose positions correspond to each other.
  • the local features corresponding to the two positions corresponding to each other are the corresponding local features.
  • the first local feature and the second local feature corresponding to each other can be understood as the position corresponding to the first local feature, and the position corresponding to the second local feature is corresponding to each other.
  • the first initial feature map 30 and the second initial feature map 40 are shown, wherein the coordinates of the position 31 of the first initial feature map 30 are (1, 1), and the coordinates of the second initial feature map 40 are The coordinates corresponding to the position 41 are also (1, 1), because the coordinates of the position 31 in the first initial feature map 30 and the coordinates of the position 41 in the second initial feature map 40 are the same, then the position 31 and the position feature 31 is the corresponding position, and the first local feature corresponding to the position 31 and the first local feature corresponding to the position 41 are the corresponding first local feature and the second local feature.
  • the sizes of the first initial feature map and the second initial feature map are also the same. Then, for each position in the first initial feature map, there will be a corresponding position in the second initial feature map.
  • the feature distance between the first local feature and the second local feature corresponding to each other can be calculated based on the following formula, which is:
  • L 1 (i, j) represents the local feature corresponding to the position (i, j) in the first initial feature map.
  • L 2 (i, j) represents the local feature corresponding to the position (i, j) in the second initial feature map.
  • the first local feature whose corresponding feature distance is smaller than the second distance threshold is used as the target local feature.
  • the first partial corresponding to each position in the first initial feature map can be obtained by calculation
  • the feature distance corresponding to the feature may be understood as the feature distance between the first local feature and the second local feature corresponding to the position.
  • the ratio of the number of target local features to the number of local features included in the first local feature map is greater than a scale threshold, it is determined that the first local feature map and the second local feature map satisfy a second similarity condition.
  • NL represents the number of target local features
  • w represents the width of the first initial feature map
  • h is the height of the first initial feature map.
  • the R can be 0.6.
  • the product of the width of the first initial feature map and the height of the first initial feature map represents the number of positions in the first initial feature map.
  • the number of local features included in the first local feature map is the number of positions in the first initial feature map.
  • S340 Perform image processing on the to-be-processed image based on the image processing parameter.
  • the method of obtaining image processing parameters of an image similar to the image to be processed can be obtained by querying , so that the image to be processed can be directly processed based on the image processing parameters of the image similar to the image to be processed, thereby improving the degree of intelligence in the image processing process.
  • the global features and local features of the images can be combined to perform similarity detection, so that a more comprehensive detection can be performed in the process of image similarity detection, which improves the performance of the image similarity detection process. Accuracy of similarity detection.
  • an image processing method provided by an embodiment of the present application is applied to a server, and the method includes:
  • S410 Receive the to-be-processed image sent by the electronic device.
  • S420 Search for an image similar to the image to be processed in a designated storage area based on the feature of the image to be processed, to obtain a similar image, wherein the image in the designated storage area corresponds to an image processing parameter.
  • S440 Perform image processing on the to-be-processed image based on the image processing parameter to obtain a processed image.
  • an image processing method After acquiring an image to be processed, an image similar to the image to be processed is searched in a designated storage area based on the characteristics of the image to be processed, so as to obtain a similar image, wherein, in The images in the designated storage area correspond to image processing parameters, and then the image processing parameters corresponding to the similar images can be obtained while the similar images are obtained, and then image processing is performed on the to-be-processed images based on the image processing parameters of the similar images.
  • the method of acquiring the image processing parameters of the image similar to the image to be processed can be obtained by query, so that the image processing parameters of the image similar to the image to be processed can be directly obtained based on the The image processing parameters of the image to be processed are used to process the image to be processed, thereby improving the degree of intelligence in the image processing process. Moreover, because the image to be processed is directly processed based on the image processing parameters of the image similar to the image to be processed, and the user does not need to perform the processing by himself, the efficiency of image processing is also improved.
  • an image processing apparatus 500 provided by an embodiment of the present application operates on an electronic device, and the apparatus 500 includes:
  • an image acquisition unit 510 configured to acquire an image to be processed
  • the image search unit 520 is configured to search for an image similar to the image to be processed in a designated storage area based on the characteristics of the image to be processed, and obtain a similar image, wherein the image in the designated storage area corresponds to an image processing parameter .
  • the parameter obtaining unit 530 is configured to obtain image processing parameters corresponding to the similar images.
  • the image processing unit 540 is configured to perform image processing on the to-be-processed image based on the image processing parameter.
  • the parameter obtaining unit 530 is specifically configured to display a plurality of similar images found; obtain a target similar image determined from the plurality of similar images; and obtain image processing parameters corresponding to the target similar images.
  • the image processing unit 540 is specifically configured to perform image processing on the to-be-processed image based on image processing parameters corresponding to the target similar image.
  • the apparatus 500 further includes: a processing effect preview unit 550 and a flow drainage unit 560 .
  • the processing effect preview unit 550 is used to obtain a reference similar image, where the reference similar image is a similar image that is detected with a designated touch operation in the plurality of similar images; during the action of the designated touch operation, Display the preview effect of the image to be processed based on the image processing parameters corresponding to the reference similar image after image processing; if it is detected that the specified touch operation ends, cancel the display of the preview effect.
  • the images in the designated storage area also correspond to link information of the display interface
  • the traffic diversion unit 560 is configured to obtain the link information corresponding to the similar images; jump to the link information based on the link information corresponding display interface.
  • the features include global features and local feature maps
  • the image search unit 520 is specifically configured to search for images related to the to-be-processed image in the designated storage area based on the global features and local feature maps of the to-be-processed image. Similar images, get similar images.
  • the image search unit 520 is specifically configured to perform similarity comparison between the global feature of the image to be processed and the global feature of the image in the designated storage area, and compare the global feature of the image to be processed with The local feature map of the processed image and the local feature map of the image in the designated storage area are similarly compared; in the designated storage area, the corresponding global feature and the global feature of the image to be processed satisfy the first similarity condition , and an image satisfying the second similarity condition between the corresponding local feature map and the local feature map of the image to be processed is regarded as a similar image.
  • an image processing apparatus 600 provided by an embodiment of the present application operates on an electronic device, and the apparatus 600 includes:
  • the data communication unit 610 is configured to receive the to-be-processed image sent by the electronic device.
  • the image search unit 620 is configured to search for an image similar to the image to be processed in a designated storage area based on the characteristics of the image to be processed, and obtain a similar image, wherein the image in the designated storage area corresponds to an image processing parameter .
  • the parameter obtaining unit 630 is configured to obtain image processing parameters corresponding to the similar images.
  • the image processing unit 640 is configured to perform image processing on the to-be-processed image based on the image processing parameter to obtain a processed image.
  • the data communication unit 610 is further configured to return the processed image to the electronic device.
  • An image processing apparatus obtains a similar image by searching for an image similar to the to-be-processed image in a designated storage area based on the characteristics of the to-be-processed image after acquiring the to-be-processed image, wherein:
  • the images in the designated storage area correspond to image processing parameters, and then the image processing parameters corresponding to the similar images can be obtained while obtaining the similar images, and then image processing is performed on the to-be-processed images based on the image processing parameters of the similar images.
  • the method of acquiring the image processing parameters of the image similar to the image to be processed can be obtained by query, so that the image processing parameters of the image similar to the image to be processed can be directly obtained based on the The image processing parameters of the image to be processed are used to process the image to be processed, thereby improving the degree of intelligence in the image processing process. Moreover, because the image to be processed is directly processed based on the image processing parameters of the image similar to the image to be processed, and the user does not need to perform the processing by himself, the efficiency of image processing is also improved.
  • the electronic device 200 includes one or more (only one shown in the figure) a processor 102, a memory 104, and a network module 106 that are coupled to each other.
  • the memory 104 stores a program that can execute the content in the foregoing embodiments, and the processor 102 can execute the program stored in the memory 104 .
  • the processor 102 may include one or more cores for processing data.
  • the processor 102 uses various interfaces and lines to connect various parts of the entire electronic device 200, and executes by running or executing the instructions, programs, code sets or instruction sets stored in the memory 104, and calling the data stored in the memory 104.
  • the processor 102 may adopt at least one of digital signal processing (Digital Signal Processing, DSP), field-programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA).
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA programmable logic array
  • the processor 102 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), a modem, and the like.
  • CPU Central Processing Unit
  • GPU Graphics Processing Unit
  • the CPU mainly handles the operating system, user interface and application programs, etc.
  • the GPU is used for rendering and drawing of the display content
  • the modem is used to handle wireless communication. It can be understood that, the above-mentioned modem may not be integrated into the processor 102, and is implemented by a communication chip alone.
  • the memory 104 may include random access memory (Random Access Memory, RAM), or may include read-only memory (Read-Only Memory). Memory 104 may be used to store instructions, programs, codes, sets of codes, or sets of instructions.
  • the memory 104 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing the operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, and the like.
  • the memory 104 may store means for image processing.
  • the image processing apparatus may be the aforementioned apparatus 500 or the aforementioned apparatus 600 .
  • the storage data area may also store data created by the terminal 100 during use (such as phone book, audio and video data, chat record data) and the like.
  • the network module 106 is used for receiving and sending electromagnetic waves, realizing mutual conversion between electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices, for example, communicate with an audio playback device.
  • the network module 106 may include various existing circuit elements for performing these functions, eg, antennas, radio frequency transceivers, digital signal processors, encryption/decryption chips, subscriber identity module (SIM) cards, memory, etc. .
  • the network module 106 can communicate with various networks such as the Internet, an intranet, a wireless network, or communicate with other devices through a wireless network.
  • the aforementioned wireless network may include a cellular telephone network, a wireless local area network, or a metropolitan area network.
  • the network module 106 may interact with the base station for information.
  • FIG. 21 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable medium 1100 stores program codes, and the program codes can be invoked by the processor to execute the methods described in the above method embodiments.
  • the computer-readable storage medium 1100 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 1100 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 1100 has storage space for program code 1110 that performs any of the method steps in the above-described methods. These program codes can be read from or written to one or more computer program products. Program code 1110 may be compressed, for example, in a suitable form.
  • an image processing method, device, electronic device and storage medium provided by the present application, after acquiring an image to be processed, and then based on the characteristics of the to-be-processed image in a designated storage area to search for and the to-be-processed image Images with similar images are obtained to obtain similar images, wherein the images in the designated storage area correspond to image processing parameters, and then the image processing parameters corresponding to similar images can be obtained while obtaining similar images, and then the image processing parameters based on similar images can be obtained.
  • the parameter performs image processing on the to-be-processed image.
  • the method of acquiring the image processing parameters of the image similar to the image to be processed can be obtained by query, so that the image processing parameters of the image similar to the image to be processed can be directly obtained based on the The image processing parameters of the image to be processed are used to process the image to be processed, thereby improving the degree of intelligence in the image processing process. Moreover, because the image to be processed is directly processed based on the image processing parameters of the image similar to the image to be processed, and the user does not need to perform the processing by himself, the efficiency of image processing is also improved.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Disclosed in embodiments of the present application are an image processing method and apparatus, an electronic device, and a storage medium. The method comprises: acquiring an image to be processed; searching, on the basis of a feature of the image to be processed, a specified storage area for an image similar to the image to be processed to obtain a similar image, wherein images in the specified storage area have corresponding image processing parameters; acquiring an image processing parameter corresponding to the similar image; and performing, on the basis of the image processing parameter, image processing on the image to be processed. Therefore, during a process of performing image processing on an image to beautify the image, an image processing parameter of an image similar to an image to be processed may be acquired by means of querying, so that image processing can be performed on the image to be processed directly on the basis of the image processing parameter of the image similar to the image to be processed, thereby improving the degree of intelligence during an image processing process, and also improving image processing efficiency.

Description

图像处理方法、装置、电子设备以及存储介质Image processing method, device, electronic device, and storage medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请要求于2020年12月8日提交的申请号为202011446215.8的中国申请的优先权,其在此出于所有目的通过引用将其全部内容并入本文。This application claims priority to Chinese Application No. 202011446215.8 filed on December 8, 2020, which is hereby incorporated by reference in its entirety for all purposes.
技术领域technical field
本申请涉及计算机技术领域,更具体地,涉及一种图像处理方法、装置、电子设备以及存储介质。The present application relates to the field of computer technology, and more particularly, to an image processing method, apparatus, electronic device, and storage medium.
背景技术Background technique
随着图像来源的越来越多,电子设备中所能获取到的图像也越来越多,对于一些图像,电子设备可以进行进一步进行美化处理,以便可以提升图像的视觉效果。With more and more image sources, more and more images can be obtained in the electronic device. For some images, the electronic device can perform further beautification processing, so that the visual effect of the image can be improved.
发明内容SUMMARY OF THE INVENTION
鉴于上述问题,本申请提出了一种图像处理方法、装置、电子设备以及存储介质,以改善上述问题。In view of the above problems, the present application proposes an image processing method, apparatus, electronic device and storage medium to improve the above problems.
第一方面,本申请提供了一种图像处理方法,应用于电子设备,所述方法包括:获取待处理图像;基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,所述指定存储区域中的图像对应有图像处理参数;获取所述相似图像对应的图像处理参数;基于所述图像处理参数对所述待处理图像进行图像处理。In a first aspect, the present application provides an image processing method, which is applied to an electronic device, the method comprising: acquiring an image to be processed; searching for a similar image to the image to be processed in a specified storage area based on the characteristics of the image to be processed to obtain similar images, wherein the images in the designated storage area correspond to image processing parameters; acquire image processing parameters corresponding to the similar images; and perform image processing on the to-be-processed images based on the image processing parameters.
第二方面,本申请提供了一种图像处理方法,应用于服务器,所述方法包括:接收电子设备发送的待处理图像;基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,所述指定存储区域中的图像对应有图像处理参数;获取所述相似图像对应的图像处理参数;基于所述图像处理参数对所述待处理图像进行图像处理,得到处理后的图像;将所述处理后的图像返回给所述电子设备。In a second aspect, the present application provides an image processing method, which is applied to a server. The method includes: receiving an image to be processed sent by an electronic device; Process images with similar images to obtain similar images, wherein the images in the designated storage area correspond to image processing parameters; obtain image processing parameters corresponding to the similar images; perform processing on the to-be-processed images based on the image processing parameters Image processing to obtain a processed image; and returning the processed image to the electronic device.
第三方面,本申请提供了一种图像处理装置,运行于电子设备,所述装置包括:图像获取单元,用于获取待处理图像;图像查找单元,用于基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,所述指定存储区域中的图像对应有图像处理参数;参数获取单元,用于获取所述相似图像对应的图像处理参数;图像处理单元,用于基于所述图像处理参数对所述待处理图像进行图像处理。In a third aspect, the present application provides an image processing apparatus, which runs on an electronic device, and the apparatus includes: an image acquisition unit for acquiring an image to be processed; an image search unit for Searching for an image similar to the image to be processed in the designated storage area, and obtaining a similar image, wherein, the image in the designated storage area corresponds to an image processing parameter; a parameter obtaining unit is used to obtain the image processing corresponding to the similar image. parameters; an image processing unit configured to perform image processing on the to-be-processed image based on the image processing parameters.
第四方面,本申请提供了一种图像处理装置,运行于服务器,所述装置包括:数据通信单元,用于接收电子设备发送的待处理图像;图像查找单元,用于基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中, 所述指定存储区域中的图像对应有图像处理参数;参数获取单元,用于获取所述相似图像对应的图像处理参数;图像处理单元,用于基于所述图像处理参数对所述待处理图像进行图像处理,得到处理后的图像;所述数据通信单元,还用于将所述处理后的图像返回给所述电子设备。In a fourth aspect, the present application provides an image processing apparatus, running on a server, the apparatus comprising: a data communication unit for receiving an image to be processed sent by an electronic device; an image search unit for based on the image to be processed The feature of the specified storage area is to search for an image similar to the image to be processed to obtain a similar image, wherein the image in the specified storage area corresponds to an image processing parameter; a parameter acquisition unit is used to obtain the corresponding image of the similar image. the image processing parameters; the image processing unit is used to perform image processing on the to-be-processed image based on the image processing parameters to obtain the processed image; the data communication unit is also used to return the processed image to to the electronic device.
第五方面,本申请提供了一种电子设备,包括处理器以及存储器;一个或多个程序被存储在所述存储器中并被配置为由所述处理器执行以实现上述的方法。In a fifth aspect, the present application provides an electronic device including a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the above method.
第六方面,本申请提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有程序代码,其中,在所述程序代码被启动控制器运行时执行上述的方法。In a sixth aspect, the present application provides a computer-readable storage medium, where a program code is stored in the computer-readable storage medium, wherein the above-mentioned method is executed when the program code is executed by a startup controller.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained from these drawings without creative effort.
图1示出了本申请实施例提出的一种图像处理方法的应用场景的示意图;FIG. 1 shows a schematic diagram of an application scenario of an image processing method proposed by an embodiment of the present application;
图2示出了本申请实施例提出的一种图像处理方法的应用场景的示意图;FIG. 2 shows a schematic diagram of an application scenario of an image processing method proposed by an embodiment of the present application;
图3示出了本申请实施例提出的一种图像处理方法的流程图;FIG. 3 shows a flowchart of an image processing method proposed by an embodiment of the present application;
图4示出了本申请实施例的图像管理程序中图像被选中的示意图;4 shows a schematic diagram of an image being selected in an image management program according to an embodiment of the present application;
图5示出了本申请实施例中编辑界面的示意图;5 shows a schematic diagram of an editing interface in an embodiment of the present application;
图6示出了本申请实施例中一种确定相似图像的示意图;FIG. 6 shows a schematic diagram of determining similar images in an embodiment of the present application;
图7示出了本申请实施例提出的另一种图像处理方法的流程图;FIG. 7 shows a flowchart of another image processing method proposed by an embodiment of the present application;
图8示出了本申请实施例提出的一种基于链接信息进行界面跳转的流程图;FIG. 8 shows a flowchart of interface jumping based on link information proposed by an embodiment of the present application;
图9示出了本申请实施例提出的一种触发进行界面跳转的示意图;FIG. 9 shows a schematic diagram of triggering interface jumping proposed by an embodiment of the present application;
图10示出了本申请实施例提出的再一种图像处理方法的流程图;FIG. 10 shows a flowchart of still another image processing method proposed by an embodiment of the present application;
图11示出了本申请实施例中得到全局特征以及局部特征图的流程图;11 shows a flowchart of obtaining a global feature and a local feature map in an embodiment of the present application;
图12示出了本申请实施例中得到全局特征的示意图;FIG. 12 shows a schematic diagram of obtaining a global feature in an embodiment of the present application;
图13示出了本申请实施例中初始特征图中的位置对应特征集合的示意图;FIG. 13 shows a schematic diagram of a feature set corresponding to a position in an initial feature map in an embodiment of the present application;
图14示出了本申请实施例中得到局部特征图的示意图;FIG. 14 shows a schematic diagram of obtaining a local feature map in an embodiment of the present application;
图15示出了本申请实施例中位置对应的示意图;FIG. 15 shows a schematic diagram of position correspondence in an embodiment of the present application;
图16示出了本申请又一实施例提出的一种图像处理方法的流程图;FIG. 16 shows a flowchart of an image processing method proposed by another embodiment of the present application;
图17示出了本申请一实施例提出的一种图像处理装置的结构框图;FIG. 17 shows a structural block diagram of an image processing apparatus proposed by an embodiment of the present application;
图18示出了本申请另一实施例提出的一种图像处理装置的结构框图;FIG. 18 shows a structural block diagram of an image processing apparatus proposed by another embodiment of the present application;
图19示出了本申请再一实施例提出的一种图像处理装置的结构框图;FIG. 19 shows a structural block diagram of an image processing apparatus proposed by still another embodiment of the present application;
图20示出了本申请的用于执行根据本申请实施例的图像处理方法的电子设备的结构框图;FIG. 20 shows a structural block diagram of an electronic device of the present application for executing the image processing method according to an embodiment of the present application;
图21是本申请实施例的用于保存或者携带实现根据本申请实施例的图像处理方法的程序代码的存储单元。FIG. 21 is a storage unit for storing or carrying a program code for implementing the image processing method according to the embodiment of the present application according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
随着图像的增多,存在有更多的关于图像的应用。例如,可以对图像进行图像处理以提升图像的视觉效果。然而发明人在研究中发现,相关的图像美化处理方式还存在智能化程度较低,且美化效率差的问题。As the number of images increases, there are more applications for images. For example, image processing can be performed on an image to enhance the visual effect of the image. However, the inventor found in the research that the related image beautification processing methods still have the problems of low degree of intelligence and poor beautification efficiency.
具体的,在相关的图像处理过程中,通常是由用户自己手动来选择所需处理的参数,而因为用户自己在图像处理经验方面的差异,进而使得在参数的选取过程中需要消耗较多的时间,从而造成了处理效率偏低,并且也不具备较好的智能化。Specifically, in the relevant image processing process, the parameters to be processed are usually selected manually by the user, and because of the differences in the user's own image processing experience, the parameter selection process needs to consume a lot of Time, resulting in low processing efficiency, and does not have better intelligence.
因此,发明人提出了本申请中可以改善上述问题的图像处理方法、装置、电子设备以及存储介质,通过获取待处理图像后,再基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,在该指定存储区域中的图像对应有图像处理参数,继而在得到相似图像的同时还可以得到相似图像对应的图像处理参数,再基于相似图像的图像处理参数对所述待处理图像进行图像处理。Therefore, the inventor proposes an image processing method, device, electronic device, and storage medium in the present application that can improve the above-mentioned problems. Describe the image similar to the image to be processed, and obtain the similar image, wherein, the image in the designated storage area corresponds to the image processing parameter, and then the similar image can also be obtained while obtaining the image processing parameter corresponding to the similar image, and then based on the similar image Perform image processing on the to-be-processed image with the image processing parameters.
从而通过上述方式,可以使得在对图像进行图像处理以对图像进行美化的过程中,可以通过查询获取与待处理图像相似的图像的图像处理参数的方式,进而使得可以直接基于与待处理图像相似的图像的图像处理参数来对待处理图像进行图像处理,从而提升了图像处理过程中的智能化程度。并且,因为是直接基于与待处理图像相似的图像的图像处理参数来对待处理图像进行图像处理,而不用用户自己手段进行处理,也提升了进行图像处理的效率。Therefore, through the above method, in the process of performing image processing on the image to beautify the image, the method of acquiring the image processing parameters of the image similar to the image to be processed can be obtained by query, so that the image processing parameters of the image similar to the image to be processed can be directly obtained based on the similarity of the image to be processed. The image processing parameters of the image to be processed are used to process the image to be processed, thereby improving the degree of intelligence in the image processing process. Moreover, because the image to be processed is directly processed based on the image processing parameters of the image similar to the image to be processed, and the user does not need to perform the processing by himself, the efficiency of image processing is also improved.
需要说明的是,本申请实施例所提供的图像处理方法可以运行于手机、平板电脑等电子设备中,也可以运行于服务器中。其中,服务器可以是单个的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云计算、云存储、CDN(Content Delivery Network,内容分发网络)、以及人工智能平台等基础云计算服务的云服务器。It should be noted that, the image processing method provided by the embodiments of the present application may be executed in electronic devices such as mobile phones and tablet computers, and may also be executed in a server. Among them, the server can be a single physical server, or a server cluster or distributed system composed of multiple physical servers, and can also provide cloud services, cloud computing, cloud storage, CDN (Content Delivery Network, Content Delivery Network), And cloud servers for basic cloud computing services such as artificial intelligence platforms.
其中,在本申请实施例提供的图像处理方法由电子设备单独完成,也可以由电子设备与服务器协同完成,还可以由多个物理服务器构成的服务器集群或者分布式系统协同执行的情况下。可选的,如图1所示,在本申请实施例提供的图像处理方法由电子设备与服务器协同完成的情况下,其中的获取待处理图像可以由电子设备中的客户端110来完成,而后续的查找与待处理图像对应的相似图像以及相似图像对应的图像处理单元,以及后续的基于所述图像处理参数对所述待处理图像进行图像处理可以由服务器120来执行。Wherein, the image processing method provided by the embodiment of the present application is performed by an electronic device alone, or can be performed by an electronic device and a server cooperatively, or can be performed cooperatively by a server cluster or a distributed system composed of multiple physical servers. Optionally, as shown in FIG. 1 , in the case where the image processing method provided by the embodiment of the present application is completed by an electronic device and a server in cooperation, the acquisition of the to-be-processed image may be completed by the client 110 in the electronic device, and The subsequent search for a similar image corresponding to the to-be-processed image and an image processing unit corresponding to the similar image, and subsequent image processing on the to-be-processed image based on the image processing parameters may be performed by the server 120 .
而在图像处理方法中的不同步骤可以分别由不同的物理服务器执行,或者可以由基于分布式系统构建的服务器基于分布式的方式执行的情况下。例如,如图2所示,其中的获取待处理图像可以单独由服务器130来执行,而后续的查找与待处理图像对应的相似图像以及相似图像对应的图像处理单元,以及基于所述图像处理参数对所述待处理图像进行图像处理则可以由服务器140来执行。In the case where different steps in the image processing method may be executed by different physical servers respectively, or may be executed in a distributed manner by a server constructed based on a distributed system. For example, as shown in FIG. 2 , the acquisition of the to-be-processed image may be performed by the server 130 alone, and the subsequent search for a similar image corresponding to the to-be-processed image and an image processing unit corresponding to the similar image, and based on the image processing parameters Image processing on the to-be-processed image may be performed by the server 140 .
下面将结合附图具体描述本申请的各实施例。The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
请参阅图3,本申请实施例提供的一种图像处理方法,应用于电子设备,所述方法包括:Referring to FIG. 3, an image processing method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
S110:获取待处理图像。S110: Acquire an image to be processed.
其中,本实施例提供的图像处理方法可以运行在多种场景下,对应的,在不同的场景下所获取的待处理图像不同。Wherein, the image processing method provided in this embodiment may operate in various scenarios, and correspondingly, the images to be processed obtained in different scenarios are different.
可选的,本实施例提供的图像处理方法可以运行于图像管理程序(例如,相册)中,在这种场景中,可以将用户从图像管理程序中选择的图像作为待处理图像。如图4所示,在图像展示界面10中显示有图像a、图像b、图像c、图像d、图像e、图像f、图像g、图像h以及图像i。若检测到图像a被选中,则会触发显示图4中右侧的图像a对应的图像放大展示界面11。在该图像放大展示界面11中会对图像a进行放大显示,并显示有编辑控件,若检测到该编辑控件被触控,则由触发显示图5所示的编辑界面12,在该编辑界面12中显示有美化操作控件,若检测到该美化操作控件被触控,则会进入到美化编辑模式,并同时会将图像a作为待处理图像,以及在将图像a作为待处理图像后直接执行后续的步骤,进而实现一键对待处理图像进行美化。Optionally, the image processing method provided in this embodiment may be executed in an image management program (eg, a photo album). In this scenario, an image selected by the user from the image management program may be used as an image to be processed. As shown in FIG. 4 , an image a, an image b, an image c, an image d, an image e, an image f, an image g, an image h, and an image i are displayed on the image display interface 10 . If it is detected that the image a is selected, the image enlargement display interface 11 corresponding to the image a on the right side in FIG. 4 is triggered to be displayed. In the image magnification display interface 11, the image a will be enlarged and displayed, and an editing control will be displayed. If it is detected that the editing control is touched, the editing interface 12 shown in FIG. 5 will be displayed by triggering. In the editing interface 12 The beautification operation control is displayed in the . If it is detected that the beautification operation control is touched, it will enter the beautification editing mode, and at the same time, the image a will be used as the image to be processed, and the subsequent image will be directly executed after the image a is used as the image to be processed. , and then realize one-click beautification of the image to be processed.
需要说明的是,上述图4和图5所示出的确定待处理图像的方式只是一种示例性的方式,此外还可以有其他的方式来触发确定待处理图像。例如,还可以通过在图像展示界面10中对图像进行长按的方式来直接触发进入到图5所示的编辑界面12。再者,也可以通过在图像展示界面10中对图像进行长按的方式来直接触发进入到编辑界面12中对应的美化编辑模式。It should be noted that the manner of determining the image to be processed as shown in FIG. 4 and FIG. 5 is only an exemplary manner, and there may be other manners to trigger the determination of the image to be processed. For example, the editing interface 12 shown in FIG. 5 can also be directly triggered by long-pressing the image in the image display interface 10 . Furthermore, entry into the corresponding beautification editing mode in the editing interface 12 can also be directly triggered by long-pressing the image in the image display interface 10 .
除了前述的场景外,可选的,本实施例提供的图像处理方法还可以运行于网络信息搜索场景中。在这种场景中,用户可以输入一种图像,进而搜索出与该输入的图像相似的图像。对应的,可以将用户输入的图像作为待处理图像。In addition to the foregoing scenarios, optionally, the image processing method provided in this embodiment may also be run in a network information search scenario. In this scenario, the user can input an image, and then search for images similar to the input image. Correspondingly, the image input by the user can be used as the image to be processed.
S120:基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,所述指定存储区域中的图像对应有图像处理参数。S120: Search for an image similar to the image to be processed in a designated storage area based on the feature of the image to be processed, to obtain a similar image, wherein the image in the designated storage area corresponds to an image processing parameter.
其中,图像的特征可以用于表征图像在内容上具有的。在本实施例中,可以基于特征向量来表征待处理图像的内容。可选的,该特征向量可以为将待处理图像输入到目标神经网络模型中,然后获取到该神经网络模型输出的特征向量作为表征待处理图像的内容的特征。对应的,在该指定存储区域中的图像也对应有各自的特征,那么在确定相似图像的过程中,可以将待处理图像的特征与该指定存储区域中的图像的特征进行比对,进而获取到相似图像。Among them, the features of the image can be used to characterize the content of the image. In this embodiment, the content of the image to be processed can be characterized based on the feature vector. Optionally, the feature vector may be inputting the image to be processed into the target neural network model, and then acquiring the feature vector output by the neural network model as a feature representing the content of the image to be processed. Correspondingly, the images in the designated storage area also have their own characteristics, so in the process of determining similar images, the characteristics of the images to be processed can be compared with the characteristics of the images in the designated storage area, and then obtain to similar images.
以特征向量为例,如图6所示,对于待处理图像和指定存储区域中当前正在该待处理对象进行比对的图像,可以分别输入到CNN(Convolutional Neural Networks)模型中,得到各自的特征向量,然后再计算待处理图像和当前正在比对的图像各自的特征向量之间的距离,若该距离小于距离阈值,则确定待处理图像和当前正在与该待处理对象进行比对的图像相似,进而确定为相似图像。Taking the feature vector as an example, as shown in Figure 6, for the image to be processed and the image currently being compared with the object to be processed in the specified storage area, it can be input into the CNN (Convolutional Neural Networks) model respectively to obtain the respective features. vector, and then calculate the distance between the respective feature vectors of the image to be processed and the image currently being compared. If the distance is less than the distance threshold, it is determined that the image to be processed is similar to the image currently being compared with the object to be processed. , and then determined to be similar images.
可选的,本申请实施例中的相似图像可以为IND(identical ND images)相似图像,也可以为NIND(non-identical ND images)相似图像Optionally, the similar images in the embodiments of the present application may be IND (identical ND images) similar images, or may be NIND (non-identical ND images) similar images
S130:获取所述相似图像对应的图像处理参数。S130: Acquire image processing parameters corresponding to the similar images.
其中,指定存储区域的图像可以对应存储有图像处理参数。可选的,该图像处理参数为使得该指定存储区域的图像表现出当前视觉效果的图像处理参数。示例性的,若对图像j进行了饱和度增强以及还对色偏进行gamma校正,那么该图像j对应的图像处理参数就包括在进行gamma校正时的gamma值以及在进行饱和度增强时的饱和度增强参数。那么若确定指定存储区域中该图像j为与待处理图像对应的相似图像,那么所获取到的图像处理参数则会包括图像j对应的用于进行gamma校正的gamma值,以及用于饱和度增强的饱和度增强参数。The image in the designated storage area may correspondingly store image processing parameters. Optionally, the image processing parameter is an image processing parameter that enables the image of the designated storage area to exhibit the current visual effect. Exemplarily, if saturation enhancement is performed on image j and gamma correction is also performed on color cast, the image processing parameters corresponding to image j include the gamma value when performing gamma correction and the saturation value when performing saturation enhancement. degree enhancement parameter. Then, if it is determined that the image j in the specified storage area is a similar image corresponding to the image to be processed, the acquired image processing parameters will include the gamma value corresponding to the image j for gamma correction, and the gamma value used for saturation enhancement. The saturation enhancement parameter of .
S140:基于所述图像处理参数对所述待处理图像进行图像处理。S140: Perform image processing on the to-be-processed image based on the image processing parameter.
在获取到相似图像对应的图像处理参数后,则可以基于相似图像对应的图像处理参数来对待处理图像进行处理。示例性的,前述图像j被确定为相似图像,且图像j对应的图像处理参数包括用于进行gamma校正的gamma值,以及用于饱和度增强的饱和度增强参数,进而在对待处理对象进行处理时,则会基于该gamma值对待处理图像进行gamma校正,以及还会基于该饱和度增强参数对待处理图像进行饱和度增强。After the image processing parameters corresponding to the similar images are acquired, the to-be-processed images may be processed based on the image processing parameters corresponding to the similar images. Exemplarily, the aforementioned image j is determined to be a similar image, and the image processing parameters corresponding to the image j include a gamma value for gamma correction and a saturation enhancement parameter for saturation enhancement, and then the object to be processed is processed. , the gamma correction will be performed on the image to be processed based on the gamma value, and the saturation enhancement will be performed on the image to be processed based on the saturation enhancement parameter.
本实施例提供的一种图像处理方法,通过获取待处理图像后,再基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,在该指定存储区域中的图像对应有图像处理参数,继而在得到相似图像的同时还可以得到相似图像对应的图像处理参数,再基于相似图像的图像处理参数对所述待处理图像进行图像处理。In an image processing method provided by this embodiment, after acquiring an image to be processed, an image similar to the image to be processed is searched in a designated storage area based on the characteristics of the image to be processed, so as to obtain a similar image, wherein, in The images in the designated storage area correspond to image processing parameters, and then the image processing parameters corresponding to the similar images can be obtained while the similar images are obtained, and then image processing is performed on the to-be-processed images based on the image processing parameters of the similar images.
从而通过上述方式,可以使得在对图像进行图像处理以对图像进行美化的过程中,可以通过查询获取与待处理图像相似的图像的图像处理参数的方式,进而使得可以直接基于与待处理图像相似的图像的图像处理参数来对待处理图像进行图像处理,从而提升了图像处理过程中的智能化程度。并且,因为是直接基于与待处理图像相似的图像的图像处理参数来对待处理图像进行图像处理,而不用用户自己手段进行处理,也提升了进行图像处理的效率。Therefore, through the above method, in the process of performing image processing on the image to beautify the image, the method of acquiring the image processing parameters of the image similar to the image to be processed can be obtained by query, so that the image processing parameters of the image similar to the image to be processed can be directly obtained based on the similarity of the image to be processed. The image processing parameters of the image to be processed are used to process the image to be processed, thereby improving the degree of intelligence in the image processing process. Moreover, because the image to be processed is directly processed based on the image processing parameters of the image similar to the image to be processed, and the user does not need to perform the processing by himself, the efficiency of image processing is also improved.
请参阅图7,本申请实施例提供的一种图像处理方法,应用于电子设备,所述方法包括:Referring to FIG. 7 , an image processing method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
S210:获取待处理图像。S210: Acquire an image to be processed.
S220:基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,所述指定存储区域中的图像对应有图像处理参数。S220: Search for an image similar to the to-be-processed image in a designated storage area based on the feature of the to-be-processed image, to obtain a similar image, wherein the image in the designated storage area corresponds to an image processing parameter.
需要说明的是,本实施例中的指定存储区域可以为在电子设备本地的存储区域,也可以为在服务器中的存储区域。若该存储区域为在服务器中的存储区域,那么电子设备可以通过向该存储区域所在的服务器发送查找指令的方式来实现S120。可选的,在该发送查找指令中可以携带有待处理图像,那么服务器在接收到该待处理图像后,需要先获取到待处理图像的特征后,再基于获取到的特征来查找相似图像。再者,可选的,电子设备也可以在本地先获取到待处理图像的特征(例如,特征向量)后,直接在该查找指令中携带该特征向量,以便服务器可以直接得到待处理图像的特征向量,进而更快的进行相似图片的查找。It should be noted that the designated storage area in this embodiment may be a local storage area of the electronic device, or may be a storage area in a server. If the storage area is a storage area in the server, the electronic device may implement S120 by sending a search instruction to the server where the storage area is located. Optionally, an image to be processed may be carried in the sending search instruction, and after receiving the image to be processed, the server needs to first acquire the features of the image to be processed, and then search for similar images based on the acquired features. Furthermore, optionally, the electronic device can also obtain the feature (for example, a feature vector) of the image to be processed locally, and directly carry the feature vector in the search instruction, so that the server can directly obtain the feature of the image to be processed. vector, and then search for similar images faster.
可以理解的是,若电子设备在本地执行提取出待处理图片的特征过程,则会在一定程度上消耗电子设备的处理资源,而若电子设备是直接将待处理图片进行上传到指定存储区域所在的服务器,由服务器来执行特征的提取过程,则又因为需要传输图片而消耗较多的网络资源。那么在本申请实施例中,为了能够更为合理的利用当前的资源,电子设备可以实时根据当前的可用的处理资源或者网络资源来确定具体确定查找指令中携带的数据内容。It can be understood that if the electronic device locally executes the feature process of extracting the picture to be processed, the processing resources of the electronic device will be consumed to a certain extent, and if the electronic device directly uploads the picture to be processed to the designated storage area. The server performs the feature extraction process by the server, which consumes more network resources because of the need to transmit pictures. Then, in this embodiment of the present application, in order to utilize the current resources more reasonably, the electronic device may determine, in real time, the data content carried in the search instruction according to the currently available processing resources or network resources.
可选的,若电子设备检测到当前剩余可用的处理资源满足资源阈值条件,则会在本地获取待处理图像的特征,并发送携带有所述待处理图像的特征的查找指令(也就是在查找指令中不会携带有待处理图像本身),以便接收到该查找指令的服务器直接根据查找指令中的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像。从而通过这种方式,避免在可用的处理资源不满足资源阈值条件的情况下,依然在本地获取特征而造成的电子设备卡顿。Optionally, if the electronic device detects that the current remaining available processing resources meet the resource threshold condition, it will locally acquire the characteristics of the image to be processed, and send a search instruction that carries the characteristics of the image to be processed (that is, when searching for the image to be processed). The instruction does not carry the image to be processed), so that the server that receives the search instruction directly searches for images similar to the image to be processed in the specified storage area according to the features in the search instruction to obtain similar images. Thus, in this way, when the available processing resources do not meet the resource threshold condition, the electronic device is still stuck locally, which is caused by acquiring the feature.
其中,资源阈值条件可以包括剩余可用的处理资源大于指定资源阈值。处理资源可以为CPU可用率。该CPU可用率可以为1减去CPU当前的负载率。CPU的负载率可以为CPU当前正在运行的线程与总共支持的线程的比。The resource threshold condition may include that the remaining available processing resources are greater than the specified resource threshold. The processing resource may be CPU availability. The CPU availability rate may be 1 minus the current load rate of the CPU. The load rate of the CPU can be the ratio of the CPU's currently running threads to the total supported threads.
若电子设备检测到当前的网络资源满足指定网络条件,则可以将待处理图像增加到查找指令中,进而将待处理图像直接通过查找指令发送给服务器,以便服务器先获取到待处理图像的特征后,再基于待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像。从而通过这种方式,可以更为有效的利用当前的网络资源,提升网络资源的有效利用率。If the electronic device detects that the current network resource meets the specified network conditions, it can add the image to be processed to the search instruction, and then directly send the image to be processed to the server through the search instruction, so that the server can first obtain the characteristics of the image to be processed and then , and then search for images similar to the to-be-processed image in the designated storage area based on the characteristics of the to-be-processed image to obtain a similar image. In this way, the current network resources can be more effectively utilized, and the effective utilization rate of the network resources can be improved.
其中,指定网络条件可以包括以下条件中的至少一个:当前是基于WIFI通信方式接入的互联网;以及网络传输速率满足指定效率。该网络传输效率可以理解为每秒钟传输的二进制数的位数。The specified network conditions may include at least one of the following conditions: the Internet is currently accessed based on WIFI communication; and the network transmission rate satisfies the specified efficiency. The network transmission efficiency can be understood as the number of bits of binary numbers transmitted per second.
需要说明的是,对于前面两种条件(资源阈值条件以及指定网络条件)可以基于不同方式来触发进行检测。It should be noted that, for the first two conditions (resource threshold condition and specified network condition), detection can be triggered based on different ways.
作为一种方式,电子设备可以同时触发对是否满足资源阈值条件和指定网络条件的检测。需要说明 的,对于是否满足资源阈值条件以及指定网络条件都需要获取一定的数据来进行计算,而该计算是会消耗时间的,那么在同时触发是否满足资源阈值条件和指定网络条件的检测的情况下,则对于该两个条件的检测的结果的返回可能会有先后,而在本申请实施例中可以优先基于先返回的检测结果来确定查找指令的生成方式。As one approach, the electronic device can trigger the detection of whether the resource threshold condition and the specified network condition are met at the same time. It should be noted that whether the resource threshold conditions are met and the specified network conditions need to obtain certain data for calculation, and the calculation will consume time, then trigger the detection of whether the resource threshold conditions and the specified network conditions are met at the same time. Under the following conditions, the results of the detection of the two conditions may be returned in sequence, and in this embodiment of the present application, the generation method of the search instruction may be determined based on the detection result returned first.
具体的,在这种方式下,电子设备可以触发同时检测是否满足资源阈值条件和指定网络条件,若先获取到对于资源阈值条件的检测结果,且检测到满足资源阈值条件,则执行前述的满足资源阈值条件时的对应步骤,并忽略后续的对于是否满足指定网络条件的检测结果。若先获取到对于资源阈值条件的检测结果,但是检测到不满足资源阈值条件,则会等待后续的对于指定网络条件的检测结果,并根据后续的对于指定网络条件的检测结果来执行对应的步骤。Specifically, in this way, the electronic device can trigger the simultaneous detection of whether the resource threshold condition and the specified network condition are satisfied. The corresponding steps when the resource threshold conditions are met, and the subsequent detection results of whether the specified network conditions are met are ignored. If the detection result for the resource threshold condition is obtained first, but it is detected that the resource threshold condition is not met, it will wait for the subsequent detection result for the specified network condition, and execute the corresponding steps according to the subsequent detection result for the specified network condition .
若先获取到对于指定网络条件的检测结果,且检测到满足指定网络条件,则执行前述的满足指定网络条件时对应的步骤,并忽略后续的对于是否满足资源阈值条件的检测。若先获取到对于指定网络条件的检测结果,且检测到不满足指定网络条件,则会等待后续的对于资源阈值条件的检测结果,并根据对于资源阈值条件的检测结果来执行对应的步骤。If the detection result for the specified network condition is obtained first, and it is detected that the specified network condition is met, the aforementioned steps corresponding to when the specified network condition is met are performed, and the subsequent detection of whether the resource threshold condition is met is ignored. If the detection result for the specified network condition is obtained first, and it is detected that the specified network condition is not satisfied, the subsequent detection result for the resource threshold condition is waited for, and corresponding steps are performed according to the detection result for the resource threshold condition.
作为另一种方式,可以先对是否满足资源阈值条件进行检测,若满足资源阈值条件,则直接执行前述的满足资源阈值条件时对应的步骤,若不满足资源阈值条件,则才触发开始检测是否满足指定网络条件。As another method, it is possible to first detect whether the resource threshold condition is met. If the resource threshold condition is met, the aforementioned steps corresponding to the resource threshold condition are directly executed. If the resource threshold condition is not met, then the detection is triggered The specified network conditions are met.
需要说明的是,在本实施例中若检测到既不满足资源阈值条件,也检测到不满足指定网络条件,则电子设备会采用提供随机获取的图像处理参数,以便基于该随机获取的图像处理参数对待处理图像进行处理。其中,该随机获取的图像处理参数可以为从本地预存储的图像处理参数中随机获取的,也可以是为从前述的指定存储区域中的图像处理参数随机获取的。It should be noted that, in this embodiment, if it is detected that neither the resource threshold condition nor the specified network condition is met, the electronic device will provide randomly acquired image processing parameters, so as to process images based on the randomly acquired image processing parameters. Parameters to process the image to be processed. The randomly acquired image processing parameters may be randomly acquired from locally pre-stored image processing parameters, or may be randomly acquired from the aforementioned image processing parameters in the designated storage area.
S230:显示查找到的多个相似图像。S230: Display the multiple similar images found.
需要说明的是,在该指定存储区域中可能会存在有多个与待处理图像对应的相似图像,而虽然都是与待处理图像相似的图像,但是各自所对应的图像处理参数会有不同,进而各自对应的视觉效果会有不同,那么为了便于用户可以自己选择所需的效果,可以将查找到的多个相似图像进行显示。其中,相似图像是已经经过其对应的图像处理参数进行处理过的,进而在显示相似图像时,用户可以感知到经过对应的图像处理参数进行处理后的视觉效果。It should be noted that there may be multiple similar images corresponding to the image to be processed in the designated storage area, and although they are all images similar to the image to be processed, their corresponding image processing parameters will be different. Furthermore, the corresponding visual effects will be different. In order to facilitate the user to select the desired effect, the found multiple similar images may be displayed. The similar images have been processed by their corresponding image processing parameters, and when the similar images are displayed, the user can perceive the visual effects processed by the corresponding image processing parameters.
S240:获取从所述多个相似图像中确定的目标相似图像。S240: Acquire a target similar image determined from the plurality of similar images.
S250:获取所述目标相似图像对应的图像处理参数。S250: Acquire image processing parameters corresponding to the target similar image.
S260:基于所述目标相似图像对应的图像处理参数对所述待处理图像进行图像处理。S260: Perform image processing on the to-be-processed image based on the image processing parameter corresponding to the target similar image.
作为一种方式,所述方法还包括:获取参考相似图像,所述参考相似图像为所述多个相似图像中检测到作用有指定触控操作的相似图像。在所述指定触控操作作用期间,显示所述待处理图像基于所述参考相似图像对应的图像处理参数进行图像处理后的预览效果。若检测到所述指定触控操作结束,取消显示所述预览效果。可选的,该指定的触控操作可以包括持续时长满足指定时长的按压操作或者按压面积满足指定面积的按压操作。In one manner, the method further includes: acquiring a reference similar image, where the reference similar image is a similar image detected to be subjected to a specified touch operation among the plurality of similar images. During the action of the designated touch operation, the preview effect of the image to be processed after image processing based on the image processing parameters corresponding to the reference similar image is displayed. If it is detected that the designated touch operation ends, the preview effect is canceled. Optionally, the specified touch operation may include a pressing operation whose duration satisfies the specified duration or a pressing operation whose pressing area satisfies the specified area.
作为一种方式,如图8所示,所述指定存储区域中的图像还对应有展示界面的链接信息;所述基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像之后还包括:As one way, as shown in FIG. 8 , the image in the designated storage area also corresponds to link information of the display interface; the search for the image to be processed in the designated storage area based on the characteristics of the image to be processed is related to the image to be processed. Similar images, after obtaining similar images, also include:
S270:获取相似图像对应的所述链接信息。S270: Acquire the link information corresponding to the similar images.
可选的,本实施例中的链接信息可以为相似图像对应的展示界面的链接地址。Optionally, the link information in this embodiment may be a link address of a display interface corresponding to the similar image.
S280:基于所述链接信息跳转到所述链接信息对应的展示界面。S280: Jump to the display interface corresponding to the link information based on the link information.
需要说明的是,前述的指定存储区域可以为图像下载平台或者主题下载平台对应的资源存储区域,那么在这种情况下,在获取到该相似图像后,还可以通过触发电子设备通过展示相似图像在图像下载平台或者主题下载平台中的展示界面来对该相似图像进行展示,进而有利于为该图像下载平台或者主题下载平台进行引流。其中,当电子设备显示到该图像下载平台或者主题下载平台中的展示界面来对该相似图像进行展示后,可以基于在该图像下载平台或者主题下载平台中搜索其他类型的图像或者主题。It should be noted that the aforementioned designated storage area may be the resource storage area corresponding to the image download platform or the theme download platform, then in this case, after the similar image is obtained, the similar image can also be displayed by triggering the electronic device. The similar images are displayed on the display interface in the image download platform or the theme download platform, thereby facilitating traffic flow for the image download platform or the theme download platform. Wherein, after the electronic device displays the similar image on the display interface in the image download platform or theme download platform, it can search for other types of images or themes in the image download platform or theme download platform.
可选的,电子设备可以响应于用户的触控操作来基于所述链接信息跳转到所述链接信息对应的展示界面。示例性的,如图9所示,图9所示的界面中显示有相似图像k以及相似图像m,若检测到相似图像k被点击则可以显示图9中右侧图像中的菜单界面13。在该菜单界面13中包括有使用图像处理参数这一选项以及跳转到对应平台这一选项。若检测到该跳转到对应平台这一选项被选中,则电子设备可以触发跳转到图像下载平台或者主题下载平台中的展示界面来对该相似图像k进行展示。Optionally, the electronic device may jump to the display interface corresponding to the link information based on the link information in response to the user's touch operation. Exemplarily, as shown in FIG. 9 , a similar image k and a similar image m are displayed in the interface shown in FIG. 9 . If it is detected that the similar image k is clicked, the menu interface 13 in the right image in FIG. 9 can be displayed. The menu interface 13 includes the option of using image processing parameters and the option of jumping to the corresponding platform. If it is detected that the option of jumping to the corresponding platform is selected, the electronic device can trigger jumping to the display interface in the image download platform or the theme download platform to display the similar image k.
本实施例提供的一种图像处理方法,从而通过上述方式,可以使得在对图像进行图像处理以对图像进行美化的过程中,可以通过查询获取与待处理图像相似的图像的图像处理参数的方式,进而使得可以直 接基于与待处理图像相似的图像的图像处理参数来对待处理图像进行图像处理,从而提升了图像处理过程中的智能化程度。并且,因为是直接基于与待处理图像相似的图像的图像处理参数来对待处理图像进行图像处理,而不用用户自己手段进行处理,也提升了进行图像处理的效率。并且,在本实施例中,还可以通过对多个相似图像触发指定的触控操作的方式,来触发对应的图像处理的预览效果,有利于便于用户选择自己所需的图像处理参数,进而进一步的提升了图像处理过程中的便利性。In the image processing method provided by this embodiment, in the above manner, in the process of performing image processing on an image to beautify the image, the method of obtaining image processing parameters of an image similar to the image to be processed can be obtained by querying , so that the image to be processed can be directly processed based on the image processing parameters of the image similar to the image to be processed, thereby improving the degree of intelligence in the image processing process. Moreover, because the image to be processed is directly processed based on the image processing parameters of the image similar to the image to be processed, and the user does not need to perform the processing by himself, the efficiency of image processing is also improved. In addition, in this embodiment, the preview effect of the corresponding image processing can also be triggered by triggering a designated touch operation on a plurality of similar images, which is beneficial for the user to select the image processing parameters required by himself, and further The convenience of image processing is improved.
请参阅图10,本申请实施例提供的一种图像处理方法,应用于电子设备,所述方法包括:Referring to FIG. 10, an image processing method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
S310:获取待处理图像。S310: Acquire the image to be processed.
S320:基于所述待处理图像的全局特征以及局部特征图,在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,所述指定存储区域中的图像对应有图像处理参数。S320: Based on the global feature and the local feature map of the image to be processed, search for an image similar to the image to be processed in a designated storage area, and obtain a similar image, wherein the image in the designated storage area corresponds to image processing parameter.
其中,全局特征可以理解为从整体上表征图像内容的特征,对应的,局部特征可以理解为从图像的局部表征图像内容的特征。Among them, the global feature can be understood as the feature that characterizes the image content as a whole, and correspondingly, the local feature can be understood as the feature that characterizes the image content from the part of the image.
作为一种方式,如图11所示,所述获取全局特征以及局部特征图,包括:As one way, as shown in FIG. 11 , the obtaining of the global feature and the local feature map includes:
S321:将所述待处理图像输入到目标神经网络,获取所述目标神经网络输出的特征图作为初始特征图。可选的,该目标神经网络可以为CNN(Convolutional Neural Networks)网络。其中,本实施例中的目标神经网络可以为已经在其他任务中训练好的模型,如分类模型、分割模型等。S321: Input the image to be processed into a target neural network, and obtain a feature map output by the target neural network as an initial feature map. Optionally, the target neural network can be a CNN (Convolutional Neural Networks) network. The target neural network in this embodiment may be a model that has been trained in other tasks, such as a classification model, a segmentation model, and the like.
S322:对于所述初始特征图进行全局平均池化处理,得到全局特征。S322: Perform global average pooling processing on the initial feature map to obtain global features.
可选的,可以基于下列公式来进行全局平均池化处理,该公式为:Optionally, global average pooling can be performed based on the following formula, which is:
Figure PCTCN2021133246-appb-000001
Figure PCTCN2021133246-appb-000001
其中,F(i,j)表示位置(i,j)处的特征向量,w表示初始特征图的宽,h表示初始特征图的高。以尺寸为w*h*d的初始特征图F为例,其中,w表示初始特征图的宽,h表示初始特征图的高,d表示初始特征图的通道数。如图12所示,尺寸为w*h*d的初始特征图F经过全局平均池化处理可以得到尺寸为1*d的全局图像特征G作为全局特征。Among them, F(i,j) represents the feature vector at position (i,j), w represents the width of the initial feature map, and h represents the height of the initial feature map. Take the initial feature map F of size w*h*d as an example, where w represents the width of the initial feature map, h represents the height of the initial feature map, and d represents the number of channels of the initial feature map. As shown in Figure 12, the initial feature map F with size w*h*d can be processed by global average pooling to obtain global image feature G with size 1*d as global feature.
S323:获取所述初始特征图中多个位置各自对应的特征集合,每个所述位置对应的特征集合包括每个位置的特征,以及每个位置的相邻位置的特征。S323: Acquire feature sets corresponding to multiple positions in the initial feature map, where the feature sets corresponding to each position include features of each position and features of adjacent positions of each position.
作为一种方式,该多个位置可以为初始特征图中的每个位置。需要说明的是,初始特征图可以对应有通道维度,那么每个位置(i,j)的信息包含每个个通道的颜色信息。示例性的,如图13所示,如图13所示的初始特征图20,其中示例性的展示为其中的位置a到位置i(初始特征图20还可以包括有位置a到位置i以外的其他位置),其中,对于位置a而言,相邻位置包括位置b、位置e以及位置d,示例性的,对于位置e而言,相邻位置包括位置a、位置b、位置c、位置f、位置i、位置h、位置g、位置d。As one approach, the plurality of locations may be each location in the initial feature map. It should be noted that the initial feature map may correspond to a channel dimension, then the information of each position (i, j) includes the color information of each channel. Exemplarily, as shown in FIG. 13 , the initial feature map 20 shown in FIG. 13 is exemplarily shown as position a to position i (the initial feature map 20 may also include positions other than position a to position i) other positions), wherein, for position a, adjacent positions include position b, position e and position d, for example, for position e, adjacent positions include position a, position b, position c, position f , position i, position h, position g, position d.
S324:对每个所述位置各自对应的特征集合进行平均处理,得到每个所述位置对应的局部特征。S324: Perform averaging processing on the feature sets corresponding to each of the positions to obtain local features corresponding to each of the positions.
S325:基于所述每个所述位置对应的局部特征得到所述局部特征图。S325: Obtain the local feature map based on the local features corresponding to each of the positions.
如图14所示,若待处理图像的尺寸为W*H*3,那么经过目标神经网络处理后,可以得到尺寸为w*h*d的初始特征图F,然后可以获取位置(i,j)的特征集合,然后对该位置(i,j)的特征集合进行局部领域求均值(即进行平均处理),可以得到尺寸为1*d的局部特征,进而将每个位置对应的尺寸为1*d的局部特征进行集合则可以得到尺寸为W*H*3的待处理图像对应的局部特征图。As shown in Figure 14, if the size of the image to be processed is W*H*3, after processing by the target neural network, an initial feature map F with a size of w*h*d can be obtained, and then the position (i, j ) of the feature set, and then average the local domain of the feature set at the position (i, j) (that is, average processing), you can obtain a local feature of size 1*d, and then the size corresponding to each position is 1 When the local features of *d are aggregated, the local feature map corresponding to the to-be-processed image of size W*H*3 can be obtained.
其中,需要说明的是,每个所述位置对应的局部特征也可以理解为每个位置的局部特征向量,可选的,可以通过下列公式来计算得到每个位置的局部特征向量,该公式为:It should be noted that the local feature corresponding to each position can also be understood as the local feature vector of each position. Optionally, the local feature vector of each position can be calculated by the following formula. The formula is: :
Figure PCTCN2021133246-appb-000002
Figure PCTCN2021133246-appb-000002
其中,F(u,v)表示位置(u,v)处的特征向量,M表征位置(u,v)对应的相邻位置的数量。Among them, F(u, v) represents the feature vector at the position (u, v), and M represents the number of adjacent positions corresponding to the position (u, v).
作为一种方式,所述基于所述待处理图像的全局特征以及局部特征图,在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,包括:As one way, based on the global feature and local feature map of the to-be-processed image, searching for an image similar to the to-be-processed image in a designated storage area to obtain a similar image, including:
将所述待处理图像的全局特征与所述指定存储区域中的图像的全局特征进行相似比对,以及将所述待处理图像的局部特征图与所述指定存储区域中的图像的局部特征图进行相似比对;Compare the global feature of the image to be processed with the global feature of the image in the designated storage area, and compare the local feature map of the image to be processed with the local feature map of the image in the designated storage area make similar comparisons;
将所述指定存储区域中,对应的全局特征与所述待处理图像的全局特征满足第一相似条件,且对应的局部特征图与所述待处理图像的局部特征图之间满足第二相似条件的图像作为相似图像。In the designated storage area, the corresponding global feature and the global feature of the image to be processed satisfy the first similarity condition, and the corresponding local feature map and the local feature map of the image to be processed satisfy the second similarity condition images as similar images.
作为一种方式,可以将待处理图像的全局特征作为第一全局特征,而将待处理图像的局部特征图作为第一局部特征图。可以将指定存储区域中当前与待处理图像进行相似对比的图像的全局特征作为第二全局特征,以及将指定存储区域中当前与待处理图像进行相似对比的图像的局部特征图作为第二局部特征图。In one way, the global feature of the image to be processed may be used as the first global feature, and the local feature map of the image to be processed may be used as the first local feature map. The global feature of the image that is currently compared with the image to be processed in the specified storage area can be used as the second global feature, and the local feature map of the image that is currently compared with the image to be processed in the specified storage area can be used as the second local feature. picture.
其中,可选的,若第一全局特征与所述第二全局特征之间的距离小于第一距离阈值,确定所述第一全局特征与所述第二全局特征满足第一相似条件。其中,作为一种方式,可以基于欧氏距离或者余弦距离来计算第一全局特征与所述第二全局特征之间的距离。在本实施例中,可以基于下列公式来计算第一全局特征与第二全局特征之间的距离,该公式为:Wherein, optionally, if the distance between the first global feature and the second global feature is less than a first distance threshold, it is determined that the first global feature and the second global feature satisfy a first similarity condition. Wherein, as an approach, the distance between the first global feature and the second global feature may be calculated based on the Euclidean distance or the cosine distance. In this embodiment, the distance between the first global feature and the second global feature can be calculated based on the following formula, where the formula is:
D G=||G 1-G 2|| 2 D G =||G 1 -G 2 || 2
其中,D G表征所计算出的第一全局特征与第二全局特征之间的距离,G 1表征第一全局特征,G 2表征第二全局特征。 Wherein, D G represents the calculated distance between the first global feature and the second global feature, G 1 represents the first global feature, and G 2 represents the second global feature.
可选的,计算第一局部特征图与第二局部特征图是否满足第二相似条件可以包括:Optionally, calculating whether the first local feature map and the second local feature map satisfy the second similarity condition may include:
计算相互对应的第一局部特征以及第二局部特征之间的特征距离,所述第一局部特征为所述第一局部特征图包括的局部特征,所述第二局部特征为所述第二局部特征图包括的局部特征。Calculate the feature distance between the corresponding first local feature and the second local feature, the first local feature is the local feature included in the first local feature map, and the second local feature is the second local feature The local features included in the feature map.
需要说明的是,第一局部特征图是由前述第一初始特征图中的多个位置各自对应的局部特征组合得到的。对应的,第二局部特征图是由前述第二初始特征图中的多个位置各自对应的局部特征组合得到的。It should be noted that the first local feature map is obtained by combining local features corresponding to multiple positions in the aforementioned first initial feature map. Correspondingly, the second local feature map is obtained by combining local features corresponding to multiple positions in the aforementioned second initial feature map.
可选的,可以基于坐标来标识第一初始特征图以及第二初始特征图中的位置,进而可以将对应坐标相同的位置作为相互对应的位置。示例的,第一局部特征图的位置(i 1,j 1),和第二局部特征图的位置(i 1,j 1)的坐标均为(i 1,j 1),那么则第一局部特征图中的位置(i 1,j 1)和第二局部特征图中的位置(i 1,j 1)为位置相互对应的两个位置。对应的,相互对应的两个位置各自所对应的局部特征,则为对应的局部特征。那么相互对应的第一局部特征以及第二局部特征,可以理解为该第一局部特征对应的位置,和该第二局部特征对应的位置是相互对应。 Optionally, the positions in the first initial feature map and the second initial feature map may be identified based on coordinates, and then positions with the same corresponding coordinates may be used as mutually corresponding positions. For example, the coordinates of the position (i 1 , j 1 ) of the first local feature map and the position (i 1 , j 1 ) of the second local feature map are both (i 1 , j 1 ), then the first local The position (i 1 , j 1 ) in the feature map and the position (i 1 , j 1 ) in the second local feature map are two positions whose positions correspond to each other. Correspondingly, the local features corresponding to the two positions corresponding to each other are the corresponding local features. Then, the first local feature and the second local feature corresponding to each other can be understood as the position corresponding to the first local feature, and the position corresponding to the second local feature is corresponding to each other.
如图15所示,示处了第一初始特征图30以及第二初始特征图40,其中,第一初始特征图30的位置31的坐标为(1,1),第二初始特征图40的位置41对应的坐标也为(1,1),因为位置31在第一初始特征图30中的坐标和位置41在第二初始特征图40中的坐标是相同的,那么位置31和位置征31为对应的位置,进而位置31所对应的第一局部特征,与位置41所对应的第一局部特征为对应的第一局部特征以及第二局部特征。As shown in FIG. 15 , the first initial feature map 30 and the second initial feature map 40 are shown, wherein the coordinates of the position 31 of the first initial feature map 30 are (1, 1), and the coordinates of the second initial feature map 40 are The coordinates corresponding to the position 41 are also (1, 1), because the coordinates of the position 31 in the first initial feature map 30 and the coordinates of the position 41 in the second initial feature map 40 are the same, then the position 31 and the position feature 31 is the corresponding position, and the first local feature corresponding to the position 31 and the first local feature corresponding to the position 41 are the corresponding first local feature and the second local feature.
那么作为一种方式,在第一图像和第二图像的尺寸相同的情况下,第一初始特征图和第二初始特征图的尺寸也是相同的。那么对于第一初始特征图中的每个位置都会在第二初始特征图中有对应的位置。Then, as a way, in the case where the sizes of the first image and the second image are the same, the sizes of the first initial feature map and the second initial feature map are also the same. Then, for each position in the first initial feature map, there will be a corresponding position in the second initial feature map.
作为一种方式,可以基于下列公式来计算相互对应的第一局部特征以及第二局部特征之间的特征距离,该公式为:As a way, the feature distance between the first local feature and the second local feature corresponding to each other can be calculated based on the following formula, which is:
D L(i,j)=||L 1(i,j)-L 2(i,j)|| 2 D L (i, j)=||L 1 (i, j)-L 2 (i, j)|| 2
其中,L 1(i,j)表征第一初始特征图中位置(i,j)处对应的局部特征。L 2(i,j)表征第二初始特征图中位置(i,j)处对应的局部特征。 Wherein, L 1 (i, j) represents the local feature corresponding to the position (i, j) in the first initial feature map. L 2 (i, j) represents the local feature corresponding to the position (i, j) in the second initial feature map.
将对应的所述特征距离小于第二距离阈值的第一局部特征作为目标局部特征。The first local feature whose corresponding feature distance is smaller than the second distance threshold is used as the target local feature.
如前述内容所示,在第一初始特征图中的每个位置在第二初始特征图中有对应的位置的情况下,可以计算得到第一初始特征图中的每个位置对应的第一局部特征所对应的特征距离。其中,第一局部特征所对应的特征距离可以理解为第一局部特征与位置对应的第二局部特征之间的特征距离。As shown in the foregoing, in the case where each position in the first initial feature map has a corresponding position in the second initial feature map, the first partial corresponding to each position in the first initial feature map can be obtained by calculation The feature distance corresponding to the feature. The feature distance corresponding to the first local feature may be understood as the feature distance between the first local feature and the second local feature corresponding to the position.
若所述目标局部特征的数量与所述第一局部特征图包括的局部特征的数量的比值大于比例阈值,确定所述第一局部特征图与所述第二局部特征图满足第二相似条件。If the ratio of the number of target local features to the number of local features included in the first local feature map is greater than a scale threshold, it is determined that the first local feature map and the second local feature map satisfy a second similarity condition.
其中,可以基于下列公式来计算该比值,该公式为:where the ratio can be calculated based on the following formula, which is:
Figure PCTCN2021133246-appb-000003
Figure PCTCN2021133246-appb-000003
其中,N L表征目标局部特征的数量,w表征第一初始特征图的宽度,h为第一初始特征图的高度。可选的,该R可以为0.6。 Among them, NL represents the number of target local features, w represents the width of the first initial feature map, and h is the height of the first initial feature map. Optionally, the R can be 0.6.
需要说明的是,第一初始特征图的宽度与第一初始特征图的高度的乘积则表征的是第一初始特征图中位置的数量,在每个位置都对应有一个局部特征的情况下,第一局部特征图包括的局部特征的数量则为第一初始特征图中位置的数量。It should be noted that the product of the width of the first initial feature map and the height of the first initial feature map represents the number of positions in the first initial feature map. In the case that each position corresponds to a local feature, The number of local features included in the first local feature map is the number of positions in the first initial feature map.
S330:获取所述相似图像对应的图像处理参数。S330: Acquire image processing parameters corresponding to the similar images.
S340:基于所述图像处理参数对所述待处理图像进行图像处理。S340: Perform image processing on the to-be-processed image based on the image processing parameter.
本实施例提供的一种图像处理方法,从而通过上述方式,可以使得在对图像进行图像处理以对图像进行美化的过程中,可以通过查询获取与待处理图像相似的图像的图像处理参数的方式,进而使得可以直接基于与待处理图像相似的图像的图像处理参数来对待处理图像进行图像处理,从而提升了图像处理过程中的智能化程度。并且,在本实施例中,在确定相似图像的过程中,可以同时结合图像的全局特征以及局 部特征进行相似性的检测,使得在进行图像相似检测过程中能够进行更为全面的检测,提升了进行相似检测的准确性。In the image processing method provided by this embodiment, in the above manner, in the process of performing image processing on an image to beautify the image, the method of obtaining image processing parameters of an image similar to the image to be processed can be obtained by querying , so that the image to be processed can be directly processed based on the image processing parameters of the image similar to the image to be processed, thereby improving the degree of intelligence in the image processing process. In addition, in this embodiment, in the process of determining similar images, the global features and local features of the images can be combined to perform similarity detection, so that a more comprehensive detection can be performed in the process of image similarity detection, which improves the performance of the image similarity detection process. Accuracy of similarity detection.
请参阅图16,本申请实施例提供的一种图像处理方法,应用于服务器,所述方法包括:Referring to FIG. 16, an image processing method provided by an embodiment of the present application is applied to a server, and the method includes:
S410:接收电子设备发送的待处理图像。S410: Receive the to-be-processed image sent by the electronic device.
S420:基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,所述指定存储区域中的图像对应有图像处理参数。S420: Search for an image similar to the image to be processed in a designated storage area based on the feature of the image to be processed, to obtain a similar image, wherein the image in the designated storage area corresponds to an image processing parameter.
S430:获取所述相似图像对应的图像处理参数。S430: Acquire image processing parameters corresponding to the similar images.
S440:基于所述图像处理参数对所述待处理图像进行图像处理,得到处理后的图像。S440: Perform image processing on the to-be-processed image based on the image processing parameter to obtain a processed image.
S450:将所述处理后的图像返回给所述电子设备。S450: Return the processed image to the electronic device.
本实施例提供的一种图像处理方法,通过获取待处理图像后,再基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,在该指定存储区域中的图像对应有图像处理参数,继而在得到相似图像的同时还可以得到相似图像对应的图像处理参数,再基于相似图像的图像处理参数对所述待处理图像进行图像处理。In an image processing method provided by this embodiment, after acquiring an image to be processed, an image similar to the image to be processed is searched in a designated storage area based on the characteristics of the image to be processed, so as to obtain a similar image, wherein, in The images in the designated storage area correspond to image processing parameters, and then the image processing parameters corresponding to the similar images can be obtained while the similar images are obtained, and then image processing is performed on the to-be-processed images based on the image processing parameters of the similar images.
从而通过上述方式,可以使得在对图像进行图像处理以对图像进行美化的过程中,可以通过查询获取与待处理图像相似的图像的图像处理参数的方式,进而使得可以直接基于与待处理图像相似的图像的图像处理参数来对待处理图像进行图像处理,从而提升了图像处理过程中的智能化程度。并且,因为是直接基于与待处理图像相似的图像的图像处理参数来对待处理图像进行图像处理,而不用用户自己手段进行处理,也提升了进行图像处理的效率。Therefore, through the above method, in the process of performing image processing on the image to beautify the image, the method of acquiring the image processing parameters of the image similar to the image to be processed can be obtained by query, so that the image processing parameters of the image similar to the image to be processed can be directly obtained based on the The image processing parameters of the image to be processed are used to process the image to be processed, thereby improving the degree of intelligence in the image processing process. Moreover, because the image to be processed is directly processed based on the image processing parameters of the image similar to the image to be processed, and the user does not need to perform the processing by himself, the efficiency of image processing is also improved.
请参阅图17,本申请实施例提供的一种图像处理装置500,运行于电子设备,所述装置500包括:Referring to FIG. 17 , an image processing apparatus 500 provided by an embodiment of the present application operates on an electronic device, and the apparatus 500 includes:
图像获取单元510,用于获取待处理图像;an image acquisition unit 510, configured to acquire an image to be processed;
图像查找单元520,用于基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,所述指定存储区域中的图像对应有图像处理参数。The image search unit 520 is configured to search for an image similar to the image to be processed in a designated storage area based on the characteristics of the image to be processed, and obtain a similar image, wherein the image in the designated storage area corresponds to an image processing parameter .
参数获取单元530,用于获取所述相似图像对应的图像处理参数。The parameter obtaining unit 530 is configured to obtain image processing parameters corresponding to the similar images.
图像处理单元540,用于基于所述图像处理参数对所述待处理图像进行图像处理。The image processing unit 540 is configured to perform image processing on the to-be-processed image based on the image processing parameter.
作为一种方式,所述相似图像有多个。参数获取单元530,具体用于显示查找到的多个相似图像;获取从所述多个相似图像中确定的目标相似图像;获取所述目标相似图像对应的图像处理参数。图像处理单元540,具体用于基于所述目标相似图像对应的图像处理参数对所述待处理图像进行图像处理。As an approach, there are multiples of the similar images. The parameter obtaining unit 530 is specifically configured to display a plurality of similar images found; obtain a target similar image determined from the plurality of similar images; and obtain image processing parameters corresponding to the target similar images. The image processing unit 540 is specifically configured to perform image processing on the to-be-processed image based on image processing parameters corresponding to the target similar image.
如图18所示,所述装置500,还包括:处理效果预览单元550以及引流单元560。As shown in FIG. 18 , the apparatus 500 further includes: a processing effect preview unit 550 and a flow drainage unit 560 .
其中,处理效果预览单元550,用于获取参考相似图像,所述参考相似图像为所述多个相似图像中检测到作用有指定触控操作的相似图像;在所述指定触控操作作用期间,显示所述待处理图像基于所述参考相似图像对应的图像处理参数进行图像处理后的预览效果;若检测到所述指定触控操作结束,取消显示所述预览效果。Among them, the processing effect preview unit 550 is used to obtain a reference similar image, where the reference similar image is a similar image that is detected with a designated touch operation in the plurality of similar images; during the action of the designated touch operation, Display the preview effect of the image to be processed based on the image processing parameters corresponding to the reference similar image after image processing; if it is detected that the specified touch operation ends, cancel the display of the preview effect.
作为一种方式,所述指定存储区域中的图像还对应有展示界面的链接信息,引流单元560,用于获取相似图像对应的所述链接信息;基于所述链接信息跳转到所述链接信息对应的展示界面。In one way, the images in the designated storage area also correspond to link information of the display interface, and the traffic diversion unit 560 is configured to obtain the link information corresponding to the similar images; jump to the link information based on the link information corresponding display interface.
作为一种方式,所述特征包括全局特征以及局部特征图,图像查找单元520,具体用于基于所述待处理图像的全局特征以及局部特征图,在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像。在这种方式下啊,可选的,图像查找单元520,具体用于将所述待处理图像的全局特征与所述指定存储区域中的图像的全局特征进行相似比对,以及将所述待处理图像的局部特征图与所述指定存储区域中的图像的局部特征图进行相似比对;将所述指定存储区域中,对应的全局特征与所述待处理图像的全局特征满足第一相似条件,且对应的局部特征图与所述待处理图像的局部特征图之间满足第二相似条件的图像作为相似图像。In one way, the features include global features and local feature maps, and the image search unit 520 is specifically configured to search for images related to the to-be-processed image in the designated storage area based on the global features and local feature maps of the to-be-processed image. Similar images, get similar images. In this manner, optionally, the image search unit 520 is specifically configured to perform similarity comparison between the global feature of the image to be processed and the global feature of the image in the designated storage area, and compare the global feature of the image to be processed with The local feature map of the processed image and the local feature map of the image in the designated storage area are similarly compared; in the designated storage area, the corresponding global feature and the global feature of the image to be processed satisfy the first similarity condition , and an image satisfying the second similarity condition between the corresponding local feature map and the local feature map of the image to be processed is regarded as a similar image.
请参阅图19,本申请实施例提供的一种图像处理装置600,运行于电子设备,所述装置600包括:Referring to FIG. 19 , an image processing apparatus 600 provided by an embodiment of the present application operates on an electronic device, and the apparatus 600 includes:
数据通信单元610,用于接收电子设备发送的待处理图像。The data communication unit 610 is configured to receive the to-be-processed image sent by the electronic device.
图像查找单元620,用于基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,所述指定存储区域中的图像对应有图像处理参数。The image search unit 620 is configured to search for an image similar to the image to be processed in a designated storage area based on the characteristics of the image to be processed, and obtain a similar image, wherein the image in the designated storage area corresponds to an image processing parameter .
参数获取单元630,用于获取所述相似图像对应的图像处理参数。The parameter obtaining unit 630 is configured to obtain image processing parameters corresponding to the similar images.
图像处理单元640,用于基于所述图像处理参数对所述待处理图像进行图像处理,得到处理后的图像。The image processing unit 640 is configured to perform image processing on the to-be-processed image based on the image processing parameter to obtain a processed image.
所述数据通信单元610,还用于将所述处理后的图像返回给所述电子设备。The data communication unit 610 is further configured to return the processed image to the electronic device.
本实施例提供的一种图像处理装置,通过获取待处理图像后,再基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,在该指定存储区域中的图像对应有图像处理参数,继而在得到相似图像的同时还可以得到相似图像对应的图像处理参数,再基于相似图像的图像处理参数对所述待处理图像进行图像处理。从而通过上述方式,可以使得在对图像进行图像处理以对图像进行美化的过程中,可以通过查询获取与待处理图像相似的图像的图像处理参数的方式,进而使得可 以直接基于与待处理图像相似的图像的图像处理参数来对待处理图像进行图像处理,从而提升了图像处理过程中的智能化程度。并且,因为是直接基于与待处理图像相似的图像的图像处理参数来对待处理图像进行图像处理,而不用用户自己手段进行处理,也提升了进行图像处理的效率。An image processing apparatus provided by this embodiment obtains a similar image by searching for an image similar to the to-be-processed image in a designated storage area based on the characteristics of the to-be-processed image after acquiring the to-be-processed image, wherein: The images in the designated storage area correspond to image processing parameters, and then the image processing parameters corresponding to the similar images can be obtained while obtaining the similar images, and then image processing is performed on the to-be-processed images based on the image processing parameters of the similar images. Therefore, through the above method, in the process of performing image processing on the image to beautify the image, the method of acquiring the image processing parameters of the image similar to the image to be processed can be obtained by query, so that the image processing parameters of the image similar to the image to be processed can be directly obtained based on the The image processing parameters of the image to be processed are used to process the image to be processed, thereby improving the degree of intelligence in the image processing process. Moreover, because the image to be processed is directly processed based on the image processing parameters of the image similar to the image to be processed, and the user does not need to perform the processing by himself, the efficiency of image processing is also improved.
需要说明的是,本申请中装置实施例与前述方法实施例是相互对应的,装置实施例中具体的原理可以参见前述方法实施例中的内容,此处不再赘述。It should be noted that the apparatus embodiments in the present application correspond to the foregoing method embodiments, and the specific principles in the apparatus embodiments may refer to the content in the foregoing method embodiments, which will not be repeated here.
下面将结合图20对本申请提供的一种电子设备进行说明。An electronic device provided by the present application will be described below with reference to FIG. 20 .
请参阅图20,基于上述的图像处理方法、装置,本申请实施例还提供的另一种可以执行前述图像处理方法的电子设备200。电子设备200包括相互耦合的一个或多个(图中仅示出一个)处理器102、存储器104以及网络模块106。其中,该存储器104中存储有可以执行前述实施例中内容的程序,而处理器102可以执行该存储器104中存储的程序。Referring to FIG. 20 , based on the above-mentioned image processing method and apparatus, another electronic device 200 that can execute the above-mentioned image processing method is further provided by the embodiments of the present application. The electronic device 200 includes one or more (only one shown in the figure) a processor 102, a memory 104, and a network module 106 that are coupled to each other. Wherein, the memory 104 stores a program that can execute the content in the foregoing embodiments, and the processor 102 can execute the program stored in the memory 104 .
其中,处理器102可以包括一个或者多个用于处理数据的核。处理器102利用各种接口和线路连接整个电子设备200内的各个部分,通过运行或执行存储在存储器104内的指令、程序、代码集或指令集,以及调用存储在存储器104内的数据,执行电子设备200的各种功能和处理数据。可选地,处理器102可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器102可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器102中,单独通过一块通信芯片进行实现。The processor 102 may include one or more cores for processing data. The processor 102 uses various interfaces and lines to connect various parts of the entire electronic device 200, and executes by running or executing the instructions, programs, code sets or instruction sets stored in the memory 104, and calling the data stored in the memory 104. Various functions of the electronic device 200 and processing data. Optionally, the processor 102 may adopt at least one of digital signal processing (Digital Signal Processing, DSP), field-programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). A hardware form is implemented. The processor 102 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), a modem, and the like. Among them, the CPU mainly handles the operating system, user interface and application programs, etc.; the GPU is used for rendering and drawing of the display content; the modem is used to handle wireless communication. It can be understood that, the above-mentioned modem may not be integrated into the processor 102, and is implemented by a communication chip alone.
存储器104可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器104可用于存储指令、程序、代码、代码集或指令集。存储器104可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。例如,存储器104中可以存储有图像处理的装置。该图像处理的装置可以为前述的装置500或为前述的装置600。存储数据区还可以存储终端100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。The memory 104 may include random access memory (Random Access Memory, RAM), or may include read-only memory (Read-Only Memory). Memory 104 may be used to store instructions, programs, codes, sets of codes, or sets of instructions. The memory 104 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing the operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, and the like. For example, the memory 104 may store means for image processing. The image processing apparatus may be the aforementioned apparatus 500 or the aforementioned apparatus 600 . The storage data area may also store data created by the terminal 100 during use (such as phone book, audio and video data, chat record data) and the like.
所述网络模块106用于接收以及发送电磁波,实现电磁波与电信号的相互转换,从而与通讯网络或者其他设备进行通讯,例如和音频播放设备进行通讯。所述网络模块106可包括各种现有的用于执行这些功能的电路元件,例如,天线、射频收发器、数字信号处理器、加密/解密芯片、用户身份模块(SIM)卡、存储器等等。所述网络模块106可与各种网络如互联网、企业内部网、无线网络进行通讯或者通过无线网络与其他设备进行通讯。上述的无线网络可包括蜂窝式电话网、无线局域网或者城域网。例如,网络模块106可以与基站进行信息交互。The network module 106 is used for receiving and sending electromagnetic waves, realizing mutual conversion between electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices, for example, communicate with an audio playback device. The network module 106 may include various existing circuit elements for performing these functions, eg, antennas, radio frequency transceivers, digital signal processors, encryption/decryption chips, subscriber identity module (SIM) cards, memory, etc. . The network module 106 can communicate with various networks such as the Internet, an intranet, a wireless network, or communicate with other devices through a wireless network. The aforementioned wireless network may include a cellular telephone network, a wireless local area network, or a metropolitan area network. For example, the network module 106 may interact with the base station for information.
请参考图21,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质1100中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。Please refer to FIG. 21 , which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. The computer-readable medium 1100 stores program codes, and the program codes can be invoked by the processor to execute the methods described in the above method embodiments.
计算机可读存储介质1100可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质1100包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质1100具有执行上述方法中的任何方法步骤的程序代码1110的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码1110可以例如以适当形式进行压缩。The computer-readable storage medium 1100 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 1100 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 1100 has storage space for program code 1110 that performs any of the method steps in the above-described methods. These program codes can be read from or written to one or more computer program products. Program code 1110 may be compressed, for example, in a suitable form.
综上所述,本申请提供的一种图像处理方法、装置、电子设备以及存储介质,通过获取待处理图像后,再基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,在该指定存储区域中的图像对应有图像处理参数,继而在得到相似图像的同时还可以得到相似图像对应的图像处理参数,再基于相似图像的图像处理参数对所述待处理图像进行图像处理。从而通过上述方式,可以使得在对图像进行图像处理以对图像进行美化的过程中,可以通过查询获取与待处理图像相似的图像的图像处理参数的方式,进而使得可以直接基于与待处理图像相似的图像的图像处理参数来对待处理图像进行图像处理,从而提升了图像处理过程中的智能化程度。并且,因为是直接基于与待处理图像相似的图像的图像处理参数来对待处理图像进行图像处理,而不用用户自己手段进行处理,也提升了进行图像处理的效率。To sum up, an image processing method, device, electronic device and storage medium provided by the present application, after acquiring an image to be processed, and then based on the characteristics of the to-be-processed image in a designated storage area to search for and the to-be-processed image Images with similar images are obtained to obtain similar images, wherein the images in the designated storage area correspond to image processing parameters, and then the image processing parameters corresponding to similar images can be obtained while obtaining similar images, and then the image processing parameters based on similar images can be obtained. The parameter performs image processing on the to-be-processed image. Therefore, through the above method, in the process of performing image processing on the image to beautify the image, the method of acquiring the image processing parameters of the image similar to the image to be processed can be obtained by query, so that the image processing parameters of the image similar to the image to be processed can be directly obtained based on the The image processing parameters of the image to be processed are used to process the image to be processed, thereby improving the degree of intelligence in the image processing process. Moreover, because the image to be processed is directly processed based on the image processing parameters of the image similar to the image to be processed, and the user does not need to perform the processing by himself, the efficiency of image processing is also improved.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征图进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: it can still be Modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements to some of the technical feature diagrams; and these modifications or replacements do not drive the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions in the embodiments of the present application .

Claims (20)

  1. 一种图像处理方法,其特征在于,应用于电子设备,所述方法包括:An image processing method, characterized in that, applied to an electronic device, the method comprising:
    获取待处理图像;Get the image to be processed;
    基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,所述指定存储区域中的图像对应有图像处理参数;Search for an image similar to the image to be processed in a designated storage area based on the feature of the image to be processed, to obtain a similar image, wherein the image in the designated storage area corresponds to an image processing parameter;
    获取所述相似图像对应的图像处理参数;obtaining image processing parameters corresponding to the similar images;
    基于所述图像处理参数对所述待处理图像进行图像处理。Image processing is performed on the to-be-processed image based on the image processing parameter.
  2. 根据权利要求1所述的方法,其特征在于,所述相似图像有多个,所述获取所述相似图像对应的图像处理参数,包括:The method according to claim 1, wherein there are multiple similar images, and the acquiring image processing parameters corresponding to the similar images comprises:
    显示查找到的多个相似图像;Display multiple similar images found;
    获取从所述多个相似图像中确定的目标相似图像;obtaining a target similar image determined from the plurality of similar images;
    获取所述目标相似图像对应的图像处理参数;obtaining image processing parameters corresponding to the target similar images;
    所述基于所述图像处理参数对所述待处理图像进行图像处理,包括:The performing image processing on the to-be-processed image based on the image processing parameter includes:
    基于所述目标相似图像对应的图像处理参数对所述待处理图像进行图像处理。Image processing is performed on the to-be-processed image based on image processing parameters corresponding to the target similar image.
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:The method according to claim 2, wherein the method further comprises:
    获取参考相似图像,所述参考相似图像为所述多个相似图像中检测到作用有指定触控操作的相似图像;Acquiring a reference similar image, where the reference similar image is a similar image detected with a specified touch operation in the plurality of similar images;
    在所述指定触控操作作用期间,显示所述待处理图像基于所述参考相似图像对应的图像处理参数进行图像处理后的预览效果;During the action of the designated touch operation, displaying the preview effect of the image to be processed after image processing based on the image processing parameters corresponding to the reference similar image;
    若检测到所述指定触控操作结束,取消显示所述预览效果。If it is detected that the designated touch operation ends, the preview effect is canceled.
  4. 根据权利要求3所述的方法,其特征在于,所述指定触控操作包括持续时长满足指定时长的按压操作或者按压面积满足指定面积的按压操作。The method according to claim 3, wherein the specified touch operation comprises a pressing operation whose duration meets the specified duration or a pressing operation whose pressing area satisfies the specified area.
  5. 根据权利要求1-4任一所述的方法,其特征在于,所述指定存储区域中的图像还对应有展示界面的链接信息;The method according to any one of claims 1-4, wherein the image in the designated storage area also corresponds to link information of the display interface;
    所述基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像之后还包括:The searching for an image similar to the image to be processed in the designated storage area based on the feature of the image to be processed, and after obtaining the similar image, further includes:
    获取相似图像对应的所述链接信息;obtaining the link information corresponding to the similar images;
    基于所述链接信息跳转到所述链接信息对应的展示界面。Jump to the display interface corresponding to the link information based on the link information.
  6. 根据权利要求1-4任一所述的方法,其特征在于,所述特征包括全局特征以及局部特征图,所述基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像包括:The method according to any one of claims 1-4, wherein the features include a global feature and a local feature map, and the feature of the to-be-processed image is searched in a specified storage area for the corresponding image to be processed. Similar images to get similar images include:
    基于所述待处理图像的全局特征以及局部特征图,在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像。Based on the global feature and the local feature map of the to-be-processed image, an image similar to the to-be-processed image is searched in a designated storage area to obtain a similar image.
  7. 根据权利要求6所述的方法,其特征在于,所述基于所述待处理图像的全局特 征以及局部特征图,在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,包括:The method according to claim 6, wherein, based on the global feature and local feature map of the image to be processed, searching for an image similar to the image to be processed in a designated storage area to obtain a similar image, comprising: :
    将所述待处理图像的全局特征与所述指定存储区域中的图像的全局特征进行相似比对,以及将所述待处理图像的局部特征图与所述指定存储区域中的图像的局部特征图进行相似比对;Compare the global feature of the image to be processed with the global feature of the image in the designated storage area, and compare the local feature map of the image to be processed with the local feature map of the image in the designated storage area make similar comparisons;
    将所述指定存储区域中,对应的全局特征与所述待处理图像的全局特征满足第一相似条件,且对应的局部特征图与所述待处理图像的局部特征图之间满足第二相似条件的图像作为相似图像。In the designated storage area, the corresponding global feature and the global feature of the image to be processed satisfy the first similarity condition, and the corresponding local feature map and the local feature map of the image to be processed satisfy the second similarity condition images as similar images.
  8. 根据权利要求7所述的方法,其特征在于,所述将所述待处理图像的全局特征与所述指定存储区域中的图像的全局特征进行相似比对,以及将所述待处理图像的局部特征图与所述指定存储区域中的图像的局部特征图进行相似比对之后还包括:The method according to claim 7, characterized in that the global feature of the image to be processed is similarly compared with the global feature of the image in the designated storage area, and the local feature of the image to be processed is compared After the feature map is similarly compared with the local feature map of the image in the designated storage area, it also includes:
    将所述待处理图像的全局特征作为第一全局特征,以及将所述待处理图像的局部特征图作为第一局部特征图;Taking the global feature of the image to be processed as the first global feature, and taking the local feature map of the image to be processed as the first local feature map;
    将所述指定存储区域中当前与所述待处理图像进行相似对比的图像的全局特征作为第二全局特征,以及将所述指定存储区域中当前与所述待处理图像进行相似对比的图像的局部特征图作为第二局部特征图;Taking the global feature of the image currently being similarly compared with the to-be-processed image in the designated storage area as the second global feature, and taking the local part of the image currently being similarly compared with the to-be-processed image in the designated storage area The feature map is used as the second local feature map;
    若所述第一全局特征与所述第二全局特征之间的距离小于第一距离阈值,确定所述第一全局特征与所述第二全局特征满足第一相似条件;If the distance between the first global feature and the second global feature is less than a first distance threshold, determining that the first global feature and the second global feature satisfy a first similarity condition;
    计算相互对应的第一局部特征以及第二局部特征之间的特征距离,所述第一局部特征为所述第一局部特征图包括的局部特征,所述第二局部特征为所述第二局部特征图包括的局部特征;Calculate the feature distance between the corresponding first local feature and the second local feature, the first local feature is the local feature included in the first local feature map, and the second local feature is the second local feature The local features included in the feature map;
    将对应的所述特征距离小于第二距离阈值的第一局部特征作为目标局部特征;Taking the first local feature whose corresponding feature distance is less than the second distance threshold as the target local feature;
    若所述目标局部特征的数量与所述第一局部特征图包括的局部特征的数量的比值大于比例阈值,确定所述第一局部特征图与所述第二局部特征图满足第二相似条件。If the ratio of the number of target local features to the number of local features included in the first local feature map is greater than a scale threshold, it is determined that the first local feature map and the second local feature map satisfy a second similarity condition.
  9. 根据权利要求6-8任一所述的方法,其特征在于,所述基于所述待处理图像的全局特征以及局部特征图,在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像之前还包括:The method according to any one of claims 6-8, wherein, based on the global feature and local feature map of the to-be-processed image, searching for an image similar to the to-be-processed image in a designated storage area, and obtaining Similar images also include:
    将所述待处理图像输入到目标神经网络,获取所述目标神经网络输出的特征图作为初始特征图;Input the image to be processed into the target neural network, and obtain the feature map output by the target neural network as the initial feature map;
    对所述初始特征图进行全局平均池化处理,得到所述全局特征;Performing global average pooling on the initial feature map to obtain the global feature;
    获取所述初始特征图中多个位置各自对应的特征集合,每个所述位置对应的特征集合包括每个位置的特征,以及每个位置的相邻位置的特征;Obtaining feature sets corresponding to multiple positions in the initial feature map, where the feature sets corresponding to each position include features of each position and features of adjacent positions of each position;
    对每个所述位置各自对应的特征集合进行平均处理,得到每个所述位置对应的局部特征;Average processing is performed on the respective feature sets corresponding to each of the positions to obtain local features corresponding to each of the positions;
    基于所述每个所述位置对应的局部特征得到所述局部特征图。The local feature map is obtained based on the local features corresponding to each of the positions.
  10. 根据权利要求1-9任一所述的方法,其特征在于,所述指定存储区域为服务器 中的存储区域,所述基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像还包括:The method according to any one of claims 1-9, wherein the designated storage area is a storage area in a server, and the search and the to-be-processed image are searched in the designated storage area based on the characteristics of the to-be-processed image. Images with similar images, obtaining similar images also includes:
    若电子设备检测到当前剩余可用的处理资源满足资源预置条件,则在本地获取所述待处理图像的特征;If the electronic device detects that the currently remaining available processing resources meet the resource preset conditions, the characteristics of the to-be-processed image are acquired locally;
    向所述服务器发送携带有所述待处理图像的特征的查找指令,以使所述服务器根据所述查找指令中的特征在所述指定存储区域中查找与与所述待处理图像相似的图像,得到相似图像。sending a search instruction carrying the characteristics of the image to be processed to the server, so that the server searches for an image similar to the image to be processed in the designated storage area according to the characteristics in the search instruction, get similar images.
  11. 根据权利要求10所述的方法,其特征在于,所述资源预置条件包括剩余可用的处理资源大于指定资源阈值,其中,所述处理资源为CPU可用率。The method according to claim 10, wherein the resource preset condition comprises that the remaining available processing resources are greater than a specified resource threshold, wherein the processing resources are CPU availability.
  12. 根据权利要求1-9任一所述的方法,其特征在于,所述所述指定存储区域为服务器中的存储区域,所述基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像还包括:The method according to any one of claims 1-9, wherein the designated storage area is a storage area in a server, and the search is performed in the designated storage area based on the characteristics of the to-be-processed image in the designated storage area. For images similar to the images to be processed, obtaining similar images also includes:
    若电子设备检测到当前的网络资源满足指定网络条件,则将所述待处理图像增加到查找指令中;If the electronic device detects that the current network resource satisfies the specified network condition, the to-be-processed image is added to the search instruction;
    将所述待处理图像通过所述查找指令发送给所述服务器,以使所述服务器先获取到所述待处理图像的特征后,基于所述待处理图像的特征在所述指定存储区域中查找与所述待处理图像相似的图像,得到相似图像。Send the image to be processed to the server through the search instruction, so that the server first obtains the feature of the image to be processed, and then searches the specified storage area based on the feature of the image to be processed Similar images to the images to be processed are obtained.
  13. 根据权利要求12所述的方法,其特征在于,所述指定网络条件包括以下条件中的至少一个:当前是基于WIFI通信方式接入的互联网;以及网络传输速率满足指定效率。The method according to claim 12, wherein the specified network condition comprises at least one of the following conditions: the Internet is currently accessed based on WIFI communication; and the network transmission rate satisfies the specified efficiency.
  14. 根据权利要求10-13任一所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 10-13, wherein the method further comprises:
    触发同时检测是否满足资源阈值条件和指定网络条件;Trigger to detect whether resource threshold conditions and specified network conditions are met at the same time;
    若先获取到对于所述资源阈值条件的检测结果,且检测到满足所述资源阈值条件,则执行向所述服务器发送携带有所述待处理图像的特征的查找指令;If the detection result for the resource threshold condition is obtained first, and it is detected that the resource threshold condition is satisfied, execute a search instruction that carries the feature of the image to be processed to the server;
    若先获取到对于所述指定网络条件的检测结果,且检测到满足所述指定网络条件,则执行将所述待处理图像通过所述查找指令发送给所述服务器。If the detection result for the specified network condition is obtained first, and it is detected that the specified network condition is satisfied, then the image to be processed is sent to the server through the search instruction.
  15. 根据权利要求14所述的方法,其特征在于,所述触发同时检测是否满足资源阈值条件和指定网络条件之后还包括:The method according to claim 14, wherein the triggering, after simultaneously detecting whether the resource threshold condition and the specified network condition are satisfied, further comprises:
    若检测到既不满足所述资源阈值条件,也不满足所述指定网络条件,则采用提供随机获取的图像处理参数,以基于所述随机获取的图像处理参数对所述待处理图像进行处理。If it is detected that neither the resource threshold condition nor the specified network condition is met, the image processing parameters obtained randomly are used to process the image to be processed based on the randomly obtained image processing parameters.
  16. 一种图像处理方法,其特征在于,应用于服务器,所述方法包括:An image processing method, characterized in that, applied to a server, the method comprising:
    接收电子设备发送的待处理图像;Receive images to be processed sent by electronic devices;
    基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,所述指定存储区域中的图像对应有图像处理参数;Search for an image similar to the image to be processed in a designated storage area based on the feature of the image to be processed, to obtain a similar image, wherein the image in the designated storage area corresponds to an image processing parameter;
    获取所述相似图像对应的图像处理参数;obtaining image processing parameters corresponding to the similar images;
    基于所述图像处理参数对所述待处理图像进行图像处理,得到处理后的图像;Perform image processing on the to-be-processed image based on the image processing parameters to obtain a processed image;
    将所述处理后的图像返回给所述电子设备。The processed image is returned to the electronic device.
  17. 一种图像处理装置,其特征在于,运行于电子设备,所述装置包括:An image processing device, characterized in that it runs on electronic equipment, and the device includes:
    图像获取单元,用于获取待处理图像;an image acquisition unit, used to acquire an image to be processed;
    图像查找单元,用于基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,所述指定存储区域中的图像对应有图像处理参数;an image search unit, configured to search for an image similar to the image to be processed in a designated storage area based on the feature of the image to be processed, to obtain a similar image, wherein the image in the designated storage area corresponds to an image processing parameter;
    参数获取单元,用于获取所述相似图像对应的图像处理参数;a parameter obtaining unit, used for obtaining image processing parameters corresponding to the similar images;
    图像处理单元,用于基于所述图像处理参数对所述待处理图像进行图像处理。An image processing unit, configured to perform image processing on the to-be-processed image based on the image processing parameter.
  18. 一种图像处理装置,其特征在于,运行于服务器,所述装置包括:An image processing device, characterized in that it runs on a server, and the device includes:
    数据通信单元,用于接收电子设备发送的待处理图像;A data communication unit, used for receiving the image to be processed sent by the electronic device;
    图像查找单元,用于基于所述待处理图像的特征在指定存储区域中查找与所述待处理图像相似的图像,得到相似图像,其中,所述指定存储区域中的图像对应有图像处理参数;an image search unit, configured to search for an image similar to the image to be processed in a designated storage area based on the feature of the image to be processed, to obtain a similar image, wherein the image in the designated storage area corresponds to an image processing parameter;
    参数获取单元,用于获取所述相似图像对应的图像处理参数;a parameter obtaining unit, used for obtaining image processing parameters corresponding to the similar images;
    图像处理单元,用于基于所述图像处理参数对所述待处理图像进行图像处理,得到处理后的图像;an image processing unit, configured to perform image processing on the to-be-processed image based on the image processing parameter to obtain a processed image;
    所述数据通信单元,还用于将所述处理后的图像返回给所述电子设备。The data communication unit is further configured to return the processed image to the electronic device.
  19. 一种电子设备,其特征在于,包括处理器以及存储器;An electronic device, comprising a processor and a memory;
    一个或多个程序被存储在所述存储器中并被配置为由所述处理器执行以实现权利要求1-15任一所述的方法。One or more programs are stored in the memory and configured to be executed by the processor to implement the method of any of claims 1-15.
  20. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有程序代码,其中,在所述程序代码被处理器运行时执行权利要求1-15任一所述的方法。A computer-readable storage medium, characterized in that a program code is stored in the computer-readable storage medium, wherein the method of any one of claims 1-15 is executed when the program code is executed by a processor.
PCT/CN2021/133246 2020-12-08 2021-11-25 Image processing method and apparatus, electronic device, and storage medium WO2022121701A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011446215.8A CN112487223A (en) 2020-12-08 2020-12-08 Image processing method and device and electronic equipment
CN202011446215.8 2020-12-08

Publications (1)

Publication Number Publication Date
WO2022121701A1 true WO2022121701A1 (en) 2022-06-16

Family

ID=74941325

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/133246 WO2022121701A1 (en) 2020-12-08 2021-11-25 Image processing method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN112487223A (en)
WO (1) WO2022121701A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117671554A (en) * 2023-10-20 2024-03-08 上海盈蝶智能科技有限公司 Security monitoring method and system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112487223A (en) * 2020-12-08 2021-03-12 Oppo广东移动通信有限公司 Image processing method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130129214A1 (en) * 2010-08-04 2013-05-23 Nec Corporation Image processing method, image processing apparatus, and image processing program
CN109857889A (en) * 2018-12-19 2019-06-07 苏州科达科技股份有限公司 A kind of image search method, device, equipment and readable storage medium storing program for executing
CN111031239A (en) * 2019-12-05 2020-04-17 Oppo广东移动通信有限公司 Image processing method and apparatus, electronic device, and computer-readable storage medium
CN111738957A (en) * 2020-06-28 2020-10-02 携程计算机技术(上海)有限公司 Intelligent beautifying method and system for image, electronic equipment and storage medium
CN111930983A (en) * 2020-08-18 2020-11-13 创新奇智(成都)科技有限公司 Image retrieval method and device, electronic equipment and storage medium
CN112487223A (en) * 2020-12-08 2021-03-12 Oppo广东移动通信有限公司 Image processing method and device and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108022207A (en) * 2017-11-30 2018-05-11 广东欧珀移动通信有限公司 Image processing method, device, storage medium and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130129214A1 (en) * 2010-08-04 2013-05-23 Nec Corporation Image processing method, image processing apparatus, and image processing program
CN109857889A (en) * 2018-12-19 2019-06-07 苏州科达科技股份有限公司 A kind of image search method, device, equipment and readable storage medium storing program for executing
CN111031239A (en) * 2019-12-05 2020-04-17 Oppo广东移动通信有限公司 Image processing method and apparatus, electronic device, and computer-readable storage medium
CN111738957A (en) * 2020-06-28 2020-10-02 携程计算机技术(上海)有限公司 Intelligent beautifying method and system for image, electronic equipment and storage medium
CN111930983A (en) * 2020-08-18 2020-11-13 创新奇智(成都)科技有限公司 Image retrieval method and device, electronic equipment and storage medium
CN112487223A (en) * 2020-12-08 2021-03-12 Oppo广东移动通信有限公司 Image processing method and device and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117671554A (en) * 2023-10-20 2024-03-08 上海盈蝶智能科技有限公司 Security monitoring method and system

Also Published As

Publication number Publication date
CN112487223A (en) 2021-03-12

Similar Documents

Publication Publication Date Title
CN111368893B (en) Image recognition method, device, electronic equipment and storage medium
WO2022121701A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN107480176B (en) Picture management method and device and terminal equipment
CN106446950B (en) Image processing method and device
KR101620933B1 (en) Method and apparatus for providing a mechanism for gesture recognition
WO2022012123A1 (en) Data processing method and apparatus, electronic device, and storage medium
KR20160074500A (en) Mobile video search
CN110909209B (en) Live video searching method and device, equipment, server and storage medium
CN109062715B (en) Method and device for determining memory clock frequency and terminal
CN109598250B (en) Feature extraction method, device, electronic equipment and computer readable medium
US10528845B2 (en) Method, device, and storage medium for generating GIF file
CN111124173B (en) Working state switching method and device of touch screen, mobile terminal and storage medium
CN110798718A (en) Video recommendation method and device
WO2021179856A1 (en) Content recognition method and apparatus, electronic device, and storage medium
WO2022012119A1 (en) Data processing method and apparatus, electronic device, and storage medium
CN111182332B (en) Video processing method, device, server and storage medium
CN110188782B (en) Image similarity determining method and device, electronic equipment and readable storage medium
US10157588B2 (en) Systems and methods for image optimization
US20170171339A1 (en) Advertisement data transmission method, electrnoic device and system
WO2022111070A1 (en) Image processing method and apparatus, and electronic device and storage medium
CN110197459B (en) Image stylization generation method and device and electronic equipment
US20170171462A1 (en) Image Collection Method, Information Push Method and Electronic Device, and Mobile Phone
US20170132755A1 (en) Method, device and system for processing image
CN114862720A (en) Canvas restoration method and device, electronic equipment and computer readable medium
CN115841575A (en) Key point detection method, device, electronic apparatus, storage medium, and program product

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21902408

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21902408

Country of ref document: EP

Kind code of ref document: A1