CN111080546B - Picture processing method and device - Google Patents

Picture processing method and device Download PDF

Info

Publication number
CN111080546B
CN111080546B CN201911268890.3A CN201911268890A CN111080546B CN 111080546 B CN111080546 B CN 111080546B CN 201911268890 A CN201911268890 A CN 201911268890A CN 111080546 B CN111080546 B CN 111080546B
Authority
CN
China
Prior art keywords
processed
region
picture
pixel point
determining
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201911268890.3A
Other languages
Chinese (zh)
Other versions
CN111080546A (en
Inventor
孟婉婷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201911268890.3A priority Critical patent/CN111080546B/en
Publication of CN111080546A publication Critical patent/CN111080546A/en
Application granted granted Critical
Publication of CN111080546B publication Critical patent/CN111080546B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

The application provides a picture processing method, which comprises the following steps: acquiring at least two pictures, wherein the at least two pictures comprise a target picture and one or more reference pictures; determining a region to be processed of the target picture, wherein the region to be processed is a region which is shielded by a shielding object in the target picture; and processing the region to be processed according to the region corresponding to the region to be processed in the reference picture, and obtaining a processed target picture. By implementing the method provided by the application, the pictures can be efficiently synthesized, the shielding can be effectively removed, and the quality of the pictures is improved.

Description

Picture processing method and device
Technical Field
The present application relates to the field of image processing, and in particular, to a picture processing method and a picture processing device.
Background
With the development of terminals and the increasing abundance of cultural lives of people, people are increasingly commonly taking photos with the terminals at hand to record the fine instants in life. The acquisition of pictures by using the photographing function of a terminal has become an important part of cultural life of many users. However, the user cannot always get the ideal picture directly by taking a picture. Sometimes, the background area of the picture is shielded and cannot be exposed, so that the picture effect and the user experience are affected. For example, in a scenic spot with a large traffic volume, because the moving people may sometimes cover the scenery, when photographing, only a local scenery is often taken, and other parts of the scenery are covered by the people, so that it is difficult to obtain an ideal picture.
Disclosure of Invention
The embodiment of the application provides a picture processing method, which comprises the following steps: acquiring at least two pictures, wherein the at least two pictures comprise a target picture and one or more reference pictures; determining a region to be processed of the target picture; and processing the region to be processed according to the region corresponding to the region to be processed in the reference picture, and obtaining a processed target picture.
The embodiment of the application provides a picture processing device, which comprises: the image acquisition module is used for acquiring at least two images, wherein the at least two images comprise a target image and one or more reference images; the region determining module is used for determining a region to be processed of the target picture, wherein the region to be processed is a region which is shielded by a shielding object in the target picture; and the picture processing module is used for processing the region to be processed according to the region corresponding to the region to be processed in the reference picture, and obtaining a processed target picture.
The embodiment of the application also provides a picture processing device which comprises a processor and a memory, wherein the processor is used for executing the picture processing method according to the embodiment of the application by calling the instructions stored in the memory.
Drawings
Fig. 1 is a schematic flow chart of a picture processing method according to an embodiment of the present application;
fig. 1a is an example of a target picture according to an embodiment of the present application;
FIG. 1b is an example of a reference picture provided by an embodiment of the present application;
FIG. 1c is an example of a reference picture provided by an embodiment of the present application;
fig. 2 is a schematic flow chart of a picture processing method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a picture processing device according to an embodiment of the present application;
Fig. 4 is a schematic structural diagram of a picture processing device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made more complete in view of the accompanying drawings, wherein it is to be understood that the embodiments described are some, but not all embodiments of the present application; the various features of the described embodiments may be combined with one another, and not all technical combinations are exhaustive. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the application, are within the scope of the application in accordance with embodiments of the present application.
Fig. 1 is a flowchart illustrating a picture processing method according to an exemplary embodiment. The method can be executed by a picture processing device, wherein the device can be realized by software and hardware, can be generally integrated in a terminal with a picture processing function, and can be generally a smart phone, a tablet personal computer, a PC, a notebook computer and the like. The picture processing method may include the steps of:
Step 101, at least two pictures are acquired, wherein the at least two pictures comprise a target picture and one or more reference pictures.
The terminal acquires at least two pictures, wherein the at least two pictures comprise one or more target pictures and one or more reference pictures. For convenience of description, the following embodiments will take a target picture as an example to describe the scheme of the present application. The scheme of the plurality of target pictures can be obtained by analogy with reference to the scheme of one target picture.
The terminal may obtain the picture in a variety of ways, for example: determining, receiving pictures actively sent by other terminals or servers according to instructions of users, acquiring pictures in a picture library (such as pictures in a terminal album) local to the terminals, acquiring pictures from a cloud (such as a cloud album), acquiring pictures from a network, acquiring the pictures through shooting, and the like. But may be obtained in other ways, and the application is not limited in this regard.
Optionally, the terminal may take the picture in various ways. For example:
(1) Direct photographing
When a user needs to take a picture, a shooting function of the terminal is started, such as a camera application in the terminal is started, a camera of the terminal is started, and a to-be-shot object is shot through the camera.
(2) And (5) continuously shooting.
When a user needs to take a picture, the shooting function of the terminal is turned on, a continuous shooting mode is selected, and a plurality of shooting images can be acquired.
(3) Delay shooting
Delay shooting is a shooting technique that shoots images or video at a lower frame rate and then plays the pictures at a normal or faster rate. The time delay controller is utilized to shoot once every certain time interval, and a plurality of pictures obtained by shooting can be continuously projected after a period of time. Therefore, a plurality of photographed images can be obtained in the time-lapse photographing mode
(4) Slow motion photography
Slow motion photography is a technique that photographs, particularly moving objects, with a high-speed camera, and then plays the picture at a slower speed, allowing the high-speed moving object to reveal more detail at a lower speed.
The terminal may also acquire the picture through other shooting modes, which is not limited in the application.
Optionally, each of the at least two pictures acquired by the terminal may be acquired in the same manner or may be acquired in different manners. For example, the terminal may acquire the at least two pictures through shooting modes such as continuous shooting; or the terminal can acquire a picture as a target picture by shooting, and then the terminal determines a plurality of pictures with the similarity higher than a threshold value with the target picture in a local picture library as reference pictures; or the terminal can acquire a picture as a target picture by shooting, and then download the reference picture on the network. The application is not limited in this regard.
Optionally, the terminal may acquire the at least two pictures at one time, or may acquire the at least two pictures multiple times. The terminal can acquire the at least two pictures at the same time, or can acquire part of the pictures first and then acquire other pictures. For example, the terminal may obtain a plurality of continuously shot photos through one continuous shot, and take part or all of the plurality of continuously shot photos as the at least two photos; or, the terminal may acquire a picture by shooting as a target picture, and then select a plurality of pictures with similarity higher than a threshold value with the target picture as reference pictures.
Optionally, the target picture and the reference picture in the at least two pictures acquired by the terminal may be confirmed by the terminal, or may be specified by the user, or may be determined by other manners. Taking the example of obtaining a plurality of continuous photos through continuous shooting: the terminal can select one photo with the best shooting quality from the plurality of continuous photos as a target picture and select one or more other photos as reference pictures. Or, the terminal may receive an instruction of the user, confirm the target picture from the plurality of continuously shot pictures according to the instruction of the user, and then use one or more other pictures as reference pictures.
Optionally, after the target picture is obtained by shooting, the identifier of the target picture is determined, and one or more reference pictures with the same identifier are obtained by searching in a memory of the local terminal or in a network server.
For example, by taking a target picture with a great wall as a background, determining that the identifier of the target picture identifies the category as the great wall, and searching a picture with the same identifier in a server as a reference picture, wherein the reference picture also has the great wall background. By way of example, by taking a target picture taking the night's rufigu as the background, determining that the identifier of the target picture identifies its category as night, rufigu, by searching in the server for a picture with the same identifier as a reference picture, which also contains the scenery of the night's rufigu. The more identifiers, the more advantageous it is to search for reference pictures with high similarity. Since the reference picture and the target picture which are searched have the same identifier, the reference picture and the target picture often have similar backgrounds with the target picture, and the method is beneficial to processing the region to be processed in the target picture according to the reference picture in the subsequent steps.
102, Determining a region to be processed of the target picture, wherein the region to be processed is a region which is shielded by a shielding object in the target picture;
The picture comprises a foreground region and a background region, wherein the foreground region generally refers to people in the picture, the background region generally refers to natural scenery or buildings in a background part in the picture, and the foreground region often causes shielding to part of the background region. For example, an area blocked by the foreground can be directly selected from the picture as the area to be processed. It will be appreciated that the area to be treated may be embodied as a regular shape, e.g. rectangular, circular, etc., including areas obscured by the foreground; or the area to be treated can also be embodied as an irregular shape intercepted according to the outline and shape of the foreground, which is not limited by the scheme of the present disclosure.
The method for determining the area to be processed by the terminal includes various methods, for example:
(1) Confirming the area to be treated by a pre-trained area to be treated determination model
Inputting the target picture into a pre-trained to-be-processed area determining model, wherein the to-be-processed area determining model is generated according to the characteristic rule of the to-be-processed area; and determining the region to be processed according to the output result of the region to be processed determination model. The method has the advantages that the to-be-processed area can be identified rapidly and accurately through the preset to-be-processed area determination model, the picture can be automatically processed without participation of a user, and the picture processing efficiency is improved.
(2) Determining a region to be processed according to the characteristic information of the shielding object
In the embodiment of the application, the target picture is analyzed, and the region to be processed in the target picture is determined, namely, the specific part of picture region in the target picture is determined to be the region to be processed. Illustratively, determining the to-be-processed region in the target picture may include: and determining a picture area containing the preset shelter characteristic information in the target picture as a to-be-processed area in the target picture. The preset shielding object characteristic information can comprise information such as shape information of a preset shielding object, color information, brightness information, texture information, ambiguity and the like of the preset shielding object. For example, the characteristic information of the preset shade may include color information of a person and shape information of the person. Of course, the characteristic information of the preset shade may also include characteristic information of the laundry. The embodiment of the present application is not limited thereto. In the embodiment of the application, the object to be processed, that is, the object to be processed, which is to be shielded from the background during shooting, is usually a relatively fixed object, such as a person, and the characteristics of the object to be processed are relatively fixed. For example, the feature information such as the outline, color, position of the person in the picture, etc. is relatively fixed. Therefore, the image region which contains the preset shielding object characteristic information in the detected target image can be used as the region to be processed.
Optionally, the feature information of the area to be processed may include: at least one of a size of the region to be processed in the picture, a position of the region to be processed in the picture, a shape of the region to be processed in the picture, a brightness of the region to be processed, a color of the region to be processed, a degree of blurring of the region to be processed, and a texture of the region to be processed.
Optionally, the method can be combined with a pre-trained to-be-processed area determination model, the to-be-processed area determination model is trained by utilizing the characteristic information of the preset shielding object, and the to-be-processed area is automatically selected by the model; the method can be combined with manual selection of a user, the terminal prompts potential one or more shielding objects according to the preset shielding object characteristic information, the user can select the potential one or more shielding objects, and the user specifically selects one or more of the potential shielding objects as the area to be processed. The application is not limited in this regard.
(3) User manual selection using selection tool
And determining the shielding object in the target picture in a clicking and selecting mode by a user, wherein the area where the shielding object is positioned is the area to be processed in the target picture.
Illustratively, the user interaction interface provides rectangular, circular, conical, irregularly shaped, etc. pointing tools that the user uses to drag into the target picture to select the region to be processed. The user may select one or more areas to be treated. By way of example, the user may click on a person in a selection mask, and the terminal automatically generates a humanoid outline of the person, and the area covered by the outline is the area to be processed.
And step 103, processing the region to be processed according to the region corresponding to the region to be processed in the reference picture, and obtaining a processed target picture.
The terminal can replace the region to be processed according to the region corresponding to the region to be processed in the reference picture; the pixel information of the corresponding region can be utilized to repair the region to be processed; the two methods can be combined, namely, a part of the picture of the corresponding region is cut to replace the corresponding part of the region to be processed, and the rest part which is not replaced is repaired according to the pixel information of the corresponding region. Wherein, the pixel information may include: and at least one of color values, brightness, positions, characteristic values and the like of pixel points of the region corresponding to the region to be processed in the reference picture. The application is not limited in this regard.
For example, the gate of the cylindrical building in the target picture 1a is blocked by a person, the portion blocked by the person is the region to be processed, and in order to repair the region to be processed, the picture of the region corresponding to the region to be processed in the reference picture 1b, that is, the picture when the gate of the cylindrical building is not blocked, may be used to replace the region to be processed.
For example, the reference picture 1c is moved relative to the position of the person in the target picture 1a, but the region of the reference picture 1c corresponding to the region to be processed in the target picture 1a is not completely exposed, and at this time, the region to be processed in the target picture 1a may be repaired by using the exposed portion. All or part of the area to be processed can be directly replaced by the exposed part of the picture; the region to be processed can be repaired using the pixel information of the exposed portion.
For example, if there are multiple reference pictures, a picture corresponding to the region to be processed in one reference picture may be selected to replace the region to be processed; or a new picture can be synthesized according to the picture of the region corresponding to the region to be processed in the multiple reference pictures to replace the region to be processed.
Repairing the region to be processed according to the pixel information may include: filling the region to be processed according to the average value of the color values of all pixel points of the corresponding region in one reference picture; determining the color value of the pixel point at the corresponding position in the region to be processed according to the color value of the pixel point at any same position of the corresponding region in the multiple reference pictures; and determining the corresponding information of the pixel points in the to-be-processed area according to comprehensive analysis of the color values, the brightness, the positions and the like of the pixel points in the corresponding area. The application is not limited in this regard.
According to the picture processing method provided by the embodiment of the application, the region to be processed is repaired according to the region corresponding to the region to be processed of the target picture from the plurality of reference pictures, so that the shielding can be effectively removed, and the quality of the picture is improved.
The embodiment of the application also provides a picture processing method, and fig. 2 is a schematic flow chart of the picture processing method according to an exemplary embodiment. As shown in fig. 2, the method includes:
step 201, obtaining at least two pictures by shooting, wherein the at least two pictures comprise a target picture and one or more reference pictures;
It will be appreciated that this step may be described with reference to the method embodiment shown in fig. 1, and will not be described here.
Step 202, determining a region to be processed of the target picture through a region to be processed determination model;
Optionally, inputting the target picture into a pre-trained to-be-processed area determination model, wherein the to-be-processed area determination model is generated according to the characteristic rule of the to-be-processed area; and determining the region to be processed according to the output result of the region to be processed determination model. The method has the advantages that the to-be-processed area can be identified rapidly and accurately through the preset to-be-processed area determination model, the picture can be automatically processed without participation of a user, and the picture processing efficiency is improved.
Step 203, obtaining a color value set of pixels in any same position in a region corresponding to the region to be processed in the reference picture;
It will be appreciated that this step may be described with reference to the method embodiment shown in fig. 1, and will not be described here.
And 204, excluding color values of pixel points of the shielding object in the region corresponding to the region to be processed in the plurality of reference pictures from the color value set.
Illustratively, the portion of the target picture 1a blocked by the person is the region to be processed, and the position of the reference picture 1c relative to the person in the target picture 1a is changed, and it can be seen that although the position of the person is changed, the region of the reference picture 1c corresponding to the region to be processed is not completely exposed. At this time, the color value set obtained in step 303 includes the color value of the shielding object in addition to the color value of the pixel point of the background, so that the effect of image processing can be improved by excluding the color value of the pixel point of the shielding object.
The method for eliminating the color value of the pixel point of the shielding object by the terminal can comprise the following steps:
(1) Excluding small and other color values from a set of color values having larger differences
Because the shielding object in the target picture is usually a fixed object such as a person, the color value of the pixel point of the shielding object is often larger than the color value of the pixel point of the background, and under the condition that the exposure effect of the region corresponding to the region to be processed in the reference picture is better, namely, most of the region corresponding to the region to be processed in the reference picture is the background and the shielding object is at least partially the shielding object, the color value of the pixel point of the shielding object can be effectively eliminated by the method.
(2) The color values of the pixels of the occlusion object are excluded from the set of color values by presetting a color value parameter to be excluded or presetting a range of color values to be excluded.
Because the shielding object in the target picture is a relatively fixed object, such as a person, the color values of the pixel points of the shielding object are relatively fixed, and under the condition that the exposure effect of the region corresponding to the region to be processed in the reference picture is relatively poor, namely, a small part of the region corresponding to the region to be processed in the reference picture is a background and most of the region is the shielding object, the color values of the pixel points of the shielding object can be eliminated by presetting the color value range to be eliminated.
And step 205, obtaining an average value or a median of the color values according to the color value set, wherein the average value or the median is used as the color value of the pixel point at the corresponding position in the region to be processed.
Alternatively, an average value or a median of the color values may be calculated according to the color value set, where the average value or the median may be used as the color value of the pixel point at the corresponding position in the area to be processed.
Step 206, after determining the color value of the pixel point at the corresponding position in the to-be-processed area according to the color value set, if an unprocessed portion still exists in the to-be-processed area, complementing the unprocessed portion according to the color value of the pixel point at the edge of the to-be-processed area and the color value of the pixel point of the processed portion of the to-be-processed area.
For example, if the same blocked portion exists in the region corresponding to the region to be processed of the target picture in all the reference pictures, that is, the portion is not exposed in all the reference pictures, it is difficult to achieve the ideal effect of removing the blocking by implementing steps 201 to 205. For example, as for the target picture 1a and the reference picture 1c, the part of the target picture 1a blocked by the person is not completely exposed in the reference picture 1c, and it is difficult to complete the repair of the region to be processed with the reference picture 1c with good effect. In such cases, the unprocessed portion may be complemented with the color values of the pixels at the edges of the region to be processed and the color values of the pixels at the processed portion of the region to be processed.
Alternatively, an average value of the color values of the pixels at the edge of the area to be processed and the processed portion of the area to be processed may be calculated, and the color value of the pixel in the unprocessed portion may be determined according to the average value.
Optionally, a first pixel point is selected from the pixel points at the edge of the area to be processed, a second pixel point is selected from the processed portion, the color value of the central pixel point in the unprocessed area is determined according to the first pixel point and the second pixel point, and the color values of the rest pixel points in the unprocessed portion are determined according to the color value of the central pixel point and the color value of the edge pixel point.
Specifically, a first pixel point is selected from the pixel points at the edge of the area to be processed, a second pixel point is selected from the processed part, weights are distributed to the color values of the two pixel points according to the distance distribution of the two pixel points from the central pixel point of the repair area, and the color value of the central pixel point is the weighted average of the color values of the first pixel point and the second pixel point.
According to the picture processing method provided by the embodiment of the application, the region to be processed is repaired according to the region corresponding to the region to be processed of the target picture from the plurality of reference pictures, so that the shielding in the picture can be effectively removed; under the conditions that the number of the reference pictures is small and the exposed part of the reference pictures corresponding to the to-be-processed area of the target picture is limited, according to the color value of the pixel point at the edge of the to-be-processed area of the target picture and the color value of the pixel point at the processed part of the to-be-processed area, the unprocessed part is complemented, the effect of removing the shielding is improved, and the quality of the picture is improved.
The embodiment of the application also provides a picture processing device for realizing the picture processing method shown in fig. 1 and 2. Fig. 3 is a schematic structural diagram of a picture processing apparatus according to an exemplary embodiment, and as shown in fig. 3, a picture processing apparatus 300 may include:
a picture obtaining module 301, configured to obtain at least two pictures, including a target picture and one or more reference pictures;
the region determining module 302 is configured to determine a region to be processed of the target picture, where the region to be processed is a region in the target picture that is blocked by a blocking object;
And the image processing module 303 is configured to process the to-be-processed area according to the area corresponding to the to-be-processed area in the reference image, so as to obtain a processed target image.
In one possible implementation manner, the above-mentioned picture obtaining module 301 is specifically configured to obtain the at least two pictures by at least one method of delayed shooting, continuous shooting, and slow motion shooting.
In one possible implementation manner, the above-mentioned picture obtaining module 301 is specifically configured to obtain the target picture by shooting; determining an identifier of the target picture; the one or more reference pictures with the same identifier are acquired by searching in the terminal or the server.
In a possible implementation manner, the above-mentioned image processing module 303 is specifically configured to process the to-be-processed area according to the statistical information of the pixels of the area corresponding to the to-be-processed area in the reference image.
In a possible implementation manner, the above-mentioned image processing module 303 is specifically configured to obtain, if there are multiple reference images, color values of pixel points in any same position in an area corresponding to the area to be processed in the multiple reference images to obtain a color value set; and determining the color value of a target pixel point according to the color value set, wherein the target pixel point is a pixel point positioned at a corresponding position in the region to be processed.
In a possible implementation manner, the above-mentioned image processing module 303 is further configured to exclude, from the set of color values, color values of pixel points of the obscuration in the region corresponding to the region to be processed in the plurality of reference images.
In one possible implementation manner, the above-mentioned image processing module 303 is specifically configured to obtain, according to the set of color values, an average value or a median of the color values, where the average value or the median is used as the color value of the target pixel point.
In a possible implementation manner, the above-mentioned picture processing module 303 is further configured to complement the unprocessed portion according to the color value of the pixel point at the edge of the to-be-processed area and the color value of the pixel point of the processed portion of the to-be-processed area if the unprocessed portion exists in the to-be-processed area.
In a possible implementation manner, the above-mentioned region determining module 302 is specifically configured to input the target picture into a pre-trained to-be-processed region determining model, where the to-be-processed region determining model is generated according to a feature rule of the to-be-processed region; and determining the region to be processed according to the output result of the determination model.
In one possible implementation manner, the characteristic rule includes at least one of a size of the region to be processed in the picture, a position of the region to be processed in the picture, a shape of the region to be processed in the picture, a brightness of the region to be processed, a color of the region to be processed, an ambiguity of the region to be processed, and a texture of the region to be processed.
In one possible implementation manner, determining the to-be-processed area of the target picture includes determining an occlusion object in the target picture.
In one possible implementation, the area determining module 302 is further configured to: and removing the obstruction to be reserved from the determined obstruction according to the size, shape, position or mode selected by the user.
In a possible implementation manner, the above-mentioned region determining module 302 is further configured to determine, according to at least one method of a picture offset and a user selection, a region in the reference picture corresponding to the region to be processed.
In a possible implementation manner, the above-mentioned image processing module 303 is further configured to cut, stretch, resize, and angle an area corresponding to the to-be-processed area in the reference image to fill the to-be-processed area.
It can be understood that the functions of each module of the image processing apparatus in the embodiment of the present application may refer to the related descriptions in the method embodiments shown in fig. 1 and fig. 2, which are not repeated herein.
The image obtaining module 301 in the image processing apparatus 300 provided in the embodiment of the present application is configured to obtain at least two images, including a target image and one or more reference images, the area determining module 302 is configured to determine a to-be-processed area of the target image, and the image processing module 303 is configured to process the to-be-processed area according to an area corresponding to the to-be-processed area in the reference image, so as to obtain a processed target image. Therefore, the image processing device 300 provided by the embodiment of the application can remove the shielding of the area to be processed in the image, and improve the quality of the image.
The embodiment of the application also provides a picture processing device for realizing the picture processing method shown in fig. 1 and 2. Fig. 4 is a schematic structural diagram of a picture processing apparatus according to an exemplary embodiment, and as shown in fig. 4, a picture processing apparatus 400 may include: a memory 401, a processor 402, and the processor 402 is configured to execute the picture processing method according to the embodiment of the present application by calling the program and data stored in the memory 401.
The processor 402 in the image processing apparatus 400 provided in the embodiment of the present application may be configured to, by calling the program and the data stored in the memory 401: acquiring at least two pictures, wherein the at least two pictures comprise a target picture and one or more reference pictures; determining a to-be-processed area of a target picture; and processing the region to be processed according to the region corresponding to the region to be processed in the reference picture, and obtaining the processed target picture. Therefore, the image processing device 400 of the embodiment of the application can effectively remove the shielding of the area to be processed in the image, and improve the quality of the image.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the picture processing method provided in the embodiments shown in fig. 1 and 2. The computer-readable storage medium may include, among other things, any type of disk including floppy disks, optical disks, DVDs, CD-ROMs, micro-drives, and magneto-optical disks, ROM, RAM, EPROM, EEPROM, DRAM, VRAM, flash memory devices, magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of media or device suitable for storing instructions and/or data.
The present application also provides a computer program product, where at least one instruction is stored, where the at least one instruction is loaded by the processor and executed by the processor, where the specific execution process may refer to the specific description of the embodiment shown in fig. 1 and fig. 2, and details are not repeated herein.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (19)

1. A method of picture processing, comprising:
Acquiring a target picture by shooting; determining an identifier of the target picture; acquiring one or more reference pictures with the same identifier by searching in a terminal or a server;
Determining a region to be processed of the target picture, wherein the region to be processed is a region which is shielded by a shielding object in the target picture;
processing the region to be processed according to the region corresponding to the region to be processed in the reference picture, including: if a plurality of reference pictures exist, acquiring color value sets of pixel points in any same position in an area corresponding to the area to be processed in the plurality of reference pictures; the color values of the pixel points of the shielding object are eliminated from the color value set through presetting color value parameters to be eliminated or presetting a color value range to be eliminated; obtaining an average value or a median according to the color value set excluding the color values of the pixel points of the shielding object, wherein the average value or the median is used as the color value of the target pixel point; the target pixel points are pixel points positioned at corresponding positions in the region to be processed; if an unprocessed portion exists in the to-be-processed area, selecting a first pixel point from pixel points at the edge of the to-be-processed area, selecting a second pixel point from the processed area, distributing weights to color values of the first pixel point and the second pixel point according to the distance between the first pixel point and the second pixel point and a center pixel point, wherein the color value of the center pixel point is a weighted average of the color values of the first pixel point and the second pixel point, and determining the color values of the rest pixel points in the unprocessed portion according to the color value of the center pixel point and the color value of the edge pixel point to obtain the processed target picture.
2. The method of claim 1, wherein the capturing the target picture by photographing comprises: and acquiring the target picture through at least one method of delay shooting, continuous shooting and slow motion shooting.
3. The method of claim 1, wherein the determining the region to be processed of the target picture comprises:
and selecting the region which is blocked by the foreground from the target picture as a region to be processed.
4. The method of claim 1, wherein the determining the region to be processed of the target picture comprises:
Inputting the target picture into a pre-trained to-be-processed area determination model, wherein the to-be-processed area determination model is generated according to the characteristic rule of the to-be-processed area;
and determining the region to be processed according to the output result of the determination model.
5. The method of claim 4, wherein the characterization rule comprises: at least one of a size of the region to be processed in the picture, a position of the region to be processed in the picture, a shape of the region to be processed in the picture, a brightness of the region to be processed, a color of the region to be processed, a degree of blurring of the region to be processed, and a texture of the region to be processed.
6. The method of claim 1, wherein the determining the region to be processed of the target picture comprises: and determining an occlusion object in the target picture.
7. The method of claim 6, wherein after determining the occlusion in the target picture, further comprising: and removing the obstruction to be reserved from the determined obstruction according to the size, shape, position or mode selected by the user.
8. The method according to claim 1, wherein before the processing the to-be-processed region according to the region corresponding to the to-be-processed region in the reference picture, further comprises: and determining the region corresponding to the region to be processed in the reference picture according to at least one method selected by the user and the picture offset.
9. The method according to claim 1, wherein the processing the region to be processed according to the region corresponding to the region to be processed in the reference picture includes: and cutting, stretching, adjusting the size and angle of the region corresponding to the region to be processed in the reference picture so as to fill the region to be processed.
10. A picture processing apparatus, characterized by comprising:
the image acquisition module is used for acquiring a target image through shooting; determining an identifier of the target picture; acquiring one or more reference pictures with the same identifier by searching in a terminal or a server;
The region determining module is used for determining a region to be processed of the target picture, wherein the region to be processed is a region which is shielded by a shielding object in the target picture;
The image processing module is configured to process the to-be-processed area according to an area corresponding to the to-be-processed area in the reference image, and includes: if a plurality of reference pictures exist, acquiring color value sets of pixel points in any same position in an area corresponding to the area to be processed in the plurality of reference pictures; the color values of the pixel points of the shielding object are eliminated from the color value set through presetting color value parameters to be eliminated or presetting a color value range to be eliminated; obtaining an average value or a median according to the color value set excluding the color values of the pixel points of the shielding object, wherein the average value or the median is used as the color value of the target pixel point; the target pixel points are pixel points positioned at corresponding positions in the region to be processed; if an unprocessed portion exists in the to-be-processed area, selecting a first pixel point from pixel points at the edge of the to-be-processed area, selecting a second pixel point from the processed area, distributing weights to color values of the first pixel point and the second pixel point according to the distance between the first pixel point and the second pixel point and a center pixel point, wherein the color value of the center pixel point is a weighted average of the color values of the first pixel point and the second pixel point, and determining the color values of the rest pixel points in the unprocessed portion according to the color value of the center pixel point and the color value of the edge pixel point to obtain the processed target picture.
11. The picture processing device according to claim 10, wherein the picture acquisition module is specifically configured to: and acquiring the target picture through at least one method of delay shooting, continuous shooting and slow motion shooting.
12. The picture processing device according to claim 10, wherein the region determination module is specifically configured to: and selecting the region which is blocked by the foreground from the target picture as a region to be processed.
13. The picture processing device according to claim 10, wherein the region determination module is specifically configured to:
Inputting the target picture into a pre-trained to-be-processed area determination model, wherein the to-be-processed area determination model is generated according to the characteristic rule of the to-be-processed area;
and determining the region to be processed according to the output result of the determination model.
14. The picture processing apparatus according to claim 13, wherein the characteristic rule includes: at least one of a size of the region to be processed in the picture, a position of the region to be processed in the picture, a shape of the region to be processed in the picture, a brightness of the region to be processed, a color of the region to be processed, a degree of blurring of the region to be processed, and a texture of the region to be processed.
15. The picture processing device of claim 10, wherein the determining the region to be processed of the target picture comprises: and determining an occlusion object in the target picture.
16. The picture processing device of claim 15, wherein the region determination module is further configured to: and removing the obstruction to be reserved from the determined obstruction according to the size, shape, position or mode selected by the user.
17. The picture processing device of claim 10, wherein the region determination module is further configured to: and determining the region corresponding to the region to be processed in the reference picture according to at least one method selected by the user and the picture offset.
18. The picture processing device as claimed in claim 10, wherein the picture processing module is further configured to: and cutting, stretching, adjusting the size and angle of the region corresponding to the region to be processed in the reference picture so as to fill the region to be processed.
19. A computer readable storage medium comprising a processor and a memory, the processor configured to perform the method of picture processing according to any one of claims 1-9 by invoking instructions stored in the memory.
CN201911268890.3A 2019-12-11 2019-12-11 Picture processing method and device Active CN111080546B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911268890.3A CN111080546B (en) 2019-12-11 2019-12-11 Picture processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911268890.3A CN111080546B (en) 2019-12-11 2019-12-11 Picture processing method and device

Publications (2)

Publication Number Publication Date
CN111080546A CN111080546A (en) 2020-04-28
CN111080546B true CN111080546B (en) 2024-06-18

Family

ID=70314005

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911268890.3A Active CN111080546B (en) 2019-12-11 2019-12-11 Picture processing method and device

Country Status (1)

Country Link
CN (1) CN111080546B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112085688A (en) * 2020-09-16 2020-12-15 蒋芳 Method and system for removing pedestrian shielding during photographing
CN113592781A (en) * 2021-07-06 2021-11-02 北京爱笔科技有限公司 Background image generation method and device, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105678685A (en) * 2015-12-29 2016-06-15 小米科技有限责任公司 Picture processing method and apparatus
CN107968917A (en) * 2017-12-05 2018-04-27 广东欧珀移动通信有限公司 Image processing method and device, computer equipment, computer-readable recording medium
CN108566516A (en) * 2018-05-14 2018-09-21 Oppo广东移动通信有限公司 Image processing method, device, storage medium and mobile terminal

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4771087B2 (en) * 2007-02-28 2011-09-14 富士ゼロックス株式会社 Image processing apparatus and image processing program
CN108664782B (en) * 2017-03-28 2023-09-12 三星电子株式会社 Face verification method and device
CN108765380A (en) * 2018-05-14 2018-11-06 Oppo广东移动通信有限公司 Image processing method, device, storage medium and mobile terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105678685A (en) * 2015-12-29 2016-06-15 小米科技有限责任公司 Picture processing method and apparatus
CN107968917A (en) * 2017-12-05 2018-04-27 广东欧珀移动通信有限公司 Image processing method and device, computer equipment, computer-readable recording medium
CN108566516A (en) * 2018-05-14 2018-09-21 Oppo广东移动通信有限公司 Image processing method, device, storage medium and mobile terminal

Also Published As

Publication number Publication date
CN111080546A (en) 2020-04-28

Similar Documents

Publication Publication Date Title
US9521391B2 (en) Settings of a digital camera for depth map refinement
EP3457683B1 (en) Dynamic generation of image of a scene based on removal of undesired object present in the scene
US10147163B2 (en) Systems and methods for automated image cropping
WO2018201809A1 (en) Double cameras-based image processing device and method
EP3108379B1 (en) Image editing techniques for a device
CN107507155B (en) Video segmentation result edge optimization real-time processing method and device and computing equipment
US20150029222A1 (en) Dynamically configuring an image processing function
JP2009093644A (en) Computer-implemented method for tacking 3d position of object moving in scene
JP2021179835A5 (en)
CN107547803B (en) Video segmentation result edge optimization processing method and device and computing equipment
CN110971841B (en) Image processing method, image processing device, storage medium and electronic equipment
CN111080546B (en) Picture processing method and device
WO2018102880A1 (en) Systems and methods for replacing faces in videos
CN107610149B (en) Image segmentation result edge optimization processing method and device and computing equipment
EP4218228A1 (en) Saliency based capture or image processing
CN110727810A (en) Image processing method, image processing device, electronic equipment and storage medium
CN111192286A (en) Image synthesis method, electronic device and storage medium
CN106815237B (en) Search method, search device, user terminal and search server
CN112887610A (en) Shooting method, shooting device, electronic equipment and storage medium
CN112367465A (en) Image output method and device and electronic equipment
US20230209182A1 (en) Automatic photography composition recommendation
CN111225144A (en) Video shooting method and device, electronic equipment and computer storage medium
CN114429484A (en) Image processing method and device, intelligent equipment and storage medium
CN112949392B (en) Image processing method and device, storage medium and terminal
CN107948522B (en) Method, device, terminal and storage medium for selecting shot person head portrait by camera

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant