WO2018137623A1 - Image processing method and apparatus, and electronic device - Google Patents

Image processing method and apparatus, and electronic device Download PDF

Info

Publication number
WO2018137623A1
WO2018137623A1 PCT/CN2018/073882 CN2018073882W WO2018137623A1 WO 2018137623 A1 WO2018137623 A1 WO 2018137623A1 CN 2018073882 W CN2018073882 W CN 2018073882W WO 2018137623 A1 WO2018137623 A1 WO 2018137623A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
information
target object
contour
sample set
Prior art date
Application number
PCT/CN2018/073882
Other languages
French (fr)
Chinese (zh)
Inventor
刘建博
严琼
鲍旭
王子彬
Original Assignee
深圳市商汤科技有限公司
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 深圳市商汤科技有限公司 filed Critical 深圳市商汤科技有限公司
Publication of WO2018137623A1 publication Critical patent/WO2018137623A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/94Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/443Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by matching or filtering
    • G06V10/449Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters
    • G06V10/451Biologically inspired filters, e.g. difference of Gaussians [DoG] or Gabor filters with interaction between the filter responses, e.g. cortical complex cells
    • G06V10/454Integrating the filters into a hierarchical structure, e.g. convolutional neural networks [CNN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/752Contour matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • G06V20/625License plates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • G06V40/165Detection; Localisation; Normalisation using facial parts and geometric relationships
    • 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/20004Adaptive image processing
    • G06T2207/20012Locally adaptive

Definitions

  • the embodiments of the present application relate to image processing technologies, and in particular, to an image processing method, apparatus, and electronic device.
  • the embodiment of the present application provides an image processing technical solution.
  • an image processing method includes: determining target object information from an image to be processed; determining a foreground region and the foreground region in the image according to the target object information and a predetermined object contour template. a background area; performing blurring processing on the foreground area and/or the background area.
  • the determining the foreground area and the background area in the image according to the target object information and the predetermined object contour template comprises: matching at least a partial area in the object outline template with the target object information; Determining difference information between an object contour in the object contour template and a contour of the target object in the image according to the matching result; adjusting an object contour in the object contour template according to the difference information; adjusting the object A contour is mapped into the image to obtain a foreground region of the image including the target object and a background region including at least a portion of the foreground region.
  • the difference information includes: scaling information, offset information, and/or angle information between an object contour in the object contour template and a contour of the target object in the image.
  • the image comprises: a still image or a video frame image.
  • the image is a video frame image
  • the determining target object information from the image to be processed includes: according to target object information determined from a video frame image before the video frame image to be processed, Determining the target image information by the video frame image to be processed; or determining the target object information in each video frame image in the video stream by performing video-by-video frame image detection on the video stream to be processed.
  • the image processing method further includes: determining a transition region between the foreground region and the background region; and performing a blurring process on the transition region.
  • the performing the blurring process on the transition region comprises: performing progressive blurring processing or spot processing on the transition region.
  • the determining target object information from the image to be processed includes: acquiring object selection information; and determining the target object information from the to-be-processed image according to the object selection information.
  • the determining target object information from the image to be processed includes: detecting a target object from the image to be processed, and obtaining the target object information.
  • detecting the target object from the image to be processed obtaining the target object information, including: detecting a target object from the image to be processed through a pre-trained depth neural network, and obtaining the target object information .
  • the target object information includes any one or more of the following: face information, license plate information, house number information, address information, identity ID information, and trademark information.
  • the face information includes any one or more of the following: information of a face key point, face position information, face size information, and face angle information.
  • the object contour template includes any one or more of the following: a face contour template, a human body contour template, a license plate contour template, a house card contour template, and a predetermined frame contour template.
  • the object contour template includes: a plurality of human body contour templates respectively corresponding to different human face angles; and determining the foreground area and the background area in the image according to the target object information and the predetermined object contour template And further comprising: determining, from the object contour template, a human body contour template corresponding to the face angle information in the face information.
  • the depth neural network is configured to detect face key point information and pre-training by: acquiring a first sample set, the first sample set including a plurality of unlabeled sample images; a neural network, performing key point position labeling on each of the unlabeled sample images in the first sample set to obtain a second sample set, wherein the deep neural network is used to perform key point positioning on the image; The partial sample image and the third sample set in the second sample set are adjusted to adjust parameters of the deep neural network, wherein the third sample set includes a plurality of labeled sample images.
  • the depth point neural network is used to perform key point position labeling on each of the unlabeled sample images in the first sample set to obtain a second sample set, including: collecting the first sample set Each of the unlabeled sample images is subjected to image transformation processing to obtain a fourth sample set; wherein the image transformation process includes any one or more of the following: rotation, translation, scaling, noise addition, and occlusion; a deep neural network, performing key point position labeling on the fourth sample set and each sample image in the first sample set to obtain the second sample set.
  • the parameter of the deep neural network is adjusted according to at least part of the sample image and the third sample set in the second sample set, including: for each unlabeled sample image in the first sample set, Determining, according to the key point position information of the unlabeled sample image, the key point position information of the unlabeled sample image is an optional sample; wherein the key point position information of the unlabeled sample image is And key point position information after performing image transformation processing are all included in the second sample set; adjusting the deep neural network according to each of the selectable samples and the third sample set in the second sample set Parameters.
  • the face key point includes any one or more of the following: an eye key point, a nose key point, a mouth key point, an eyebrow key point, and a face contour key point.
  • an image processing apparatus including: an object information determining module, configured to determine target object information from an image to be processed; a front background determining module, configured to use the object information according to the object information Determining the target object information determined by the module and the predetermined object contour template to determine a foreground area and a background area in the image; a blurring processing module, configured to determine a foreground area and/or the background area of the front background determining module Perform blurring.
  • the front background determining module includes: a template matching unit, configured to match at least a local area in the object contour template with the target object information; and a difference determining unit, configured to perform, according to the template matching unit
  • the matching result determines difference information between the object contour in the object contour template and the contour of the target object in the image
  • the contour adjusting unit is configured to adjust the object contour template according to the difference information determined by the difference determining unit An object contour
  • a front background determining unit configured to map an object contour adjusted by the contour adjusting unit into the image, obtain a foreground region including the target object in the image, and include at least a portion of the foreground region Background area.
  • the difference information includes: scaling information, offset information, and/or angle information between an object contour in the object contour template and a contour of the target object in the image.
  • the image comprises: a still image or a video frame image.
  • the image is a video frame image
  • the object information determining module includes: a first object information determining unit, configured to determine, according to the target object information determined from the video frame image before the video frame image to be processed, Determining the target object information from the to-be-processed video frame image; or, the second object information determining unit is configured to perform video-by-video frame image detection by the video stream to be processed, and determine each video frame image in the video stream.
  • Target object information in .
  • the image processing apparatus further includes: a transition area determining module, configured to determine a transition area between the foreground area and the background area; and a transition blur processing module, configured to determine a transition of the transition area determining module The area is blurred.
  • the transition blur processing module is configured to perform progressive blurring processing or spot processing on the transition region.
  • the object information determining module includes: a selection information acquiring unit, configured to acquire object selection information; and a third object information determining unit, configured to: according to the object selection information acquired by the selection information acquiring unit, from the to-be-processed The target object information is determined in the image.
  • the object information determining module includes: a fourth object information determining unit, configured to detect a target object from the image to be processed, and obtain the target object information.
  • the fourth object information determining unit is configured to detect the target object from the image to be processed by using a pre-trained depth neural network to obtain the target object information.
  • the target object information includes any one or more of the following: face information, license plate information, house number information, address information, identity ID information, and trademark information.
  • the face information includes any one or more of the following: information of a face key point, face position information, face size information, and face angle information.
  • the object contour template includes any one or more of the following: a face contour template, a human body contour template, a license plate contour template, a house card contour template, and a predetermined frame contour template.
  • the object contour template includes: a plurality of human body contour templates respectively corresponding to different human face angles; the front background determining module is further configured to determine the image according to the target object information and a predetermined object contour template. Before the foreground area and the background area, a human body contour template corresponding to the face angle information in the face information is determined from the object outline templates.
  • the device further includes: a sample set obtaining module, configured to acquire a first sample set, the first sample set includes a plurality of unlabeled sample images; and a key point position labeling module is configured to be based on the deep nerve a network, performing key point position labeling on each of the unlabeled sample images in the first sample set to obtain a second sample set, wherein the deep neural network is used for key point positioning of the image; the network parameter adjustment module And a parameter for adjusting the depth neural network according to at least a partial sample image and a third sample set in the second sample set, wherein the third sample set includes a plurality of labeled sample images.
  • a sample set obtaining module configured to acquire a first sample set, the first sample set includes a plurality of unlabeled sample images
  • a key point position labeling module is configured to be based on the deep nerve a network, performing key point position labeling on each of the unlabeled sample images in the first sample set to obtain a second sample set, wherein the deep neural
  • the key point location labeling module includes: an image transform processing unit, configured to perform image transform processing on each of the unlabeled sample images in the first sample set to obtain a fourth sample set;
  • the image transformation process includes any one or more of the following: rotation, translation, scaling, noise addition, and occlusion; a key point location unit for using the fourth sample set and the location based on the depth neural network
  • Each of the unlabeled sample images in the first sample set performs key point position labeling to obtain the second sample set.
  • the network parameter adjustment module includes: an optional sample determining unit, configured to perform, for each unlabeled sample image in the first sample set, a key point after image transformation processing based on the unlabeled sample image Position information, determining whether the key point position information of the unlabeled sample image is an optional sample; wherein the key point position information of the unlabeled sample image and the key point position information after performing image transformation processing are included in And the network parameter adjustment unit is configured to adjust parameters of the deep neural network according to each of the selectable samples and the third sample set in the second sample set.
  • the face key point includes any one or more of the following: an eye key point, a nose key point, a mouth key point, an eyebrow key point, and a face contour key point.
  • an electronic device including:
  • another electronic device including: a processor and a memory;
  • the memory is configured to store at least one executable instruction that causes the processor to perform operations corresponding to any of the image processing methods described above.
  • a computer program comprising computer readable code, the processor in the device executing the above-described implementation of the present application when the computer readable code is run on a device
  • a computer readable storage medium for storing computer readable instructions, and when the instructions are executed, implementing the image processing method according to any one of the foregoing embodiments of the present application. The operation of each step in the process.
  • the image to be processed is detected to determine target object information, and the foreground area and the background area in the image to be processed are acquired according to the determined target object information and the object contour template, and then The background area and/or the foreground area are blurred, so that the foreground area or the background area in which the blurring process needs to be performed can be automatically determined by the target object information detected from the image without manually marking the user to perform the blurring process
  • the area or manual execution of the blur (blur) operation improves the convenience and accuracy of the operation.
  • FIG. 1 is a flow chart of an image processing method according to an embodiment of the present application.
  • FIG. 2 is a flowchart of an image processing method according to another embodiment of the present application.
  • FIG. 3 is a flowchart of an image processing method according to still another embodiment of the present application.
  • FIG. 4 is a schematic diagram of an exemplary character outline template including a human body and a face contour template including a human face in the embodiment of the present application;
  • FIG. 5 is a flow chart of an exemplary method of training a keypoint location model in an embodiment of the present application
  • FIG. 6 is a logic block diagram of an image processing apparatus according to an embodiment of the present application.
  • FIG. 7 is a logic block diagram showing an image processing apparatus according to another embodiment of the present application.
  • FIG. 8 is a logic block diagram showing an image processing apparatus according to still another embodiment of the present application.
  • FIG. 9 is a schematic structural view showing an electronic device according to an embodiment of the present application.
  • Embodiments of the present application can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with numerous other general purpose or special purpose computing system environments or configurations.
  • Examples of well-known terminal devices, computing systems, environments, and/or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, and the like include, but are not limited to, personal computer systems, server computer systems, thin clients, thick clients Machines, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, networked personal computers, small computer systems, mainframe computer systems, and distributed cloud computing technology environments including any of the above, and the like.
  • Electronic devices such as terminal devices, computer systems, servers, etc., can be described in the general context of computer system executable instructions (such as program modules) being executed by a computer system.
  • program modules may include routines, programs, target programs, components, logic, data structures, and the like that perform particular tasks or implement particular abstract data types.
  • the computer system/server can be implemented in a distributed cloud computing environment where tasks are performed by remote processing devices that are linked through a communication network.
  • program modules may be located on a local or remote computing system storage medium including storage devices.
  • FIG. 1 is a flow chart of an image processing method according to an embodiment of the present application.
  • the image processing method can be implemented in any terminal device, personal computer or server. Referring to FIG. 1, the image processing method of this embodiment includes:
  • target object information is determined from the image to be processed.
  • the image to be processed has a certain resolution, and may be an image taken by using a shooting device (such as a mobile phone, a digital camera, a camera, etc.), or may be a pre-stored image (such as an image in a mobile phone album). It can also be an image in a video sequence.
  • the image may be an image of a subject, an animal, a vehicle, an object (such as a business card, an ID card, a license plate, etc.). If the image is a person image, the image may also be a portrait (close-up), a bust, or a full-body photo.
  • the target object information can be determined/detected from the image to be processed by any suitable image analysis technique.
  • the detected target object information can be used to locate the area occupied by the target object in the image.
  • the target object information may include, but is not limited to, any one or more of the following: location, size of the target object, information of the key part (such as the position of the nose, face position and size, etc.), key points of the target object, targets The attribute information of the object (such as the skin color of the person).
  • the step S110 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by the object information determining module 610 being executed by the processor.
  • step S120 a foreground area and a background area in the image are determined based on the target object information and a predetermined object outline template.
  • the target object information determined in step S110 can be used to locate an area occupied by the target object in the image, and thus can be distinguished according to the determined target object information and the object outline template representing the shape and proportional relationship of the target object.
  • An area occupied by the target object in the image to be processed, and an area occupied by the target object in the image to be processed is determined as a foreground area of the image, and at least a part of the image area outside the foreground area is determined as a background region.
  • the human face has a relatively determined position and proportional relationship in the whole human body, and can match the detected target object information with the character outline template that characterizes the shape and proportion of the human body, thereby delineating that the character occupies the image to be processed.
  • the area is used as the foreground area, and all or part of the area other than the foreground area in the image to be processed is determined as the background area.
  • the step S120 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a front background determination module 620 that is executed by the processor.
  • step S130 the determined foreground area and/or background area is subjected to blurring processing.
  • the background area and/or the foreground area may be blurred according to the needs of the application scenario.
  • the determined background area may be blurred to highlight the captured target object in the image screen to improve the shooting effect; or the foreground area (such as the character area or the license plate) may be blurred to blur the display target.
  • the object person, ID number, or license plate number, etc. protects the privacy information; or, the determined background area and foreground area may be blurred at the same time.
  • the foreground area and/or the background area may be blurred by using any suitable image blurring technique.
  • the blurring filter can be used to blur the background area and/or the foreground area, that is, to change the adjacent pixel values by Gaussian filtering to achieve a blurred visual effect.
  • the above is only an exemplary implementation, and the foreground area and/or the background area may be blurred by any other blurring method.
  • the step S130 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a blurring processing module 630 executed by the processor.
  • the image to be processed is detected to determine target object information, and the foreground area and the background area in the image to be processed are acquired according to the determined target object information and the object contour template, and then The background area and/or the foreground area are blurred, so that the foreground area or the background area in which the blurring process needs to be performed can be automatically determined by the target object information detected from the image without manually marking the user to perform the blurring process
  • the area or manual execution of the blur (blur) operation improves the convenience and accuracy of the operation.
  • FIG. 2 is a flow chart of an image processing method according to another embodiment of the present application.
  • the image processing method of this embodiment includes:
  • step S210 target object information is determined from the image to be processed.
  • the target object may be a character, an animal, or any object (such as a license plate, a vehicle, an ID card).
  • the determined target object information may include any one or more of the following: face information, license plate information, house number information, address information, identification (ID) information, trademark information, but is not limited to the above information.
  • the target object information each characterizes at least a portion of the features of the target object in the image in which the target object is captured.
  • the step S210 may include step S212 and step S213.
  • object selection information is acquired, and the object selection information may be, for example, information of an image area specified by (user), identification (ID) information of an object, information of an object type, and the like.
  • ID identification
  • target object information is determined from the image to be processed based on the object selection information. For example, the target object information is determined in the specified image area based on the information of the image area specified by the user.
  • the steps S21 and S213 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a selection information acquiring unit 6103 and a third object information determining unit 6104, respectively, which are executed by the processor.
  • the image can be detected based on the object selection information provided separately, and the target object information can be acquired.
  • step S210 may include: S214: detecting a target object from the image to be processed, and obtaining the detected target object information. That is to say, the target object is first detected from the image, and the target object information is determined according to the detected target object.
  • the target object may be detected from the image to be processed through a pre-trained deep neural network to obtain the detected target object information.
  • a deep neural network for detecting a target object may be pre-trained by a sample image labeled with object object information for detecting a deep neural network of a target object such as a vehicle, a face, a pedestrian, an animal, or the like.
  • the image to be processed is input to the deep neural network, and the target object information is acquired by the detection process of the deep neural network.
  • the image to be processed may be a still image captured, a video frame image in the recorded video content, or a video frame image in the online video stream.
  • step S210 may include: S215, determining the target object information from the video frame image to be processed according to the target object information determined from the previous video frame image.
  • the position and size of the same target object between successive video frames are relatively close. Therefore, the video to be processed can be detected from the current video frame image to be detected according to the target object information determined from the previous or previous video frame images.
  • the target object information of the frame image thereby improving the detection efficiency.
  • the step S215 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by the first object information determining unit 6101 being executed by the processor.
  • step S210 may include: S216, performing video-by-video frame image detection by the video stream to be processed, and determining target object information in each video frame image in the video stream.
  • step S216 may be performed by the processor invoking a corresponding instruction stored in the memory, or may be performed by the second object information determining unit 6102 being executed by the processor.
  • video frame in the video stream to be processed mentioned above may represent a real frame in the video stream, and may also be represented as a sample frame in the video stream that needs to be processed. .
  • the target object information is detected from the image to be processed by the processing of any of the foregoing embodiments.
  • the step S210 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by the object information determining module 610 executed by the processor.
  • step S220 a foreground area and a background area in the image are determined according to the target object information and a predetermined object outline template.
  • step S220 in this embodiment includes the following steps S221, S223, S225, S227, and S229.
  • step S221 at least a partial area in the object contour template is matched with the determined target object information.
  • the object contour template can be preset to outline the outline of the target object that may appear in the image, or that is of interest or to be detected.
  • a character outline template, a car outline template, a dog's outline template, and the like may be set in advance for matching with the target object information.
  • the object contour template may include, but is not limited to, any one or more of the following: a face contour template, a human body contour template, a license plate contour template, a house card contour template, a predetermined frame. Outline templates, etc.
  • the face contour template is used to match the silhouette of the person in the recent photo of the person
  • the human body contour template is used to match the silhouette of the person in the whole body or the half body photo
  • the license plate contour template is used to match the license plate contour on the vehicle in the image, the predetermined frame
  • the contour template is used to match the contour of an object having a predetermined shape, such as an identity card or the like.
  • At least a local area in the object contour template may be matched with the determined target object information.
  • the determined target object information is the license plate information of the vehicle
  • the contour template of the front side of the vehicle can be matched with respect to the position of the license plate.
  • the target object since the target object may not be photographed at the time of photographing, when the object contour template is matched with the target object information, the local region of the object contour template may be matched with the determined target object information to determine that the target object is in the image. The area occupied by.
  • the step S221 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a template matching unit 6201 executed by the processor.
  • step S223 difference information between the object contour in the object contour template and the contour of the target object in the image is determined according to the matching result.
  • the object contour template that characterizes the common features of the object may not be the same size as the object size in the image to be processed, and the position, posture angle, and the like of the object may deviate from the position, posture angle, and the like in the object contour template.
  • the object contour template may be first scaled, translated, and/or rotated, and then matched with the determined object's position, size, or key point to obtain the object contour and the image to be processed in the object contour template. Information about the difference between the contours of the object.
  • the difference information may include, but is not limited to, scaling information and/or offset information between the object contour in the object contour template and the contour of the target object in the image, and the like, and may also include, for example, an object contour template. Angle information between the contour of the object and the contour of the target object in the image, and the like.
  • the step S223 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a difference determining unit 6202 executed by the processor.
  • step S225 the object contour in the object contour template is adjusted according to the difference information.
  • the object contour in the object contour template may be scaled, translated, rotated, etc. according to the difference information including the aforementioned scaling information, offset information, etc., to match the area in which the target object is located in the image.
  • the step S225 may be performed by the processor invoking a corresponding instruction stored in the memory, or may be performed by the contour adjustment unit 6203 executed by the processor.
  • step S227 the adjusted object contour is mapped into the image to be processed, and the foreground region including the target object and the background region including at least part of the non-foreground region are obtained in the image.
  • the portion of the image to be processed that falls within the adjusted character contour can be determined to include the foreground region of the target object, which is the region occupied by the target object. Further, an image area including the foreground area or an image area including a part of the non-foreground area is determined as the background area of the image.
  • step S227 may be performed by the processor invoking a corresponding instruction stored in the memory, or may be performed by the front background determining unit 6204 being executed by the processor.
  • a transition area between the foreground area and the background area is determined.
  • an image area in the background area that is smaller than a predetermined extended distance from the outer edge of the area where the target object is located may be determined as the transition area. That is to say, the outer edge of the contour of the target object is extended outward by a certain distance, and the extended area is used as the transition area.
  • step S229 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a transition region determination module 640 that is executed by the processor.
  • step S220 or S221-229 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a front background determination module 620 that is executed by the processor.
  • step S230 the determined foreground area and/or the background area are subjected to blurring processing, and progressive blurring processing or spot processing is performed on the determined transition area.
  • the blurring process performed on the determined foreground area and/or the background area is similar to the processing of step S130, and will not be described herein.
  • Progressive blurring or spot processing can be performed on the transition area to make the effect of the blurring process more natural.
  • the step S230 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a transition blur processing module 650 executed by the processor.
  • the still image or the video frame image to be processed is detected in various manners, and the target object information in the still image or the video frame image is determined, according to the determined target object information and the object contour template.
  • the face key point is used as the face information. It should be noted that the face key point is only a feasible implementation manner of the embodiment of the present application, and the face information may further include face location information, face size information, and face angle information. Any one or more of the others.
  • the image processing method of this embodiment includes:
  • step S310 face information is detected from the image to be processed.
  • the face key point is detected from the image to be processed by the pre-trained key point positioning model, and the detected face key point is used as the face information.
  • An exemplary method of training a keypoint location model will be described later.
  • body type between individuals as individuals, they have commonality from the outline of the overall figure, for example, the head is elliptical and the torso is roughly triangular.
  • 4 is a schematic diagram of an exemplary character outline template including a human body and a face contour template including a human face in the embodiment of the present application.
  • the person being photographed may be in a plurality of different angles and distances during the shooting of the person, it is also possible to preset a plurality of character contour templates such as a face, a half body, a portrait, a side body, etc., for matching from different shooting distances. Or the image to be processed captured by the shooting angle. Therefore, at this step S310, face angle information can also be detected from the image to be processed.
  • the step S310 may be performed by the processor invoking a corresponding instruction stored in the memory, or may be performed by the fourth object information determining unit 6105 being executed by the processor.
  • step S320 a human body contour template corresponding to the face angle information is determined from among predetermined body contour templates.
  • the step S320 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a front background determination module 620 that is executed by the processor.
  • step S330 a foreground area and a background area in the image are determined according to the face information and a predetermined human body contour template.
  • step S330 is similar to the processing of the foregoing step S120 or S221 to S229, and details are not described herein.
  • the step S330 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a front background determination module 620 that is executed by the processor.
  • step S340 the foreground area and/or the background area are subjected to blurring processing.
  • This step is similar to the processing of step S130 and will not be described here.
  • the step S340 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a blurring processing module 630 executed by the processor.
  • the face information is obtained by detecting the image to be processed, and the foreground area and the background area in the image to be processed are acquired according to the detected face information and the character outline template, and then The background area and/or the foreground area are blurred, so that when the image related to the person is processed, the foreground area and the background area that need to be processed can be automatically and accurately determined by the face information detected from the image.
  • an exemplary method of the training keypoint location model includes:
  • a first sample set is acquired, the first sample set including a plurality of unlabeled sample images.
  • an image that has been input into the model and has been marked with key position information is generally referred to as an annotated sample image.
  • the key position information refers to the coordinate information of the key point in the image coordinate system.
  • the sample image may be marked in advance by manual labeling or the like.
  • the key points of the face are mainly distributed in the facial organs and facial contours, such as key points of the eyes, key points of the nose, key points of the mouth, key points of the facial contour, and the like.
  • the face key position information is the coordinate information of the face key point in the face image coordinate system. For example, the upper left corner of a sample image containing a human face is recorded as the coordinate origin, and the horizontal direction is the positive direction of the X-axis, and the vertical direction is the positive direction of the Y-axis.
  • the face image coordinate system is established, and the i-th person is The sitting key of the face key point in the face image coordinate system is (x i , y i ), and the sample image obtained by the above method is the labeled sample image.
  • the sample image can be understood as an unlabeled sample image.
  • the first sample set in this step is an image set containing a plurality of the above unlabeled sample images.
  • the step S510 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a sample set acquisition module 660 executed by the processor.
  • step S520 based on the depth neural network, key point position annotation is performed on each of the unlabeled sample images in the first sample set to obtain a second sample set.
  • the deep neural network is used for key point positioning of an image.
  • the deep neural network may be a convolutional neural network, but is not limited thereto. Since the deep neural network is used to locate the key points of the image, the unlabeled sample images in the first sample set are input into the deep neural network, and the key point position annotation can be realized for each unlabeled sample image. . It should be noted that the key point position labeling is to mark the key point position information (ie, coordinate information) in the unlabeled sample image.
  • the key points may include, but are not limited to, any one or more of the following: a face key point, a limb key point, a palm print key point, and a marker key point.
  • the face key point may include, but is not limited to, any one or more of the following: an eye key point, a nose key point, a mouth key point, an eyebrow key point, and a face contour key point.
  • an unlabeled sample image containing a human face is input into a deep neural network, and the output is an unlabeled sample image itself, and key position information of the unlabeled sample image, such as an eye key.
  • key position information of the unlabeled sample image such as an eye key.
  • the coordinate information of the point, the coordinate information of the nose key point, and the like constitute the second sample set in this step.
  • the step S520 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a keypoint location labeling module 670 that is executed by the processor.
  • step S530 parameters of the deep neural network are adjusted according to at least part of the sample image and the third sample set in the second sample set.
  • the third sample set includes a plurality of labeled sample images.
  • a partial sample image or a full sample image in the second set of samples may be used, and the third set of samples together adjust the parameters of the deep neural network.
  • the labeled sample image can be referred to the description and explanation in step S510 of the embodiment, and details are not described herein again.
  • step S530 may be performed by a processor invoking a corresponding instruction stored in the memory or by a network parameter adjustment module 680 executed by the processor.
  • the method for training a key point localization model uses two sample sets to adjust parameters of the deep neural network, one of which is a second sample set, the second sample set is derived from a deep neural network, including A first sample set of a plurality of unlabeled sample images is obtained by key point position annotation; and the other is a third sample set including a plurality of labeled sample images.
  • the embodiment of the present application can improve the training accuracy of the key point positioning model under the premise that the images input to the model are not all labeled images, in other words, the sample resource waste can be avoided, and the efficiency of the model training can be improved.
  • step S520 may include a process of performing image transformation processing on each unlabeled sample image in the first sample set to obtain a fourth sample set, where the image transformation
  • the processing may include, for example but not limited to, any one or more of the following: rotation, translation, scaling, noise addition, and occlusion, but is not limited thereto; based on the depth neural network, the fourth sample set and the Each sample image in the first sample set is subjected to key point position annotation to obtain the second sample set.
  • the set angle is usually in the range of (-20°, 20°), that is, a rotation transformation of a small amplitude.
  • the translation processing is also a small displacement. Pan.
  • the first sample set includes 10,000 unlabeled sample images, and each of the unlabeled sample images is subjected to image transformation processing (such as scaling, translation, etc.) to obtain 10 image-converted unlabeled sample images. At this time, 10,000 unlabeled sample images become 100,000 unlabeled sample images, and the 100,000 unlabeled sample images constitute the fourth sample set.
  • the unlabeled sample image is input to the deep neural network based on the same principle as described in the foregoing embodiment, and the fourth sample set and the first sample set are output.
  • Each sample image itself, as well as key point location information for each sample image.
  • step S530 may include: performing key transformation after image transformation processing based on the unlabeled sample image for each unlabeled sample image in the first sample set Position information, determining whether the key point position information of the unlabeled sample image is an optional sample; wherein the key point position information of the unlabeled sample image and the key point position information after performing image transformation processing are included in The second sample set; adjusting parameters of the deep neural network according to each of the selectable samples and the third sample set in the second sample set.
  • the key point position information of the unlabeled sample image and the key point position information after the image transform processing are included in the second sample set.
  • the key point position information after the image conversion processing is performed on the unlabeled sample image, and image correction processing is performed.
  • the image correction processing is the inverse transformation processing of the image transformation processing described above. For example, if an unlabeled sample image is shifted to the right by 5 mm, the key point position information after the image conversion processing is performed on the unlabeled sample image, It is necessary to translate 5 mm to the left to implement image correction processing.
  • the covariance matrix Cov1 is obtained by image-corrected key position information (ie, coordinate values of a series of points), and the covariance matrix Cov1 is expanded into a vector form by column or row by row, and normalized into a unit vector Cov1_v. .
  • the covariance matrix Cov2 is obtained for the key point position information of the unlabeled sample image, and Cov2 is expanded into a vector form column by column or row by row, and normalized into a unit vector Cov2_v.
  • D is compared with the set inner product threshold. If D is less than the inner product threshold, the key position information of the unlabeled sample image is an optional sample. Conversely, if D is greater than or equal to the inner product threshold, the key position information of the unlabeled sample image is not an optional sample.
  • Another way to select an optional sample is that the difference from the above-mentioned judging process is only in the last step. If D is less than the set threshold, image conversion processing is performed on the unlabeled sample image. After the key point position information, image correction processing is performed to obtain image corrected key point position information. Then, the result of the data distribution of the key position information corrected by the image (for example, the mean value of the coordinate values of a series of points) is used, and the key point position is marked on the unlabeled sample image, and the key position information of the label is used as Samples are selected, including in the second sample set.
  • the parameters of the deep neural network may be adjusted according to the commonly used training methods of the deep neural network, and the parameters of the deep neural network are adjusted according to the selected samples and the third sample set in the second sample set, and details are not described herein.
  • any of the methods provided by the foregoing embodiments of the present application may be performed by any suitable device having data processing capabilities, including but not limited to: a terminal device, a server, and the like.
  • any of the methods provided by the foregoing embodiments of the present application may be executed by a processor, such as the processor, by executing a corresponding instruction stored in a memory to perform any of the methods mentioned in the foregoing embodiments of the present application. This will not be repeated below.
  • FIG. 6 is a logic block diagram of an image processing apparatus according to an embodiment of the present application.
  • the image processing apparatus of Embodiment 5 includes an object information determining module 610, a front background determining module 620, and a blurring processing module 630. among them:
  • the object information determining module 610 is configured to determine target object information from the image to be processed.
  • the front background determining module 620 is configured to determine a foreground area and a background area in the image according to the target object information determined by the object information determining module 610 and the predetermined object contour template.
  • the blurring processing module 630 is configured to perform a blurring process on the foreground area and/or the background area determined by the front background determining module 620.
  • the image processing apparatus of the present embodiment can be used to implement the corresponding image processing method in the foregoing method embodiments, and has the beneficial effects of the corresponding method embodiments, and details are not described herein again.
  • FIG. 7 is a logic block diagram showing an image processing apparatus according to another embodiment of the present application.
  • the image processing apparatus of Embodiment 6 includes an object information determining module 610, a front background determining module 620, and a blurring processing module 630.
  • the front background determining module 620 includes a template matching unit 6201, a difference determining unit 6202, a contour adjusting unit 6203, and a front background determining unit 6204. among them:
  • the template matching unit 6201 is configured to match at least a partial area in the foregoing object contour template with the determined target object information.
  • the difference determining unit 6202 is configured to determine difference information between the object contour in the object contour template and the contour of the target object in the image according to the matching result of the template matching unit 6201.
  • the contour adjustment unit 6203 is configured to adjust an object contour in the object contour template according to the difference information determined by the difference determining unit 6202.
  • the front background determining unit 6204 is configured to map an object contour adjusted by the contour adjusting unit 6203 into the image, obtain a foreground region including the target object in the image, and a background region including at least a portion not the foreground region.
  • the difference information includes: scaling information, offset information, and/or angle information between an object contour in the object contour template and a contour of the target object in the image.
  • the image may include, but is not limited to, a still image or a video frame image.
  • the image is a video frame image.
  • the object information determining module 610 includes: a first object information determining unit 6101, configured to determine the target object information from the to-be-processed video frame image according to target object information determined from a video frame image before the video frame image to be processed;
  • the second object information determining unit 6102 is configured to perform target-by-video frame image detection by the video stream to be processed, and determine target object information in each of the video frame images.
  • the image processing apparatus of this embodiment further includes: a transition area determining module 640, configured to determine a transition area between the foreground area and the background area; and a transition blur processing module 650, configured to use the transition area The transition area determined by the determination module 640 is blushed.
  • the transition blur processing module 650 is optionally configured to perform progressive blurring processing or spot processing on the transition region.
  • the object information determining module 610 includes: a selection information acquiring unit 6103 for acquiring object selection information; and a third object information determining unit 6104 for acquiring according to the selection information acquiring unit 6103.
  • the object selection information determines the target object information from the image to be processed.
  • the object information determining module 610 includes: a fourth object information determining unit 6105, configured to detect a target object from the image to be processed, and obtain the detected target object information.
  • the fourth object information determining unit 6105 is configured to detect the target object from the image to be processed through a pre-trained depth neural network, and obtain the detected target object information.
  • the target object information may include, but is not limited to, any one or more of the following: face information, license plate information, house number information, address information, identity ID information, and trademark information.
  • the face information may include, but is not limited to, any one or more of the following: information of a face key point, face position information, face size information, and face angle information.
  • the object contour template may include, but is not limited to, any one or more of the following: a face contour template, a human body contour template, a license plate contour template, a house card contour template, and a predetermined frame contour template.
  • the predetermined object contour template may include: a plurality of human body contour templates respectively corresponding to different human face angles; correspondingly, the front background determining module 620 is further configured to use the target object information according to the target object information and the predetermined object contour Before the template determines the foreground area and the background area in the image, a human body contour template corresponding to the face angle information in the face information is determined from among the predetermined object outline templates.
  • the image processing apparatus of the present embodiment is used to implement the corresponding image processing method in the foregoing method embodiments of the present application, and has the beneficial effects of the corresponding method embodiments, and details are not described herein again.
  • FIG. 8 is a logic block diagram showing an image processing apparatus according to still another embodiment of the present application.
  • the image processing apparatus of this embodiment includes an object information determining module 610, a front background determining module 620, and a blurring processing module 630.
  • the image processing apparatus further includes a transition region determining module 640 and a transition blur processing module 650.
  • the image processing apparatus further includes a sample set acquisition module 660, a key point location labeling module 670, and a network parameter adjustment module 680. among them:
  • the sample set obtaining module 660 is configured to acquire a first sample set, where the first sample set includes a plurality of unlabeled sample images.
  • a key point location labeling module 670 configured to perform key point position labeling on each of the unlabeled sample images in the first sample set based on a depth neural network, to obtain a second sample set, where the depth neural network is used For key point positioning of the image.
  • the network parameter adjustment module 680 is configured to adjust parameters of the deep neural network according to at least a partial sample image and a third sample set in the second sample set, where the third sample set includes a plurality of labeled sample images .
  • the key point location labeling module 670 may include: an image transformation processing unit 6701, configured to perform image transformation processing on each unlabeled sample image in the first sample set to obtain a fourth sample set, where
  • the image transformation processing may include, but is not limited to, any one or more of the following: rotation, translation, scaling, noise addition, and occlusion; a key point location labeling unit 6702, for the fourth based on the depth neural network
  • the sample set and each unlabeled sample image in the first sample set perform key point position labeling to obtain the second sample set.
  • the network parameter adjustment module 680 includes: an optional sample determining unit 6801, configured to perform image transformation processing on the basis of the unlabeled sample image for each unlabeled sample image in the first sample set. Point position information, determining whether the key point position information of the unlabeled sample image is an optional sample, wherein the key point position information of the unlabeled sample image and the key point position information after the image transformation processing are included
  • the network parameter adjustment unit 6802 is configured to adjust parameters of the deep neural network according to each of the selectable samples and the third sample set in the second sample set.
  • the face key point may include, but is not limited to, any one or more of the following: an eye key point, a nose key point, a mouth key point, an eyebrow key point, and a face contour key point.
  • the image processing apparatus of the present embodiment is used to implement the corresponding image processing method in the foregoing method embodiments, and has the beneficial effects of the corresponding method embodiments, and details are not described herein again.
  • the embodiment of the present application further provides an electronic device, including: a processor and an image processing apparatus according to any of the foregoing embodiments of the present application.
  • a processor runs the image processing apparatus, the image of any of the foregoing embodiments of the present application
  • the units in the processing unit are operated.
  • the embodiment of the present application further provides another electronic device, including: a processor and a memory, where the memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform image processing in any of the foregoing embodiments of the present application.
  • a processor and a memory where the memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform image processing in any of the foregoing embodiments of the present application. The corresponding operation of the method.
  • FIG. 9 is a schematic structural view showing an electronic device according to an embodiment of the present application.
  • a block diagram of an electronic device 900 suitable for use in implementing a terminal device or server of an embodiment of the present application is shown. As shown in FIG.
  • electronic device 900 includes one or more processors, communication elements, etc., one or more processors such as one or more central processing units (CPUs) 901, and/or one or more image processing
  • processors such as one or more central processing units (CPUs) 901, and/or one or more image processing
  • the GPU 913 or the like, the processor may perform various appropriate operations according to executable instructions stored in the read only memory (ROM) 902 or executable instructions loaded from the storage portion 908 into the random access memory (RAM) 903.
  • the communication component includes a communication component 912 and a communication interface 909.
  • the communication component 912 can include, but is not limited to, a network card, which can include, but is not limited to, an IB (Infiniband) network card, the communication interface 909 includes a communication interface of a network interface card such as a LAN card, a modem, etc., and the communication interface 909 is via a network such as the Internet. Perform communication processing.
  • a network card which can include, but is not limited to, an IB (Infiniband) network card
  • the communication interface 909 includes a communication interface of a network interface card such as a LAN card, a modem, etc.
  • the communication interface 909 is via a network such as the Internet. Perform communication processing.
  • the processor can communicate with the read only memory 902 and/or the random access memory 930 to execute executable instructions, connect to the communication component 912 via the bus 904, and communicate with other target devices via the communication component 912, thereby completing the embodiments of the present application.
  • Corresponding operations of any one of the methods for example, determining target object information from the image to be processed; determining foreground and background regions in the image according to the target object information and the predetermined object contour template; / or the background area is blurred.
  • RAM 903 various programs and data required for the operation of the device can be stored.
  • the CPU 901, the ROM 902, and the RAM 903 are connected to each other by a bus 904.
  • ROM 902 is an optional module.
  • the RAM 903 stores executable instructions or writes executable instructions to the ROM 902 at runtime, the executable instructions causing the processor 901 to perform operations corresponding to the above-described communication methods.
  • An input/output (I/O) interface 905 is also coupled to bus 904.
  • the communication component 912 can be integrated or can be configured to have multiple sub-modules (eg, multiple IB network cards) and be on a bus link.
  • the following components are connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, etc.; an output portion 907 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a storage portion 908 including a hard disk or the like. And a communication interface 909 including a network interface card such as a LAN card, a modem, or the like.
  • Driver 910 is also connected to I/O interface 905 as needed.
  • a removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory or the like is mounted on the drive 910 as needed so that a computer program read therefrom is installed into the storage portion 908 as needed.
  • FIG. 9 is only an optional implementation manner.
  • the number and types of components in FIG. 9 may be selected, deleted, added, or replaced according to actual needs.
  • implementations such as separate settings or integrated settings may also be adopted.
  • the GPU and the CPU may be detachably set or the GPU may be integrated on the CPU
  • the communication component 912 may be separately configured, or may be integrated in the CPU or On the GPU, and so on.
  • embodiments of the present application include a computer program product comprising a computer program tangibly embodied on a machine readable medium, the computer program comprising program code for executing the method illustrated in the flowchart, the program code comprising the corresponding execution
  • the instruction corresponding to the method step provided by the embodiment of the present application determines, for example, the target object information from the image to be processed; and determines the foreground area and the background area in the image according to the target object information and the predetermined object contour template; The foreground area and/or the background area are subjected to blurring processing.
  • the computer program can be downloaded and installed from the network via a communication component, and/or installed from the removable media 911.
  • the computer program is executed by the central processing unit (CPU) 901, the above-described functions defined in the method of the embodiment of the present application are executed.
  • the electronic device 900 of the eighth embodiment detects the image to be processed to determine target object information, and acquires a foreground area and a background area in the image to be processed according to the determined target object information and the object contour template, and then the background area or the foreground area.
  • the blurring process is performed so that the foreground area or the background area in which the blurring process needs to be performed can be automatically determined by the target object information detected from the image without the user manually marking the area where the blurring processing is to be performed or manually performing the virtual (fuzzy) operation to improve the convenience and accuracy of operation.
  • the embodiment of the present application further provides a computer program, including computer readable code, when the computer readable code is run on the device, the processor in the device is configured to implement any of the foregoing embodiments of the present application. Instructions for each step in the image processing method.
  • the embodiment of the present application further provides a computer readable storage medium for storing computer readable instructions, which are executed to implement the operations of the steps in the image processing method of any of the foregoing embodiments of the present application.
  • the methods, apparatus, and apparatus of the present application may be implemented in a number of ways.
  • the method, apparatus, and apparatus of the embodiments of the present application can be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware.
  • the above-described sequence of steps for the method is for illustrative purposes only, and the steps of the method of the embodiments of the present application are not limited to the order of the above optional description unless otherwise specified.
  • the present application may also be embodied as a program recorded in a recording medium, the programs including machine readable instructions for implementing a method in accordance with embodiments of the present application.
  • the present application also covers a recording medium storing a program for executing the method according to the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Biomedical Technology (AREA)
  • Biodiversity & Conservation Biology (AREA)
  • Molecular Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Geometry (AREA)
  • Human Computer Interaction (AREA)
  • Image Analysis (AREA)

Abstract

Provided are an image processing method and apparatus, and an electronic device. The image processing method comprises: determining target object information from an image to be processed; determining a foreground area and a background area in the image according to the target object information and a pre-set object profile template; and performing blurring processing on the foreground area and/or the background area. The technical solution provided in the embodiments of the present application improves the convenience and accuracy of an image blurring processing.

Description

图像处理方法、装置以及电子设备Image processing method, device and electronic device
本申请要求在2017年01月24日提交中国专利局、申请号为CN201710060426.X、申请名称为“用户图像处理方法、装置以及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application filed on Jan. 24, 2017, the application number of which is CN201710060426.X, and the application name is "user image processing method, device and electronic device", the entire contents of which are incorporated by reference. In this application.
技术领域Technical field
本申请实施例涉及图像处理技术,尤其涉及一种图像处理方法、装置以及电子设备。The embodiments of the present application relate to image processing technologies, and in particular, to an image processing method, apparatus, and electronic device.
背景技术Background technique
在处理图像时,经常需要对被拍摄对象的背景进行虚化处理,以突出被拍摄对象,营造单反相机的拍摄效果。在现有的虚化处理方法中,通常需要用户手动指定要执行虚化的区域(通常为背景区域),再对该区域进行虚化处理。When processing an image, it is often necessary to blur the background of the subject to highlight the subject and create a SLR camera. In the existing ambiguous processing method, it is usually required for the user to manually specify an area (usually a background area) to be falsified, and then ambiguize the area.
另一方面,在网络、电视、报刊等媒体上刊登或播放照片或视频时,为了保护个人隐私,也需要对照片或视频中的某些内容进行模糊处理。例如,在播放有关犯罪的新闻照片或视频时,需要对其中出现的证人或者青少年的脸部进行模糊处理。在现有的处理方法中,通常也采用手动指定要执行处理的区域(通常为人脸区域),再对该区域进行相应模糊处理。On the other hand, when posting or playing photos or videos on media such as the Internet, television, newspapers, etc., in order to protect personal privacy, some content in the photos or videos needs to be blurred. For example, when playing a news photo or video about a crime, it is necessary to blur the face of the witness or teenager appearing therein. In the existing processing method, it is usually also adopted to manually specify an area (usually a face area) to be processed, and then perform corresponding blurring processing on the area.
发明内容Summary of the invention
本申请实施例提供一种图像处理技术方案。The embodiment of the present application provides an image processing technical solution.
根据本申请实施例的一方面,提供一种图像处理方法,包括:从待处理的图像中确定目标对象信息;根据所述目标对象信息和预定的对象轮廓模板确定所述图像中的前景区域和背景区域;对所述前景区域和/或所述背景区域进行虚化处理。According to an aspect of an embodiment of the present application, an image processing method includes: determining target object information from an image to be processed; determining a foreground region and the foreground region in the image according to the target object information and a predetermined object contour template. a background area; performing blurring processing on the foreground area and/or the background area.
可选地,所述根据所述目标对象信息和预定的对象轮廓模板确定所述图像中的前景区域和背景区域包括:将所述对象轮廓模板中至少局部区域与所述目标对象信息进行匹配;根据匹配结果确定所述对象轮廓模板中的对象轮廓与所述图像中的目标对象的轮廓之间的差异信息;根据所述差异信息调整所述对象轮廓模板中的对象轮廓;将经过调整的对象轮廓映射到所述图像中,获得所述图像中包括目标对象的前景区域以及包括至少部分非所述前景区域的背景区域。Optionally, the determining the foreground area and the background area in the image according to the target object information and the predetermined object contour template comprises: matching at least a partial area in the object outline template with the target object information; Determining difference information between an object contour in the object contour template and a contour of the target object in the image according to the matching result; adjusting an object contour in the object contour template according to the difference information; adjusting the object A contour is mapped into the image to obtain a foreground region of the image including the target object and a background region including at least a portion of the foreground region.
可选地,所述差异信息包括:所述对象轮廓模板中的对象轮廓与所述图像中的目标对象的轮廓之间的缩放信息、偏移信息和/或角度信息。Optionally, the difference information includes: scaling information, offset information, and/or angle information between an object contour in the object contour template and a contour of the target object in the image.
可选地,所述图像包括:静态图像或视频帧图像。Optionally, the image comprises: a still image or a video frame image.
可选地,所述图像为视频帧图像;所述从待处理的图像中确定目标对象信息,包括:根据从所述待处理的视频帧图像之前的视频帧图像确定的目标对象信息,从所述待处理的视频帧图像确定所述目标对象信息;或者,通过对待处理的视频流进行逐视频帧图像检测,确定所述视频流中各视频帧图像中的目标对象信息。Optionally, the image is a video frame image; the determining target object information from the image to be processed includes: according to target object information determined from a video frame image before the video frame image to be processed, Determining the target image information by the video frame image to be processed; or determining the target object information in each video frame image in the video stream by performing video-by-video frame image detection on the video stream to be processed.
可选地,该图像处理方法还包括:确定所述前景区域和背景区域之间的过渡区域;对所述过渡区域进行虚化处理。Optionally, the image processing method further includes: determining a transition region between the foreground region and the background region; and performing a blurring process on the transition region.
可选地,所述对所述过渡区域进行虚化处理,包括:对所述过渡区域进行渐进虚化处理或光斑处理。Optionally, the performing the blurring process on the transition region comprises: performing progressive blurring processing or spot processing on the transition region.
可选地,所述从待处理的图像中确定目标对象信息,包括:获取对象选择信息;根据所述对象选择信息从所述待处理的图像中确定所述目标对象信息。Optionally, the determining target object information from the image to be processed includes: acquiring object selection information; and determining the target object information from the to-be-processed image according to the object selection information.
可选地,所述从待处理的图像中确定目标对象信息,包括:从所述待处理的图像中检测目标对象,获得所述目标对象信息。Optionally, the determining target object information from the image to be processed includes: detecting a target object from the image to be processed, and obtaining the target object information.
可选地,从所述待处理的图像中检测目标对象,获得所述目标对象信息,包括:通过预先训练的深度神经网络从所述待处理的图像中检测目标对象,获得所述目标对象信息。Optionally, detecting the target object from the image to be processed, obtaining the target object information, including: detecting a target object from the image to be processed through a pre-trained depth neural network, and obtaining the target object information .
可选地,所述目标对象信息包括以下任意一项或多项:人脸信息、车牌信息、门牌信息、地址信息、身份ID信息、商标信息。Optionally, the target object information includes any one or more of the following: face information, license plate information, house number information, address information, identity ID information, and trademark information.
可选地,所述人脸信息包括以下任意一项或多项:人脸关键点的信息、人脸位置信息、人脸大小信息、人脸角度信息。Optionally, the face information includes any one or more of the following: information of a face key point, face position information, face size information, and face angle information.
可选地,所述对象轮廓模板包括以下任意一项或多项:人脸轮廓模板、人体轮廓模板、车牌轮廓模板、门牌轮廓模板、预定框轮廓模板。Optionally, the object contour template includes any one or more of the following: a face contour template, a human body contour template, a license plate contour template, a house card contour template, and a predetermined frame contour template.
可选地,所述对象轮廓模板包括:分别对应不同人脸角度的多个人体轮廓模板;所述根据所述目标对象信息和预定的对象轮廓模板确定所述图像中的前景区域和背景区域之前,还包括:从所述对象轮廓模板中确定与所述人脸信息中的人脸角度信息对应的人体轮廓模板。Optionally, the object contour template includes: a plurality of human body contour templates respectively corresponding to different human face angles; and determining the foreground area and the background area in the image according to the target object information and the predetermined object contour template And further comprising: determining, from the object contour template, a human body contour template corresponding to the face angle information in the face information.
可选地,所述深度神经网络用于检测人脸关键点信息并采用以下方法预先训练而得:获取第一样本集,所述第一样本集包括多个未标注样本图像;基于深度神经网络,对所述第一样本集中的各所述未标注样本图像进行关键点位置标注,得到第二样本集,其中,所述深度神经网络用于对图像进行关键点定位;至少根据所述第二样本集中的部分样本图像及第三样本集,调整所述深度神经网络的参数,其中,所述第三样本集包括多个已标注样本图像。Optionally, the depth neural network is configured to detect face key point information and pre-training by: acquiring a first sample set, the first sample set including a plurality of unlabeled sample images; a neural network, performing key point position labeling on each of the unlabeled sample images in the first sample set to obtain a second sample set, wherein the deep neural network is used to perform key point positioning on the image; The partial sample image and the third sample set in the second sample set are adjusted to adjust parameters of the deep neural network, wherein the third sample set includes a plurality of labeled sample images.
可选地,所述基于深度神经网络,对所述第一样本集中的各所述未标注样本图像进行关键点位置标注,得到第二样本集,包括:对所述第一样本集中的各所述未标注样本图像进行图像变换处理,得到第四样本集;其中,所述图像变换处理包括以下任意一项或多项:旋转、平移、缩放、加噪及加遮挡物;基于所述深度神经网络,对所述第四样本集以及所述第一样本集中的各样本图像进行关键点位置标注,得到所述第二样本集。Optionally, the depth point neural network is used to perform key point position labeling on each of the unlabeled sample images in the first sample set to obtain a second sample set, including: collecting the first sample set Each of the unlabeled sample images is subjected to image transformation processing to obtain a fourth sample set; wherein the image transformation process includes any one or more of the following: rotation, translation, scaling, noise addition, and occlusion; a deep neural network, performing key point position labeling on the fourth sample set and each sample image in the first sample set to obtain the second sample set.
可选地,所述至少根据所述第二样本集中的部分样本图像及第三样本集,调整所述深度神经网络的参数,包括:对于所述第一样本集中的各未标注样本图像,基于所述未标注样本图像进行图像变换处理后的关键点位置信息,判断所述未标注样本图像的关键点位置信息是否为可选样本;其中,所述未标注样本图像的关键点位置信息,及其进行图像变换处理后的关键点位置信息均包括在所述第二样本集中;根据所述第二样本集中的各所述可选样本及所述第三样本集,调整所述深度神经网络的参数。Optionally, the parameter of the deep neural network is adjusted according to at least part of the sample image and the third sample set in the second sample set, including: for each unlabeled sample image in the first sample set, Determining, according to the key point position information of the unlabeled sample image, the key point position information of the unlabeled sample image is an optional sample; wherein the key point position information of the unlabeled sample image is And key point position information after performing image transformation processing are all included in the second sample set; adjusting the deep neural network according to each of the selectable samples and the third sample set in the second sample set Parameters.
可选地,所述人脸关键点包括以下任意一项或多项:眼睛关键点、鼻子关键点、嘴巴关键点、眉毛关键点及脸部轮廓关键点。Optionally, the face key point includes any one or more of the following: an eye key point, a nose key point, a mouth key point, an eyebrow key point, and a face contour key point.
根据本申请实施例的另一方面,还提供一种图像处理装置,包括:对象信息确定模块,用于从待处理的图像中确定目标对象信息;前背景确定模块,用于根据所述对象信息确定模块确定的目标对象信息和预定的对象轮廓模板确定所述图像中的前景区域和背景区域;虚化处理模块,用于对所述前背景确定模块确定的前景区域和/或所述背景区域进行虚化处理。According to another aspect of the embodiments of the present application, an image processing apparatus is further provided, including: an object information determining module, configured to determine target object information from an image to be processed; a front background determining module, configured to use the object information according to the object information Determining the target object information determined by the module and the predetermined object contour template to determine a foreground area and a background area in the image; a blurring processing module, configured to determine a foreground area and/or the background area of the front background determining module Perform blurring.
可选地,所述前背景确定模块包括:模板匹配单元,用于将所述对象轮廓模板中至少局部区域与所述目标对象信息进行匹配;差异确定单元,用于根据所述模板匹配单元的匹配结果确定所述对象轮廓模板中的对象轮廓与所述图像中的目标对象的轮廓之间的差异信息;轮廓调整单元,用于根据所述差异确定单元确定的差异信息调整所述对象轮廓模板中的对象轮廓;前背景确定单元,用于将经过所述轮廓调整单元调整的对象轮廓映射到所述图像中,获得所述图像中包括目标对象的前景区域以及包括至少部分非所述前景区域的背景区域。Optionally, the front background determining module includes: a template matching unit, configured to match at least a local area in the object contour template with the target object information; and a difference determining unit, configured to perform, according to the template matching unit The matching result determines difference information between the object contour in the object contour template and the contour of the target object in the image; the contour adjusting unit is configured to adjust the object contour template according to the difference information determined by the difference determining unit An object contour; a front background determining unit, configured to map an object contour adjusted by the contour adjusting unit into the image, obtain a foreground region including the target object in the image, and include at least a portion of the foreground region Background area.
可选地,所述差异信息包括:所述对象轮廓模板中的对象轮廓与所述图像中的目标对象的轮廓之间的缩放信息、偏移信息和/或角度信息。Optionally, the difference information includes: scaling information, offset information, and/or angle information between an object contour in the object contour template and a contour of the target object in the image.
可选地,所述图像包括:静态图像或视频帧图像。Optionally, the image comprises: a still image or a video frame image.
可选地,所述图像为视频帧图像;所述对象信息确定模块包括:第一对象信息确定单元,用于根据从所述待处理的视频帧图像之前的视频帧图像确定的目标对象信息,从所述待处理的视频帧图像确定所述目标对象信息;或者,第二对象信息确定单元,用于通过对待处理的视频流进行逐视频帧图像检测,确定所述视频流中各视频帧图像中的目标对象信息。Optionally, the image is a video frame image; the object information determining module includes: a first object information determining unit, configured to determine, according to the target object information determined from the video frame image before the video frame image to be processed, Determining the target object information from the to-be-processed video frame image; or, the second object information determining unit is configured to perform video-by-video frame image detection by the video stream to be processed, and determine each video frame image in the video stream. Target object information in .
可选地,该图像处理装置还包括:过渡区域确定模块,用于确定所述前景区域和背景区域之间的过渡区域;过渡虚化处理模块,用于对所述过渡区域确定模块确定的过渡区域进行虚化处理。Optionally, the image processing apparatus further includes: a transition area determining module, configured to determine a transition area between the foreground area and the background area; and a transition blur processing module, configured to determine a transition of the transition area determining module The area is blurred.
可选地,所述过渡虚化处理模块用于对所述过渡区域进行渐进虚化处理或光斑处理。Optionally, the transition blur processing module is configured to perform progressive blurring processing or spot processing on the transition region.
可选地,所述对象信息确定模块包括:选择信息获取单元,用于获取对象选择信息;第三对象信息确定单元,用于根据所述选择信息获取单元获取的对象选择信息从所述待处理的图像中确定所述目标对象信息。Optionally, the object information determining module includes: a selection information acquiring unit, configured to acquire object selection information; and a third object information determining unit, configured to: according to the object selection information acquired by the selection information acquiring unit, from the to-be-processed The target object information is determined in the image.
可选地,所述对象信息确定模块包括:第四对象信息确定单元,用于从所述待处理的图像中检测目标对象,获得所述目标对象信息。Optionally, the object information determining module includes: a fourth object information determining unit, configured to detect a target object from the image to be processed, and obtain the target object information.
可选地,所述第四对象信息确定单元用于通过预先训练的深度神经网络从所述待处理的图像中检测目标对象,获得所述目标对象信息。Optionally, the fourth object information determining unit is configured to detect the target object from the image to be processed by using a pre-trained depth neural network to obtain the target object information.
可选地,所述目标对象信息包括以下任意一项或多项:人脸信息、车牌信息、门牌信息、地址信息、身份ID信息、商标信息。Optionally, the target object information includes any one or more of the following: face information, license plate information, house number information, address information, identity ID information, and trademark information.
可选地,所述人脸信息包括以下任意一项或多项:人脸关键点的信息、人脸位置信息、人脸大小信息、人脸角度信息。Optionally, the face information includes any one or more of the following: information of a face key point, face position information, face size information, and face angle information.
可选地,所述对象轮廓模板包括以下任意一项或多项:人脸轮廓模板、人体轮廓模板、车牌轮廓模板、门牌轮廓模板、预定框轮廓模板。Optionally, the object contour template includes any one or more of the following: a face contour template, a human body contour template, a license plate contour template, a house card contour template, and a predetermined frame contour template.
可选地,所述对象轮廓模板包括:分别对应不同人脸角度的多个人体轮廓模板;所述前背景确定模块还用于在根据所述目标对象信息和预定的对象轮廓模板确定所述图像中的前景区域和背景区域之前,从所述对象轮廓模板当中确定与所述人脸信息中的人脸角度信息对应的人体轮廓模板。Optionally, the object contour template includes: a plurality of human body contour templates respectively corresponding to different human face angles; the front background determining module is further configured to determine the image according to the target object information and a predetermined object contour template. Before the foreground area and the background area, a human body contour template corresponding to the face angle information in the face information is determined from the object outline templates.
可选地,所述装置还包括:样本集获取模块,用于获取第一样本集,所述第一样本集包括多个未标注样本图像;关键点位置标注模块,用于基于深度神经网络,对所述第一样本集中的各所述未标注样本图像进行关键点位置标注,得到第二样本集,其中,所述深度神经网络用于对图像进行关键点定位;网络参数调整模块,用于至少根据所述第二样本集中的部分样本图像及第三样本集,调整所述深度神经网络的参数,其中,所述第三样本集包括多个已标注样本图像。Optionally, the device further includes: a sample set obtaining module, configured to acquire a first sample set, the first sample set includes a plurality of unlabeled sample images; and a key point position labeling module is configured to be based on the deep nerve a network, performing key point position labeling on each of the unlabeled sample images in the first sample set to obtain a second sample set, wherein the deep neural network is used for key point positioning of the image; the network parameter adjustment module And a parameter for adjusting the depth neural network according to at least a partial sample image and a third sample set in the second sample set, wherein the third sample set includes a plurality of labeled sample images.
可选地,所述关键点位置标注模块包括:图像变换处理单元,用于对所述第一样本集中的各所述未标注样本图像进行图像变换处理,得到第四样本集;其中,所述图像变换处理包括以下任意一项或多项:旋转、平移、缩放、加噪及加遮挡物;关键点位置标注单元,用于基于所述深度神经网络,对所述第四样本集以及所述第一样本集中的各所述未标注样本图像进行关键点位置标注,得到所述第二样本集。Optionally, the key point location labeling module includes: an image transform processing unit, configured to perform image transform processing on each of the unlabeled sample images in the first sample set to obtain a fourth sample set; The image transformation process includes any one or more of the following: rotation, translation, scaling, noise addition, and occlusion; a key point location unit for using the fourth sample set and the location based on the depth neural network Each of the unlabeled sample images in the first sample set performs key point position labeling to obtain the second sample set.
可选地,所述网络参数调整模块包括:可选样本判断单元,用于对于所述第一样本集中的各未标注样本图像,基于所述未标注样本图像进行图像变换处理后的关键点位置信息,判断所述未标注样本图像的关键点位置信息是否为可选样本;其中,所述未标注样本图像的关键点位置信息,及其进行图像变换处理后的关键点位置信息均包括在所述第二样本集中;网络参数调整单元,用于根据所述第二样本集中的各所述可选样本及所述第三样本集,调整所述深度神经网络的参数。Optionally, the network parameter adjustment module includes: an optional sample determining unit, configured to perform, for each unlabeled sample image in the first sample set, a key point after image transformation processing based on the unlabeled sample image Position information, determining whether the key point position information of the unlabeled sample image is an optional sample; wherein the key point position information of the unlabeled sample image and the key point position information after performing image transformation processing are included in And the network parameter adjustment unit is configured to adjust parameters of the deep neural network according to each of the selectable samples and the third sample set in the second sample set.
可选地,所述人脸关键点包括以下任意一项或多项:眼睛关键点、鼻子关键点、嘴巴关键点、眉毛关键点及脸部轮廓关键点。Optionally, the face key point includes any one or more of the following: an eye key point, a nose key point, a mouth key point, an eyebrow key point, and a face contour key point.
根据本申请实施例的又一方面,还提供一种电子设备,包括:According to still another aspect of the embodiments of the present application, an electronic device is further provided, including:
处理器和前述任一所述的图像处理装置;A processor and an image processing apparatus according to any of the preceding claims;
在处理器运行所述图像处理装置时,本申请上述任一实施例所述的图像处理装置中的单元被运行。When the processor runs the image processing apparatus, the units in the image processing apparatus according to any of the above embodiments of the present application are executed.
根据本申请实施例的又一方面,还提供另一种电子设备,包括:处理器和存储器;According to still another aspect of the embodiments of the present application, another electronic device is provided, including: a processor and a memory;
所述存储器用于存放至少一可执行指令,所述可执行指令使所述处理器执行前述任一图像处理方法对应的操作。The memory is configured to store at least one executable instruction that causes the processor to perform operations corresponding to any of the image processing methods described above.
根据本申请实施例的又一方面,还提供一种计算机程序,包括计算机可读代码,当所述计算机可读代码在设备上运行时,所述设备中的处理器执行用于实现本申请上述任一实施例所述的图像处理方法中各步骤的指令。According to still another aspect of embodiments of the present application, there is also provided a computer program comprising computer readable code, the processor in the device executing the above-described implementation of the present application when the computer readable code is run on a device The instructions of the steps in the image processing method described in any of the embodiments.
根据本申请实施例的又一方面,还提供一种计算机可读存储介质,用于存储计算机可读取的指令,所述指令被执行时实现本申请上述任一实施例所述的图像处理方法中各步骤的操作。According to still another aspect of the embodiments of the present application, a computer readable storage medium is provided for storing computer readable instructions, and when the instructions are executed, implementing the image processing method according to any one of the foregoing embodiments of the present application. The operation of each step in the process.
根据本申请实施例提供的图像处理技术,对待处理的图像进行检测,以确定目标对象信息,根据确定的目标对象信息和对象轮廓模板获取待处理的图像中的前景区域以及背景区域,再对该背景区域和/或前景区域进行虚化处理,从而可通过从图像检测到的目标对象信息来自动地确定需要执行虚化处理的前景区域或背景区域,而无需用户手动地标注要执行虚化处理的区域或者手动地执行虚化(模糊)操作,提高操作便利和准确性。According to the image processing technology provided by the embodiment of the present application, the image to be processed is detected to determine target object information, and the foreground area and the background area in the image to be processed are acquired according to the determined target object information and the object contour template, and then The background area and/or the foreground area are blurred, so that the foreground area or the background area in which the blurring process needs to be performed can be automatically determined by the target object information detected from the image without manually marking the user to perform the blurring process The area or manual execution of the blur (blur) operation improves the convenience and accuracy of the operation.
下面通过附图和实施例,对本申请的技术方案做进一步的详细描述。The technical solutions of the present application are further described in detail below through the accompanying drawings and embodiments.
附图说明DRAWINGS
构成说明书的一部分的附图描述了本申请的实施例,并且连同描述一起用于解释本申请的原理。The accompanying drawings, which are incorporated in FIG.
参照附图,根据下面的详细描述,可以更加清楚地理解本申请,其中:The present application can be more clearly understood from the following detailed description, in which:
图1是本申请一个实施例的图像处理方法的流程图;1 is a flow chart of an image processing method according to an embodiment of the present application;
图2是本申请另一个实施例的图像处理方法的流程图;2 is a flowchart of an image processing method according to another embodiment of the present application;
图3是本申请又一个实施例的图像处理方法的流程图;3 is a flowchart of an image processing method according to still another embodiment of the present application;
图4是本申请实施例中包含人体全身的示例性人物轮廓模板以及包含人脸的人脸轮廓模板示意图;4 is a schematic diagram of an exemplary character outline template including a human body and a face contour template including a human face in the embodiment of the present application;
图5是本申请实施例中训练关键点定位模型的一个示例性方法的流程图;5 is a flow chart of an exemplary method of training a keypoint location model in an embodiment of the present application;
图6是本申请一个实施例的图像处理装置的逻辑框图;Figure 6 is a logic block diagram of an image processing apparatus according to an embodiment of the present application;
图7是示出根据本申请另一个实施例的图像处理装置的逻辑框图;FIG. 7 is a logic block diagram showing an image processing apparatus according to another embodiment of the present application; FIG.
图8是示出根据本申请又一个实施例的图像处理装置的逻辑框图;FIG. 8 is a logic block diagram showing an image processing apparatus according to still another embodiment of the present application; FIG.
图9是示出根据本申请一个实施例的电子设备的结构示意图。FIG. 9 is a schematic structural view showing an electronic device according to an embodiment of the present application.
具体实施方式detailed description
下面结合附图详细描述本申请实施例的示例性实施例。应注意到:除非另外可选说明,否则在这些实施例中阐述的部件和步骤的相对布置、数字表达式和数值不限制本申请的范围。Exemplary embodiments of the embodiments of the present application are described in detail below with reference to the accompanying drawings. It should be noted that the relative arrangement of the components and steps, numerical expressions and numerical values set forth in the embodiments are not intended to limit the scope of the application.
同时,应当明白,为了便于描述,附图中所示出的各个部分的尺寸并不是按照实际的比例关系绘制的。In the meantime, it should be understood that the dimensions of the various parts shown in the drawings are not drawn in the actual scale relationship for the convenience of the description.
以下对至少一个示例性实施例的描述实际上仅仅是说明性的,决不作为对本申请及其应用或使用的任何限制。The following description of the at least one exemplary embodiment is merely illustrative and is in no way
对于相关领域普通技术人员已知的技术、方法和设备可能不作详细讨论,但在适当情况下,所述技术、方法和设备应当被视为说明书的一部分。Techniques, methods and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail, but the techniques, methods and apparatus should be considered as part of the specification, where appropriate.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步讨论。It should be noted that similar reference numerals and letters indicate similar items in the following figures, and therefore, once an item is defined in one figure, it is not required to be further discussed in the subsequent figures.
本申请实施例可以应用于终端设备、计算机系统、服务器等电子设备,其可与众多其它通用或专用计算系统环境或配置一起操作。适于与终端设备、计算机系统、服务器等电子设备一起使用的众所周知的终端设备、计算系统、环境和/或配置的例子包括但不限于:个人计算机系统、服务器计算机系统、瘦客户机、厚客户机、手持或膝上设备、基于微处理器的系统、机顶盒、可编程消费电子产品、网络个人电脑、小型计算机系统﹑大型计算机系统和包括上述任何系统的分布式云计算技术环境,等等。Embodiments of the present application can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with numerous other general purpose or special purpose computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments, and/or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, and the like include, but are not limited to, personal computer systems, server computer systems, thin clients, thick clients Machines, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, networked personal computers, small computer systems, mainframe computer systems, and distributed cloud computing technology environments including any of the above, and the like.
终端设备、计算机系统、服务器等电子设备可以在由计算机系统执行的计算机系统可执行指令(诸如程序模块)的一般语境下描述。通常,程序模块可以包括例程、程序、目标程序、组件、逻辑、数据结构等等,它们执行特定的任务或者实现特定的抽象数据类型。计算机系统/服务器可以在分布式云计算环境中实施,分布式云计算环境中,任务是由通过通信网络链接的远程处理设备执行的。在分布式云计算环境中,程序模块可以位于包括存储设备的本地或远程计算系统存储介质上。Electronic devices such as terminal devices, computer systems, servers, etc., can be described in the general context of computer system executable instructions (such as program modules) being executed by a computer system. Generally, program modules may include routines, programs, target programs, components, logic, data structures, and the like that perform particular tasks or implement particular abstract data types. The computer system/server can be implemented in a distributed cloud computing environment where tasks are performed by remote processing devices that are linked through a communication network. In a distributed cloud computing environment, program modules may be located on a local or remote computing system storage medium including storage devices.
图1是本申请一个实施例的图像处理方法的流程图。可在任何包括终端设备、个人计算机或服务器中实现该图像处理方法。参照图1,该实施例的图像处理方法包括:1 is a flow chart of an image processing method according to an embodiment of the present application. The image processing method can be implemented in any terminal device, personal computer or server. Referring to FIG. 1, the image processing method of this embodiment includes:
在步骤S110,从待处理的图像中确定目标对象信息。At step S110, target object information is determined from the image to be processed.
本申请实施例中,待处理的图像具有一定的分辨率,可以是使用拍摄设备(如手机、数码相机、摄像头等)拍摄的图像,也可以是预存的图像(如手机相册中的图像),也可以是视频序列中的图像。该图像可以是以人物、动物、车辆、物件(如名片、身份证、车牌等)为被拍摄对象的图像。如果该图像是人物图像,则该图像还可以是人物肖像(近照)、半身像,也可以是全身照。In the embodiment of the present application, the image to be processed has a certain resolution, and may be an image taken by using a shooting device (such as a mobile phone, a digital camera, a camera, etc.), or may be a pre-stored image (such as an image in a mobile phone album). It can also be an image in a video sequence. The image may be an image of a subject, an animal, a vehicle, an object (such as a business card, an ID card, a license plate, etc.). If the image is a person image, the image may also be a portrait (close-up), a bust, or a full-body photo.
在该步骤S110,可通过任何适用的图像分析技术,从该待处理的图像中确定/检测目标对象信息。检测到的目标对象信息可用于定位目标对象在图像中占据的区域。At this step S110, the target object information can be determined/detected from the image to be processed by any suitable image analysis technique. The detected target object information can be used to locate the area occupied by the target object in the image.
该目标对象信息例如可以包括但不限于以下任意一项或多项:目标对象的位置、大小、关键部位的信息(如鼻子的位置、人脸位置和大小等)、目标对象的关键点、目标对象的属性信息(如人的肤色)等。The target object information may include, but is not limited to, any one or more of the following: location, size of the target object, information of the key part (such as the position of the nose, face position and size, etc.), key points of the target object, targets The attribute information of the object (such as the skin color of the person).
在一个可选示例中,该步骤S110可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的对象信息确定模块610执行。In an optional example, the step S110 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by the object information determining module 610 being executed by the processor.
在步骤S120,根据所述目标对象信息和预定的对象轮廓模板确定所述图像中的前景区域和背景区 域。In step S120, a foreground area and a background area in the image are determined based on the target object information and a predetermined object outline template.
如前所述,在步骤S110确定的目标对象信息可用于定位目标对象在图像中占据的区域,因此,可根据确定的目标对象信息、以及表征目标对象的形状和比例关系的对象轮廓模板来区分出目标对象在该待处理的图像中占据的区域,并且将该目标对象在该待处理的图像中占据的区域确定为图像的前景区域,而将该前景区域以外的至少部分图像区域确定为背景区域。例如,人脸在整个人体中具有相对确定的位置和比例关系,可根据检测到的目标对象信息与表征人体形状和比例的人物轮廓模板进行匹配,从而勾画出人物在该待处理的图像中占据的区域作为前景区域,并且将该待处理的图像中前景区域以外的其他全部区域或局部区域确定为背景区域。As described above, the target object information determined in step S110 can be used to locate an area occupied by the target object in the image, and thus can be distinguished according to the determined target object information and the object outline template representing the shape and proportional relationship of the target object. An area occupied by the target object in the image to be processed, and an area occupied by the target object in the image to be processed is determined as a foreground area of the image, and at least a part of the image area outside the foreground area is determined as a background region. For example, the human face has a relatively determined position and proportional relationship in the whole human body, and can match the detected target object information with the character outline template that characterizes the shape and proportion of the human body, thereby delineating that the character occupies the image to be processed. The area is used as the foreground area, and all or part of the area other than the foreground area in the image to be processed is determined as the background area.
在一个可选示例中,该步骤S120可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的前背景确定模块620执行。In an alternative example, the step S120 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a front background determination module 620 that is executed by the processor.
在步骤S130,对确定的前景区域和/或背景区域进行虚化处理。In step S130, the determined foreground area and/or background area is subjected to blurring processing.
本申请实施例中,可根据应用场景的需要对背景区域和/或前景区域进行虚化处理。例如,可对确定的背景区域进行虚化处理,以在图像画面中突出被拍摄的目标对象,改善拍摄效果;或者,可对前景区域(例如人物区域或车牌)进行模糊处理,以模糊显示目标对象(人物、身份证号、或车牌号等),保护隐私信息;或者,也可以同时对确定的背景区域和前景区域进行虚化处理。In the embodiment of the present application, the background area and/or the foreground area may be blurred according to the needs of the application scenario. For example, the determined background area may be blurred to highlight the captured target object in the image screen to improve the shooting effect; or the foreground area (such as the character area or the license plate) may be blurred to blur the display target. The object (person, ID number, or license plate number, etc.) protects the privacy information; or, the determined background area and foreground area may be blurred at the same time.
本申请实施例中,可使用任何适用的图像虚化技术对前景区域和/或背景区域进行虚化处理。例如,可使用虚化滤镜对背景区域和/或前景区域进行模糊处理,即:通过高斯滤波改变临近的像素值,达到模糊的视觉效果。以上仅为一种示例性实现方式,另外还可以采用任何其他虚化方法对前景区域和/或背景区域进行虚化处理。In the embodiment of the present application, the foreground area and/or the background area may be blurred by using any suitable image blurring technique. For example, the blurring filter can be used to blur the background area and/or the foreground area, that is, to change the adjacent pixel values by Gaussian filtering to achieve a blurred visual effect. The above is only an exemplary implementation, and the foreground area and/or the background area may be blurred by any other blurring method.
在一个可选示例中,该步骤S130可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的虚化处理模块630执行。In an alternative example, the step S130 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a blurring processing module 630 executed by the processor.
根据本申请上述实施例的图像处理方法,对待处理的图像进行检测,以确定目标对象信息,根据确定的目标对象信息和对象轮廓模板获取待处理的图像中的前景区域以及背景区域,再对该背景区域和/或前景区域进行虚化处理,从而可通过从图像检测到的目标对象信息来自动地确定需要执行虚化处理的前景区域或背景区域,而无需用户手动地标注要执行虚化处理的区域或者手动地执行虚化(模糊)操作,提高操作便利和准确性。According to the image processing method of the above embodiment of the present application, the image to be processed is detected to determine target object information, and the foreground area and the background area in the image to be processed are acquired according to the determined target object information and the object contour template, and then The background area and/or the foreground area are blurred, so that the foreground area or the background area in which the blurring process needs to be performed can be automatically determined by the target object information detected from the image without manually marking the user to perform the blurring process The area or manual execution of the blur (blur) operation improves the convenience and accuracy of the operation.
图2是本申请另一个实施例的图像处理方法的流程图。参照图2,该实施例的图像处理方法包括:2 is a flow chart of an image processing method according to another embodiment of the present application. Referring to FIG. 2, the image processing method of this embodiment includes:
在步骤S210,从待处理的图像中确定目标对象信息。In step S210, target object information is determined from the image to be processed.
这里,目标对象可以是人物、动物或任何物体(如车牌、车辆、身份证)。确定的目标对象信息可包括以下任意一项或多项:人脸信息、车牌信息、门牌信息、地址信息、身份标识(ID)信息、商标信息,但不限于上述信息。这些目标对象信息均表征在拍摄有该目标对象的图像中该目标对象的至少部分特征。Here, the target object may be a character, an animal, or any object (such as a license plate, a vehicle, an ID card). The determined target object information may include any one or more of the following: face information, license plate information, house number information, address information, identification (ID) information, trademark information, but is not limited to the above information. The target object information each characterizes at least a portion of the features of the target object in the image in which the target object is captured.
可选地,根据本申请实施例的一种实施方式中,该步骤S210可以包括步骤S212和步骤S213。在步骤S212,获取对象选择信息,该对象选择信息例如可以是,(用户)指定的图像区域的信息、对象的标识(ID)信息、对象类型的信息等。在步骤S213,根据所述对象选择信息从待处理的图像中确定目标对象信息。例如,根据用户指定的图像区域的信息,在指定的图像区域确定目标对象信息。在一个可选示例中,该步骤S21和S213可以由处理器调用存储器存储的相应指令执行,也可以分别由被处理器运行的选择信息获取单元6103、第三对象信息确定单元6104执行。通过步骤S212和S213的处理,可根据另行提供的对象选择信息来对图像进行检测,获取目标对象信息。Optionally, in an implementation manner of the embodiment of the present application, the step S210 may include step S212 and step S213. In step S212, object selection information is acquired, and the object selection information may be, for example, information of an image area specified by (user), identification (ID) information of an object, information of an object type, and the like. In step S213, target object information is determined from the image to be processed based on the object selection information. For example, the target object information is determined in the specified image area based on the information of the image area specified by the user. In an optional example, the steps S21 and S213 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a selection information acquiring unit 6103 and a third object information determining unit 6104, respectively, which are executed by the processor. By the processing of steps S212 and S213, the image can be detected based on the object selection information provided separately, and the target object information can be acquired.
可选地,根据本申请实施例的另一种实施方式中,步骤S210可以包括:S214,从待处理的图像中检测目标对象,获得检测到的目标对象信息。也就是说,先从图像中检测得到目标对象,再根据检测到的目标对象确定目标对象信息。Optionally, in another implementation manner of the embodiment of the present application, step S210 may include: S214: detecting a target object from the image to be processed, and obtaining the detected target object information. That is to say, the target object is first detected from the image, and the target object information is determined according to the detected target object.
可选地,可通过预先训练的深度神经网络从所述待处理的图像中检测目标对象,以获得检测到的目标对象信息。可选地,可通过标注有物体对象信息的样本图像预先训练用于检测目标对象的深度神经网络,用于检测例如车辆、人脸、行人、动物等目标对象的深度神经网络。在检测处理中,将待处理的图像输入该深度神经网络,通过深度神经网络的检测处理来获取目标对象信息。Optionally, the target object may be detected from the image to be processed through a pre-trained deep neural network to obtain the detected target object information. Alternatively, a deep neural network for detecting a target object may be pre-trained by a sample image labeled with object object information for detecting a deep neural network of a target object such as a vehicle, a face, a pedestrian, an animal, or the like. In the detection process, the image to be processed is input to the deep neural network, and the target object information is acquired by the detection process of the deep neural network.
另一方面,该待处理的图像可以是拍摄的静态图像,也可以是录制的视频内容中的视频帧图像,也可以是在线视频流中的视频帧图像。On the other hand, the image to be processed may be a still image captured, a video frame image in the recorded video content, or a video frame image in the online video stream.
相应地,根据本申请实施例的又一种可实施方式,步骤S210可包括:S215,根据从之前的视频 帧图像确定的目标对象信息从待处理的视频帧图像确定所述目标对象信息。同一目标对象在连续的视频帧之间所在的位置和大小相对接近,因此,可根据从前一或前几个视频帧图像确定的目标对象信息从当前待检测的视频帧图像来检测待处理的视频帧图像的目标对象信息,从而提高检测效率。在一个可选示例中,该步骤S215可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的第一对象信息确定单元6101执行。Correspondingly, according to still another implementation manner of the embodiments of the present application, step S210 may include: S215, determining the target object information from the video frame image to be processed according to the target object information determined from the previous video frame image. The position and size of the same target object between successive video frames are relatively close. Therefore, the video to be processed can be detected from the current video frame image to be detected according to the target object information determined from the previous or previous video frame images. The target object information of the frame image, thereby improving the detection efficiency. In an optional example, the step S215 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by the first object information determining unit 6101 being executed by the processor.
或者,根据本申请实施例的再一种可实施方式,步骤S210可包括:S216,通过对待处理的视频流进行逐视频帧图像检测,确定该视频流中各视频帧图像中的目标对象信息。通过对视频流中的视频帧图像进行逐帧检测,通过各帧的检测结果分别进行各帧的背景/前景虚化处理,有效保证了检测的稳定性和准确性,由于每一帧都进行了虚化处理,因此从整个视频流来看,相当于实现对相同目标对象的动态跟踪虚化处理。在一个可选示例中,该步骤S216可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的第二对象信息确定单元6102执行。Alternatively, according to still another implementation manner of the embodiment of the present application, step S210 may include: S216, performing video-by-video frame image detection by the video stream to be processed, and determining target object information in each video frame image in the video stream. By performing frame-by-frame detection on the video frame image in the video stream, the background/foreground blur processing of each frame is respectively performed by the detection result of each frame, thereby effectively ensuring the stability and accuracy of the detection, since each frame is performed. Blurring processing, so from the perspective of the entire video stream, it is equivalent to realizing dynamic tracking blurring of the same target object. In an alternative example, the step S216 may be performed by the processor invoking a corresponding instruction stored in the memory, or may be performed by the second object information determining unit 6102 being executed by the processor.
需要说明的是,上文提及的待处理的视频流中的视频帧可以代表视频流中实实在在的帧,也可表示为视频流中需要进行处理的采样帧,本文对此并不限制。It should be noted that the video frame in the video stream to be processed mentioned above may represent a real frame in the video stream, and may also be represented as a sample frame in the video stream that needs to be processed. .
通过前述任一种实施方式的处理,从待处理的图像中检测到目标对象信息。The target object information is detected from the image to be processed by the processing of any of the foregoing embodiments.
在一个可选示例中,该步骤S210可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的对象信息确定模块610执行。In an optional example, the step S210 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by the object information determining module 610 executed by the processor.
在步骤S220,根据所述目标对象信息和预定的对象轮廓模板确定所述图像中的前景区域和背景区域。In step S220, a foreground area and a background area in the image are determined according to the target object information and a predetermined object outline template.
可选地,该实施例中的步骤S220包括可以如下步骤S221、S223、S225、S227和S229。Optionally, step S220 in this embodiment includes the following steps S221, S223, S225, S227, and S229.
在步骤S221,将所述对象轮廓模板中至少局部区域与确定的目标对象信息进行匹配。虽然作为个体的各个目标对象(如人、狗、车辆、车牌等)之间存在差异,但每一类目标对象从总体外形轮廓上具有共性。因此,可预先设置对象轮廓模板来勾画出图像中可能出现的、或感兴趣的、或待检测的目标对象的轮廓。例如,可预先设置人物轮廓模板、轿车轮廓模板、狗的轮廓模板等,以用于与目标对象信息进行匹配。In step S221, at least a partial area in the object contour template is matched with the determined target object information. Although there are differences between individual target objects (such as people, dogs, vehicles, license plates, etc.), each type of target object has commonality from the overall outline. Therefore, the object contour template can be preset to outline the outline of the target object that may appear in the image, or that is of interest or to be detected. For example, a character outline template, a car outline template, a dog's outline template, and the like may be set in advance for matching with the target object information.
在本申请各实施例的一个可选示例中,上述对象轮廓模板例如可包括但不限于以下任意一项或多项:人脸轮廓模板、人体轮廓模板、车牌轮廓模板、门牌轮廓模板、预定框轮廓模板等。其中,人脸轮廓模板用于匹配人物近照中的人物轮廓,人体轮廓模板用于匹配人物全身照或半身照中的人物轮廓,车牌轮廓模板用于匹配图像中车辆上的车牌轮廓,预定框轮廓模板用于匹配具有预定形状的物件的轮廓,如身份证等。In an optional example of the embodiments of the present application, the object contour template may include, but is not limited to, any one or more of the following: a face contour template, a human body contour template, a license plate contour template, a house card contour template, a predetermined frame. Outline templates, etc. The face contour template is used to match the silhouette of the person in the recent photo of the person, the human body contour template is used to match the silhouette of the person in the whole body or the half body photo, and the license plate contour template is used to match the license plate contour on the vehicle in the image, the predetermined frame The contour template is used to match the contour of an object having a predetermined shape, such as an identity card or the like.
可选地,在该步骤S221中,可将对象轮廓模板中至少局部区域与确定的目标对象信息进行匹配。例如,假设确定的目标对象信息是车辆的车牌信息,由于车辆的车牌通常设置在车辆头部的正中部,则可将车辆正面的轮廓模板相对于车牌的位置进行匹配。Optionally, in the step S221, at least a local area in the object contour template may be matched with the determined target object information. For example, assuming that the determined target object information is the license plate information of the vehicle, since the license plate of the vehicle is usually disposed in the middle of the head of the vehicle, the contour template of the front side of the vehicle can be matched with respect to the position of the license plate.
此外,由于在拍照时可能不会拍摄目标对象的全部,在将对象轮廓模板与目标对象信息匹配时,可将对象轮廓模板的局部区域与确定的目标对象信息进行匹配,以确定目标对象在图像中占据的区域。In addition, since the target object may not be photographed at the time of photographing, when the object contour template is matched with the target object information, the local region of the object contour template may be matched with the determined target object information to determine that the target object is in the image. The area occupied by.
在一个可选示例中,该步骤S221可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的模板匹配单元6201执行。In an optional example, the step S221 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a template matching unit 6201 executed by the processor.
在步骤S223,根据匹配结果确定所述对象轮廓模板中的对象轮廓与所述图像中的目标对象的轮廓之间的差异信息。In step S223, difference information between the object contour in the object contour template and the contour of the target object in the image is determined according to the matching result.
由于表征对象共有特征的对象轮廓模板与待处理的图像中的对象大小可能不是同一尺寸,并且对象的位置、姿态角度等与对象轮廓模板中的位置、姿态角度等可能会有偏差,因此在进行匹配的过程中,可以先将对象轮廓模板进行缩放、平移和/或旋转,再与确定的对象的位置、大小或关键点进行匹配,从而获取对象轮廓模板中的对象轮廓与待处理的图像中的对象轮廓之间的差异信息。Since the object contour template that characterizes the common features of the object may not be the same size as the object size in the image to be processed, and the position, posture angle, and the like of the object may deviate from the position, posture angle, and the like in the object contour template, During the matching process, the object contour template may be first scaled, translated, and/or rotated, and then matched with the determined object's position, size, or key point to obtain the object contour and the image to be processed in the object contour template. Information about the difference between the contours of the object.
这里,该差异信息例如可包括但不限于:对象轮廓模板中的对象轮廓与所述图像中的目标对象的轮廓之间的缩放信息和/或偏移信息等,还可包括例如对象轮廓模板中的对象轮廓与所述图像中的目标对象的轮廓之间的角度信息等。Here, the difference information may include, but is not limited to, scaling information and/or offset information between the object contour in the object contour template and the contour of the target object in the image, and the like, and may also include, for example, an object contour template. Angle information between the contour of the object and the contour of the target object in the image, and the like.
在一个可选示例中,该步骤S223可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的差异确定单元6202执行。In an optional example, the step S223 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a difference determining unit 6202 executed by the processor.
在步骤S225,根据所述差异信息调整所述对象轮廓模板中的对象轮廓。In step S225, the object contour in the object contour template is adjusted according to the difference information.
可选地,可以根据包括前述缩放信息、偏移信息等的差异信息,将对象轮廓模板中的对象轮廓进 行缩放、平移、旋转等,以与上述图像中目标对象所在的区域相匹配。Alternatively, the object contour in the object contour template may be scaled, translated, rotated, etc. according to the difference information including the aforementioned scaling information, offset information, etc., to match the area in which the target object is located in the image.
在一个可选示例中,该步骤S225可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的轮廓调整单元6203执行。In an optional example, the step S225 may be performed by the processor invoking a corresponding instruction stored in the memory, or may be performed by the contour adjustment unit 6203 executed by the processor.
在步骤S227,将经过调整的对象轮廓映射到待处理的图像中,获得所述图像中包括目标对象的前景区域以及包括至少部分非前景区域的背景区域。In step S227, the adjusted object contour is mapped into the image to be processed, and the foreground region including the target object and the background region including at least part of the non-foreground region are obtained in the image.
通过将经过调整的对象轮廓映射到待处理的图像中,可以将待处理的图像中落入调整的人物轮廓的部分确定为包括目标对象的前景区域,该前景区域内为目标对象占据的区域。此外,将包括前景区域以外的图像区域或者包括部分非前景区域的图像区域确定为该图像的背景区域。By mapping the adjusted object contour into the image to be processed, the portion of the image to be processed that falls within the adjusted character contour can be determined to include the foreground region of the target object, which is the region occupied by the target object. Further, an image area including the foreground area or an image area including a part of the non-foreground area is determined as the background area of the image.
在一个可选示例中,该步骤S227可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的前背景确定单元6204执行。In an alternative example, the step S227 may be performed by the processor invoking a corresponding instruction stored in the memory, or may be performed by the front background determining unit 6204 being executed by the processor.
在步骤S229,确定所述前景区域和背景区域之间的过渡区域。At step S229, a transition area between the foreground area and the background area is determined.
可选地,可将背景区域中与目标对象所在区域的外缘的距离小于预定的扩展距离的图像区域确定为该过渡区域。也就是说,将目标对象的轮廓的外缘向外扩展一定的距离,将扩展的区域作为该过渡区域。Alternatively, an image area in the background area that is smaller than a predetermined extended distance from the outer edge of the area where the target object is located may be determined as the transition area. That is to say, the outer edge of the contour of the target object is extended outward by a certain distance, and the extended area is used as the transition area.
在一个可选示例中,该步骤S229可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的过渡区域确定模块640执行。In an alternative example, the step S229 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a transition region determination module 640 that is executed by the processor.
在一个可选示例中,该步骤S220或者S221~229可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的前背景确定模块620执行。In an alternative example, step S220 or S221-229 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a front background determination module 620 that is executed by the processor.
在步骤S230,对确定的前景区域和/或背景区域进行虚化处理,并且对确定的过渡区域进行渐进虚化处理或光斑处理。In step S230, the determined foreground area and/or the background area are subjected to blurring processing, and progressive blurring processing or spot processing is performed on the determined transition area.
对确定的前景区域和/或背景区域进行的虚化处理与步骤S130的处理类似,在此不予赘述。对过渡区域可执行渐进虚化处理或光斑处理,以使虚化处理的效果更为自然。The blurring process performed on the determined foreground area and/or the background area is similar to the processing of step S130, and will not be described herein. Progressive blurring or spot processing can be performed on the transition area to make the effect of the blurring process more natural.
在一个可选示例中,该步骤S230可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的过渡虚化处理模块650执行。In an alternative example, the step S230 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a transition blur processing module 650 executed by the processor.
根据本申请上述实施例的图像处理方法,以多种方式对待处理的静态图像或视频帧图像进行检测,确定静态图像或视频帧图像中的目标对象信息,根据确定的目标对象信息和对象轮廓模板获取所述待处理的图像中的前景区域、背景区域以及其间的过渡区域,再对所述背景区域和/或前景区域进行虚化处理并对过渡区域进行虚化处理,从而可通过从静态图像或视频帧图像检测到的目标对象信息来自动地确定需要执行虚化处理的前景区域、背景区域以及过渡区域,而无需用户手动地标注要执行虚化处理的区域或者手动地执行虚化(模糊)操作,提高操作便利和准确性,并且使得虚化效果更为自然。According to the image processing method of the above embodiment of the present application, the still image or the video frame image to be processed is detected in various manners, and the target object information in the still image or the video frame image is determined, according to the determined target object information and the object contour template. Obtaining a foreground area, a background area, and a transition area in the image to be processed, and then blurring the background area and/or the foreground area, and performing a blurring process on the transition area, so as to pass the static image Or the target object information detected by the video frame image to automatically determine the foreground area, the background area, and the transition area that need to perform the blurring process without the user manually marking the area to be subjected to the blurring process or manually performing the blurring (blurring) ) operation, improve the convenience and accuracy of the operation, and make the blur effect more natural.
图3是本申请又一个实施例的图像处理方法的流程图。下面以人物作为目标对象的示例描述本实施例的图像处理方法。在此,以人脸关键点作为人脸信息。需要指出,以人脸关键点作为人脸信息仅为本申请实施例一种可行的实施方式,而不限于此,人脸信息还可以包括人脸位置信息、人脸大小信息以及人脸角度信息等的任意一个或多个。参照图3,该实施例的图像处理方法包括:3 is a flow chart of an image processing method according to still another embodiment of the present application. The image processing method of the present embodiment will be described below with an example in which a person is a target object. Here, the face key point is used as the face information. It should be noted that the face key point is only a feasible implementation manner of the embodiment of the present application, and the face information may further include face location information, face size information, and face angle information. Any one or more of the others. Referring to FIG. 3, the image processing method of this embodiment includes:
在步骤S310,从待处理的图像检测人脸信息。At step S310, face information is detected from the image to be processed.
根据一种可实施方式,通过预先训练的关键点定位模型从待处理的图像检测人脸关键点,将检测到的人脸关键点作为人脸信息。稍后将介绍一种训练关键点定位模型的示例性方法。虽然作为个体的人与人之间在体型上存在差异,但从总体人物轮廓上具有共性,例如,头部为椭圆形,躯干大致为三角形。图4是本申请实施例中包含人体全身的示例性人物轮廓模板以及包含人脸的人脸轮廓模板示意图。此外,由于在人物拍摄中,被拍摄的人可能处于多个不同的角度和距离,因此还可以预先设置人脸、半身、肖像、侧身等多个人物轮廓模板,用于匹配从不同的拍摄距离或拍摄角度捕捉的待处理的图像。因此,在该步骤S310,还可从待处理的图像检测人脸角度信息。According to an implementation manner, the face key point is detected from the image to be processed by the pre-trained key point positioning model, and the detected face key point is used as the face information. An exemplary method of training a keypoint location model will be described later. Although there are differences in body type between individuals as individuals, they have commonality from the outline of the overall figure, for example, the head is elliptical and the torso is roughly triangular. 4 is a schematic diagram of an exemplary character outline template including a human body and a face contour template including a human face in the embodiment of the present application. In addition, since the person being photographed may be in a plurality of different angles and distances during the shooting of the person, it is also possible to preset a plurality of character contour templates such as a face, a half body, a portrait, a side body, etc., for matching from different shooting distances. Or the image to be processed captured by the shooting angle. Therefore, at this step S310, face angle information can also be detected from the image to be processed.
在一个可选示例中,该步骤S310可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的第四对象信息确定单元6105执行。In an optional example, the step S310 may be performed by the processor invoking a corresponding instruction stored in the memory, or may be performed by the fourth object information determining unit 6105 being executed by the processor.
在步骤S320,从预定的人体轮廓模板当中确定与所述人脸角度信息对应的人体轮廓模板。In step S320, a human body contour template corresponding to the face angle information is determined from among predetermined body contour templates.
在一个可选示例中,该步骤S320可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的前背景确定模块620执行。In an alternative example, the step S320 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a front background determination module 620 that is executed by the processor.
在步骤S330,根据所述人脸信息和预定的人体轮廓模板确定所述图像中的前景区域和背景区域。In step S330, a foreground area and a background area in the image are determined according to the face information and a predetermined human body contour template.
步骤S330的处理与前述步骤S120或S221~S229的处理类似,在此不予赘述。The processing of step S330 is similar to the processing of the foregoing step S120 or S221 to S229, and details are not described herein.
在一个可选示例中,该步骤S330可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的前背景确定模块620执行。In an alternative example, the step S330 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a front background determination module 620 that is executed by the processor.
在步骤S340,对所述前景区域和/或所述背景区域进行虚化处理。In step S340, the foreground area and/or the background area are subjected to blurring processing.
该步骤与步骤S130的处理类似,在此不予赘述。This step is similar to the processing of step S130 and will not be described here.
在一个可选示例中,该步骤S340可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的虚化处理模块630执行。In an alternative example, the step S340 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a blurring processing module 630 executed by the processor.
根据本申请上述实施例的图像处理方法,通过对待处理的图像进行检测,获得人脸信息,根据检测到的人脸信息和人物轮廓模板获取待处理的图像中的前景区域以及背景区域,再对背景区域和/或前景区域进行虚化处理,从而在对与人物相关的图像进行处理时,可通过从图像检测到的人脸信息来自动地、准确地确定需要执行处理的前景区域和背景区域,以对前景区域或背景区域执行虚化处理,而无需用户手动地标注要执行虚化处理的区域或者手动地执行处理操作,提高操作便利和准确性。According to the image processing method of the above embodiment of the present application, the face information is obtained by detecting the image to be processed, and the foreground area and the background area in the image to be processed are acquired according to the detected face information and the character outline template, and then The background area and/or the foreground area are blurred, so that when the image related to the person is processed, the foreground area and the background area that need to be processed can be automatically and accurately determined by the face information detected from the image. To perform the blurring process on the foreground area or the background area without the user manually marking the area where the blurring process is to be performed or manually performing the processing operation, improving the convenience and accuracy of the operation.
以下介绍一种训练关键点定位模型的示例性方法。An exemplary method of training a keypoint location model is described below.
图5是本申请实施例中训练关键点定位模型的一个示例性方法的流程图。参照图5,该训练关键点定位模型的示例性方法包括:5 is a flow chart of an exemplary method of training a keypoint location model in an embodiment of the present application. Referring to FIG. 5, an exemplary method of the training keypoint location model includes:
在步骤S510,获取第一样本集,所述第一样本集包括多个未标注样本图像。At step S510, a first sample set is acquired, the first sample set including a plurality of unlabeled sample images.
在实际应用中,通常将输入到模型中的已经标注有关键点位置信息的图像,称为已标注样本图像。其中,关键点位置信息是指关键点在图像坐标系中的坐标信息。可选地,可通过人工标注等方式事先对样本图像进行关键点位置标注。In practical applications, an image that has been input into the model and has been marked with key position information is generally referred to as an annotated sample image. The key position information refers to the coordinate information of the key point in the image coordinate system. Optionally, the sample image may be marked in advance by manual labeling or the like.
以人脸关键点为例,标注的人脸关键点主要分布在人脸器官和脸部轮廓,人脸关键点如眼睛关键点、鼻子关键点、嘴巴关键点、脸部轮廓关键点等。人脸关键点位置信息是人脸关键点在人脸图像坐标系中的坐标信息。例如,将某一包含人脸的样本图像的左上角记为坐标原点,以水平向右为X轴正方向,以垂直向下为Y轴正方向,建立人脸图像坐标系,将第i个人脸关键点在该人脸图像坐标系中的坐标记为(x i,y i),通过上述方式获得的样本图像即是已标注样本图像。相反地,如果不对样本图像进行上述关键点位置标注的处理,那么该样本图像可以理解为未标注样本图像。本步骤中的第一样本集就是包含有多个上述未标注样本图像的图像集合。 Taking the key points of the face as an example, the key points of the face are mainly distributed in the facial organs and facial contours, such as key points of the eyes, key points of the nose, key points of the mouth, key points of the facial contour, and the like. The face key position information is the coordinate information of the face key point in the face image coordinate system. For example, the upper left corner of a sample image containing a human face is recorded as the coordinate origin, and the horizontal direction is the positive direction of the X-axis, and the vertical direction is the positive direction of the Y-axis. The face image coordinate system is established, and the i-th person is The sitting key of the face key point in the face image coordinate system is (x i , y i ), and the sample image obtained by the above method is the labeled sample image. Conversely, if the processing of the above-described key point position labeling is not performed on the sample image, the sample image can be understood as an unlabeled sample image. The first sample set in this step is an image set containing a plurality of the above unlabeled sample images.
在一个可选示例中,该步骤S510可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的样本集获取模块660执行。In an optional example, the step S510 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a sample set acquisition module 660 executed by the processor.
在步骤S520,基于深度神经网络,对所述第一样本集中的各所述未标注样本图像进行关键点位置标注,得到第二样本集。In step S520, based on the depth neural network, key point position annotation is performed on each of the unlabeled sample images in the first sample set to obtain a second sample set.
其中,所述深度神经网络用于对图像进行关键点定位。Wherein, the deep neural network is used for key point positioning of an image.
其中,深度神经网络可以为卷积神经网络,但不限于此。由于深度神经网络是用于对图像进行关键点定位的,因此,将第一样本集中的各未标注样本图像输入到深度神经网络中,就可以对每一个未标注样本图像实现关键点位置标注。需要说明的是,关键点位置标注就是将未标注样本图像中的关键点位置信息(即坐标信息)标注出来。The deep neural network may be a convolutional neural network, but is not limited thereto. Since the deep neural network is used to locate the key points of the image, the unlabeled sample images in the first sample set are input into the deep neural network, and the key point position annotation can be realized for each unlabeled sample image. . It should be noted that the key point position labeling is to mark the key point position information (ie, coordinate information) in the unlabeled sample image.
可选地,上述关键点例如可以包括但不限于以下任意一项或多项:人脸关键点、肢体关键点、掌纹关键点及标记物关键点。当关键点包括人脸关键点时,人脸关键点例如可以包括但不限于以下任意一项或多项:眼睛关键点、鼻子关键点、嘴巴关键点、眉毛关键点及脸部轮廓关键点。Optionally, the key points may include, but are not limited to, any one or more of the following: a face key point, a limb key point, a palm print key point, and a marker key point. When the key point includes a face key point, the face key point may include, but is not limited to, any one or more of the following: an eye key point, a nose key point, a mouth key point, an eyebrow key point, and a face contour key point.
仍以包含人脸的未标注样本图像为例,将包含人脸的未标注样本图像输入深度神经网络,输出的是未标注样本图像本身,以及未标注样本图像的关键点位置信息,如眼睛关键点的坐标信息、鼻子关键点的坐标信息等。由此,当多个包含人脸的未标注样本图像输入到深度神经网络时,大量的未标注样本图像本身,以及未标注样本图像的关键点位置信息组成了本步骤中的第二样本集。Taking an unlabeled sample image containing a human face as an example, an unlabeled sample image containing a human face is input into a deep neural network, and the output is an unlabeled sample image itself, and key position information of the unlabeled sample image, such as an eye key. The coordinate information of the point, the coordinate information of the nose key point, and the like. Thus, when a plurality of unlabeled sample images including faces are input to the deep neural network, a large number of unlabeled sample images themselves, and key point position information of the unlabeled sample images constitute the second sample set in this step.
在一个可选示例中,该步骤S520可以由处理器调用存储器存储的相应指令执行,也可以由被处理器运行的关键点位置标注模块670执行。In an alternative example, the step S520 may be performed by a processor invoking a corresponding instruction stored in the memory, or may be performed by a keypoint location labeling module 670 that is executed by the processor.
在步骤S530,至少根据所述第二样本集中的部分样本图像及第三样本集,调整所述深度神经网络的参数。In step S530, parameters of the deep neural network are adjusted according to at least part of the sample image and the third sample set in the second sample set.
其中,所述第三样本集包括多个已标注样本图像。The third sample set includes a plurality of labeled sample images.
可以使用第二样本集中的部分样本图像或者全部样本图像,以及第三样本集一起调整深度神经网络的参数。这里,已标注样本图像可以参照本实施例步骤S510中的介绍和解释说明,在此不再赘述。A partial sample image or a full sample image in the second set of samples may be used, and the third set of samples together adjust the parameters of the deep neural network. Here, the labeled sample image can be referred to the description and explanation in step S510 of the embodiment, and details are not described herein again.
在一个可选示例中,该步骤S530可以由处理器调用存储器存储的相应指令执行,也可以由被处 理器运行的网络参数调整模块680执行。In an alternative example, the step S530 may be performed by a processor invoking a corresponding instruction stored in the memory or by a network parameter adjustment module 680 executed by the processor.
通过本申请上述实施例提供的训练关键点定位模型的方法,利用两个样本集调整深度神经网络的参数,其中一个是第二样本集,该第二样本集来源于基于深度神经网络,对包括多个未标注样本图像的第一样本集进行关键点位置标注获得的;另一个是包括多个已标注样本图像的第三样本集。本申请实施例可以实现在输入到模型的图像非全部为已标注图像的前提下,提高关键点定位模型的训练准确度,换言之,既可以避免样本资源浪费,又可以提高模型训练的效率。The method for training a key point localization model provided by the above embodiment of the present application uses two sample sets to adjust parameters of the deep neural network, one of which is a second sample set, the second sample set is derived from a deep neural network, including A first sample set of a plurality of unlabeled sample images is obtained by key point position annotation; and the other is a third sample set including a plurality of labeled sample images. The embodiment of the present application can improve the training accuracy of the key point positioning model under the premise that the images input to the model are not all labeled images, in other words, the sample resource waste can be avoided, and the efficiency of the model training can be improved.
根据本申请实施例的一种可实施方案,步骤S520可包括以下处理:对所述第一样本集中的各未标注样本图像进行图像变换处理,得到第四样本集,其中,所述图像变换处理例如可以包括但不限于以下任意一项或多项:旋转、平移、缩放、加噪及加遮挡物,但不限于此;基于所述深度神经网络,对所述第四样本集以及所述第一样本集中的各样本图像进行关键点位置标注,得到所述第二样本集。According to an implementation manner of the embodiment of the present application, step S520 may include a process of performing image transformation processing on each unlabeled sample image in the first sample set to obtain a fourth sample set, where the image transformation The processing may include, for example but not limited to, any one or more of the following: rotation, translation, scaling, noise addition, and occlusion, but is not limited thereto; based on the depth neural network, the fourth sample set and the Each sample image in the first sample set is subjected to key point position annotation to obtain the second sample set.
例如,将某一未标注样本图像旋转设定角度,该设定角度的取值范围通常为(-20°,20°),即属于小幅度的旋转变换,同理,平移处理也是小位移的平移。假设第一样本集包括1万个未标注样本图像,对每一个未标注样本图像经过图像变换处理(如缩放、平移等)得到10个图像变换处理后的未标注样本图像。此时,1万个未标注样本图像就变成了10万个未标注样本图像,这10万个未标注样本图像组成了第四样本集。需要指出,无论是任何形式的图像变换处理的组合,只要能达到对于第一样本集中的各未标注样本图像,做相同或者不同图像变换处理效果,均属于本申请实施例的技术范畴内。此外,对未标注样本图像可选做哪种图像变换处理,还可以结合样本图像本身的特性,做适合该样本图像的图像变换处理。For example, if an unlabeled sample image is rotated to set an angle, the set angle is usually in the range of (-20°, 20°), that is, a rotation transformation of a small amplitude. Similarly, the translation processing is also a small displacement. Pan. It is assumed that the first sample set includes 10,000 unlabeled sample images, and each of the unlabeled sample images is subjected to image transformation processing (such as scaling, translation, etc.) to obtain 10 image-converted unlabeled sample images. At this time, 10,000 unlabeled sample images become 100,000 unlabeled sample images, and the 100,000 unlabeled sample images constitute the fourth sample set. It should be noted that, regardless of any combination of image transformation processing, it is within the technical scope of the embodiments of the present application to achieve the same or different image transformation processing effects for each unlabeled sample image in the first sample set. In addition, which image transformation processing can be selected for the unlabeled sample image, and the image transformation processing suitable for the sample image can be combined with the characteristics of the sample image itself.
由于第四样本集和第一样本集中均是未标注样本图像,那么基于与前述实施例说明的相同原理,将未标注样本图像输入深度神经网络,输出第四样本集以及第一样本集中的各样本图像的本身,以及各样本图像的关键点位置信息。Since the fourth sample set and the first sample set are both unlabeled sample images, the unlabeled sample image is input to the deep neural network based on the same principle as described in the foregoing embodiment, and the fourth sample set and the first sample set are output. Each sample image itself, as well as key point location information for each sample image.
此外,根据本申请实施例的一种可实施方式,步骤S530可以包括:对于所述第一样本集中的每个未标注样本图像,基于所述未标注样本图像进行图像变换处理后的关键点位置信息,判断所述未标注样本图像的关键点位置信息是否为可选样本;其中,所述未标注样本图像的关键点位置信息,及其进行图像变换处理后的关键点位置信息均包括在所述第二样本集中;根据所述第二样本集中的各所述可选样本及第三样本集,调整所述深度神经网络的参数。In addition, according to an implementation manner of the embodiment of the present application, step S530 may include: performing key transformation after image transformation processing based on the unlabeled sample image for each unlabeled sample image in the first sample set Position information, determining whether the key point position information of the unlabeled sample image is an optional sample; wherein the key point position information of the unlabeled sample image and the key point position information after performing image transformation processing are included in The second sample set; adjusting parameters of the deep neural network according to each of the selectable samples and the third sample set in the second sample set.
其中,未标注样本图像的关键点位置信息,及其进行图像变换处理后的关键点位置信息包括在第二样本集中。The key point position information of the unlabeled sample image and the key point position information after the image transform processing are included in the second sample set.
首先,将该未标注样本图像进行图像变换处理后的关键点位置信息,进行图像校正处理。需要说明的是,图像校正处理就是上述图像变换处理的反变换处理,例如,某一未标注样本图像向右平移了5毫米,那么该未标注样本图像进行图像变换处理后的关键点位置信息,需要向左平移5毫米以实现图像校正处理。其次,对经图像校正的关键点位置信息(即一系列点的坐标值)求协方差矩阵Cov1,并将协方差矩阵Cov1逐列或逐行展开成向量的形式,并归一化成单位向量Cov1_v。并且,对该未标注样本图像的关键点位置信息求协方差矩阵Cov2,并将Cov2逐列或逐行展开成向量的形式,并归一化成单位向量Cov2_v。计算Cov1_v和Cov2_v的内积,并将内积记作D。最后,将D与设定的内积阈值进行比较,若D小于内积阈值,则该未标注样本图像的关键点位置信息为可选样本。相反地,若D大于等于内积阈值,则该未标注样本图像的关键点位置信息不为可选样本。以此类推,基于第二样本集中图像变换处理之前和之后的关键点位置信息,对第一样本集中的每个未标注样本图像都进行上述判断处理,就可以选出各可选样本。First, the key point position information after the image conversion processing is performed on the unlabeled sample image, and image correction processing is performed. It should be noted that the image correction processing is the inverse transformation processing of the image transformation processing described above. For example, if an unlabeled sample image is shifted to the right by 5 mm, the key point position information after the image conversion processing is performed on the unlabeled sample image, It is necessary to translate 5 mm to the left to implement image correction processing. Secondly, the covariance matrix Cov1 is obtained by image-corrected key position information (ie, coordinate values of a series of points), and the covariance matrix Cov1 is expanded into a vector form by column or row by row, and normalized into a unit vector Cov1_v. . And, the covariance matrix Cov2 is obtained for the key point position information of the unlabeled sample image, and Cov2 is expanded into a vector form column by column or row by row, and normalized into a unit vector Cov2_v. Calculate the inner product of Cov1_v and Cov2_v and record the inner product as D. Finally, D is compared with the set inner product threshold. If D is less than the inner product threshold, the key position information of the unlabeled sample image is an optional sample. Conversely, if D is greater than or equal to the inner product threshold, the key position information of the unlabeled sample image is not an optional sample. By analogy, based on the key point position information before and after the image conversion processing in the second sample set, the above-described judging process is performed on each unlabeled sample image in the first sample set, and each of the selectable samples can be selected.
此外,另一种选取可选样本的方式是,与上述判断过程不同的之处仅在于最后步骤中,若D小于设定的阈值,则针对该未标注样本图像,采用对其进行图像变换处理后的关键点位置信息,进行图像校正处理,获得经图像校正的关键点位置信息。再利用经图像校正的关键点位置信息的数据分布情况推断出的结果(例如一系列点的坐标值的均值),对该未标注样本图像进行关键点位置标注,标注的关键点位置信息作为可选样本,包括在第二样本集中。In addition, another way to select an optional sample is that the difference from the above-mentioned judging process is only in the last step. If D is less than the set threshold, image conversion processing is performed on the unlabeled sample image. After the key point position information, image correction processing is performed to obtain image corrected key point position information. Then, the result of the data distribution of the key position information corrected by the image (for example, the mean value of the coordinate values of a series of points) is used, and the key point position is marked on the unlabeled sample image, and the key position information of the label is used as Samples are selected, including in the second sample set.
可使用深度神经网络的常用训练方法,根据所述第二样本集中的各所述可选样本及第三样本集,调整所述深度神经网络的参数,在此不予赘述。The parameters of the deep neural network may be adjusted according to the commonly used training methods of the deep neural network, and the parameters of the deep neural network are adjusted according to the selected samples and the third sample set in the second sample set, and details are not described herein.
本申请上述实施例提供的任一种方法可以由任意适当的具有数据处理能力的设备执行,包括但不限于:终端设备和服务器等。或者,本申请上述实施例提供的任一种方法可以由处理器执行,如处理器通过调用存储器存储的相应指令来执行本申请上述实施例提及的任一种方法。下文不再赘述。Any of the methods provided by the foregoing embodiments of the present application may be performed by any suitable device having data processing capabilities, including but not limited to: a terminal device, a server, and the like. Alternatively, any of the methods provided by the foregoing embodiments of the present application may be executed by a processor, such as the processor, by executing a corresponding instruction stored in a memory to perform any of the methods mentioned in the foregoing embodiments of the present application. This will not be repeated below.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。图6是本申请一个实施例的图像处理装置的逻辑框图。参照图6,实施例五的图像处理装置包括对象信息确定模块610、前背景确定模块620和虚化处理模块630。其中:A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to the program instructions. The foregoing program may be stored in a computer readable storage medium, and the program is executed when executed. The foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk. Figure 6 is a logic block diagram of an image processing apparatus according to an embodiment of the present application. Referring to FIG. 6, the image processing apparatus of Embodiment 5 includes an object information determining module 610, a front background determining module 620, and a blurring processing module 630. among them:
对象信息确定模块610,用于从待处理的图像中确定目标对象信息。The object information determining module 610 is configured to determine target object information from the image to be processed.
前背景确定模块620,用于根据对象信息确定模块610确定的目标对象信息和预定的对象轮廓模板确定所述图像中的前景区域和背景区域。The front background determining module 620 is configured to determine a foreground area and a background area in the image according to the target object information determined by the object information determining module 610 and the predetermined object contour template.
虚化处理模块630,用于对前背景确定模块620确定的前景区域和/或所述背景区域进行虚化处理。The blurring processing module 630 is configured to perform a blurring process on the foreground area and/or the background area determined by the front background determining module 620.
本实施例的图像处理装置可用于实现前述方法实施例中相应的图像处理方法,且具有相应方法实施例的有益效果,在此不再赘述。The image processing apparatus of the present embodiment can be used to implement the corresponding image processing method in the foregoing method embodiments, and has the beneficial effects of the corresponding method embodiments, and details are not described herein again.
图7是示出根据本申请另一个实施例的图像处理装置的逻辑框图。参照图7,实施例六的图像处理装置包括对象信息确定模块610、前背景确定模块620和虚化处理模块630。其中,前背景确定模块620包括模板匹配单元6201、差异确定单元6202、轮廓调整单元6203和前背景确定单元6204。其中:FIG. 7 is a logic block diagram showing an image processing apparatus according to another embodiment of the present application. Referring to FIG. 7, the image processing apparatus of Embodiment 6 includes an object information determining module 610, a front background determining module 620, and a blurring processing module 630. The front background determining module 620 includes a template matching unit 6201, a difference determining unit 6202, a contour adjusting unit 6203, and a front background determining unit 6204. among them:
模板匹配单元6201,用于将前述对象轮廓模板中至少局部区域与确定的所述目标对象信息进行匹配。The template matching unit 6201 is configured to match at least a partial area in the foregoing object contour template with the determined target object information.
差异确定单元6202,用于根据模板匹配单元6201的匹配结果确定所述对象轮廓模板中的对象轮廓与所述图像中的目标对象的轮廓之间的差异信息。The difference determining unit 6202 is configured to determine difference information between the object contour in the object contour template and the contour of the target object in the image according to the matching result of the template matching unit 6201.
轮廓调整单元6203,用于根据差异确定单元6202确定的差异信息调整所述对象轮廓模板中的对象轮廓。The contour adjustment unit 6203 is configured to adjust an object contour in the object contour template according to the difference information determined by the difference determining unit 6202.
前背景确定单元6204,用于将经过轮廓调整单元6203调整的对象轮廓映射到所述图像中,获得所述图像中包括目标对象的前景区域以及包括至少部分非所述前景区域的背景区域。The front background determining unit 6204 is configured to map an object contour adjusted by the contour adjusting unit 6203 into the image, obtain a foreground region including the target object in the image, and a background region including at least a portion not the foreground region.
可选地,所述差异信息包括:所述对象轮廓模板中的对象轮廓与所述图像中的目标对象的轮廓之间的缩放信息、偏移信息和/或角度信息。Optionally, the difference information includes: scaling information, offset information, and/or angle information between an object contour in the object contour template and a contour of the target object in the image.
可选地,所述图像可以包括但不限于:静态图像或视频帧图像。Optionally, the image may include, but is not limited to, a still image or a video frame image.
根据本申请实施例的一种可实施方式,所述图像为视频帧图像。对象信息确定模块610包括:第一对象信息确定单元6101,用于根据从待处理的视频帧图像之前的视频帧图像确定的目标对象信息从该待处理的视频帧图像确定所述目标对象信息;或者,第二对象信息确定单元6102,用于通过对待处理的视频流进行逐视频帧图像检测,确定各所述视频帧图像中的目标对象信息。According to an implementation manner of the embodiments of the present application, the image is a video frame image. The object information determining module 610 includes: a first object information determining unit 6101, configured to determine the target object information from the to-be-processed video frame image according to target object information determined from a video frame image before the video frame image to be processed; Alternatively, the second object information determining unit 6102 is configured to perform target-by-video frame image detection by the video stream to be processed, and determine target object information in each of the video frame images.
可选地,该实施例的图像处理装置还包括:过渡区域确定模块640,用于确定所述前景区域和背景区域之间的过渡区域;过渡虚化处理模块650,用于对所述过渡区域确定模块640确定的过渡区域进行虚化处理。Optionally, the image processing apparatus of this embodiment further includes: a transition area determining module 640, configured to determine a transition area between the foreground area and the background area; and a transition blur processing module 650, configured to use the transition area The transition area determined by the determination module 640 is blushed.
可选地,过渡虚化处理模块650可选用于对所述过渡区域进行渐进虚化处理或光斑处理。Optionally, the transition blur processing module 650 is optionally configured to perform progressive blurring processing or spot processing on the transition region.
根据本申请的一种可实施方式,对象信息确定模块610包括:选择信息获取单元6103,用于获取对象选择信息;第三对象信息确定单元6104,用于根据所述选择信息获取单元6103获取的对象选择信息从所述待处理的图像中确定所述目标对象信息。According to an embodiment of the present application, the object information determining module 610 includes: a selection information acquiring unit 6103 for acquiring object selection information; and a third object information determining unit 6104 for acquiring according to the selection information acquiring unit 6103. The object selection information determines the target object information from the image to be processed.
根据本申请的另一种可实施方式,对象信息确定模块610包括:第四对象信息确定单元6105,用于从所述待处理的图像中检测目标对象,获得检测到的目标对象信息。According to another implementation manner of the present application, the object information determining module 610 includes: a fourth object information determining unit 6105, configured to detect a target object from the image to be processed, and obtain the detected target object information.
可选地,第四对象信息确定单元6105,用于通过预先训练的深度神经网络从所述待处理的图像中检测目标对象,获得检测到的目标对象信息。Optionally, the fourth object information determining unit 6105 is configured to detect the target object from the image to be processed through a pre-trained depth neural network, and obtain the detected target object information.
可选地,所述目标对象信息可以包括但不限于以下任意一项或多项:人脸信息、车牌信息、门牌信息、地址信息、身份ID信息、商标信息。Optionally, the target object information may include, but is not limited to, any one or more of the following: face information, license plate information, house number information, address information, identity ID information, and trademark information.
可选地,所述人脸信息可以包括但不限于以下任意一项或多项:人脸关键点的信息、人脸位置信息、人脸大小信息、人脸角度信息。Optionally, the face information may include, but is not limited to, any one or more of the following: information of a face key point, face position information, face size information, and face angle information.
可选地,所述对象轮廓模板可以包括但不限于以下任意一项或多项:人脸轮廓模板、人体轮廓模板、车牌轮廓模板、门牌轮廓模板、预定框轮廓模板。Optionally, the object contour template may include, but is not limited to, any one or more of the following: a face contour template, a human body contour template, a license plate contour template, a house card contour template, and a predetermined frame contour template.
可选地,所述预定的对象轮廓模板可以包括:分别对应不同人脸角度的多个人体轮廓模板;相应地,前背景确定模块620还可用于在根据所述目标对象信息和预定的对象轮廓模板确定所述图像中的 前景区域和背景区域之前,从所述预定的对象轮廓模板当中确定与人脸信息中的人脸角度信息对应的人体轮廓模板。Optionally, the predetermined object contour template may include: a plurality of human body contour templates respectively corresponding to different human face angles; correspondingly, the front background determining module 620 is further configured to use the target object information according to the target object information and the predetermined object contour Before the template determines the foreground area and the background area in the image, a human body contour template corresponding to the face angle information in the face information is determined from among the predetermined object outline templates.
本实施例的图像处理装置用于实现本申请前述方法实施例中相应的图像处理方法,且具有相应方法实施例的有益效果,在此不再赘述。The image processing apparatus of the present embodiment is used to implement the corresponding image processing method in the foregoing method embodiments of the present application, and has the beneficial effects of the corresponding method embodiments, and details are not described herein again.
图8是示出根据本申请又一个实施例的图像处理装置的逻辑框图。参照图8,该实施例的图像处理装置包括:对象信息确定模块610、前背景确定模块620和虚化处理模块630。可选地,该图像处理装置还包括过渡区域确定模块640和过渡虚化处理模块650。此外,该图像处理装置还包括样本集获取模块660、关键点位置标注模块670和网络参数调整模块680。其中:FIG. 8 is a logic block diagram showing an image processing apparatus according to still another embodiment of the present application. Referring to FIG. 8, the image processing apparatus of this embodiment includes an object information determining module 610, a front background determining module 620, and a blurring processing module 630. Optionally, the image processing apparatus further includes a transition region determining module 640 and a transition blur processing module 650. In addition, the image processing apparatus further includes a sample set acquisition module 660, a key point location labeling module 670, and a network parameter adjustment module 680. among them:
样本集获取模块660,用于获取第一样本集,所述第一样本集包括多个未标注样本图像。The sample set obtaining module 660 is configured to acquire a first sample set, where the first sample set includes a plurality of unlabeled sample images.
关键点位置标注模块670,用于基于深度神经网络,对所述第一样本集中的各所述未标注样本图像进行关键点位置标注,得到第二样本集,其中,所述深度神经网络用于对图像进行关键点定位。a key point location labeling module 670, configured to perform key point position labeling on each of the unlabeled sample images in the first sample set based on a depth neural network, to obtain a second sample set, where the depth neural network is used For key point positioning of the image.
网络参数调整模块680,用于至少根据所述第二样本集中的部分样本图像及第三样本集,调整所述深度神经网络的参数,其中,所述第三样本集包括多个已标注样本图像。The network parameter adjustment module 680 is configured to adjust parameters of the deep neural network according to at least a partial sample image and a third sample set in the second sample set, where the third sample set includes a plurality of labeled sample images .
可选地,关键点位置标注模块670可以包括:图像变换处理单元6701,用于对所述第一样本集中的各未标注样本图像进行图像变换处理,得到第四样本集,其中,所述图像变换处理可以包括但不限于以下任意一项或多项:旋转、平移、缩放、加噪及加遮挡物;关键点位置标注单元6702,用于基于所述深度神经网络,对所述第四样本集以及所述第一样本集中的各未标注样本图像进行关键点位置标注,得到所述第二样本集。Optionally, the key point location labeling module 670 may include: an image transformation processing unit 6701, configured to perform image transformation processing on each unlabeled sample image in the first sample set to obtain a fourth sample set, where The image transformation processing may include, but is not limited to, any one or more of the following: rotation, translation, scaling, noise addition, and occlusion; a key point location labeling unit 6702, for the fourth based on the depth neural network The sample set and each unlabeled sample image in the first sample set perform key point position labeling to obtain the second sample set.
可选地,网络参数调整模块680包括:可选样本判断单元6801,用于对于所述第一样本集中的每个未标注样本图像,基于所述未标注样本图像进行图像变换处理后的关键点位置信息,判断所述未标注样本图像的关键点位置信息是否为可选样本,其中,所述未标注样本图像的关键点位置信息,及其进行图像变换处理后的关键点位置信息均包括在所述第二样本集中;网络参数调整单元6802,用于根据所述第二样本集中的各所述可选样本及第三样本集,调整所述深度神经网络的参数。Optionally, the network parameter adjustment module 680 includes: an optional sample determining unit 6801, configured to perform image transformation processing on the basis of the unlabeled sample image for each unlabeled sample image in the first sample set. Point position information, determining whether the key point position information of the unlabeled sample image is an optional sample, wherein the key point position information of the unlabeled sample image and the key point position information after the image transformation processing are included In the second sample set, the network parameter adjustment unit 6802 is configured to adjust parameters of the deep neural network according to each of the selectable samples and the third sample set in the second sample set.
可选地,所述人脸关键点可以包括但不限于以下任意一项或多项:眼睛关键点、鼻子关键点、嘴巴关键点、眉毛关键点及脸部轮廓关键点。Optionally, the face key point may include, but is not limited to, any one or more of the following: an eye key point, a nose key point, a mouth key point, an eyebrow key point, and a face contour key point.
本实施例的图像处理装置用于实现前述方法实施例中相应的图像处理方法,且具有相应方法实施例的有益效果,在此不再赘述。The image processing apparatus of the present embodiment is used to implement the corresponding image processing method in the foregoing method embodiments, and has the beneficial effects of the corresponding method embodiments, and details are not described herein again.
另外,本申请实施例还提供了一种电子设备,包括:处理器和本申请前述任一实施例的图像处理装置,在处理器运行该图像处理装置时,本申请前述任一实施例的图像处理装置中的单元被运行。In addition, the embodiment of the present application further provides an electronic device, including: a processor and an image processing apparatus according to any of the foregoing embodiments of the present application. When the processor runs the image processing apparatus, the image of any of the foregoing embodiments of the present application The units in the processing unit are operated.
另外,本申请实施例还提供了另一种电子设备,包括:处理器和存储器,该存储器用于存放至少一可执行指令,可执行指令使处理器执行本申请前述任一实施例的图像处理方法对应的操作。In addition, the embodiment of the present application further provides another electronic device, including: a processor and a memory, where the memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform image processing in any of the foregoing embodiments of the present application. The corresponding operation of the method.
本申请实施例还提供了一种电子设备,例如可以是移动终端、个人计算机(PC)、平板电脑、服务器等。图9是示出根据本申请一个实施例的电子设备的结构示意图。下面参考图9,其示出了适于用来实现本申请实施例的终端设备或服务器的电子设备900的结构示意图。如图9所示,电子设备900包括一个或多个处理器、通信元件等,一个或多个处理器例如:一个或多个中央处理单元(CPU)901,和/或一个或多个图像处理器(GPU)913等,处理器可以根据存储在只读存储器(ROM)902中的可执行指令或者从存储部分908加载到随机访问存储器(RAM)903中的可执行指令而执行各种适当的动作和处理。通信元件包括通信组件912和通信接口909。其中,通信组件912可包括但不限于网卡,网卡可包括但不限于IB(Infiniband)网卡,通信接口909包括诸如LAN卡、调制解调器等的网络接口卡的通信接口,通信接口909经由诸如因特网的网络执行通信处理。The embodiment of the present application further provides an electronic device, such as a mobile terminal, a personal computer (PC), a tablet computer, a server, and the like. FIG. 9 is a schematic structural view showing an electronic device according to an embodiment of the present application. Referring now to Figure 9, a block diagram of an electronic device 900 suitable for use in implementing a terminal device or server of an embodiment of the present application is shown. As shown in FIG. 9, electronic device 900 includes one or more processors, communication elements, etc., one or more processors such as one or more central processing units (CPUs) 901, and/or one or more image processing The GPU 913 or the like, the processor may perform various appropriate operations according to executable instructions stored in the read only memory (ROM) 902 or executable instructions loaded from the storage portion 908 into the random access memory (RAM) 903. Action and processing. The communication component includes a communication component 912 and a communication interface 909. The communication component 912 can include, but is not limited to, a network card, which can include, but is not limited to, an IB (Infiniband) network card, the communication interface 909 includes a communication interface of a network interface card such as a LAN card, a modem, etc., and the communication interface 909 is via a network such as the Internet. Perform communication processing.
处理器可与只读存储器902和/或随机访问存储器930中通信以执行可执行指令,通过总线904与通信组件912相连、并经通信组件912与其他目标设备通信,从而完成本申请实施例提供的任一项方法对应的操作,例如,从待处理的图像中确定目标对象信息;根据目标对象信息和预定的对象轮廓模板确定所述图像中的前景区域和背景区域;对所述前景区域和/或所述背景区域进行虚化处理。The processor can communicate with the read only memory 902 and/or the random access memory 930 to execute executable instructions, connect to the communication component 912 via the bus 904, and communicate with other target devices via the communication component 912, thereby completing the embodiments of the present application. Corresponding operations of any one of the methods, for example, determining target object information from the image to be processed; determining foreground and background regions in the image according to the target object information and the predetermined object contour template; / or the background area is blurred.
此外,在RAM 903中,还可存储有装置操作所需的各种程序和数据。CPU901、ROM902以及RAM903通过总线904彼此相连。在有RAM903的情况下,ROM902为可选模块。RAM903存储可执行指令,或在运行时向ROM902中写入可执行指令,可执行指令使处理器901执行上述通信方法对应的操作。输入/输出(I/O)接口905也连接至总线904。通信组件912可以集成设置,也可以设置为具有多个子模块(例如多个IB网卡),并在总线链接上。Further, in the RAM 903, various programs and data required for the operation of the device can be stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other by a bus 904. In the case of RAM 903, ROM 902 is an optional module. The RAM 903 stores executable instructions or writes executable instructions to the ROM 902 at runtime, the executable instructions causing the processor 901 to perform operations corresponding to the above-described communication methods. An input/output (I/O) interface 905 is also coupled to bus 904. The communication component 912 can be integrated or can be configured to have multiple sub-modules (eg, multiple IB network cards) and be on a bus link.
以下部件连接至I/O接口905:包括键盘、鼠标等的输入部分906;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分907;包括硬盘等的存储部分908;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信接口909。驱动器910也根据需要连接至I/O接口905。可拆卸介质911,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器910上,以便于从其上读出的计算机程序根据需要被安装入存储部分908。The following components are connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, etc.; an output portion 907 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a storage portion 908 including a hard disk or the like. And a communication interface 909 including a network interface card such as a LAN card, a modem, or the like. Driver 910 is also connected to I/O interface 905 as needed. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory or the like is mounted on the drive 910 as needed so that a computer program read therefrom is installed into the storage portion 908 as needed.
需要说明的是,如图9所示的架构仅为一种可选实现方式,在可选实践过程中,可根据实际需要对上述图9的部件数量和类型进行选择、删减、增加或替换;在不同功能部件设置上,也可采用分离设置或集成设置等实现方式,例如GPU和CPU可分离设置或者可将GPU集成在CPU上,通信组件912可分离设置,也可集成设置在CPU或GPU上,等等。这些可替换的实施方式均落入本申请的保护范围。It should be noted that the architecture shown in FIG. 9 is only an optional implementation manner. In an optional practice process, the number and types of components in FIG. 9 may be selected, deleted, added, or replaced according to actual needs. In different function component settings, implementations such as separate settings or integrated settings may also be adopted. For example, the GPU and the CPU may be detachably set or the GPU may be integrated on the CPU, the communication component 912 may be separately configured, or may be integrated in the CPU or On the GPU, and so on. These alternative embodiments are all within the scope of the present application.
特别地,根据本申请实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本申请实施例包括一种计算机程序产品,其包括有形地包含在机器可读介质上的计算机程序,计算机程序包含用于执行流程图所示的方法的程序代码,程序代码可包括对应执行本申请实施例提供的方法步骤对应的指令,例如,从待处理的图像中确定目标对象信息;根据所述目标对象信息和预定的对象轮廓模板确定所述图像中的前景区域和背景区域;对所述前景区域和/或所述背景区域进行虚化处理。在这样的实施例中,该计算机程序可以通过通信元件从网络上被下载和安装,和/或从可拆卸介质911被安装。在该计算机程序被中央处理单元(CPU)901执行时,执行本申请实施例的方法中限定的上述功能。In particular, according to embodiments of the present application, the processes described above with reference to the flowcharts may be implemented as a computer software program. For example, embodiments of the present application include a computer program product comprising a computer program tangibly embodied on a machine readable medium, the computer program comprising program code for executing the method illustrated in the flowchart, the program code comprising the corresponding execution The instruction corresponding to the method step provided by the embodiment of the present application determines, for example, the target object information from the image to be processed; and determines the foreground area and the background area in the image according to the target object information and the predetermined object contour template; The foreground area and/or the background area are subjected to blurring processing. In such an embodiment, the computer program can be downloaded and installed from the network via a communication component, and/or installed from the removable media 911. When the computer program is executed by the central processing unit (CPU) 901, the above-described functions defined in the method of the embodiment of the present application are executed.
实施例八的电子设备900对待处理的图像进行检测,以确定目标对象信息,根据确定的目标对象信息和对象轮廓模板获取待处理的图像中的前景区域以及背景区域,再对背景区域或者前景区域进行虚化处理,从而可通过从图像检测到的目标对象信息来自动地确定需要执行虚化处理的前景区域或背景区域,而无需用户手动地标注要执行虚化处理的区域或者手动地执行虚化(模糊)操作,提高操作便利和准确性。The electronic device 900 of the eighth embodiment detects the image to be processed to determine target object information, and acquires a foreground area and a background area in the image to be processed according to the determined target object information and the object contour template, and then the background area or the foreground area. The blurring process is performed so that the foreground area or the background area in which the blurring process needs to be performed can be automatically determined by the target object information detected from the image without the user manually marking the area where the blurring processing is to be performed or manually performing the virtual (fuzzy) operation to improve the convenience and accuracy of operation.
另外,本申请实施例还提供了一种计算机程序,包括计算机可读代码,当计算机可读代码在设备上运行时,设该备中的处理器执行用于实现本申请前述任一实施例的图像处理方法中各步骤的指令。In addition, the embodiment of the present application further provides a computer program, including computer readable code, when the computer readable code is run on the device, the processor in the device is configured to implement any of the foregoing embodiments of the present application. Instructions for each step in the image processing method.
另外,本申请实施例还提供了一种计算机可读存储介质,用于存储计算机可读取的指令,该指令被执行时实现本申请前述任一实施例的图像处理方法中各步骤的操作。In addition, the embodiment of the present application further provides a computer readable storage medium for storing computer readable instructions, which are executed to implement the operations of the steps in the image processing method of any of the foregoing embodiments of the present application.
可能以许多方式来实现本申请的方法和装置、设备。例如,可通过软件、硬件、固件或者软件、硬件、固件的任何组合来实现本申请实施例的方法和装置、设备。用于方法的步骤的上述顺序仅是为了进行说明,本申请实施例的方法的步骤不限于以上可选描述的顺序,除非以其它方式特别说明。此外,在一些实施例中,还可将本申请实施为记录在记录介质中的程序,这些程序包括用于实现根据本申请实施例的方法的机器可读指令。因而,本申请还覆盖存储用于执行根据本申请的方法的程序的记录介质。The methods, apparatus, and apparatus of the present application may be implemented in a number of ways. For example, the method, apparatus, and apparatus of the embodiments of the present application can be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described sequence of steps for the method is for illustrative purposes only, and the steps of the method of the embodiments of the present application are not limited to the order of the above optional description unless otherwise specified. Moreover, in some embodiments, the present application may also be embodied as a program recorded in a recording medium, the programs including machine readable instructions for implementing a method in accordance with embodiments of the present application. Thus, the present application also covers a recording medium storing a program for executing the method according to the present application.
本申请实施例的描述是为了示例和描述起见而给出的,而并不是无遗漏的或者将本申请限于所公开的形式。很多修改和变化对于本领域的普通技术人员而言是显然的。选择和描述实施例是为了更好说明本申请的原理和实际应用,并且使本领域的普通技术人员能够理解本申请从而设计适于特定用途的带有各种修改的各种实施例。The description of the embodiments of the present application has been presented for purposes of illustration and description Many modifications and variations will be apparent to those skilled in the art. The embodiments were chosen and described in order to best explain the principles and embodiments of the embodiments of the invention,

Claims (40)

  1. 一种图像处理方法,包括:An image processing method comprising:
    从待处理的图像中确定目标对象信息;Determining target object information from the image to be processed;
    根据所述目标对象信息和预定的对象轮廓模板确定所述图像中的前景区域和背景区域;Determining a foreground area and a background area in the image according to the target object information and a predetermined object outline template;
    对所述前景区域和/或所述背景区域进行虚化处理。The foreground area and/or the background area are blurred.
  2. 根据权利要求1所述的方法,其中,所述根据所述目标对象信息和预定的对象轮廓模板确定所述图像中的前景区域和背景区域包括:The method of claim 1, wherein the determining the foreground area and the background area in the image according to the target object information and the predetermined object outline template comprises:
    将所述对象轮廓模板中至少局部区域与所述目标对象信息进行匹配;Matching at least a partial area in the object contour template with the target object information;
    根据匹配结果确定所述对象轮廓模板中的对象轮廓与所述图像中的目标对象的轮廓之间的差异信息;Determining difference information between an object contour in the object contour template and a contour of the target object in the image according to the matching result;
    根据所述差异信息调整所述对象轮廓模板中的对象轮廓;Adjusting an object contour in the object contour template according to the difference information;
    将经过调整的对象轮廓映射到所述图像中,获得所述图像中包括目标对象的前景区域以及包括至少部分非所述前景区域的背景区域。Mapping the adjusted object contour into the image obtains a foreground region of the image including the target object and a background region including at least a portion of the foreground region.
  3. 根据权利要求2所述的方法,其中,所述差异信息包括:所述对象轮廓模板中的对象轮廓与所述图像中的目标对象的轮廓之间的缩放信息、偏移信息和/或角度信息。The method of claim 2, wherein the difference information comprises: scaling information, offset information, and/or angle information between an object contour in the object contour template and a contour of the target object in the image .
  4. 根据权利要求1~3中任一项所述的方法,其中,所述图像包括:静态图像或视频帧图像。The method according to any one of claims 1 to 3, wherein the image comprises: a still image or a video frame image.
  5. 根据权利要求4所述的方法,其中,所述图像为视频帧图像;The method of claim 4 wherein said image is a video frame image;
    所述从待处理的图像中确定目标对象信息,包括:Determining target object information from the image to be processed, including:
    根据从所述待处理的视频帧图像之前的视频帧图像确定的目标对象信息,从所述待处理的视频帧图像确定所述目标对象信息;或者,通过对待处理的视频流进行逐视频帧图像检测,确定所述视频流中各视频帧图像中的目标对象信息。Determining the target object information from the to-be-processed video frame image according to target object information determined from the video frame image preceding the video frame image to be processed; or performing a video-by-video frame image through the video stream to be processed Detecting, determining target object information in each video frame image in the video stream.
  6. 根据权利要求1~5中任一项所述的方法,其中,还包括:The method according to any one of claims 1 to 5, further comprising:
    确定所述前景区域和背景区域之间的过渡区域;Determining a transition region between the foreground region and the background region;
    对所述过渡区域进行虚化处理。The transition area is blurred.
  7. 根据权利要求6所述的方法,其中,所述对所述过渡区域进行虚化处理,包括:对所述过渡区域进行渐进虚化处理或光斑处理。The method according to claim 6, wherein said performing blurring processing on said transition region comprises: performing progressive blurring processing or spot processing on said transition region.
  8. 根据权利要求1~7中任一项所述的方法,其中,所述从待处理的图像中确定目标对象信息,包括:The method according to any one of claims 1 to 7, wherein the determining the target object information from the image to be processed comprises:
    获取对象选择信息;Obtain object selection information;
    根据所述对象选择信息从所述待处理的图像中确定所述目标对象信息。Determining the target object information from the image to be processed according to the object selection information.
  9. 根据权利要求1~8中任一项所述的方法,其中,所述从待处理的图像中确定目标对象信息,包括:The method according to any one of claims 1 to 8, wherein the determining the target object information from the image to be processed comprises:
    从所述待处理的图像中检测目标对象,获得所述目标对象信息。A target object is detected from the image to be processed, and the target object information is obtained.
  10. 根据权利要求9所述的方法,其中,从所述待处理的图像中检测目标对象,获得所述目标对象信息,包括:The method according to claim 9, wherein detecting the target object from the image to be processed and obtaining the target object information comprises:
    通过预先训练的深度神经网络从所述待处理的图像中检测目标对象,获得所述目标对象信息。The target object is obtained by detecting a target object from the image to be processed through a pre-trained deep neural network.
  11. 根据权利要求10所述的方法,其中,所述目标对象信息包括以下任意一项或多项:人脸信息、车牌信息、门牌信息、地址信息、身份ID信息、商标信息。The method according to claim 10, wherein the target object information comprises any one or more of the following: face information, license plate information, house number information, address information, identity ID information, trademark information.
  12. 根据权利要求11所述的方法,其中,所述人脸信息包括以下任意一项或多项:人脸关键点的信息、人脸位置信息、人脸大小信息、人脸角度信息。The method according to claim 11, wherein the face information comprises any one or more of the following: information of a face key point, face position information, face size information, face angle information.
  13. 根据权利要求11或12所述的方法,其中,所述对象轮廓模板包括以下任意一项或多项:人脸轮廓模板、人体轮廓模板、车牌轮廓模板、门牌轮廓模板、预定框轮廓模板。The method according to claim 11 or 12, wherein the object outline template comprises any one or more of the following: a face contour template, a human body contour template, a license plate contour template, a house card contour template, a predetermined frame contour template.
  14. 根据权利要求11~13中任一项所述的方法,其中,所述对象轮廓模板包括:分别对应不同人脸角度的多个人体轮廓模板;The method according to any one of claims 11 to 13, wherein the object contour template comprises: a plurality of human body contour templates respectively corresponding to different face angles;
    所述根据所述目标对象信息和预定的对象轮廓模板确定所述图像中的前景区域和背景区域之前,还包括:从所述对象轮廓模板中确定与所述人脸信息中的人脸角度信息对应的人体轮廓模板。Before determining the foreground area and the background area in the image according to the target object information and the predetermined object contour template, the method further includes: determining, from the object contour template, face angle information in the face information Corresponding human contour template.
  15. 根据权利要求14所述的方法,其中,所述深度神经网络用于检测人脸关键点信息并采用以下方法预先训练而得:The method according to claim 14, wherein said deep neural network is used for detecting face key point information and pre-training by the following method:
    获取第一样本集,所述第一样本集包括多个未标注样本图像;Obtaining a first sample set, the first sample set including a plurality of unlabeled sample images;
    基于深度神经网络,对所述第一样本集中的各所述未标注样本图像进行关键点位置标注,得到第二样本集;其中,所述深度神经网络用于对图像进行关键点定位;And performing, according to the depth neural network, performing key point position labeling on each of the unlabeled sample images in the first sample set to obtain a second sample set; wherein the deep neural network is used to perform key point positioning on the image;
    至少根据所述第二样本集中的部分样本图像及第三样本集,调整所述深度神经网络的参数,其中,所述第三样本集包括多个已标注样本图像。Adjusting parameters of the deep neural network according to at least a partial sample image and a third sample set in the second sample set, wherein the third sample set includes a plurality of labeled sample images.
  16. 根据权利要求15所述的方法,其中,所述基于深度神经网络,对所述第一样本集中的各所述未标注样本图像进行关键点位置标注,得到第二样本集,包括:The method according to claim 15, wherein the depth point neural network is used to perform key point position labeling on each of the unlabeled sample images in the first sample set to obtain a second sample set, including:
    对所述第一样本集中的各所述未标注样本图像进行图像变换处理,得到第四样本集;其中,所述图像变换处理包括以下任意一项或多项:旋转、平移、缩放、加噪及加遮挡物;Performing image transformation processing on each of the unlabeled sample images in the first sample set to obtain a fourth sample set; wherein the image transformation process includes any one or more of the following: rotation, translation, scaling, and addition Noise and occlusion;
    基于所述深度神经网络,对所述第四样本集以及所述第一样本集中的各所述未标注样本图像进行关键点位置标注,得到所述第二样本集。And performing, according to the depth neural network, key point location annotation on each of the fourth sample set and each of the unlabeled sample images in the first sample set to obtain the second sample set.
  17. 根据权利要求16所述的方法,其中,所述至少根据所述第二样本集中的部分样本图像及第三样本集,调整所述深度神经网络的参数,包括:The method according to claim 16, wherein the adjusting the parameters of the deep neural network according to at least a partial sample image and a third sample set in the second sample set comprises:
    对于所述第一样本集中的各未标注样本图像,基于所述未标注样本图像进行图像变换处理后的关键点位置信息,判断所述未标注样本图像的关键点位置信息是否为可选样本;其中,所述未标注样本图像的关键点位置信息,及其进行图像变换处理后的关键点位置信息均包括在所述第二样本集中;For each unlabeled sample image in the first sample set, based on the key point position information after the image transformation process is performed on the unlabeled sample image, determining whether the key point position information of the unlabeled sample image is an optional sample Wherein the key point position information of the unlabeled sample image and the key point position information after the image transformation processing are included in the second sample set;
    根据所述第二样本集中的各所述可选样本及所述第三样本集,调整所述深度神经网络的参数。And adjusting parameters of the deep neural network according to each of the selectable samples and the third sample set in the second sample set.
  18. 根据权利要求15~17中任一项所述的方法,其中,所述人脸关键点包括以下任意一项或多项:眼睛关键点、鼻子关键点、嘴巴关键点、眉毛关键点及脸部轮廓关键点。The method according to any one of claims 15 to 17, wherein the face key point comprises any one or more of the following: an eye key point, a nose key point, a mouth key point, an eyebrow key point, and a face Contour key points.
  19. 一种图像处理装置,包括:An image processing apparatus comprising:
    对象信息确定模块,用于从待处理的图像中确定目标对象信息;An object information determining module, configured to determine target object information from the image to be processed;
    前背景确定模块,用于根据所述对象信息确定模块确定的目标对象信息和预定的对象轮廓模板确定所述图像中的前景区域和背景区域;a front background determining module, configured to determine a foreground area and a background area in the image according to the target object information determined by the object information determining module and the predetermined object contour template;
    虚化处理模块,用于对所述前背景确定模块确定的前景区域和/或所述背景区域进行虚化处理。And a blurring processing module, configured to perform a blurring process on the foreground area and/or the background area determined by the front background determining module.
  20. 根据权利要求19所述的装置,其中,所述前背景确定模块包括:The apparatus of claim 19, wherein the front background determination module comprises:
    模板匹配单元,用于将所述对象轮廓模板中至少局部区域与所述目标对象信息进行匹配;a template matching unit, configured to match at least a local area in the object contour template with the target object information;
    差异确定单元,用于根据所述模板匹配单元的匹配结果确定所述对象轮廓模板中的对象轮廓与所述图像中的目标对象的轮廓之间的差异信息;a difference determining unit, configured to determine, according to a matching result of the template matching unit, difference information between an object contour in the object contour template and a contour of the target object in the image;
    轮廓调整单元,用于根据所述差异确定单元确定的差异信息调整所述对象轮廓模板中的对象轮廓;a contour adjustment unit, configured to adjust an object contour in the object contour template according to the difference information determined by the difference determining unit;
    前背景确定单元,用于将经过所述轮廓调整单元调整的对象轮廓映射到所述图像中,获得所述图像中包括目标对象的前景区域以及包括至少部分非所述前景区域的背景区域。And a front background determining unit, configured to map an object contour adjusted by the contour adjusting unit into the image, obtain a foreground region including the target object in the image, and a background region including at least a portion not the foreground region.
  21. 根据权利要求20所述的装置,其中,所述差异信息包括:所述对象轮廓模板中的对象轮廓与所述图像中的目标对象的轮廓之间的缩放信息、偏移信息和/或角度信息。The apparatus according to claim 20, wherein the difference information comprises: scaling information, offset information, and/or angle information between an object contour in the object contour template and a contour of the target object in the image .
  22. 根据权利要求19~21中任一项所述的装置,其中,所述图像包括:静态图像或视频帧图像。The apparatus according to any one of claims 19 to 21, wherein the image comprises: a still image or a video frame image.
  23. 根据权利要求22所述的装置,其中,所述图像为视频帧图像;The apparatus of claim 22, wherein the image is a video frame image;
    所述对象信息确定模块包括:The object information determining module includes:
    第一对象信息确定单元,用于根据从所述待处理的视频帧图像之前的视频帧图像确定的目标对象信息,从所述待处理的视频帧图像确定所述目标对象信息;或者,a first object information determining unit, configured to determine the target object information from the to-be-processed video frame image according to target object information determined from a video frame image before the video frame image to be processed; or
    第二对象信息确定单元,用于通过对待处理的视频流进行逐视频帧图像检测,确定所述视频流中各视频帧图像中的目标对象信息。The second object information determining unit is configured to perform target-by-video frame image detection by the video stream to be processed, and determine target object information in each video frame image in the video stream.
  24. 根据权利要求19~23中任一项所述的装置,其中,还包括:The apparatus according to any one of claims 19 to 23, further comprising:
    过渡区域确定模块,用于确定所述前景区域和背景区域之间的过渡区域;a transition area determining module, configured to determine a transition area between the foreground area and the background area;
    过渡虚化处理模块,用于对所述过渡区域确定模块确定的过渡区域进行虚化处理。The transition blur processing module is configured to perform a blurring process on the transition region determined by the transition region determining module.
  25. 根据权利要求24所述的装置,其中,所述过渡虚化处理模块用于对所述过渡区域进行渐进虚化处理或光斑处理。The apparatus according to claim 24, wherein said transition blur processing module is configured to perform progressive blurring processing or spot processing on said transition region.
  26. 根据权利要求19~25中任一项所述的装置,其中,所述对象信息确定模块包括:The apparatus according to any one of claims 19 to 25, wherein the object information determining module comprises:
    选择信息获取单元,用于获取对象选择信息;Selecting an information obtaining unit, configured to acquire object selection information;
    第三对象信息确定单元,用于根据所述选择信息获取单元获取的对象选择信息从所述待处理的图像中确定所述目标对象信息。The third object information determining unit is configured to determine the target object information from the image to be processed according to the object selection information acquired by the selection information acquiring unit.
  27. 根据权利要求19~26中任一项所述的装置,其中,所述对象信息确定模块包括:The apparatus according to any one of claims 19 to 26, wherein the object information determining module comprises:
    第四对象信息确定单元,用于从所述待处理的图像中检测目标对象,获得所述目标对象信息。And a fourth object information determining unit, configured to detect the target object from the image to be processed, and obtain the target object information.
  28. 根据权利要求27所述的装置,其中,所述第四对象信息确定单元用于通过预先训练的深度神经网络从所述待处理的图像中检测目标对象,获得所述目标对象信息。The apparatus according to claim 27, wherein said fourth object information determining unit is configured to detect the target object from said image to be processed through a pre-trained depth neural network to obtain said target object information.
  29. 根据权利要求28所述的装置,其中,所述目标对象信息包括以下任意一项或多项:人脸信息、车牌信息、门牌信息、地址信息、身份ID信息、商标信息。The apparatus according to claim 28, wherein said target object information comprises any one or more of the following: face information, license plate information, house number information, address information, identity ID information, trademark information.
  30. 根据权利要求29所述的装置,其中,所述人脸信息包括以下任意一项或多项:人脸关键点的信息、人脸位置信息、人脸大小信息、人脸角度信息。The device according to claim 29, wherein the face information comprises any one or more of the following: information of a face key point, face position information, face size information, face angle information.
  31. 根据权利要求29或30所述的装置,其中,所述对象轮廓模板包括以下任意一项或多项:人脸轮廓模板、人体轮廓模板、车牌轮廓模板、门牌轮廓模板、预定框轮廓模板。The apparatus according to claim 29 or 30, wherein the object contour template comprises any one or more of the following: a face contour template, a human body contour template, a license plate contour template, a house card contour template, a predetermined frame contour template.
  32. 根据权利要求29~31中任一项所述的装置,其中,所述对象轮廓模板包括:分别对应不同人脸角度的多个人体轮廓模板;The apparatus according to any one of claims 29 to 31, wherein the object contour template comprises: a plurality of human body contour templates respectively corresponding to different face angles;
    所述前背景确定模块还用于在根据所述目标对象信息和预定的对象轮廓模板确定所述图像中的前景区域和背景区域之前,从所述对象轮廓模板当中确定与所述人脸信息中的人脸角度信息对应的人体轮廓模板。The front background determining module is further configured to determine from the object contour template and the face information before determining the foreground area and the background area in the image according to the target object information and the predetermined object contour template. The human face contour information corresponding to the face angle information.
  33. 根据权利要求32所述的装置,其中,还包括:The device according to claim 32, further comprising:
    样本集获取模块,用于获取第一样本集,所述第一样本集包括多个未标注样本图像;a sample set obtaining module, configured to acquire a first sample set, where the first sample set includes a plurality of unlabeled sample images;
    关键点位置标注模块,用于基于深度神经网络,对所述第一样本集中的各所述未标注样本图像进行关键点位置标注,得到第二样本集,其中,所述深度神经网络用于对图像进行关键点定位;a key point location labeling module, configured to perform key point position labeling on each of the unlabeled sample images in the first sample set based on a depth neural network, to obtain a second sample set, wherein the deep neural network is used for Key point positioning of the image;
    网络参数调整模块,用于至少根据所述第二样本集中的部分样本图像及第三样本集,调整所述深度神经网络的参数,其中,所述第三样本集包括多个已标注样本图像。And a network parameter adjustment module, configured to adjust parameters of the deep neural network according to at least a partial sample image and a third sample set in the second sample set, wherein the third sample set includes a plurality of labeled sample images.
  34. 根据权利要求33所述的装置,其中,所述关键点位置标注模块包括:The apparatus of claim 33, wherein the keypoint location labeling module comprises:
    图像变换处理单元,用于对所述第一样本集中的各所述未标注样本图像进行图像变换处理,得到第四样本集;其中,所述图像变换处理包括以下任意一项或多项:旋转、平移、缩放、加噪及加遮挡物;The image transformation processing unit is configured to perform image transformation processing on each of the unlabeled sample images in the first sample set to obtain a fourth sample set; wherein the image transformation processing includes any one or more of the following: Rotate, pan, zoom, add noise, and add occlusion;
    关键点位置标注单元,用于基于所述深度神经网络,对所述第四样本集以及所述第一样本集中的各所述未标注样本图像进行关键点位置标注,得到所述第二样本集。a key point location labeling unit, configured to perform key point position labeling on each of the fourth sample set and each of the unlabeled sample images in the first sample set based on the depth neural network, to obtain the second sample set.
  35. 根据权利要求34所述的装置,其中,所述网络参数调整模块包括:The device of claim 34, wherein the network parameter adjustment module comprises:
    可选样本判断单元,用于对于所述第一样本集中的各未标注样本图像,基于所述未标注样本图像进行图像变换处理后的关键点位置信息,判断所述未标注样本图像的关键点位置信息是否为可选样本;其中,所述未标注样本图像的关键点位置信息,及其进行图像变换处理后的关键点位置信息均包括在所述第二样本集中;The optional sample determining unit is configured to determine, according to the unmarked sample image, the key point position information after the image transform processing on the unlabeled sample image in the first sample set, and determine the key of the unlabeled sample image Whether the point position information is an optional sample; wherein the key point position information of the unlabeled sample image and the key point position information after the image transformation processing are included in the second sample set;
    网络参数调整单元,用于根据所述第二样本集中的各所述可选样本及所述第三样本集,调整所述深度神经网络的参数。And a network parameter adjustment unit, configured to adjust parameters of the deep neural network according to each of the selectable samples and the third sample set in the second sample set.
  36. 根据权利要求32~35中任一项所述的装置,其中,所述人脸关键点包括以下任意一项或多项:眼睛关键点、鼻子关键点、嘴巴关键点、眉毛关键点及脸部轮廓关键点。The device according to any one of claims 32 to 35, wherein the face key point comprises any one or more of the following: an eye key point, a nose key point, a mouth key point, an eyebrow key point, and a face Contour key points.
  37. 一种电子设备,其特征在于,包括:An electronic device, comprising:
    处理器和权利要求19~36中任一项所述的图像处理装置;A processor and the image processing device according to any one of claims 19 to 36;
    在处理器运行所述图像处理装置时,权利要求19~36中任一项所述的图像处理装置中的单元被运行。The unit in the image processing apparatus according to any one of claims 19 to 36 is operated when the processor operates the image processing apparatus.
  38. 一种电子设备,包括:处理器和存储器;An electronic device comprising: a processor and a memory;
    所述存储器用于存放至少一可执行指令,所述可执行指令使所述处理器执行权利要求1~18中任一项所述的图像处理方法对应的操作。The memory is configured to store at least one executable instruction that causes the processor to perform an operation corresponding to the image processing method of any one of claims 1-18.
  39. 一种计算机程序,包括计算机可读代码,其特征在于,当所述计算机可读代码在设备上运行时,所述设备中的处理器执行用于实现权利要求1~18中任一项所述的图像处理方法中各步骤的指令。A computer program comprising computer readable code, wherein when the computer readable code is run on a device, a processor in the device performs the implementation of any one of claims 1-18 The instructions of each step in the image processing method.
  40. 一种计算机可读存储介质,用于存储计算机可读取的指令,其特征在于,所述指令被执行时实现权利要求1~18中任一项所述的图像处理方法中各步骤的操作。A computer readable storage medium for storing computer readable instructions, wherein the instructions are executed to perform the operations of the steps of the image processing method according to any one of claims 1 to 18.
PCT/CN2018/073882 2017-01-24 2018-01-23 Image processing method and apparatus, and electronic device WO2018137623A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710060426.XA CN108230252B (en) 2017-01-24 2017-01-24 Image processing method and device and electronic equipment
CN201710060426.X 2017-01-24

Publications (1)

Publication Number Publication Date
WO2018137623A1 true WO2018137623A1 (en) 2018-08-02

Family

ID=62657248

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/073882 WO2018137623A1 (en) 2017-01-24 2018-01-23 Image processing method and apparatus, and electronic device

Country Status (2)

Country Link
CN (1) CN108230252B (en)
WO (1) WO2018137623A1 (en)

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109242763A (en) * 2018-08-27 2019-01-18 Oppo广东移动通信有限公司 Image processing method, picture processing unit, terminal device
CN110147708A (en) * 2018-10-30 2019-08-20 腾讯科技(深圳)有限公司 A kind of image processing method and relevant apparatus
CN110827371A (en) * 2019-11-05 2020-02-21 厦门美图之家科技有限公司 Certificate photo generation method and device, electronic equipment and storage medium
CN110889314A (en) * 2018-09-10 2020-03-17 北京市商汤科技开发有限公司 Image processing method, device, electronic equipment, server and system
CN110910304A (en) * 2019-11-08 2020-03-24 北京达佳互联信息技术有限公司 Image processing method, image processing apparatus, electronic device, and medium
CN111274852A (en) * 2018-12-05 2020-06-12 北京猎户星空科技有限公司 Target object key point detection method and device
CN111325217A (en) * 2018-12-14 2020-06-23 北京海益同展信息科技有限公司 Data processing method, device, system and medium
CN111507896A (en) * 2020-04-27 2020-08-07 北京字节跳动网络技术有限公司 Image liquefaction processing method, device, equipment and storage medium
CN111652796A (en) * 2020-05-13 2020-09-11 上海连尚网络科技有限公司 Image processing method, electronic device, and computer-readable storage medium
CN111860304A (en) * 2020-07-17 2020-10-30 北京百度网讯科技有限公司 Image labeling method, electronic device, equipment and storage medium
CN112016508A (en) * 2020-09-07 2020-12-01 杭州海康威视数字技术股份有限公司 Face recognition method, device, system, computing equipment and storage medium
CN112132913A (en) * 2019-06-25 2020-12-25 北京字节跳动网络技术有限公司 Image processing method, image processing apparatus, image processing medium, and electronic device
CN112348035A (en) * 2020-11-11 2021-02-09 东软睿驰汽车技术(沈阳)有限公司 Vehicle key point detection method and device and electronic equipment
CN112364898A (en) * 2020-10-27 2021-02-12 星火科技技术(深圳)有限责任公司 Image identification automatic labeling method, device, equipment and storage medium
CN112800878A (en) * 2021-01-14 2021-05-14 北京迈格威科技有限公司 Target detection method and device, electronic equipment and readable storage medium
CN113012054A (en) * 2019-12-20 2021-06-22 舜宇光学(浙江)研究院有限公司 Sample enhancement method and training method based on sectional drawing, system and electronic equipment thereof
CN113129207A (en) * 2019-12-30 2021-07-16 武汉Tcl集团工业研究院有限公司 Method and device for blurring background of picture, computer equipment and storage medium
CN113379623A (en) * 2021-05-31 2021-09-10 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN114143561A (en) * 2021-11-12 2022-03-04 北京中联合超高清协同技术中心有限公司 Ultrahigh-definition video multi-view roaming playing method
CN111539443B (en) * 2020-01-22 2024-02-09 北京小米松果电子有限公司 Image recognition model training method and device and storage medium

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109147024A (en) * 2018-08-16 2019-01-04 Oppo广东移动通信有限公司 Expression replacing options and device based on threedimensional model
CN109816663B (en) * 2018-10-15 2021-04-20 华为技术有限公司 Image processing method, device and equipment
CN113298845A (en) * 2018-10-15 2021-08-24 华为技术有限公司 Image processing method, device and equipment
CN110033463B (en) 2019-04-12 2021-06-04 腾讯科技(深圳)有限公司 Foreground data generation and application method thereof, and related device and system
CN110310327B (en) * 2019-06-28 2022-10-25 联想(北京)有限公司 Image processing method and apparatus, computer system, and readable storage medium
WO2021026848A1 (en) * 2019-08-14 2021-02-18 深圳市大疆创新科技有限公司 Image processing method and device, and photographing apparatus, movable platform and storage medium
CN110728632B (en) * 2019-09-04 2022-07-12 北京奇艺世纪科技有限公司 Image blurring processing method, image blurring processing device, computer device and storage medium
CN112785487B (en) * 2019-11-06 2023-08-04 RealMe重庆移动通信有限公司 Image processing method and device, storage medium and electronic equipment
CN110991298B (en) * 2019-11-26 2023-07-14 腾讯科技(深圳)有限公司 Image processing method and device, storage medium and electronic device
CN113129241B (en) * 2019-12-31 2023-02-07 RealMe重庆移动通信有限公司 Image processing method and device, computer readable medium and electronic equipment
CN111639653B (en) * 2020-05-08 2023-10-10 浙江大华技术股份有限公司 False detection image determining method, device, equipment and medium
CN113191348B (en) * 2021-05-31 2023-02-03 山东新一代信息产业技术研究院有限公司 Template-based text structured extraction method and tool
CN113784207A (en) * 2021-07-30 2021-12-10 北京达佳互联信息技术有限公司 Video picture display method and device, electronic equipment and storage medium
CN114063858B (en) * 2021-11-26 2023-03-17 北京百度网讯科技有限公司 Image processing method, image processing device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5870103A (en) * 1996-09-25 1999-02-09 Eastman Kodak Company Method for creating realistic-looking composite images
CN104751407A (en) * 2015-03-11 2015-07-01 百度在线网络技术(北京)有限公司 Method and device used for blurring image
CN105979165A (en) * 2016-06-02 2016-09-28 广东欧珀移动通信有限公司 Blurred photos generation method, blurred photos generation device and mobile terminal

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012162981A1 (en) * 2011-09-16 2012-12-06 华为技术有限公司 Video character separation method and device
CN104408743A (en) * 2014-11-05 2015-03-11 百度在线网络技术(北京)有限公司 Image segmentation method and device
CN104751406B (en) * 2015-03-11 2018-05-01 百度在线网络技术(北京)有限公司 A kind of method and apparatus for being blurred to image
CN105447458B (en) * 2015-11-17 2018-02-27 深圳市商汤科技有限公司 A kind of large-scale crowd video analytic system and method
CN105701513B (en) * 2016-01-14 2019-06-07 深圳市未来媒体技术研究院 The method of rapidly extracting palmmprint area-of-interest
CN105678714B (en) * 2016-02-05 2020-12-29 网易传媒科技(北京)有限公司 Image processing method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5870103A (en) * 1996-09-25 1999-02-09 Eastman Kodak Company Method for creating realistic-looking composite images
CN104751407A (en) * 2015-03-11 2015-07-01 百度在线网络技术(北京)有限公司 Method and device used for blurring image
CN105979165A (en) * 2016-06-02 2016-09-28 广东欧珀移动通信有限公司 Blurred photos generation method, blurred photos generation device and mobile terminal

Cited By (34)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109242763B (en) * 2018-08-27 2023-09-01 Oppo广东移动通信有限公司 Picture processing method, picture processing device and terminal equipment
CN109242763A (en) * 2018-08-27 2019-01-18 Oppo广东移动通信有限公司 Image processing method, picture processing unit, terminal device
CN110889314A (en) * 2018-09-10 2020-03-17 北京市商汤科技开发有限公司 Image processing method, device, electronic equipment, server and system
CN110147708A (en) * 2018-10-30 2019-08-20 腾讯科技(深圳)有限公司 A kind of image processing method and relevant apparatus
CN110147708B (en) * 2018-10-30 2023-03-31 腾讯科技(深圳)有限公司 Image data processing method and related device
CN111274852A (en) * 2018-12-05 2020-06-12 北京猎户星空科技有限公司 Target object key point detection method and device
CN111274852B (en) * 2018-12-05 2023-10-31 北京猎户星空科技有限公司 Target object key point detection method and device
CN111325217A (en) * 2018-12-14 2020-06-23 北京海益同展信息科技有限公司 Data processing method, device, system and medium
CN111325217B (en) * 2018-12-14 2024-02-06 京东科技信息技术有限公司 Data processing method, device, system and medium
CN112132913A (en) * 2019-06-25 2020-12-25 北京字节跳动网络技术有限公司 Image processing method, image processing apparatus, image processing medium, and electronic device
CN110827371A (en) * 2019-11-05 2020-02-21 厦门美图之家科技有限公司 Certificate photo generation method and device, electronic equipment and storage medium
CN110827371B (en) * 2019-11-05 2023-04-28 厦门美图之家科技有限公司 Certificate generation method and device, electronic equipment and storage medium
CN110910304A (en) * 2019-11-08 2020-03-24 北京达佳互联信息技术有限公司 Image processing method, image processing apparatus, electronic device, and medium
CN110910304B (en) * 2019-11-08 2023-12-22 北京达佳互联信息技术有限公司 Image processing method, device, electronic equipment and medium
CN113012054B (en) * 2019-12-20 2023-12-05 舜宇光学(浙江)研究院有限公司 Sample enhancement method and training method based on matting, system and electronic equipment thereof
CN113012054A (en) * 2019-12-20 2021-06-22 舜宇光学(浙江)研究院有限公司 Sample enhancement method and training method based on sectional drawing, system and electronic equipment thereof
CN113129207A (en) * 2019-12-30 2021-07-16 武汉Tcl集团工业研究院有限公司 Method and device for blurring background of picture, computer equipment and storage medium
CN111539443B (en) * 2020-01-22 2024-02-09 北京小米松果电子有限公司 Image recognition model training method and device and storage medium
CN111507896A (en) * 2020-04-27 2020-08-07 北京字节跳动网络技术有限公司 Image liquefaction processing method, device, equipment and storage medium
CN111507896B (en) * 2020-04-27 2023-09-05 抖音视界有限公司 Image liquefaction processing method, device, equipment and storage medium
CN111652796A (en) * 2020-05-13 2020-09-11 上海连尚网络科技有限公司 Image processing method, electronic device, and computer-readable storage medium
CN111860304A (en) * 2020-07-17 2020-10-30 北京百度网讯科技有限公司 Image labeling method, electronic device, equipment and storage medium
CN111860304B (en) * 2020-07-17 2024-04-30 北京百度网讯科技有限公司 Image labeling method, electronic device, equipment and storage medium
CN112016508B (en) * 2020-09-07 2023-08-29 杭州海康威视数字技术股份有限公司 Face recognition method, device, system, computing device and storage medium
CN112016508A (en) * 2020-09-07 2020-12-01 杭州海康威视数字技术股份有限公司 Face recognition method, device, system, computing equipment and storage medium
CN112364898B (en) * 2020-10-27 2024-01-19 星火科技技术(深圳)有限责任公司 Automatic labeling method, device, equipment and storage medium for image recognition
CN112364898A (en) * 2020-10-27 2021-02-12 星火科技技术(深圳)有限责任公司 Image identification automatic labeling method, device, equipment and storage medium
CN112348035A (en) * 2020-11-11 2021-02-09 东软睿驰汽车技术(沈阳)有限公司 Vehicle key point detection method and device and electronic equipment
CN112348035B (en) * 2020-11-11 2024-05-24 东软睿驰汽车技术(沈阳)有限公司 Vehicle key point detection method and device and electronic equipment
CN112800878A (en) * 2021-01-14 2021-05-14 北京迈格威科技有限公司 Target detection method and device, electronic equipment and readable storage medium
CN113379623B (en) * 2021-05-31 2023-12-19 北京达佳互联信息技术有限公司 Image processing method, device, electronic equipment and storage medium
CN113379623A (en) * 2021-05-31 2021-09-10 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN114143561B (en) * 2021-11-12 2023-11-07 北京中联合超高清协同技术中心有限公司 Multi-view roaming playing method for ultra-high definition video
CN114143561A (en) * 2021-11-12 2022-03-04 北京中联合超高清协同技术中心有限公司 Ultrahigh-definition video multi-view roaming playing method

Also Published As

Publication number Publication date
CN108230252B (en) 2022-02-01
CN108230252A (en) 2018-06-29

Similar Documents

Publication Publication Date Title
WO2018137623A1 (en) Image processing method and apparatus, and electronic device
US11107232B2 (en) Method and apparatus for determining object posture in image, device, and storage medium
US11775056B2 (en) System and method using machine learning for iris tracking, measurement, and simulation
US10699103B2 (en) Living body detecting method and apparatus, device and storage medium
US10872420B2 (en) Electronic device and method for automatic human segmentation in image
WO2018219180A1 (en) Method and apparatus for determining facial image quality, as well as electronic device and computer storage medium
WO2018121777A1 (en) Face detection method and apparatus, and electronic device
US9262671B2 (en) Systems, methods, and software for detecting an object in an image
US8391645B2 (en) Detecting orientation of digital images using face detection information
WO2018176938A1 (en) Method and device for extracting center of infrared light spot, and electronic device
US8081844B2 (en) Detecting orientation of digital images using face detection information
JP6368709B2 (en) Method for generating 3D body data
CN111008935B (en) Face image enhancement method, device, system and storage medium
WO2019061658A1 (en) Method and device for positioning eyeglass, and storage medium
US20180357819A1 (en) Method for generating a set of annotated images
MX2013002904A (en) Person image processing apparatus and person image processing method.
CN109087261B (en) Face correction method based on unlimited acquisition scene
TW202011267A (en) Method and device for damage segmentation of vehicle damage image
WO2019061659A1 (en) Method and device for removing eyeglasses from facial image, and storage medium
JP2013037539A (en) Image feature amount extraction device and program thereof
CN113436251B (en) Pose estimation system and method based on improved YOLO6D algorithm
US9349038B2 (en) Method and apparatus for estimating position of head, computer readable storage medium thereof
Smiatacz Normalization of face illumination using basic knowledge and information extracted from a single image
US20060010582A1 (en) Chin detecting method, chin detecting system and chin detecting program for a chin of a human face
Danisman et al. In-plane face orientation estimation in still images

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: 18743952

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 21/11/2019)

122 Ep: pct application non-entry in european phase

Ref document number: 18743952

Country of ref document: EP

Kind code of ref document: A1