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

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

Info

Publication number
KR102386642B1
KR102386642B1 KR1020207019432A KR20207019432A KR102386642B1 KR 102386642 B1 KR102386642 B1 KR 102386642B1 KR 1020207019432 A KR1020207019432 A KR 1020207019432A KR 20207019432 A KR20207019432 A KR 20207019432A KR 102386642 B1 KR102386642 B1 KR 102386642B1
Authority
KR
South Korea
Prior art keywords
key point
apple
zone
face image
determining
Prior art date
Application number
KR1020207019432A
Other languages
Korean (ko)
Other versions
KR20200107957A (en
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 KR20200107957A publication Critical patent/KR20200107957A/en
Application granted granted Critical
Publication of KR102386642B1 publication Critical patent/KR102386642B1/en

Links

Images

Classifications

    • G06T5/77
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration by the use of more than one image, e.g. averaging, subtraction
    • G06T5/94
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • 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/168Feature extraction; Face representation
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Abstract

본 발명의 실시예는 이미지 처리 방법 및 장치, 이미지 기기 및 저장 매체를 개시한다. 상기 이미지 처리 방법은, 제1 얼굴 이미지의 키 포인트를 검출하는 단계; 상기 키 포인트에 기반하여, 애플존에 의해 조정된 목표 영역을 결정하는 단계; 상기 키 포인트에 기반하여, 애플존의 조정 파라미터를 결정하는 단계; 및 상기 조정 파라미터에 기반하여, 상기 목표 영역을 조정하여 제2 얼굴 이미지를 형성하는 단계를 포함한다.Embodiments of the present invention disclose an image processing method and apparatus, an image device, and a storage medium. The image processing method may include: detecting a key point of a first face image; determining a target area adjusted by the Apple Zone based on the key point; determining an adjustment parameter of the Apple Zone based on the key point; and adjusting the target area based on the adjustment parameter to form a second face image.

Description

이미지 처리 방법 및 장치, 전자 기기 및 저장 매체Image processing method and apparatus, electronic device and storage medium

관련 출원의 상호 참조Cross-referencing of related applications

본 출원은 2019년 3월 6일에 중국 특허청에 제출한 출원 번호가 201910169460.X이고, 발명의 명칭이 “이미지 처리 방법 및 장치, 이미지 기기 및 저장 매체”이며, 그 전부 내용은 인용을 통해 본 출원에 결합된다.This application is filed with the Chinese Intellectual Property Office on March 6, 2019, the application number is 201910169460.X, and the title of the invention is “Image processing method and apparatus, image device and storage medium”, the entire contents of which are hereby incorporated by reference bound to the application.

본 출원은 컴퓨터 기술 분야에 관한 것으로, 특히 이미지 처리 방법 및 이미지 처리 장치, 이미지 기기 및 저장 매체에 관한 것이다.The present application relates to the field of computer technology, and more particularly, to an image processing method, an image processing apparatus, an image device, and a storage medium.

휴대폰, 태블릿 컴퓨터 또는 웨어러블 기기 등에는 일반적으로 이미지를 수집할 수 있는 카메라가 장착된다. 그러나 수집된 이미지는 사용자가 원하는 이상적인 이미지일 필요는 없으며, 예를 들어 이미지를 아름답고, 코믹스럽거나, 귀엽게 하는 것과 같이 사용자의 기대를 충족시키도록 조정될 필요가 있을 수 있으며 인물 처리를 예를 들어, 관련 기술에서 이미지의 처리에 대해, 일반적으로 눈, 코 및 얼굴형의 처리로 제한되지만, 다른 부분에 대한 미화 등 처리는 상대적으로 적다. 따라서 관련 기술의 이미지 처리 기술은 최적화되지 않고 완벽하지 않으며, 이미지의 처리 효과는 이상적인 예상 효과에 도달하지 못했다.Cell phones, tablet computers, or wearables, etc. are usually equipped with cameras that can collect images. However, the collected image need not be the ideal image desired by the user, and may need to be adjusted to meet the user's expectations, for example to make the image beautiful, comical, or cute, and may need to be adapted to the processing of a person, for example. Regarding image processing in technology, it is generally limited to processing of eyes, nose and face shapes, but processing such as beautification of other parts is relatively small. Therefore, the image processing technology of the related art is not optimized and not perfect, and the processing effect of the image has not reached the ideal expected effect.

이를 고려하여, 본 발명의 실시예는 이미지 처리 방법 및 장치, 이미지 기기 및 저장 매체를 제공한다.In consideration of this, embodiments of the present invention provide an image processing method and apparatus, an image device, and a storage medium.

제1 측면에 있어서, 이미지 처리 방법을 제공하며, 상기 이미지 처리 방법은, In a first aspect, there is provided an image processing method, the image processing method comprising:

제1 얼굴 이미지의 키 포인트를 검출하는 단계; detecting a key point of the first face image;

상기 키 포인트에 기반하여, 애플존에 의해 조정된 목표 영역을 결정하는 단계; determining a target area adjusted by the Apple Zone based on the key point;

상기 키 포인트에 기반하여, 애플존의 조정 파라미터를 결정하는 단계; 및determining an adjustment parameter of the Apple Zone based on the key point; and

상기 조정 파라미터에 기반하여, 상기 목표 영역을 조정하여 제2 얼굴 이미지를 형성하는 단계를 포함한다.and adjusting the target area based on the adjustment parameter to form a second face image.

본 발명의 임의의 실시형태와 결합하면, 상기 키 포인트에 기반하여, 애플존에 의해 조정된 목표 영역을 결정하기 전에, 상기 이미지 처리 방법은, In combination with any embodiment of the present invention, before determining, based on the key point, the target area adjusted by the applezone, the image processing method comprises:

상기 제1 얼굴 이미지에서 얼굴의 방향을 결정하는 단계를 더 포함하며; determining the orientation of the face in the first face image;

상기 키 포인트에 기반하여, 애플존에 의해 조정된 목표 영역을 결정하는 단계는, Determining the target area adjusted by the Apple Zone based on the key point comprises:

상기 키 포인트 및 상기 방향에 기반하여, 애플존에 의해 조정된 상기 목표 영역을 결정하는 단계를 포함한다.and determining, based on the key point and the direction, the target area adjusted by the applezone.

본 발명의 임의의 실시형태와 결합하면, 상기 키 포인트는, 눈꼬리 키 포인트, 제1 얼굴 윤곽 키 포인트 및 콧방울 키 포인트를 포함하며; Combined with any of the embodiments of the present invention, the key points include an eye corner key point, a first facial contour key point and a nostril key point;

상기 키 포인트 및 상기 방향에 기반하여, 애플존에 의해 조정된 상기 목표 영역을 결정하는 단계는, Determining the target area adjusted by the Apple Zone based on the key point and the direction comprises:

상기 방향이 제1 얼굴 이미지가 정면 얼굴 이미지임을 나타내는 것으로 결정될 경우, 상기 제1 얼굴 윤곽 키 포인트 및 상기 콧방울 키 포인트에 기반하여, 상기 목표 영역의 제1 중간점을 결정하는 단계; 및when it is determined that the direction indicates that the first facial image is a frontal facial image, determining a first midpoint of the target area based on the first facial contour key point and the nostril key point; and

상기 제1 중간점 및 상기 눈꼬리 키 포인트에 기반하여, 상기 목표 영역을 결정하는 단계를 포함한다.and determining the target area based on the first midpoint and the key point of the corner of the eye.

본 발명의 임의의 실시형태와 결합하면, 상기 키 포인트는 눈꼬리 키 포인트, 제2 얼굴 윤곽 키 포인트 및 콧방울 키 포인트를 포함하며; In combination with any of the embodiments of the present invention, the key points include an eye corner key point, a second facial contour key point and a nostril key point;

상기 키 포인트 및 상기 방향에 기반하여, 애플존에 의해 조정된 상기 목표 영역을 결정하는 단계는, Determining the target area adjusted by the Apple Zone based on the key point and the direction comprises:

상기 방향이 상기 제1 얼굴 이미지가 측면 얼굴 이미지임을 나타내는 것으로 결정될 경우, 상기 제2 얼굴 윤곽 키 포인트 및 상기 콧방울 키 포인트에 기반하여, 상기 목표 영역의 제2 중간점을 결정하는 단계; 및when it is determined that the direction indicates that the first face image is a side face image, determining a second midpoint of the target area based on the second facial contour key point and the nostril key point; and

상기 제2 중간점과 상기 눈꼬리 키 포인트에 기반하여, 상기 목표 영역을 결정하는 단계를 포함한다.and determining the target area based on the second midpoint and the key point of the corner of the eye.

본 발명의 임의의 실시형태와 결합하면, 상기 키 포인트에 기반하여, 애플존의 조정 파라미터를 결정하는 단계는, In combination with any embodiment of the present invention, the step of determining, based on the key point, an adjustment parameter of the apple zone,

상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 방향을 결정하는 단계를 포함한다.and determining an adjustment direction of the apple zone based on the key point and the direction.

본 발명의 임의의 실시형태와 결합하면, 상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 방향을 결정하는 단계는, When combined with any embodiment of the present invention, the step of determining the adjustment direction of the apple zone based on the key point and the direction comprises:

상기 방향이 제1 얼굴 이미지가 정면 얼굴 이미지임을 나타낼 경우, 상기 키 포인트에 기반하여 애플존의 조정 방향이 제1 방향이라고 결정하는 단계를 포함한다.and when the direction indicates that the first face image is a front face image, determining that the adjustment direction of the Apple Zone is the first direction based on the key point.

본 발명의 임의의 실시형태와 결합하면, 상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 방향을 결정하는 단계는, When combined with any embodiment of the present invention, the step of determining the adjustment direction of the apple zone based on the key point and the direction comprises:

상기 방향이 제1 얼굴 이미지가 측면 얼굴 이미지임을 나타낼 경우, 상기 키 포인트에 기반하여 애플존의 조정 방향이 제2 방향 및 제3 방향이라고 결정하는 단계 - 상기 제3 방향은 상기 제2 방향과 상이함 - 를 포함한다.when the direction indicates that the first face image is a side face image, determining that the adjustment directions of the apple zone are a second direction and a third direction based on the key point, wherein the third direction is different from the second direction includes -.

본 발명의 임의의 실시형태와 결합하면, 상기 제1 방향은, 상기 목표 영역의 제1 중간점이 눈꼬리 키 포인트를 가리키는 방향이다.Combined with any embodiment of the present invention, the first direction is a direction in which the first midpoint of the target area points to the corner key point.

본 발명의 임의의 실시형태와 결합하면, 상기 제2 방향은, 상기 목표 영역의 제2 중간점이 눈꼬리 키 포인트를 가리키는 방향이며; Combined with any of the embodiments of the present invention, the second direction is a direction in which a second midpoint of the target area points to a corner key point;

상기 제3 방향은, 콧방울 키 포인트가 목표 영역을 결정하는 제2 얼굴 윤곽 키 포인트를 가리키는 방향이다.The third direction is a direction in which the nose bridge key point points to the second facial contour key point determining the target area.

본 발명의 임의의 실시형태와 결합하면, 상기 키 포인트에 기반하여, 애플존의 조정 파라미터를 결정하는 단계는, In combination with any embodiment of the present invention, the step of determining, based on the key point, an adjustment parameter of the apple zone,

상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 폭을 결정하는 단계를 포함한다.and determining an adjustment width of the apple zone based on the key point and the direction.

본 발명의 임의의 실시형태와 결합하면, 상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 폭을 결정하는 단계는, In combination with any embodiment of the present invention, the step of determining the adjustment width of the apple zone based on the key point and the direction comprises:

눈꼬리 키 포인트 및 눈머리 키 포인트에 기반하여, 상기 애플존의 최대 이동 거리를 결정하는 단계; 및determining the maximum moving distance of the apple zone based on the key point of the corner of the eye and the key point of the corner of the eye; and

상기 방향이 상기 제1 얼굴 이미지가 측면 얼굴 이미지임을 나타낼 경우, 얼굴 편향각 및 상기 최대 이동 거리에 따라, 상기 제1 얼굴 이미지의 애플존의 실제 이동 거리를 결정하는 단계를 포함한다.and when the direction indicates that the first face image is a side face image, determining an actual moving distance of the apple zone of the first face image according to a face deflection angle and the maximum moving distance.

본 발명의 임의의 실시형태와 결합하면, 상기 이미지 처리 방법은, Combined with any embodiment of the present invention, the image processing method comprises:

상기 제2 얼굴 이미지에서의 애플존에 대해 브라이트닝 처리를 수행하여, 제3 얼굴 이미지를 획득하는 단계를 더 포함한다.The method further includes performing a brightening process on the apple zone in the second face image to obtain a third face image.

본 발명의 임의의 실시형태와 결합하면, 상기 제2 얼굴 이미지에서의 애플존에 대해 브라이트닝 처리를 수행하여, 제3 얼굴 이미지를 획득하는 단계는, In combination with any embodiment of the present invention, the step of performing a brightening process on the apple zone in the second face image to obtain a third face image includes:

상기 제2 얼굴 이미지로부터 얼굴의 피부색 파라미터를 획득하는 단계; obtaining a skin color parameter of the face from the second face image;

상기 얼굴 피부색 파라미터에 기반하여, 애플존 브라이트닝 처리를 위한 브라이트닝 파라미터를 결정하는 단계; 및determining a brightening parameter for apple zone brightening treatment based on the facial skin color parameter; and

상기 브라이트닝 파라미터에 기반하여 상기 제2 얼굴 이미지에서의 애플존에 대해 브라이트닝 처리를 수행하여, 상기 제3 얼굴 이미지를 획득하는 단계를 포함한다.and performing a brightening process on the apple zone in the second face image based on the brightening parameter to obtain the third face image.

본 발명의 임의의 실시형태와 결합하면, 상기 제2 얼굴 이미지에서의 애플존에 대해 브라이트닝 처리를 수행하여, 제3 얼굴 이미지를 획득하는 단계는, In combination with any embodiment of the present invention, the step of performing a brightening process on the apple zone in the second face image to obtain a third face image includes:

상기 제2 얼굴 이미지에서의 애플존의 위치에 따라, 마스크 이미지를 생성하는 단계; 및generating a mask image according to the position of the apple zone in the second face image; and

상기 마스크 이미지에 기반하여, 상기 제2 얼굴 이미지에 대해 상기 애플존의 브라이트닝 처리를 수행하여 상기 제3 얼굴 이미지를 획득하는 단계를 포함한다.and obtaining the third face image by performing the Apple Zone brightening process on the second face image based on the mask image.

본 발명의 임의의 실시형태와 결합하면, 상기 제2 얼굴 이미지에서의 애플존의 위치에 따라, 마스크 이미지를 생성하는 단계는, In combination with any embodiment of the present invention, according to the position of the apple zone in the second face image, generating a mask image includes:

기설정된 애플존 브라이트닝의 밝은 점, 및 상기 제2 얼굴 이미지에서의 애플존의 위치에 따라, 상기 밝은 점을 포함한 상기 마스크 이미지를 생성하는 단계를 포함한다.and generating the mask image including the bright point according to the preset bright point of the apple zone brightening and the position of the apple zone in the second face image.

본 발명의 임의의 실시형태와 결합하면, 상기 마스크 이미지에 기반하여, 상기 제2 얼굴 이미지에 대해 상기 애플존의 브라이트닝 처리를 수행하여 상기 제3 얼굴 이미지를 획득하는 단계는, In combination with any embodiment of the present invention, based on the mask image, performing the apple zone brightening process on the second face image to obtain the third face image,

상기 마스크 이미지의 픽셀 값이 소정의 임계값보다 큰 픽셀을, 상기 제2 얼굴 이미지에 대응하는 위치 픽셀의 제1 픽셀 값과 혼합하여, 혼합된 제2 픽셀 값를 획득하는 단계; 및obtaining a mixed second pixel value by mixing a pixel of the mask image whose pixel value is greater than a predetermined threshold with a first pixel value of a position pixel corresponding to the second face image; and

상기 제2 픽셀 값에 기반하여, 상기 제3 얼굴 이미지를 생성하는 단계를 포함한다.and generating the third face image based on the second pixel value.

본 발명의 임의의 실시형태와 결합하면, 상기 이미지 처리 방법은, Combined with any embodiment of the present invention, the image processing method comprises:

제어 파라미터를 획득하는 단계를 더 포함하며; further comprising obtaining a control parameter;

상기 제2 픽셀 값에 기반하여, 상기 제3 얼굴 이미지를 생성하는 단계는, Based on the second pixel value, generating the third face image includes:

상기 제어 파라미터, 상기 제2 픽셀 값 및 상기 제1 픽셀 값에 기반하여 선형 혼합을 수행하여, 제3 픽셀 값을 획득하는 단계; 및performing linear mixing based on the control parameter, the second pixel value, and the first pixel value to obtain a third pixel value; and

상기 제3 픽셀 값에 기반하여, 상기 제3 얼굴 이미지를 생성하는 단계를 포함한다.and generating the third face image based on the third pixel value.

제2 측면에 있어서, 이미지 처리 장치를 제공하며, In a second aspect, there is provided an image processing device,

제1 얼굴 이미지의 키 포인트를 검출하기 위한 검출 유닛; a detection unit for detecting a key point of the first face image;

상기 키 포인트에 기반하여, 애플존에 의해 조정된 목표 영역을 결정하기 위한 제1 결정 유닛; a first determining unit for determining, based on the key point, a target area adjusted by the apple zone;

상기 키 포인트에 기반하여, 애플존의 조정 파라미터를 결정하기 위한 제2 결정 유닛; 및a second determining unit for determining, based on the key point, an adjustment parameter of the apple zone; and

상기 조정 파라미터에 기반하여, 상기 목표 영역을 조정하여 제2 얼굴 이미지를 형성하기 위한 조정 유닛을 포함한다.and an adjustment unit, configured to adjust the target area to form a second face image, based on the adjustment parameter.

본 발명의 임의의 실시형태와 결합하면, 상기 이미지 처리 장치는, Combined with any embodiment of the present invention, the image processing apparatus comprises:

상기 제1 얼굴 이미지에서 얼굴의 방향을 결정하기 위한 제3 결정 유닛을 더 포함하며; a third determining unit for determining a direction of a face in the first face image;

상기 제1 결정 유닛은, The first determining unit is

상기 키 포인트 및 상기 방향에 기반하여, 애플존에 의해 조정된 상기 목표 영역을 결정하기 위한 것이다.to determine the target area adjusted by the applezone based on the key point and the direction.

본 발명의 임의의 실시형태와 결합하면, 상기 키 포인트는, 눈꼬리 키 포인트, 제1 얼굴 윤곽 키 포인트 및 콧방울 키 포인트를 포함하며; Combined with any of the embodiments of the present invention, the key points include an eye corner key point, a first facial contour key point and a nostril key point;

상기 제2 결정 유닛은, the second determining unit,

상기 방향이 제1 얼굴 이미지가 정면 얼굴 이미지임을 나타내는 것으로 결정될 경우, 상기 제1 얼굴 윤곽 키 포인트 및 상기 콧방울 키 포인트에 기반하여, 상기 목표 영역의 제1 중간점을 결정하고;when it is determined that the direction indicates that the first facial image is a frontal facial image, determine a first midpoint of the target area based on the first facial contour key point and the nostril key point;

상기 제1 중간점 및 상기 눈꼬리 키 포인트에 기반하여, 상기 목표 영역을 결정하기 위한 것이다.Based on the first midpoint and the key point of the corner of the eye, the target area is determined.

본 발명의 임의의 실시형태와 결합하면, 상기 키 포인트는 눈꼬리 키 포인트, 제2 얼굴 윤곽 키 포인트 및 콧방울 키 포인트를 포함하며; In combination with any of the embodiments of the present invention, the key points include an eye corner key point, a second facial contour key point and a nostril key point;

상기 제1 결정 유닛은, The first determining unit is

상기 방향이 상기 제1 얼굴 이미지가 측면 얼굴 이미지임을 나타내는 것으로 결정될 경우, 상기 제2 얼굴 윤곽 키 포인트 및 상기 콧방울 키 포인트에 기반하여, 상기 목표 영역의 제2 중간점을 결정하고;if it is determined that the direction indicates that the first face image is a side face image, determine a second midpoint of the target area based on the second facial contour key point and the nostril key point;

상기 제2 중간점과 상기 눈꼬리 키 포인트에 기반하여, 상기 목표 영역을 결정하기 위한 것이다.Based on the second midpoint and the key point of the corner of the eye, the target area is determined.

본 발명의 임의의 실시형태와 결합하면, 상기 제2 결정 유닛은, When combined with any embodiment of the present invention, the second determining unit comprises:

상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 방향을 결정하기 위한 것이다.Based on the key point and the direction, to determine the adjustment direction of the apple zone.

본 발명의 임의의 실시형태와 결합하면, 상기 제3 결정 유닛은, When combined with any embodiment of the present invention, the third determining unit comprises:

상기 방향이 제1 얼굴 이미지가 정면 얼굴 이미지임을 나타낼 경우, 상기 키 포인트에 기반하여 애플존의 조정 방향이 제1 방향이라고 결정하기 위한 것이다.When the direction indicates that the first face image is a front face image, it is determined that the adjustment direction of the Apple Zone is the first direction based on the key point.

본 발명의 임의의 실시형태와 결합하면, 상기 제3 결정 유닛은 또한, Combined with any embodiment of the present invention, the third determining unit further comprises:

상기 방향이 제1 얼굴 이미지가 측면 얼굴 이미지임을 나타낼 경우, 상기 키 포인트에 기반하여 애플존의 조정 방향이 제2 방향 및 제3 방향이라고 결정하기 위한 것이고, 여기서, 상기 제3 방향은 상기 제2 방향과 상이하다.when the direction indicates that the first face image is a side face image, determining that the adjustment directions of the apple zone are a second direction and a third direction based on the key point, wherein the third direction is the second direction different from the direction

본 발명의 임의의 실시형태와 결합하면, 상기 제1 방향은, 상기 목표 영역의 제1 중간점이 눈꼬리 키 포인트를 가리키는 방향이다.Combined with any embodiment of the present invention, the first direction is a direction in which the first midpoint of the target area points to the corner key point.

본 발명의 임의의 실시형태와 결합하면, 상기 제2 방향은, 상기 목표 영역의 제2 중간점이 눈꼬리 키 포인트를 가리키는 방향이며; Combined with any of the embodiments of the present invention, the second direction is a direction in which a second midpoint of the target area points to a corner key point;

상기 제3 방향은, 콧방울 키 포인트가 목표 영역을 결정하는 제2 얼굴 윤곽 키 포인트를 가리키는 방향이다.The third direction is a direction in which the nose bridge key point points to the second facial contour key point determining the target area.

본 발명의 임의의 실시형태와 결합하면, 상기 제2 결정 유닛은, When combined with any embodiment of the present invention, the second determining unit comprises:

상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 폭을 결정하기 위한 것이다.based on the key point and the direction, to determine an adjustment width of the apple zone.

본 발명의 임의의 실시형태와 결합하면, 상기 제2 결정 유닛은, When combined with any embodiment of the present invention, the second determining unit comprises:

눈꼬리 키 포인트 및 눈머리 키 포인트에 기반하여, 상기 애플존의 최대 이동 거리를 결정하고;determining the maximum moving distance of the apple zone based on the key points of the corners of the eyes and the key points of the corners of the eyes;

상기 방향이 상기 제1 얼굴 이미지가 측면 얼굴 이미지임을 나타낼 경우, 얼굴 편향각 및 상기 최대 이동 거리에 따라, 상기 제1 얼굴 이미지의 애플존의 실제 이동 거리를 결정하기 위한 것이다.When the direction indicates that the first face image is a side face image, an actual moving distance of the apple zone of the first face image is determined according to a face deflection angle and the maximum moving distance.

본 발명의 임의의 실시형태와 결합하면, 상기 이미지 처리 장치는, Combined with any embodiment of the present invention, the image processing apparatus comprises:

상기 제2 얼굴 이미지에서의 애플존에 대해 브라이트닝 처리를 수행하여, 제3 얼굴 이미지를 획득하기 위한 브라이트닝 처리 유닛을 더 포함한다.and a brightening processing unit configured to perform brightening processing on the apple zone in the second facial image to obtain a third facial image.

본 발명의 임의의 실시형태와 결합하면, 상기 브라이트닝 처리 유닛은, Combined with any embodiment of the present invention, the brightening processing unit comprises:

상기 제2 얼굴 이미지로부터 얼굴의 피부색 파라미터를 획득하고;obtain a skin color parameter of the face from the second face image;

상기 얼굴 피부색 파라미터에 기반하여, 애플존 브라이트닝 처리를 위한 브라이트닝 파라미터를 결정하며;determine a brightening parameter for apple zone brightening treatment based on the facial skin color parameter;

상기 브라이트닝 파라미터에 기반하여 상기 제2 얼굴 이미지에서의 애플존에 대해 브라이트닝 처리를 수행하여, 상기 제3 얼굴 이미지를 획득하기 위한 것이다.Brightening processing is performed on the apple zone in the second face image based on the brightening parameter to obtain the third face image.

본 발명의 임의의 실시형태와 결합하면, 상기 브라이트닝 처리 유닛은, Combined with any embodiment of the present invention, the brightening processing unit comprises:

상기 제2 얼굴 이미지에서의 애플존의 위치에 따라, 마스크 이미지를 생성하고;generate a mask image according to the position of the apple zone in the second face image;

상기 마스크 이미지에 기반하여, 상기 제2 얼굴 이미지에 대해 상기 애플존의 브라이트닝 처리를 수행하여 상기 제3 얼굴 이미지를 획득하기 위한 것이다.Based on the mask image, the Apple Zone brightening process is performed on the second face image to obtain the third face image.

본 발명의 임의의 실시형태와 결합하면, 상기 브라이트닝 처리 유닛은, Combined with any embodiment of the present invention, the brightening processing unit comprises:

기설정된 애플존 브라이트닝의 밝은 점, 및 상기 제2 얼굴 이미지에서의 애플존의 위치에 따라, 상기 밝은 점을 포함한 상기 마스크 이미지를 생성하기 위한 것이다.This is to generate the mask image including the bright point according to the preset bright point of the apple zone brightening and the position of the apple zone in the second face image.

본 발명의 임의의 실시형태와 결합하면, 상기 브라이트닝 처리 유닛은, Combined with any embodiment of the present invention, the brightening processing unit comprises:

상기 마스크 이미지의 픽셀 값이 소정의 임계값보다 큰 픽셀을, 상기 제2 얼굴 이미지에 대응하는 위치 픽셀의 제1 픽셀 값과 혼합하여, 혼합된 제2 픽셀 값를 획득하고;a pixel having a pixel value greater than a predetermined threshold value of the mask image is mixed with a first pixel value of a position pixel corresponding to the second face image to obtain a mixed second pixel value;

상기 제2 픽셀 값에 기반하여, 상기 제3 얼굴 이미지를 생성하기 위한 것이다.Based on the second pixel value, the third face image is generated.

본 발명의 임의의 실시형태와 결합하면, 상기 이미지 처리 장치는, Combined with any embodiment of the present invention, the image processing apparatus comprises:

제어 파라미터를 획득하는 획득 유닛을 더 포함하며; an acquiring unit for acquiring the control parameter;

상기 브라이트닝 처리 유닛은, The brightening processing unit,

상기 제어 파라미터, 상기 제2 픽셀 값 및 상기 제1 픽셀 값에 기반하여 선형 혼합을 수행하여, 제3 픽셀 값을 획득하고;perform linear mixing based on the control parameter, the second pixel value, and the first pixel value to obtain a third pixel value;

상기 제3 픽셀 값에 기반하여, 상기 제3 얼굴 이미지를 생성하기 위한 것이다.Based on the third pixel value, the third face image is generated.

제3 측면에 있어서, 제공된 이미지 기기는, In a third aspect, the provided imaging device comprises:

메모리; 및Memory; and

상기 메모리에 연결되고, 상기 메모리에 저장된 컴퓨터 실행 가능한 명령어를 실행하여, 제1 측면 및 이의 임의의 실시형태를 구현하기 위한 프로세서를 포함한다.and a processor coupled to the memory and configured to execute computer-executable instructions stored in the memory to implement the first aspect and any embodiments thereof.

컴퓨터 실행 가능한 명령어가 저장된 컴퓨터 저장 매체로서, 상기 컴퓨터 실행 가능한 명령어가 실행된 후, 전술한 제1 측면 및 이의 임의의 실시형태를 구현할 수 있다.A computer storage medium having computer-executable instructions stored therein, and after the computer-executable instructions are executed, the above-described first aspect and any embodiments thereof can be implemented.

본 발명의 실시예에서 제공한 기술 방안은, 제1 얼굴 이미지에 대해 키 포인트 검출을 실행하여, 제1 얼굴 이미지에서의 키 포인트를 획득한 후, 키 포인트에 근거하여 제1 얼굴 이미지에서의 애플존이 위치한 목표 영역을 결정하며, 키 포인트에 기반하여 제1 얼굴 이미지의 애플존을 조정하는 조정 파라미터를 결정하여, 상기 조정 파라미터를 이용하여 상기 목표 영역을 조정하면, 애플존이 조정된 후의 제2 얼굴 이미지를 생성할 수 있다. 이러한 방식으로, 본 발명의 실시예에서 제공한 기술 방안은, 적어도 얼굴 이미지에에서의 애플존을 조정하는 기능을 제공하고, 후속적으로 사용자 요구에 따라 얼굴 이미지에서의 애플존을 조정할 수 있어, 얼굴 이미지에 대해 미화 및 코믹 효과를 향상시킨다.The technical solution provided in the embodiment of the present invention is to perform key point detection on the first face image to obtain a key point in the first face image, and then, based on the key point, perform key point detection in the first face image. If the target area where the zone is located is determined, and an adjustment parameter for adjusting the apple zone of the first face image is determined based on the key point, and the target area is adjusted using the adjustment parameter, the second target area after the apple zone is adjusted is determined. 2 You can create a face image. In this way, the technical solution provided in the embodiment of the present invention can at least provide the function of adjusting the apple zone in the face image, and subsequently adjust the apple zone in the face image according to the user's demand, Enhances beautifying and comical effects for face images.

본 출원의 실시예 또는 배경 기술에서의 기술 방안을 보다 명확하게 설명하기 위해, 본 출원의 실시예 또는 배경 기술을 설명하는데 필요한 도면에 대해 설명한다.
본문의 도면은 본 명세서에 포함되어 본 명세서의 일부을 구성하며, 이 첨부 도면은 본 발명에 부합되는 실시예를 도시하고, 명세서와 함께 본 발명의 기술 방안의 설명에 사용된다.
도 1은 본 발명의 실시예에서 제공한 픽셀 좌표계의 모식도이다.
도 2는 본 발명의 실시예에서 제공한 얼굴 이미지의 영역 분할의 모식도이다.
도 3은 본 발명의 실시예에서 제공한 이미지 처리 방법의 흐름 모식도이다.
도 4는 본 발명의 실시예에서 제공한 얼굴 키 포인트의 모식도이다.
도 5는 본 발명의 실시예에서 제공한 다른 이미지 처리 방법의 흐름 모식도이다.
도 6a는 본 발명의 실시예에서 제공한 정면 얼굴 인물의 효과 모식도이다.
도 6b는 본 발명의 실시예에서 제공한 측면 얼굴 인물의 효과 모식도이다.
도 6c는 본 발명의 실시예에서 제공한 다른 측면 얼굴 인물의 효과 모식도이다.
도 7은 본 발명의 실시예에서 제공한 마스크 이미지의 효과 모식도이다.
도 8은 본 발명의 실시예에서 제공한 이미지 처리 장치의 구조 모식도이다.
도 9는 본 발명의 실시예는 제공 이미지 기기의 구조 모식도이다.
도 10은 본 발명의 실시예에서 제공한 이미지 처리 방법의 효과 모식도이다.
In order to more clearly explain the technical solutions in the embodiments or the background art of the present application, the drawings necessary to explain the embodiments or the background art of the present application will be described.
BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings are incorporated in and constitute a part of this specification, and the accompanying drawings show an embodiment consistent with the present invention, and together with the specification are used to describe the technical solution of the present invention.
1 is a schematic diagram of a pixel coordinate system provided in an embodiment of the present invention.
2 is a schematic diagram of region division of a face image provided in an embodiment of the present invention.
3 is a flow schematic diagram of an image processing method provided in an embodiment of the present invention.
4 is a schematic diagram of face key points provided in an embodiment of the present invention.
5 is a flowchart of another image processing method provided in an embodiment of the present invention.
6A is a schematic diagram of the effect of a front face person provided in an embodiment of the present invention.
6B is a schematic diagram of the effect of a side face person provided in an embodiment of the present invention.
6C is a schematic diagram of the effect of another side face person provided in an embodiment of the present invention.
7 is a schematic diagram of the effect of a mask image provided in an embodiment of the present invention.
8 is a structural schematic diagram of an image processing apparatus provided in an embodiment of the present invention.
9 is a structural schematic diagram of an image providing apparatus according to an embodiment of the present invention.
10 is a schematic diagram of the effect of the image processing method provided in the embodiment of the present invention.

아래에 본 명세서의 도면 및 구체적인 실시예를 결합하여 본 발명의 기술 방안에 대해 상세히 설명하고자 한다.In combination with the drawings and specific embodiments of the present specification below, the technical method of the present invention will be described in detail.

다음의 설명에 앞서, 먼저 본 발명의 실시예에서의 픽셀 좌표계에 대해 정의한다. 도 1에 도시된 바와 같이, 얼굴 이미지(A)의 오른쪽 아래 모서리는 픽셀 좌표계의 원점(o)으로 사용하여, 얼굴 이미지(A)의 행에 평행한 방향은 x축 방향이고, 얼굴 이미지(A)의 열에 평행한 방향은 y축 방향으로 취함으로써, 픽셀 좌표계(xoy)를 구성한다. 필셀 좌표계에서, 가로 좌표는 얼굴 이미지(A)에서 얼굴 이미지(A)에서의 픽셀의 열수를 나타내기 위한 것이고, 세로 좌표는 얼굴 이미지(A)에서 얼굴 이미지(A)에서의 픽셀의 행수를 나타내기 위한 것이며, 가로 좌표 및 세로 좌표의 유닛은 모두 픽셀일 수 있다. 예를 들어, 도 1에서의 픽셀 a의 좌표가 (10, 30)이면, 즉 픽셀 a의 가로 좌표는 10 개의 픽섹이고, 픽셀 a의 세로 좌표는 30 개의 픽셀이며, 픽셀 a는 얼굴 이미지(A)에서의 제10열 제30행의 픽셀이다.Prior to the following description, the pixel coordinate system in the embodiment of the present invention is first defined. 1, the lower right corner of the face image (A) is used as the origin (o) of the pixel coordinate system, the direction parallel to the row of the face image (A) is the x-axis direction, and the face image (A) ), the direction parallel to the column is taken as the y-axis direction, thereby constituting the pixel coordinate system (xoy). In the pixel coordinate system, the abscissa is for representing the number of columns of pixels in the face image (A) in the face image (A), and the ordinate represents the number of rows of pixels in the face image (A) in the face image (A). For the purpose of betting, both the abscissa and ordinate units may be pixels. For example, if the coordinates of pixel a in Fig. 1 are (10, 30), that is, the abscissa of pixel a is 10 pixels, the ordinate of pixel a is 30 pixels, and pixel a is a face image (A ) in column 10, row 30.

설명의 편의를 위해, 본 발명의 실시예는 얼굴 이미지에서의 얼굴 영역을 왼쪽 얼굴 영역 및 오른쪽 얼굴 영역으로 분할한다. 도 2에 도시된 바와 같이, 얼굴 영역의 대칭 중심선을 기준으로 얼굴 영역을 왼쪽 얼굴 영역 및 오른쪽 얼굴 영역으로 나눈다.For convenience of description, an embodiment of the present invention divides a face region in a face image into a left face region and a right face region. As shown in FIG. 2 , the face region is divided into a left face region and a right face region based on a symmetric center line of the face region.

도 3에 도시된 바와 같이, 본 실시예에 제공된 이미지 처리 방법은 다음의 방법을 포함한다.As shown in Fig. 3, the image processing method provided in this embodiment includes the following method.

단계 S110에 있어서, 제1 얼굴 이미지의 키 포인트를 검출한다.In step S110, a key point of the first face image is detected.

단계 S120에 있어서, 상기 키 포인트에 기반하여, 애플존에 의해 조정된 목표 영역을 결정한다.In step S120, a target area adjusted by the Apple Zone is determined based on the key point.

단계 S130에 있어서, 상기 키 포인트에 기반하여, 애플존의 조정 파라미터를 결정한다.In step S130, an adjustment parameter of the Apple Zone is determined based on the key point.

단계 S140에 있어서, 상기 조정 파라미터에 기반하여, 상기 목표 영역을 조정하여 제2 얼굴 이미지를 형성한다.In step S140, a second face image is formed by adjusting the target area based on the adjustment parameter.

본 실시예에서, 얼굴에서의 애플존은 눈 아래 영역에 위치한 역 삼각형의 조직의 영역으로 이해할 수 있다. 이 영역은 사람이 미소를 짓거나 표정을 지을 때 얼굴 근육의 압박으로 인해 약간 부풀어 오르며, 상기 역 삼각형의 조직이 위치한 영역은 둥글고 광택있는 사과처럼 보이기 때문에, 애플존이라 지칭한다. 본 실시예는 애플존에 대한 조정 방안을 제공하여, 실제 응용에서 또한 사람 얼굴의 다른 부위 또는 만화 캐릭터의 얼굴 부위 또는 동물의 얼굴 부위 등에 적용될 수 있으며, 상기 조정 방안의 기술 개념에 기반하여 상기 얼굴 부위에 대해 조정하며, 본 발명의 실시예의 기술 범위 내인 것으로 간주될 수 있다.In the present embodiment, the apple zone on the face may be understood as an inverted triangular tissue region located in the area under the eyes. This area swells slightly due to the compression of facial muscles when a person smiles or makes an expression, and the area in which the inverted triangle tissue is located looks like a round and glossy apple, so it is called Apple Zone. This embodiment provides an adjustment method for the Apple Zone, and in actual application, it can also be applied to other parts of a human face, a face part of a cartoon character, an animal face part, etc., based on the technical concept of the adjustment scheme, the face Adjusted for the site, it can be considered to be within the technical scope of the embodiment of the present invention.

단계 S110에서 뉴럴 네트워크와 같은 딥 러닝 모델 또는 얼굴 키 포인트 검출 알고리즘을 이용하여 제1 얼굴 이미지에 대해 처리를 수행함으로써, 제1 얼굴 이미지에서의 얼굴 키 포인트를 결정한다. 상기 얼굴 키 포인트 검출 알고리즘은, OpenFace, 멀티 태스크 계단식 컨볼루션 네트워크(multi-task cascaded convolutional networks, MTCNN), 트윗된 컨볼루션 뉴럴 네트워크 조정(tweaked convolutional neural networks, TCNN), 또는 작업 제한 딥 컨볼루션 네트워크(tasks-constrained deep convolutional network, TCDCN) 중의 하나일 수 있으며, 본 발명은 얼굴 키 포인트 검출 알고리즘에 대해 한정하지 않는다.In step S110, a face key point in the first face image is determined by performing processing on the first face image using a deep learning model such as a neural network or a face key point detection algorithm. The face key point detection algorithm may include OpenFace, multi-task cascaded convolutional networks (MTCNN), tweaked convolutional neural networks (TCNN), or task-limited deep convolutional networks. (tasks-constrained deep convolutional network, TCDCN), and the present invention is not limited to the face key point detection algorithm.

예를 들어, 상기 키 포인트는,For example, the key point is

도 4에 도시된 키 포인프(0) 내지 키 포인트(32)인 얼굴 윤곽 키 포인트;face contour key points, which are key points 0 to 32 shown in Fig. 4;

도 4에 도시된 키 포인트(33) 내지 키 포인트(37), 키 포인트(38) 내지 키 포인트(42) 및 키 포인트(64) 내지 키 포인트(71)인 눈썹 키 포인트; eyebrow key points that are key point 33 to key point 37, key point 38 to key point 42, and key point 64 to key point 71 shown in FIG. 4;

눈 키 포인트; eye key point;

코 키 포인트; 및 foot key point; and

입술 키 포인트 등 키 포인트를 포함하지만 이에 한정되지 않으며, 상기 입술 키 포인트는 도 4의 키 포인트(84) 내지 키 포인트(103)를 참조할 수 있다. It includes, but is not limited to, key points such as lip key points, and the lip key points may refer to key points 84 to 103 of FIG. 4 .

상기 눈 키 포인트는 눈에서의 키 포인트의 분포에 따라 또한, wherein the eye key points depend on the distribution of key points in the eye;

도 4에 도시된 키 포인트(55) 및 키 포인트(58)와 같은 내안각에 위치한 눈머리 키 포인트;key points located in the inner canthus, such as key point 55 and key point 58 shown in FIG. 4;

도 4에 도시된 키 포인트(52) 및 키 포인트(62)와 같은 외안각에 위치한 눈꼬리 키 포인트;a key point located at the lateral canthus, such as key point 52 and key point 62 shown in FIG. 4;

도 4에 도시된 키 포인트(53, 72 및 54), 및 키 포인트(59, 75 및 60)와 같은 상안검에 위치한 상안검 키 포인트; upper eyelid key points located on the upper eyelid, such as key points 53, 72 and 54, and key points 59, 75 and 60 shown in FIG. 4;

도 4에 도시된 키 포인트(62, 76 및 63), 및 키 포인트(57, 73 및 56)와 같은 하안검에 위치한 하안검 키 포인트; 및 the lower eyelid key points located on the lower eyelid, such as key points 62, 76 and 63, and key points 57, 73 and 56 shown in FIG. 4; and

도 4에 도시된 키 포인트(74 및 104) 및 키 포인트(77 및 105)와 같은 안구에 위치한 안구 키 포인트를 포함할 수 있으며; may include ocular key points located in the eye, such as key points 74 and 104 and key points 77 and 105 shown in FIG. 4 ;

상기 코 키 포인트는 코에서의 키 분포에 따라, The nose key point is according to the height distribution in the nose,

도 4에 도시된 키 포인트(43)와 같은 산근에 위치한 키 포인트; a key point located at a mountain root, such as the key point 43 shown in FIG. 4 ;

도 4의 키 포인트(44) 및 키 포인트(45)와 같은 콧날에 위치한 콧날 키 포인트; a nasal key point located on the nose, such as key point 44 and key point 45 in FIG. 4;

도 4의 키 포인트(80) 내지 키 포인트(83)와 같은 콧방울에 위치한 콧방울 키 포인트; a nostril key point located on the nostril, such as key point 80 through key point 83 in FIG. 4;

도 4의 키 포인트(46)와 같은 코끝에 위치한 코끝 키 포인트; 및a nose tip key point located at the tip of the nose, such as the key point 46 of FIG. 4; and

도 4에 도시된 키 포인트(47) 내지 키 포인트(51)와 같은 코밑에 위치한 코밑 키 포인트로 나눌수 있다.It can be divided into key points located under the nose, such as the key point 47 to the key point 51 shown in FIG. 4 .

본 실시예에서, 애플존 조정과 관련된 키 포인트는, In this embodiment, the key points related to Apple Zone adjustment are:

도 4에 도시된 얼굴 윤곽 키 포인트에서 광대뼈와 가까운 위치의 키 포인트(4), 키 포인트(5), 키 포인트(28) 및 키 포인트(27); a key point 4, a key point 5, a key point 28, and a key point 27 at positions close to the cheekbones in the facial contour key points shown in Fig. 4;

눈꼬리 키 포인트; 및eyebrow key point; and

눈머리 키 포인트 중 적어도 하나를 포함한다.It includes at least one of the eyebrow key points.

단계 S310에서 먼저 키 포인트에서의 하나 또는 복수 개의 키 포인트에 따라, 제1 얼굴 이미지에서 애플존 조정을 수행하기 위한 목표 영역을 표시한다. 상기 영역을 표시한 후 상기 영역 내의 픽셀에 근거하여 애플존의 조정을 구현할 수 있다. 구체적인 실시예에서 상기 얼굴 윤곽 키 포인트는 제1 얼굴 윤곽 키 포인트 및 제2 얼굴 윤곽 키 포인트 중 적어도 하나를 선택할 수 있으므로, 애플존의 조정 파라미터를 결정한다.In step S310, a target area for performing apple zone adjustment in the first face image is displayed according to one or a plurality of key points in the key point. After displaying the area, adjustment of the apple zone may be implemented based on the pixels in the area. In a specific embodiment, since at least one of the first facial contour key point and the second facial contour key point can be selected as the facial contour key point, an adjustment parameter of the Apple Zone is determined.

본 실시예에서, 상기 목표 영역은 원형 영역 또는 타원형 영역일 수 있다.In this embodiment, the target area may be a circular area or an elliptical area.

단계 S310에서 키 포인트에서의 하나 또는 복수 개의 키 포인트 따라, 애플존의 조정 파라미터를 결정한다. 상기 애플존의 조정 파라미터는, In step S310, according to one or a plurality of key points at the key point, an adjustment parameter of the Apple Zone is determined. The adjustment parameters of the Apple Zone are,

애플존의 조정 방향; Adjustment direction of Apple Zone;

애플존의 조정 폭; 및Apple Zone adjustment width; and

애플존의 그라디언트 중 적어도 하나를 포함하지만 이에 한정되지 않는다.At least one of the gradients of the Apple Zone includes, but is not limited to.

조정 방향은, 제1 얼굴 이미지에서의 애플존의 이동 방향을 결정하기 위해 사용될 수 있고; the adjustment direction may be used to determine a movement direction of the applezone in the first facial image;

조정 폭은, 제1 얼굴 이미지에서의 애플존의 이동 거리 또는 스케일 비율 등과 같은 변화 척도 등을 결정하기 위해 사용될 수 있으며; The adjustment width may be used to determine a change measure such as a moving distance or a scale ratio of the apple zone in the first face image;

조정 그라디언트는, 여러 번 조정될 경우 상이한 조정 사이의 조정 폭 차이, 또는, 애플존의 구분 영역에 대해 조정이 수행될 경우, 상이한 영역 사이의 조정 폭 차이를 조정하는데 사용될 수 있다. 예를 들어, 원형 또는 타원형의 목표 영역을 내부 영역 및 외부 영역으로 분할하며; 외부 영역은 내부 영역으로 둘러싸여 있고, 애플존에 대해 밝기 조정이 수행될 경우, 내부 영역의 밝기 조정 폭이 외부 영역의 밝기 조정 폭보다 크면, 내부 영역과 외부 영역 사이의 조정 밝기의 차이는 상기 조정 그라디언트를 구성한다. 물론 이는 예일 뿐이고, 복수 개의 특정 구현 방식이 있다.The adjustment gradient can be used to adjust the adjustment width difference between different adjustments when adjusted multiple times, or the adjustment width difference between different areas when the adjustment is performed on a divided area of the Apple Zone. dividing, for example, a circular or elliptical target area into an inner area and an outer area; The outer area is surrounded by the inner area, and when brightness adjustment is performed for the Apple Zone, if the brightness adjustment width of the inner area is larger than the brightness adjustment width of the outer area, the difference in the adjusted brightness between the inner area and the outer area is Make up gradients. Of course, this is just an example, and there are a plurality of specific implementations.

단계 S310에서 상기 조정 파라미터 및 상기 목표 영역을 결정하기 위한 키 포인트는 동일하거나 상이할 수 있다. 일부 실시예에서, 상기 조정 파라미터 및 상기 목표 영역을 결정하기 위한 키 포인트의 일부는 동일할 수 있다. 예를 들어, 동일한 얼굴 윤곽 키 포인트를 사용하여 상기 조정 파라미터 및 상기 목표 영역을 결정할 수 있다. 다시 예를 들어, 동일한 눈 키 포인트를 동시에 사용하여 상기 조정 파라미터 및 상기 목표 영역을 결정할 수 있다.In step S310, the adjustment parameter and the key point for determining the target area may be the same or different. In some embodiments, a portion of the key point for determining the adjustment parameter and the target area may be the same. For example, the same facial contour key point may be used to determine the adjustment parameter and the target area. Again, for example, the same eye key point may be used simultaneously to determine the adjustment parameter and the target area.

단계 S140에서 조정 파라미터에 따라, 제1 얼굴 이미지에서의 위치, 모양, 치수, 또는 색상 중 적어도 하나의 목표 영역을 조정함으로써, 제2 얼굴 이미지를 형성한다.In step S140 , the second face image is formed by adjusting the target area of at least one of a position, a shape, a dimension, or a color in the first face image according to the adjustment parameter.

구체적으로, 상기 단계 S140은, Specifically, the step S140 is

상기 목표 영역에 대해 이동을 수행하여, 상기 목표 영역의 위치를 조정하는 단계; adjusting a position of the target area by moving the target area;

상기 목표 영역에 대해 스케일링을 수행하여, 제2 얼굴 이미지에서의 상기 목표 영역의 치수를 조정하는 단계; adjusting a dimension of the target area in a second face image by scaling the target area;

상기 목표 영역에 대해 색상 변환을 수행하여, 상기 목표 영역의 색상을 조정함으로써, 얼굴의 하이라이트 영역 또는 그림자 영역 등을 형성하는 단계 ; 및forming a highlight area or a shadow area of a face by performing color conversion on the target area and adjusting the color of the target area; and

상기 목표 영역 내에 대해 모양 변화를 수행하여, 상기 목표 영역에 나타낸 모양을 조정함으로써, 얼굴의 얼굴 모양에 적합한 애플존 모양을 이미지화하는 단계 중 적어도 하나를 포함한다. 예를 들어, 상이한 인물은 상이한 얼굴형을 이미지화하며, 예를 들어, 일부는 계란형 얼굴, 일부는 하트형 얼굴, 일부는 둥근 얼굴, 일부는 다이아몬드형 얼굴이다. 애플존의 모양은 대체적으로 역삼각형이지만; 역삼각형의 세 모서리의 각도 또는 정점이 얼굴 이미지에서의 위치가 상이하면, 애플존으로 하여금 상이한 시각적 느낌을 나타내도록 한다. 따라서 일부 실시예어서, 이미지 기기는 또한 목표 영역 내의 픽셀의 위치 등 방식을 조정함으로써, 얼굴형과 일치하도록 애플존으로 하여금 목표 영역 내 또는 이동 후의 목표 영역 내에서 상이한 모양의 얼굴 모양에 알맞는 역삼각형으로 나타내도록 하여, 인물 미화, 또는 코믹 등 처리를 구현할 수 있다.and performing a shape change in the target area to adjust the shape shown in the target area, thereby imaging an apple zone shape suitable for a facial shape of the face. For example, different people image different face shapes, for example, some oval faces, some heart-shaped faces, some round faces, some diamond faces. The shape of the Apple Zone is generally an inverted triangle; If the angles or vertices of the three corners of the inverted triangle are different from each other in the face image, it makes Apple Zone show different visual impressions. Thus, in some embodiments, the imaging device may also adjust the position, etc. of pixels within the target area, so as to match the face shape, so that the Apple Zone can be adapted to fit different shaped face shapes within the target area or within the target area after movement. By making it appear as a triangle, it is possible to implement processing such as beautifying a person or a comic.

요컨대, 본 실시예에서 제공된 방법은 얼굴 이미지에서의 애플존에 대해 조정을 수행함으므로써, 얼굴 이미지에서 애플존의 아름답고, 코믹스럽거나, 귀엽게 하거나 또는 상이한 스타일 타입의 애플존을 구현할 수 있으며; 이러한 방식으로, 사용자 요구에 따라 이미지의 애플존 처리를 구현할 수 있음으로써, 사용자의 상이한 이미지 요구를 만족시키며, 사용자 체험, 및 이미지 처리 품질을 향상시킬 수 있다.In short, the method provided in this embodiment can implement the Apple Zone of a beautiful, comical, cute or different style type of Apple Zone in the face image by performing the adjustment on the Apple Zone in the face image; In this way, it is possible to implement apple zone processing of images according to user requirements, thereby satisfying different image needs of users, and improving user experience and image processing quality.

일부 실시예에서, 상기 단계 S130에서 상기 조정 파라미터가 생성될 경우, 현재 애플존의 예상 조정 효과에 따라, 상기 조정 파라미터를 생성할 수 있다. 예를 들어, 현재 예상된 조정 효과가 애플존 미화 효과이면, 미화 효과에 따라 애플존으로 하여금 제2 얼굴 이미지에서 제1 얼굴 이미지에서보다 비교적 대중적인 미적 미화 효과를 나타낸다. 다시 예를 들어, 현재 예상된 조정 효과가 코믹 효과이면, 제1 얼굴 이미지에서의 애플존의 조정을 통해, 유머 효과를 나타내면; 상기 조정 파라미터가 생성될 경우, 상기 키 포인트 및 상기 코믹 효과를 결합하여 제2 얼굴 이미지로 하여금 유머 개그 효과를 나타내는 애플존을 생성한다. 요컨대, 일부 실시예에서, 상기 조정 파라미터의 생성은 또한 상기 예상 조정 효과에 따라 결정된다.In some embodiments, when the adjustment parameter is generated in step S130, the adjustment parameter may be generated according to the expected adjustment effect of the current Apple Zone. For example, if the currently expected adjustment effect is the Apple Zone beautifying effect, according to the beautifying effect, Apple Zone exhibits a relatively popular aesthetic beautifying effect in the second face image than in the first face image. Again, for example, if the currently expected adjustment effect is a comic effect, a humor effect is expressed through adjustment of the apple zone in the first face image; When the adjustment parameter is generated, the key point and the comic effect are combined to generate an apple zone in which a second face image exhibits a humorous gag effect. In sum, in some embodiments, the generation of the adjustment parameter is also determined according to the expected adjustment effect.

본 실시예에서, 애플존에 대한 조정은 이미지 미화 과정에 사용될 수 있으며, 뷰티 애플리케이션에서 사용될 수 있고, 본 발명의 실시예에서 제공한 애플존 조정은 원클릭 인물 뷰티에 사용될 수 있으며, 이러한 방식으로, 애플존 미화는 눈 미화, 코 미화 또는 얼굴형 미화 등과 함께 원클릭 인물 뷰티의 하나의 기능으로서 구현된다.In this embodiment, the adjustment for the Apple Zone can be used in the image beautification process, can be used in a beauty application, and the Apple Zone adjustment provided in the embodiment of the present invention can be used for one-click portrait beauty, in this way , Apple Zone beautification is implemented as one function of one-click portrait beauty along with beautification of eyes, nose, or face shape.

물론 본 실시예에서 제공한 애플존의 조정은, 전문적인 애플존 미화 기능에도 사용될 수 있다. 예를 들어, 뷰티 애플리케이션에서 애플존 미화 제어가 설정되고, 상기 애플존 미화 제어에 작용하는 사용자의 조작이 검출될 경우, 상기 방법을 사용하여 이미지에서의 애플존에 대해 독립적으로 미화를 수행한다.Of course, the adjustment of the Apple Zone provided in this embodiment can also be used for a professional Apple Zone beautification function. For example, when the Apple Zone beautification control is set in the beauty application, and a user's manipulation acting on the Apple Zone beautification control is detected, the Apple Zone in the image is independently beautified using the above method.

요컨대, 본 실시예에서 설명된 이미지 처리 방법은, 애플존의 조정 기능을 가지고, 인물 처리를 수행하는 과정에서 애플존에 대한 조정을 수행할 수 있음으로써, 애플존 조정에 대한 사용자 요구를 만족시키고, 사용자 체험 및 이미지 기기의 지능을 향상시킨다.In short, the image processing method described in this embodiment has an Apple Zone adjustment function and can perform adjustments to the Apple Zone in the process of performing person processing, thereby satisfying the user's needs for Apple Zone adjustment and , improve user experience and image device intelligence.

다른 일부 실시예에서, 도 5에 도시된 바와 같이, 상기 이미지 처리 방법은 다음의 단계를 포함한다. In some other embodiments, as shown in FIG. 5 , the image processing method includes the following steps.

단계 S111에 있어서, 상기 제1 얼굴 이미지에서 얼굴의 방향을 결정한다. In step S111, the direction of the face in the first face image is determined.

상기 단계 S120은 단계 S121을 포함할 수 있으며; 상기 단계 S121은, 상기 키 포인트 및 상기 방향에 기반하여, 애플존에 의해 조정된 상기 목표 영역을 결정하는 단계를 포함할 수 있다.The step S120 may include step S121; The step S121 may include determining the target area adjusted by the Apple Zone based on the key point and the direction.

본 실시예에서, 또한 제1 얼굴 이미지의 방향을 결정한다. 제1 얼굴 이미지의 방향은 적어도 두 가지 방향으로 나눈다.In this embodiment, it also determines the direction of the first face image. The direction of the first face image is divided into at least two directions.

첫 번째 방향에 있어서, 정면 얼굴 방향, 즉 제1 얼굴 이미지가 정면 얼굴 이미지인 것으로 나타내며; in the first direction, the front face direction, that is, the first face image is indicated as the front face image;

두 번째 방향에 있어서, 측면 얼굴 방향, 즉 제1 얼굴 이미지가 측면 얼굴 이미지인 것으로 나타낸다.In the second direction, it is indicated that the side face direction, that is, the first face image is the side face image.

상기 제1 얼굴 이미지를 수집하는 촬상 기기의 촬영 방향과 촬영되는 사람의 얼굴 영역의 대칭 중심선 사이의 협각(아래에 얼굴 편향각도로 지칭됨)이 제1 기설정 범위 내에 위치할 경우, 제1 얼굴 이미지의 방향은 정면 얼굴 방향이다.When an included angle (referred to as a face deflection angle below) between a photographing direction of an imaging device that collects the first face image and a symmetric center line of a face region of a person to be photographed is located within a first preset range, the first face The orientation of the image is the front face orientation.

상기 얼굴 편향각은 촬상 기기의 촬영 방향과 촬영되는 사람의 얼굴 영역의 수직선 사이의 각도를 지칭하며, 촬영되는 사람의 머리 위에서 아래로 내려다 보면, 촬상 기기의 촬영 방향이 촬영되는 사람의 얼굴 영역의 대칭 중심선의 오프셋 방향에 대해 시계 방향인 경우, 얼굴 편향각은 양수이고, 그렇지 않으면, 촬영되는 사람의 머리 위에서 아래로 내려다 보면, 촬상 기기의 촬영 방향이 촬영되는 사람의 얼굴 영역의 대칭 중심선의 오프셋 방향에 대해 시계 반대 방향인 경우, 얼굴 편향각은 음수이다.The face deflection angle refers to an angle between the photographing direction of the imaging device and the vertical line of the face region of the person being photographed. When clockwise with respect to the offset direction of the symmetrical centerline, the face deflection angle is positive; If it is counter-clockwise to the direction, the face deflection angle is negative.

상기 제1 얼굴 이미지의 얼굴 편향각이 제2 기설정 범위 내에 위치할 경우, 제1 얼굴 이미지의 방향은 측면 얼굴 방향이다.When the face deflection angle of the first face image is within a second preset range, the direction of the first face image is a side face direction.

상기 제1 기설정 범위와 상기 제2 기설정 범위는 서로에 대해 상보적인 세트이다. 예를 들어, 제1 기설정 범위가 -10도 내지 10도이면, 제2 기설정 범위는 -180도 내지 -10도, 및 10도 내지 180도이다.The first preset range and the second preset range are sets complementary to each other. For example, if the first preset range is -10 degrees to 10 degrees, the second preset range is -180 degrees to -10 degrees, and 10 degrees to 180 degrees.

얼굴 이미지에서 상기 정면 얼굴 방향 이외의 방향은 모두 측면 얼굴 방향으로 간주될 수 있고, 물론 이때 얼굴을 포함하지 않는 후면 이미지는 제외된다.All directions other than the front face direction in the face image may be regarded as side face directions, and of course, in this case, the back image not including the face is excluded.

도 6a는 정면 얼굴 방향의 얼굴 이미지이고; 도 6b는 측면 얼굴 방향의 얼굴 이미지이며; 도 6c는 다른 측면 얼굴 방향의 얼굴 이미지이다.6A is a face image in the front face direction; 6B is a face image in a lateral face direction; 6C is a face image in another lateral face direction.

일부 실시예에서, 도 6a에 도시된 얼굴 이미지의 얼굴 편향각은 0도이고, 도 6b에 도시된 얼굴 이미지의 얼굴 편향각이 -90도이면, 도 6c에 도시된 얼굴 이미지의 얼굴 편향각은 90도이다.In some embodiments, if the facial deflection angle of the facial image shown in FIG. 6A is 0 degrees and the facial deflection angle of the face image shown in FIG. 6B is -90 degrees, the facial deflection angle of the face image shown in FIG. 6C is It is 90 degrees.

물론 상기 제1 기설정 범위 및 상기 제2 기설정 범위는 필요에 따라 설정될 수 있다.Of course, the first preset range and the second preset range may be set as needed.

정면 얼굴 방향의 얼굴 이미지(이하 정면 얼굴 이미지로 지칭됨)에서의 애플존에 의해 커버되는 영역 및 측면 얼굴 방향의 얼굴 이미지(이하 측면 얼굴 이미지로 지칭됨)에서의 애플존에 의해 커버되는 영역이 상이(애플존이 커버하는 영역의 면적이 상이하고, 애플존이 커버하는 영역의 각도가 상이한 등을 포함함)하기 때문에, 정면 얼굴 이미지 및 측면 얼굴 이미지에 대해 동일한 조정 표준 또는 조정 파라미터를 사용할 경우, 얼굴 이미지에서의 애플존의 조정 효과가 떨어진다(예를 들어, 조정된 후의 애플존 영역의 면적과 얼굴 영역의 면적의 비율는 부적절하고, 다른 예를 들어, 조정된 애플존 영역의 색상 및 얼굴 영역에서 비 애플존 영역의 색상의 차이가 큼). 이를 위해, 본 발명의 실시예는 상이한 방향의 얼굴 이미지에 대해 상이한 방식을 사용하여 조정 파라미터를 결정하여, 얼굴 이미지에 대한 애플존의 조정 효과를 향상시킨다.The area covered by the apple zone in the face image in the front face direction (hereinafter referred to as the front face image) and the area covered by the apple zone in the face image in the side face direction (hereinafter referred to as the side face image) are When using the same adjustment standard or adjustment parameters for the front face image and the side face image because of the different (including the area covered by the Apple Zone being different, the angle of the area covered by the Apple Zone being different, etc.) , the effect of adjusting the apple zone in the face image is poor (for example, the ratio of the area of the apple zone area to the area of the face area after adjustment is inappropriate, for example, the color and face area of the adjusted apple zone area) In the non-apple zone, the color difference is large). To this end, the embodiment of the present invention determines the adjustment parameters using different methods for face images in different directions, so as to improve the adjustment effect of the Apple Zone on the face images.

이하 목표 영역을 결정할 때의 정면 얼굴 이미지 및 측면 얼굴 이미지의 유사점과 차이점에 대해 각각 소개한다.Hereinafter, the similarities and differences between the front face image and the side face image when determining the target area will be introduced respectively.

정면 얼굴 이미지인 경우, 상기 단계 S120은, In the case of a front face image, the step S120 is

상기 방향이 상기 제1 얼굴 이미지가 정면 얼굴 이미지임을 나타내는 것으로 결정될 경우, 제1 얼굴 윤곽 키 포인트 및 상기 콧방울 키 포인트에 기반하여, 상기 목표 영역의 제1 중간점을 결정하는 단계를 포함할 수 있다.when it is determined that the direction indicates that the first facial image is a frontal facial image, determining a first midpoint of the target region based on a first facial contour key point and the nostril key point .

상기 제1 얼굴 윤곽 키 포인트는 제1 목표 범위내의 세로 좌표의 얼굴 윤곽 키 포인트일 수 있으며, 여기서, 제1 목표 범위는 애플존에 의해 커버되는 영역의 세로 좌표 범위와 제3 기설정 범위의 합이다. 선택적으로, 상기 제3 기설정 범위는 -5 개의 픽셀 내지 5 개의 픽셀이다. 예컨대, 애플존에 의해 커버되는 영역 내의 픽셀의 세로 좌표의 최대값이 35 개의 픽셀이고, 최소값이 16 개의 픽셀이며, 제3 기설정 범위가 -4 개의 픽셀 내지 5 개의 픽셀이면, 세로 좌표는 16-4=12 개의 픽셀보다 크거나 같고, 35+5=40 개의 픽셀보다 작거나 같은 얼굴 윤곽 키 포인트는 제1 얼굴 윤곽 키 포인트이다.The first facial contour key point may be a facial contour key point of vertical coordinates within a first target range, wherein the first target range is the sum of the vertical coordinate range of the area covered by the Apple Zone and the third preset range. am. Optionally, the third preset range is from -5 pixels to 5 pixels. For example, if the maximum value of the vertical coordinate of a pixel in the area covered by the Apple Zone is 35 pixels, the minimum value is 16 pixels, and the third preset range is -4 to 5 pixels, the vertical coordinate is 16 A facial contour key point greater than or equal to -4=12 pixels and less than or equal to 35+5=40 pixels is a first facial contour key point.

선택적으로, 도 4를 참조하면, 키 포인트 4 및 키 포인트 5는 얼굴 이미지에서 좌측 애플존(즉 왼쪽 얼굴 영역에 위치한 애플존임)을 조정하기 위한 제1 얼굴 윤곽 키 포인트로 사용될 수 있다.Optionally, referring to FIG. 4 , key point 4 and key point 5 may be used as first facial contour key points for adjusting the left apple zone (ie, the apple zone located in the left face region) in the face image.

본 실시예에서, 바람직하게 키 포인트 5는 상기 제1 얼굴 윤곽 키 포인트로 사용된다. 상기 콧방울 키 포인트는 세로 좌표와 제1 얼굴 윤곽 키 포인트의 세로 좌표 사이의 차이값이 제4 기설정 범위내에 위치하고, 콧방울 영역(상기 영역은 사용자 요구에 따라 정의됨) 내에 위치하는 키 포인트이다. 예를 들어, 제1 얼굴 윤곽 키 포인트에서의 키 포인트의 세로 좌표의 최대값은 50 개의 픽셀, 최소값은 40 개의 픽셀, 제4 기설정 범위는 10 개의 픽셀이면, 콧방울 키 포인트의 세로 좌표가 30 개의 픽셀보다 크거나 같고 60 개의 픽셀보다 작거나 같은 범위 내의 콧방울 키 포인트이다.In this embodiment, preferably key point 5 is used as the first facial contour key point. The nostril key point is a key point in which a difference value between the vertical coordinates and the vertical coordinates of the first facial contour key point is located within a fourth preset range, and is located within the nostril area (the area is defined according to user requirements). For example, if the maximum value of the ordinate of the key point in the first facial contour key point is 50 pixels, the minimum value is 40 pixels, and the fourth preset range is 10 pixels, the ordinate of the key point of the nostril is 30 Nostril key points greater than or equal to n pixels and less than or equal to 60 pixels.

선택적으로, 상기 콧방울 키 포인트는 도 4에 도시된 키 포인트 80 또는 키 포인트 82일 수 있으며, 바람직하게 본 실시예에서 키 포인트 80은 상기 콧방울 키 포인트로 선택된다. 선택적으로, 제1 얼굴 이미지가 정면 얼굴 이미지이면, 도 4에 도시된 키 포인트(5) 및 키 포인트(80)를 각각 우측 애플존(즉 오른쪽 얼굴 영역의 애플존에 위치함)을 조정하기 위한 제1 얼굴 윤곽 키 포인트 및 콧방울 키 포인트로 선택하며, 조정 효과는 사용자 기대를 더욱 만족시킨다. 도 4에 도시된 키 포인트(27) 및 키 포인트(81)는 각각 왼쪽 얼굴 애플존의 제1 얼굴 윤곽 키 포인트 및 콧방울 키 포인트로 선택된다.Optionally, the key point of the nostril may be the key point 80 or the key point 82 shown in FIG. 4 , and preferably, the key point 80 is selected as the key point of the nostril in this embodiment. Optionally, if the first face image is a front face image, the key point 5 and the key point 80 shown in FIG. 4 for adjusting the right apple zone (that is, located in the apple zone of the right face region) respectively It is selected as the first facial contour key point and nostril key point, and the adjustment effect further satisfies user expectations. The key point 27 and the key point 81 shown in Fig. 4 are selected as the first facial contour key point and the nostril key point of the left facial apple zone, respectively.

상기 제1 중간점은, 상기 제1 얼굴 윤곽 키 포인트 및 콧방울 키 포인트의 중간점(도 4에 도시된 키 포인트(80) 및 키 포인트(82) 사이의 중간점, 키 포인트(81) 및 키 포인트(83) 사이의 중간점)을 포함하지만 이에 한정되지 않는다.The first midpoint is the midpoint between the first facial contour key point and the nose bridge key point (the midpoint between the key point 80 and the key point 82 shown in Fig. 4, the key point 81 and the key midpoints between points 83).

일부 실시예에서, 제1 얼굴 이미지에 의해 나타낸 얼굴 이미지의 얼굴 특징이 상이하면, 제1 얼굴 윤곽 키 포인트 및 콧방울 키 포인트의 중간점에 기반하여 위치 보정을 수행한 후, 상기 제1 중간점을 획득한다. 예를 들어, 제1 얼굴 이미지가 얼굴(A)을 나타내면, 안구 키 포인트에서 대응 위치까지의 제1 얼굴 윤곽 키 포인트 사이의 거리가 제1 거리라고 가정하고, 안구 키 포인트에서 대응 위치에 있는 콧방울 키 포인트의 중간점까지의 거리가 제2 거리라고 가정한다. 상기 대응 위치에 있는 제1 얼굴 윤곽 키 포인트는, 안구 키 포인트가 얼굴 영역의 왼쪽 얼굴 영역에 위치하고, 안구 키 포인트에 대응하는 제1 얼굴 윤곽 키 포인트는 왼쪽 얼굴 영역의 제1 얼굴 키 포인트에서 안구 키 포인트와 가장 가까운 거리에 위치한 제1 얼굴 윤곽 키 포인트를 의미하며; 안구 키 포인트가 얼굴 영역의 오른쪽 얼굴 영역에 위치하면, 안구 키 포인트에 대응하는 제1 얼굴 윤곽 키 포인트는 오른쪽 얼굴 영역의 제1 얼굴 윤곽 키 포인트에서 안구 키 포인트와 가장 가까운 거리에 위치한 제1 얼굴 윤곽 키 포인트를 의미한다. 상기 대응 위치의 콧방울 키 포인트의 중점은, 안구 키 포인트가 얼굴 영역의 왼쪽 얼굴 영역에 위치하면, 안구 키 포인트에 대응하는 콧방울 키 포인트의 중점은 왼쪽 얼굴 영역의 콧방울 키 포인트에 위치한 중점이며; 안구 키 포인트가 얼굴 영역의 오른쪽 얼굴 영역에 위치하면, 안구 키 포인트에 대응하는 콧방울 키 포인트의 중점은 오른쪽 얼굴 영역의 콧방울 키 포인트에 위치한 중점을 의미한다.In some embodiments, if the facial features of the facial image represented by the first facial image are different, position correction is performed based on the midpoint of the first facial contour key point and the nostril key point, and then the first midpoint is determined acquire For example, if the first face image represents the face A, it is assumed that the distance between the first facial contour key point from the eye key point to the corresponding position is the first distance, and the nostril at the corresponding position at the eye key point is assumed to be the first distance. It is assumed that the distance to the midpoint of the key point is the second distance. The first facial contour key point in the corresponding position includes the eyeball key point located in the left facial region of the face region, and the first facial contour key point corresponding to the eyeball key point is the eyeball at the first facial key point in the left facial region means a first facial contour key point located at the closest distance to the key point; If the eye key point is located in the right face region of the face region, the first facial contour key point corresponding to the eye key point is the first face contour key point located closest to the eye key point in the first facial contour key point of the right face region Means the outline key point. the midpoint of the key point of the nostril of the corresponding position is: if the key point of the eyeball is located in the left facial region of the face region, the midpoint of the key point of the nostril corresponding to the key point of the eye is the midpoint of the key point of the nose of the left face region; When the eyeball key point is located in the right face region of the face region, the midpoint of the nose key point corresponding to the eyeball key point means the midpoint located at the nostril key point in the right face region.

상기 비율에 따라 상기 보정 파라미터를 생성한다. 제1 거리 및 제2 거리의 비율이 1이면, 안구 키 포인트에 대응하는 제1 얼굴 윤곽 키 포인트 및 안구 키 포인트에 대응하는 콧방울 키 포인트의 중점을 상기 제1 중간점으로 한다.The calibration parameter is generated according to the ratio. When the ratio of the first distance and the second distance is 1, the midpoint of the first facial contour key point corresponding to the eyeball key point and the nose bridge key point corresponding to the eyeball key point is set as the first midpoint.

제1 거리 및 제2 거리 사이의 비율이 1보다 크거나 작으면, 안구 키 포인트에 대응하는 제1 얼굴 윤곽 키 포인트 및 안구 키 포인트에 대응하는 콧방울 키 포인트 사이의 연결선 상에서 중점(아래에 확인될 제1 중간점이라고 지칭됨)에서 대칭 중심선으로 이동하거나 얼굴 윤곽선에 대한 오프셋 양을 먼저 결정할 수 있고, 상기 오프셋 양은 횡방향 오프셋 양 및 수직 오프셋 양을 포함한다. 확인될 제1 중간점의 좌표와 오프셋 양의 합에 의해 지점을 결정된 제1 중간점으로 한다.If the ratio between the first distance and the second distance is greater than or less than 1, the midpoint (to be identified below (referred to as a first midpoint) to a symmetrical centerline or may first determine an offset amount relative to the facial contour, said offset amount comprising a lateral offset amount and a vertical offset amount. Let the point be the first intermediate point determined by the sum of the offset amount and the coordinates of the first intermediate point to be identified.

하나의 가능한 구현 형태에 있어서, 제1 거리가 제2 거리와 동일하지 않으면, 오프셋 양을 통해 확인될 중간점을 얼굴 윤곽선으로 이동할 수 있고, 예를 들어, 안구 키 포인트 및 제1 얼굴 윤곽 키 포인트가 왼쪽 얼굴 영역에 위치하면, 횡방향 오프셋 양은 음의 값을 취하여, 확인될 제1 중간점을 얼굴 윤곽선으로 이동하게 하며; 안구 키 포인트 및 제1 얼굴 윤곽 키 포인트가 왼쪽 얼굴 영역에 위치하면, 횡방향 오프셋 양은 양의 값을 취하여, 확인될 제1 중간점을 대칭 중심선으로 이동하게 하며; 안구 키 포인트 및 제1 얼굴 윤곽 키 포인트가 오른쪽 얼굴 영역에 위치하면, 횡방향 오프셋 양은 양의 값을 취하여, 확인될 제1 중간점을 얼굴 윤곽선으로 이동하게 하며; 안구 키 포인트 및 제1 얼굴 윤곽 키 포인트가 오른쪽 얼굴 영역에 위치하면, 횡방향 오프셋 양은 음의 값을 취하여, 확인될 제1 중간점을 대칭 중심선으로 이동하게 한다.In one possible implementation form, if the first distance is not equal to the second distance, the midpoint to be identified through the offset amount may be moved to the facial contour, for example an eye key point and a first facial contour key point is located in the left face region, the lateral offset amount takes a negative value, causing the first midpoint to be identified to be shifted to the face outline; if the eye key point and the first facial contour key point are located in the left facial region, the lateral offset amount takes a positive value, causing the first midpoint to be identified to be moved to the symmetrical center line; if the eye key point and the first facial contour key point are located in the right facial region, the lateral offset amount takes a positive value, causing the first midpoint to be identified to be moved to the facial contour; If the eye key point and the first facial contour key point are located in the right face region, the lateral offset amount takes a negative value, causing the first midpoint to be identified to be moved to the symmetrical center line.

목표 영역이 원형 영역이면, 사용자에 의해 설정된 목표 영역의 반경 및 제1 중간점에 근거하여 얼굴 영역에서 목표 영역을 결정할 수 있다. 하나의 목표 영역의 반경을 결정하는 구현 방식에 있어서, 목표 영역의 반경은 얼굴 영역의 면적에 따라 결정된다. 다른 하나의 목표 영역의 반경을 결정하는 구현 방식에 있어서, 목표 영역의 반경은 또한 제1 얼굴 이미지에 따른 딥 러닝 모델에 의한 추정에 의해 획득될 수 있다.If the target area is a circular area, the target area may be determined from the face area based on the first midpoint and the radius of the target area set by the user. In the implementation manner of determining the radius of one target region, the radius of the target region is determined according to the area of the face region. In another implementation manner of determining the radius of the target area, the radius of the target area may also be obtained by estimation by a deep learning model according to the first face image.

또한, 상기 단계 S120은, In addition, the step S120,

상기 제1 중간점 및 눈꼬리 키 포인트에 기반하여, 상기 목표 영역을 결정하는 단계를 더 포함한다.The method further includes determining the target area based on the first midpoint and the key point of the corner of the eye.

하나의 가능한 구현 형태에 있어서, 선형 보간 알고리즘을 이용하여 제1 얼굴 이미지에서의 제1 중간점 및 눈꼬리 키 포인트의 좌표를 얻음으로써, 목표 영역의 원형 반경 또는 장축 및 단축을 산출한다. 목표 영역이 원형이면, 제1 중간점을 원형 영역의 원심으로 하여, 산출된 목표 영역의 원형 반경을 반경으로 취함으로써, 목표 영역을 구성할 수 있다. 목표 영역이 타원형이면, 제1 중간점은 타원형 영역의 중심이므로, 장축 또는 단축 중 하나를 결정한 다음, 기설정된 장축 및 단축 사이의 비율에 기반하여, 다른 하나의 축도 결정되며, 중심, 장축 및 단축이 모두 결정되면, 타원형의 목표 영역도 따라서 결정된다.In one possible implementation form, a circular radius or major and minor axis of the target area is calculated by obtaining the coordinates of the first midpoint and the corner key point in the first face image using a linear interpolation algorithm. If the target region is circular, the target region can be configured by using the first intermediate point as the centrifugal point of the circular region and taking the calculated circular radius of the target region as the radius. If the target area is an ellipse, since the first midpoint is the center of the elliptical area, one of the major axis or the minor axis is determined, and then the other axis is also determined based on a preset ratio between the major axis and the minor axis, and includes a center, a major axis and a minor axis. When all of these are determined, the elliptical target area is also determined accordingly.

상기는 선형 보간 알고리즘의 예일 뿐이고, 구체적인 구현은 상기 어느 한 항에 한정되지 않는다.The above is only an example of a linear interpolation algorithm, and a specific implementation is not limited to any one of the above.

측면 얼굴 이미지에 대해, 상기 단계 S120은, For the side face image, the step S120 is

상기 방향이 상기 제1 얼굴 이미지가 측면 얼굴 이미지임을 나타내는 것으로 결정될 경우, 제2 얼굴 윤곽 키 포인트 및 콧방울 키 포인트에 기반하여, 상기 목표 영역의 제2 중간점을 결정하는 단계를 포함할 수 있다.If it is determined that the direction indicates that the first face image is a side face image, determining a second midpoint of the target area based on a second facial contour key point and a nose bridge key point.

애플존 조정이 수행될 경우, 얼굴 방향이 상이하므로, 상이한 키 포인트를 선택하여 목표 영역을 결정할 수 있다.When the apple zone adjustment is performed, since the face directions are different, a target area can be determined by selecting different key points.

예를 들어, 측면 얼굴 이미지에서의 제2 얼굴 윤곽 키 포인트는 정면 얼굴 이미지의 제1 얼굴 윤곽 키 포인트와 상이하다. 제2 얼굴 윤곽 키 포인트는 세로 좌표가 제2 목표 범위 내에서의 얼굴 윤곽 키 포인트일 수 있고, 여기서, 제2 목표 범위는 애플존에 의해 커버되는 영역의 세로 좌표 범위와 제5 기설정 범위의 합이고, 제5 기설정 범위는 상기 제3 기설정 범위보다 작다. 선택적으로, 도 4에 도시된 키 포인트 4, 키 포인트 5, 키 포인트 27 및 키 포인트 28은 모두 제2 얼굴 윤곽 키 포인트이다.For example, the second facial contour key point in the side face image is different from the first facial contour key point in the front face image. The second facial contour key point may be a facial contour key point whose ordinate is within a second target range, wherein the second target range is the ordinate of the area covered by the apple zone and the fifth preset range. sum, and the fifth preset range is smaller than the third preset range. Optionally, key point 4, key point 5, key point 27 and key point 28 shown in FIG. 4 are all second facial contour key points.

본 실시예에서, 상기 콧방울 키 포인트는 정면 얼굴 이미지의 콧방울 키 포인트와 동일하고 도 4 도시된 키 포인트(80) 또는 키 포인트(81)를 선택하여 참조할 수 있다.In this embodiment, the key point of the nostril is the same as the key point of the nose of the front face image, and can be referred to by selecting the key point 80 or the key point 81 shown in FIG. 4 .

본 실시예에서, 상기 제2 중간점은 마찬가지로 제2 얼굴 윤곽 키 포인트 및 콧방울 키 포인트의 중점(아래에 확인될 제2 중간점으로 지칭됨)일 수 있으며, 또는 정면 참조 얼굴 이미지에서 오프셋 양을 이용하여 상기 확인될 제1 중간점을 이동하여 제1 중간점을 획득하는 방식으로 측면 얼굴 이미지에서의 확인될 제2 중간점을 이동하여 제2 중간점을 획득한다.In this embodiment, the second midpoint may likewise be the midpoint of the second facial contour key point and the nostril key point (referred to as the second midpoint to be identified below), or an offset amount in the frontal reference face image. The second midpoint is obtained by moving the second midpoint to be identified in the side face image in such a way that the first midpoint to be identified is moved using the method to obtain the first midpoint.

제2 중간점은 목표 영역의 중심점일 수 있다.The second midpoint may be a center point of the target area.

또한, 상기 단계 S120은, 상기 제2 중간점과 눈꼬리 키 포인트에 기반하여, 상기 목표 영역의 범위를 결정하는 단계를 더 포함할 수 있다.In addition, the step S120 may further include determining the range of the target area based on the second midpoint and the key point of the corner of the eye.

본 실시예에서, 상기 제2 중간점 및 눈꼬리 키 포인트는 선형 보간 알고리즘에 기반하여 상기 목표 영역의 반경 등 결정 범위의 파라미터를 획득할 수 있음으로써, 상기 제1 얼굴 이미지에서 상기 목표 영역의 범위를 결정한다.In the present embodiment, the second midpoint and the key point of the corner of the eye may obtain a parameter of a determination range, such as a radius of the target area, based on a linear interpolation algorithm, thereby determining the range of the target area in the first face image. decide

일부 실시예에서, 상기 단계 S130은, In some embodiments, the step S130,

상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 파라미터를 결정하는 단계를 포함할 수 있다.Based on the key point and the direction, it may include determining an adjustment parameter of the apple zone.

애플존의 최적화 조정을 구현하기 위해, 키 포인트 및 방향에 기반하여 구체적인 조정 파라미터를 결정할 수 있다.In order to implement the optimal adjustment of Apple Zone, specific adjustment parameters can be determined based on the key point and direction.

상이한 방향에 따라, 애플존의 조정 전략이 상이할 수 있다. 예를 들어, 정면 얼굴 이미지의 조정 및 측면 얼굴 이미지의 조정에 있어서, 조정 방향 및 각도 중 적어도 하나는 상이하며, 대응하는 조정 전략도 상이하다. 다시 예를 들어, 상기 방향이 상이하면, 상기 애플존의 밝기 및 그라디언트 중 적어도 하나에 대한 조정은 상이하다.According to different directions, Apple Zone's adjustment strategy may be different. For example, in the adjustment of the front face image and the adjustment of the side face image, at least one of the adjustment direction and the angle is different, and the corresponding adjustment strategy is also different. Again, for example, if the directions are different, the adjustment of at least one of the brightness and the gradient of the Apple Zone is different.

예를 들어, 상기 단계 S130은 구체적으로, 상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 방향을 결정하는 단계를 포함할 수 있다.For example, the step S130 may specifically include determining an adjustment direction of the apple zone based on the key point and the direction.

상기 방향이 상이하면, 애플존의 조정 방향은 상이하다.If the directions are different, the direction of adjustment of the apple zone is different.

이미지 미화가 수행될 경우, 일반적으로 애플존에 대해 풀업 또는 스웰 조정을 수행할 필요가 있으며, 얼굴 방향이 상이하므로, 풀업의 구체적인 방향 또는 스웰의 구체적인 방향은 상이하다.When image beautification is performed, it is generally necessary to perform pull-up or swell adjustment for the apple zone, and since the face direction is different, the specific direction of the pull-up or the specific direction of the swell is different.

일부 실시예에서, 상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 방향을 결정하는 단계는, In some embodiments, the determining of the adjustment direction of the apple zone based on the key point and the direction comprises:

상기 방향이 제1 얼굴 이미지가 정면 얼굴 이미지임을 나타낼 경우, 상기 키 포인트에 기반하여 애플존의 조정 방향이 제1 방향이라고 결정하는 단계; 및determining that the adjustment direction of the Apple Zone is the first direction based on the key point when the direction indicates that the first face image is a front face image; and

상기 방향이 제1 얼굴 이미지가 측면 얼굴 이미지임을 나타낼 경우, 상기 키 포인트에 기반하여 애플존의 조정 방향이 제2 방향 및 제3 방향이라고 결정하는 단계 - 상기 제3 방향은 상기 제2 방향과 상이함 - 를 포함한다.when the direction indicates that the first face image is a side face image, determining that the adjustment directions of the apple zone are a second direction and a third direction based on the key point, wherein the third direction is different from the second direction includes -.

일부 실시예에서, 상기 제3 방향은 상기 제2 방향과 상이한 경우, 제3 방향은 상기 제2 방향에 수직되는 것을 포함하지만 이에 한정되지 않는다.In some embodiments, when the third direction is different from the second direction, the third direction includes, but is not limited to, being perpendicular to the second direction.

예를 들어, 측면 얼굴 이미지에 대해 목표 영역은 두 방향으로 이동하는데, 하나는 목표 영역을 눈 방향으로 풀업하고, 다른 하나는 목표 영역을 얼굴의 가장자리를 향해 이동시키는 것이며, 선택적으로, 제3 방향은 제2 방향에 수직된다.For example, for a side face image, the target area is moved in two directions, one is to pull up the target area toward the eyes, the other is to move the target area toward the edge of the face, optionally in a third direction is perpendicular to the second direction.

그러나 애플존의 조정 효과를 최적화하기 위해, 본 실시예에서, 상기 제1 방향은 상기 제1 중간점이 상기 눈꼬리 키 포인트를 가리키는 방향일 수 있고; 상기 제2 방향은 상기 제2 중간점이 상기 눈꼬리 키 포인트를 가리키는 방향일 수 있으며; 상기 제3 방향은, 제2 얼굴 윤곽 키 포인트가 가리키는 콧방울 키 포인트의 반대 방향(즉, 상기 콧방울 키 포인트로부터 상기 제2 얼굴 윤곽 키 포인트를 가리키는 방향)이다.However, in order to optimize the adjustment effect of the apple zone, in this embodiment, the first direction may be a direction in which the first midpoint points to the corner of the eye key point; The second direction may be a direction in which the second intermediate point points to the eye corner key point; The third direction is a direction opposite to the nostril key point pointed to by the second facial contour key point (ie, a direction pointing from the nostril key point to the second facial contour key point).

얼굴 윤곽 키 포인트 및 눈꼬리 키 포인트는 모두 제1 얼굴 이미지로부터 검출되므로, 분포 자체가 얼굴의 특징을 반영하며, 이러한 방식으로, 얼굴 윤곽 키 포인트 및 눈꼬리 키 포인트에 기반하여, 조정된 제1 방향, 제2 방향 및 제3 방향을 결정하며, 실질적으로 상이한 얼굴에 대해 개별 조정을 수행하고, 애플존의 최적화 조정을 구현할 수 있다.Since both the facial contour key points and the eye tail key points are detected from the first facial image, the distribution itself reflects the facial features, and in this way, based on the facial contour key points and the eye tail key points, the adjusted first direction; It is possible to determine the second direction and the third direction, perform individual adjustments for substantially different faces, and implement the optimal adjustment of the Apple Zone.

구체적으로, 상기 단계 S130은, Specifically, the step S130,

눈꼬리 키 포인트 및 눈머리 키 포인트에 기반하여, 상기 애플존의 최대 이동 거리를 결정하는 단계를 포함할 수 있다.Based on the key point of the corner of the eye and the key point of the head of the eye, determining the maximum moving distance of the apple zone may include.

상기 눈꼬리 키 포인트 및 눈머리 키 포인트사이의 거리는 실질적으로 제1 얼굴 이미지에서 눈의 길이이며; 예를 들어, 눈꼬리 키 포인트 및 눈머리 키 포인트 사이는 M 개의 픽셀로 격리되면, 상기 최대 거리는 M*A 개의 픽셀일 수 있다. A는 1보다 작은 양수일 수 있다. 또한, 예를 들어, 상기 A의 값은 0.44 내지 0.74 사이의 양수일 수 있다.the distance between the corner key point and the eyebrow key point is substantially the length of the eye in the first facial image; For example, if the distance between the eye corner key point and the eye head key point is M pixels, the maximum distance may be M*A pixels. A may be a positive number less than 1. Also, for example, the value of A may be a positive number between 0.44 and 0.74.

일부 실시예에서, 상기 애플존의 실제 이동 거리는 사용자 조작에 기반하여 결정할 수 있으며, 예를 들어, 사용자는 휴먼-머신 인터랙션 인터페이스에 사용자 조작을 입력하고, 사용자 조작에 따라 실제 이동 거리를 결정한다. 사용자 조작에 기반하여 산출된 이동 거리가 상기 최대 이동 거리보다 크면, 상기 최대 이동 거리를 상기 애플존의 실제 이동 거리로 사용하여 애플존에 대해 조정을 수행한다.In some embodiments, the actual movement distance of the apple zone may be determined based on a user operation, for example, the user inputs the user operation into the human-machine interaction interface, and determines the actual movement distance according to the user operation. If the movement distance calculated based on the user manipulation is greater than the maximum movement distance, the Apple Zone is adjusted using the maximum movement distance as the actual movement distance of the Apple Zone.

일부 실시예에서, 상기 단계 S130은, In some embodiments, the step S130,

상기 방향이 제1 얼굴 이미지가 측면 얼굴 이미지임을 나타내면, 얼굴 편향각 및 상기 최대 이동 거리에 따라, 측면 얼굴 이미지의 애플존의 실제 이동 거리를 결정하는 단계를 포함할 수 있다.If the direction indicates that the first face image is a side face image, determining an actual moving distance of the apple zone of the side face image according to the face deflection angle and the maximum moving distance.

본 실시예에서, 키 포인트에 기반하여 애플존의 최대 이동 거리를 결정할 수 있으며, 상기 최대 이동 거리는 목표 영역의 최대 이동 거리이다.In this embodiment, the maximum movement distance of the Apple Zone may be determined based on the key point, and the maximum movement distance is the maximum movement distance of the target area.

본 실시예에서, 눈의 키 포인트를 상기 키 포인트로 하여, 눈의 치수에 기반하여 애플존의 최대 이동 거리를 결정한다.In this embodiment, using the key point of the eye as the key point, the maximum moving distance of the apple zone is determined based on the size of the eye.

하나의 가능한 구현 형태에 있어서, 상기 실제 이동 거리와 측면 얼굴 이미지에서의 얼굴 편향각와 양의 상관 관계를 나타낸다. 예를 들어, 일부 실시예에서, 얼굴 편향각이 90도 또는 -90도일 때, 실제 이동 거리는 상기 최대 이동 거리일 수 있다. 얼굴 편향각이 90도 및 -90도가 아닌 경우, 실제 이동 거리=상기 최대 이동 거리*a이며, 여기서, a는 1보다 작은 양수이다.In one possible implementation form, a positive correlation between the actual moving distance and a face deflection angle in the side face image is shown. For example, in some embodiments, when the face deflection angle is 90 degrees or -90 degrees, the actual moving distance may be the maximum moving distance. When the face deflection angle is not 90 degrees and -90 degrees, the actual movement distance = the maximum movement distance * a, where a is a positive number less than 1.

물론 상기는 예일 뿐이고, 상기에 한정되지 않는 많은 특정 구현 방식이 존재한다.Of course, the above is merely an example, and there are many specific implementations that are not limited thereto.

일부 실시예에서, 상기 이미지 처리 방법은 아래 단계를 더 포함한다. In some embodiments, the image processing method further comprises the following steps.

단계 S150에 있어서, 제2 얼굴 이미지에서의 애플존에 대해 브라이트닝 처리를 수행하여, 제3 얼굴 이미지를 획득한다.In step S150, a brightening process is performed on the apple zone in the second face image to obtain a third face image.

제2 얼굴 이미지는 제1 얼굴 이미지에 대해 애플존으로 하여금 얼굴에서 이동하게 한다. 본 실시예에서, 이동된 애플존에 대해 브라이트닝 처리를 수행하여, 애플존으로 하여금 더욱 충만하고 풍성하게 보이도록 한다.The second facial image causes Applezone to move in the face relative to the first facial image. In this embodiment, a brightening process is performed on the moved Apple Zone to make the Apple Zone appear fuller and fuller.

일부 실시예에서, 상기 브라이트닝 처리에서, 애플존에서 상이한 위치에 대한 픽셀의 브라이트닝 수준은 상이하다. 예를 들어, 애플존의 최고점 위치에서 애플존의 주변으로의 브라이트닝 수준은 순차적으로 감소됨으로써, 애플존의 최고점의 위치는 가장 높은 밝기를 가지며, 다음, 밝기는 애플존 주변 피부 픽셀과 동일한 밝기로 점진적으로 천천히 감소하여, 한편으로 애플존으로 하여금 조정된 후 더욱 자연스럽게 보이도록 하는 동시에 애플존의 상이한 위치에서의 밝기 차이를 이용하여 애플존의 입체 효과를 나타낸다.In some embodiments, in the brightening process, the brightening level of the pixel for different locations in the apple zone is different. For example, the brightness level from the highest point of the Apple Zone to the periphery of the Apple Zone is sequentially decreased, so that the location of the highest point of the Apple Zone has the highest brightness, and then the brightness is set to the same brightness as the skin pixels around the Apple Zone. It decreases gradually and slowly, on the one hand, making the Apple Zone look more natural after being adjusted, and at the same time using the difference in brightness at different positions of the Apple Zone to show the three-dimensional effect of the Apple Zone.

일부 실시예에서, 상기 이미지 처리 방법은, In some embodiments, the image processing method comprises:

상기 제2 얼굴 이미지로부터 얼굴의 피부색 파라미터를 획득하는 단계; 및obtaining a skin color parameter of the face from the second face image; and

상기 얼굴 피부색 파라미터에 기반하여, 애플존 브라이트닝 처리를 위한 브라이트닝 파라미터를 결정하는 단계를 더 포함하며;based on the facial skin color parameter, further comprising determining a brightening parameter for the apple zone brightening treatment;

상기 단계 S150은, 상기 브라이트닝 파라미터에 기반하여 상기 제2 얼굴 이미지에서의 애플존에 대해 브라이트닝 처리를 수행하여, 상기 제3 얼굴 이미지를 획득하는 단계를 포함할 수 있다.The step S150 may include performing a brightening process on the apple zone in the second face image based on the brightening parameter to obtain the third face image.

한 가지 방식에 있어서, 상이한 얼굴 이미지에 대해 단일한 브라이트닝 파라미터를 사용하여 브라이트닝을 수행함으로써, 원래의 어두운 얼굴 이미지가, 브라이트닝 후 애플존이 매우 부자연스러운 현상이 발생하지만, 원래 피부색이 밝은 얼굴 이미지에 대해, 브라이트닝을 수행한 후의 애플존의 브라이트닝 효과는 불명확하다. 본 실시예에서, 얼굴 이미지의 피부색 파라미터를 획득하고, 상기 피부색 파라미터는, In one way, by performing brightening using a single brightening parameter for different face images, the original dark face image is very unnatural in the apple zone after brightening, but the original dark face image is very unnatural to the face image with light skin color. In contrast, the brightening effect of Apple Zone after brightening is unclear. In this embodiment, a skin color parameter of the face image is obtained, and the skin color parameter is

얼굴 이미지에서 피부 픽셀의 생상 값 및 얼굴 이미지에서 눈 및 입술 사이의 피부 픽셀의 생상 값, 얼굴 이미지에서 피부 픽셀의 그레이 스케일 히스토그램 및 얼굴 이미지에서 눈 및 입술 사이의 피부 픽셀의 생상 값, 얼굴 이미지에서 피부 픽셀의 생상 값 및 얼굴 이미지에서 눈 및 입술 사이의 피부 픽셀의 그레이 스케일 히스토그램, 얼굴 이미지에서 피부 픽셀의 그레이 스케일 히스토그램 및 얼굴 이미지에서 눈 및 입술 사이의 피부 픽셀의 그레이 스케일 히스토그램 중 적어도 하나를 포함하지만 이에 한정되지 않는다.Brightness values of skin pixels in a face image and liveness values of skin pixels between eyes and lips in a face image, grayscale histogram of skin pixels in a face image, and vivid values of skin pixels between eyes and lips in a face image, in a face image contains at least one of the raw values of skin pixels and a grayscale histogram of skin pixels between eyes and lips in a face image, a grayscale histogram of skin pixels in a face image, and a grayscale histogram of skin pixels between eyes and lips in a face image However, the present invention is not limited thereto.

상기 피부색 파라미터에 기반하여 애플존 및 애플존 주변의 피부의 밝기 평균치 또는 중간 휘도 등을 결정할 수 있어, 상기 평균치 또는 중간 밝기에 기반하여 애플존 영역의 픽셀의 브라이트닝 파라미터를 결정함으로써, 애플존 및 애플존 주변의 피부를 구분하는 동시에 애플존 및 애플존 주변의 피부 차이를 감소시킬 수 있다.Based on the skin color parameter, it is possible to determine the average brightness or intermediate brightness of the skin around the Apple Zone and the Apple Zone. It is possible to differentiate the skin around the zone and at the same time reduce the difference between the skin around the apple zone and the apple zone.

상기 브라이트닝 파라미터는 브라이트닝 폭 및 브라이트닝 비율 중 적어도 하나를 포함하지만 이에 한정되지 않는다.The brightening parameter includes, but is not limited to, at least one of a brightening width and a brightening ratio.

브라이트닝 애플존의 구체적인 구현 방식은 복수 개가 있으며, 본 실시예에서, 마스크 이미지를 이용하여 브라이트닝을 수행한다.There are a plurality of specific implementation methods of the brightening apple zone, and in this embodiment, brightening is performed using a mask image.

일부 실시예에서, 상기 애플존을 브라이트닝하는 것은, In some embodiments, brightening the Apple Zone comprises:

상기 브라이트닝 폭에 기반하여 애플존의 원래 픽셀 값에 하나의 대응하는 브라이트닝 폭을 추가하면, 브라이트닝 후의 픽셀 값을 획득할 있으며, 애플존 영역 내 모든 픽셀에 대해 브라이트닝 처리를 완료한 후, 브라이트닝 후의 애플존을 획득하고, 제3 얼굴 이미지를 획득하는 것을 포함할 수 있으며; If one corresponding brightening width is added to the original pixel value of the apple zone based on the brightening width, the pixel value after brightening can be obtained. acquiring a zone, and acquiring a third face image;

다른 일부 실시예에서, 상기 애플존을 브라이트닝하는 것은, In some other embodiments, brightening the Apple Zone comprises:

상기 브라이트닝 비율에 기반하여 애플존의 원래 픽셀 값에 상기 브라이트닝 비율을 곱하여 브라이트닝 후의 픽셀 값을 획득할 수 있으며, 애플존 영역 내 모든 픽셀에 대해 브라이트닝 처리를 완료한 후, 브라이트닝 후의 애플존을 획득하고, 제3 얼굴 이미지를 획득하는 것을 포함할 수 있다.Based on the brightening ratio, the pixel value after brightening can be obtained by multiplying the original pixel value of the apple zone by the brightening ratio. , obtaining a third face image.

일부 실시예에서, 상기 단계 S150은, 상기 제2 얼굴 이미지에서의 애플존의 위치에 따라, 마스크 이미지를 생성하는 단계; 및 상기 마스크 이미지에 기반하여, 상기 제2 얼굴 이미지에 대해 상기 애플존의 브라이트닝 처리를 수행하여 상기 제3 얼굴 이미지를 획득하는 단계를 포함할 수 있다.In some embodiments, the step S150 may include: generating a mask image according to the location of the apple zone in the second face image; and obtaining the third face image by performing the Apple Zone brightening process on the second face image based on the mask image.

상기 단계 S150은, The step S150 is,

제2 얼굴 이미지에서의 애플존의 위치를 결정하는 단계; determining the location of the apple zone in the second face image;

상기 위치에 기반하여 상기 제2 얼굴 이미지와 동일한 치수를 갖는 하나의 마스크 이미지를 형성하는 단계 - 상기 마스크 이미지는 제2 얼굴 이미지의 위치에서 반투명 브라이트닝 할로를 형성하며; 다른 위치는 투명 영역임 - ; 및 forming one mask image having the same dimensions as the second facial image based on the position, the mask image forming a translucent brightening halo at the position of the second facial image; Other locations are transparent areas - ; and

상기 마스크 이미지를 상기 제2 얼굴 이미지에 중첩하여 상기 제3 얼굴 이미지를 생성하는 단계를 포함할 수 있다.The method may include generating the third face image by superimposing the mask image on the second face image.

이때, 상기 마스크 이미지에서의 브라이트닝 할로의 밝기 값은 바로 브라이트닝 후의 애플존의 밝기 값이므로, 상기 브라이트닝 파라미터는, 브라이트닝 후의 애플존의 밝기 값을 더 포함할 수 있다.In this case, since the brightness value of the brightening halo in the mask image is the brightness value of the apple zone immediately after brightening, the brightening parameter may further include the brightness value of the apple zone after brightening.

도 7은 본 실시예에서 제공한 마스크 이미지의 모식도이다. 도 5에서 화이트 할로 영역은 애플존을 브라이트닝하기 위해 조정된 애플존이 위치한 영역과 중첩되는 영역이다.7 is a schematic diagram of a mask image provided in this embodiment. In FIG. 5 , the white halo area overlaps the area where the apple zone adjusted to brighten the apple zone is located.

애플존에 대해 브라이트닝을 수행하는 다른 하나의 방식은, 상기 제2 얼굴 이미지에서의 애플존의 위치에 따라, 마스크 이미지를 생성하는 단계가, Another method of performing brightening for the Apple Zone includes the steps of generating a mask image according to the location of the Apple Zone in the second face image,

미리 설정된 애플존 브라이트닝의 밝은 점, 및 상기 제2 얼굴 이미지에서의 애플존의 위치에 따라, 상기 밝은 점을 포함한 상기 마스크 이미지를 생성하는 단계를 포함하는 것; according to the preset bright point of the apple zone brightening and the position of the apple zone in the second face image, generating the mask image including the bright point;

및, and,

상기 마스크 이미지에 기반하여, 상기 제2 얼굴 이미지에 대해 상기 애플존의 브라이트닝 처리를 수행하여 상기 제3 얼굴 이미지를 획득하는 단계가, obtaining the third face image by performing the Apple Zone brightening process on the second face image based on the mask image;

상기 마스크 이미지의 픽셀 값이 소정의 임계값보다 큰 픽셀을, 상기 제2 얼굴 이미지에 대응하는 위치 픽셀의 제1 픽셀 값에 혼합하여, 혼합된 제2 픽셀 값를 획득하는 단계; 및obtaining a mixed second pixel value by mixing pixels having a pixel value greater than a predetermined threshold value of the mask image with a first pixel value of a position pixel corresponding to the second face image; and

상기 제2 픽셀 값에 기반하여, 상기 제3 얼굴 이미지를 생성하는 단계를 포함하는 것 중 적어도 하나이다.based on the second pixel value, generating the third face image.

일부 실시예에서, 애플존의 밝은 점은 미리 결정될 수 있고, 상기 밝은 점의 모양 및 밝기는 모두 미리 결정될 수 있다. 이러한 방식으로, 마스크 이미지의 생성 속도를 가속화할 수 있다.In some embodiments, the bright point of the apple zone may be predetermined, and both the shape and brightness of the bright dot may be predetermined. In this way, the speed of generating the mask image can be accelerated.

마스크 이미지에서의 애플존의 밝은 점의 위치는, 제2 얼굴 이미지에서 애플존의 위치에 대응한다. 예를 들어, 제1 얼굴 이미지에서 키 포인트의 검출을 수행하고, 제1 얼굴 이미지 및 제2 얼굴 이미지는 애플존에서만 일부가 변환되지만, 변환은 여전히 얼굴 범위 내에 있고, 큰 움직임이 아니므로, 제2 얼굴 이미지에서 애플존이 위치한 영역은 단계 S110에서 검출된 키 포인트에 따라 결정될 수 있으며; 예를 들어, 단계 S120에서 결정된 목표 영역에 따라; 또는, 목표 영역 및 실제 이동 거리에 기반하여, 제2 얼굴 이미지에서의 애플존이 위치한 영역을 획득하고, 상기 영역에 기반하여 대응하는 상기 밝은 점을 마스크 이미지에 추가한다.The position of the bright dot of the apple zone in the mask image corresponds to the position of the apple zone in the second face image. For example, the detection of key points in the first face image is performed, and the first face image and the second face image are partially transformed only in the apple zone, but the transformation is still within the face range, and there is no large movement, so 2 The area where the apple zone is located in the face image may be determined according to the key point detected in step S110; For example, according to the target area determined in step S120; Alternatively, an area in which the apple zone is located in the second face image is obtained based on the target area and the actual moving distance, and the corresponding bright point is added to the mask image based on the area.

본 실시예에서, 상기 마스크 이미지에서 밝은 점의 위치의 픽셀 값은 상기 소정의 임계값보다 크고, 밝은 점의 위치의 픽셀 값 이외의 픽셀 값은 모두 상기 소정의 임계값보다 작거나 같다. 이러한 방식으로 픽셀 혼합을 수행할 경우, 대량의 연산에 적합한 그래픽 프로세싱 유닛(GPU)과 같은 연산 모듈을 사용할 수 있어, 마스크 이미지에서의 픽셀을 순회할 경우, 픽셀 값을 소정의 임계값과 비교함으로써, 상기 픽셀이 제2 얼굴 이미지에서의 픽셀과 혼합되어야 하는지 여부를 결정한다. 예를 들어, 제2 얼굴 이미지가 RGB 이미지이면, 제2 얼굴 이미지는 3 가지 색상 채널을 포함하며, 이 3 가지 색상 채널의 각 픽셀에는 모두 대응하는 픽셀 값이 있고, 마스크 이미지에서 M 번째 픽셀의 픽셀 값이 상기 소정의 임계값보다 크면, 마스크 이미지에서 M 번째 픽셀의 픽셀 값 및 상기 제2 얼굴 이미지에서 M 번째 픽셀의 3 개 색상 채널의 생상 값에 대해 혼합을 수행한 후, 이 3 가지 색상 채널의 혼합된 값을 결합하여 상기 제2 픽셀 값을 획득한다. 여기서 혼합은, 선형 혼합 또는 비선형 혼합일 수 있다. 본 실시예에서, 상기 마스크 이미지 및 제2 얼굴 이미지의 혼합은 바람직하게 비선형 혼합이고, 이러한 방식으로 획득한 애플존의 브라이트닝 효과는 더 우수하다.In the present embodiment, the pixel value at the position of the bright point in the mask image is greater than the predetermined threshold, and all pixel values other than the pixel value at the position of the bright dot are less than or equal to the predetermined threshold. When performing pixel blending in this way, it is possible to use a computation module such as a graphics processing unit (GPU) suitable for a large amount of computation, so that when traversing the pixels in the mask image, the pixel value is compared with a predetermined threshold. , determine whether the pixel should be blended with the pixel in the second face image. For example, if the second face image is an RGB image, the second face image contains three color channels, each pixel of the three color channels all have a corresponding pixel value, and the Mth pixel in the mask image If the pixel value is greater than the predetermined threshold value, after performing blending on the pixel value of the M-th pixel in the mask image and the production values of the three color channels of the M-th pixel in the second face image, these three colors The second pixel value is obtained by combining the mixed values of the channels. Here, the mixing may be a linear mixing or a non-linear mixing. In this embodiment, the mixing of the mask image and the second face image is preferably non-linear mixing, and the brightening effect of the apple zone obtained in this way is better.

상기 비선형 혼합의 구체적인 함수 관계는 다음과 같을 수 있다.A specific functional relationship of the nonlinear mixing may be as follows.

Sqrt(original color)*(a*mask color-1.0)+b*original color*(c-mask color), 여기서, original color는 제2 얼굴 이미지에서의 제1 픽셀 값이고; mask color는 마스크 이미지에서의 픽셀 값이며; a, b, c는 모두 알려진 계산 파라미터이다. 구체적인 값은 요구에 따라 설정될 수 있다.Sqrt(original color)*(a*mask color-1.0)+b*original color*(c-mask color), where original color is the first pixel value in the second face image; mask color is the pixel value in the mask image; a, b and c are all known computational parameters. The specific value can be set according to the request.

Sqrt는 제곱근풀이를 의미하고, Sqrt(original color)는 제1 픽셀 값에 대한 제곱근풀이를 의미한다.Sqrt means square root solution, and Sqrt (original color) means square root solution for the first pixel value.

본 실시예에서, 상기 a의 값 및 b의 값은 동일할 수 있고, 예를 들어, original color 및 mask color가 모두 0과 1 사이의 값으로 정규화된 후, 상기 a 및 b의 값은 모두 2.0일 수 있으며; 상기 c의 값은 1.0일 수 있다.In this embodiment, the value of a and the value of b may be the same, for example, after both the original color and the mask color are normalized to a value between 0 and 1, the values of a and b are both 2.0 can be; The value of c may be 1.0.

요컨대, 상기 a, b 및 c의 값은 동일하거나, 상이할 수 있다.In other words, the values of a, b, and c may be the same or different.

일부 실시예에서, 픽셀 값을 혼합하기 전에 픽셀 값 또는 생상 값에 대해 정규화 처리를 수행하여, 획득된 픽셀 값 또는 생상 값은 모두 0과 1 사이에 위치한 데이터이다. 이 경우, 한편으로, 상이한 비트 수의 색상 채널에 의해 형성된 이미지라도, 0과 1 사이에 위치한 동일한 픽셀 값 또는 생상 값을 얻을 수도 있다. 다른 한편으로, 정규화 처리를 통해, 후속 픽셀 혼합 계산에 수반되는 값이 크게 감소되어, 계산을 단순화한다.In some embodiments, normalization processing is performed on pixel values or product values before mixing the pixel values, so that the pixel values or product values obtained are all data located between 0 and 1. In this case, on the one hand, even if an image is formed by color channels of different bit numbers, the same pixel value or product value located between 0 and 1 may be obtained. On the other hand, through the normalization process, the value involved in the subsequent pixel blending calculation is greatly reduced, thereby simplifying the calculation.

일부 실시예에서, 상기 소정의 임계값은 0.4, 0.45, 0.5, 0.55 및 0.6 등 값일 수 있다. 상기 소정의 임계값의 범위는 0.4 내지 0.6일 수 있다.In some embodiments, the predetermined threshold may be a value such as 0.4, 0.45, 0.5, 0.55, and 0.6. The range of the predetermined threshold value may be 0.4 to 0.6.

또한, 상기 이미지 처리 방법은, 제어 파라미터를 획득하는 단계를 더 포함하며; Also, the image processing method further comprises: obtaining a control parameter;

상기 제2 픽셀 값에 기반하여, 상기 제3 얼굴 이미지를 생성하는 단계는, Based on the second pixel value, generating the third face image includes:

상기 제어 파라미터, 상기 제2 픽셀 값 및 상기 제1 픽셀 값에 기반하여 선형 혼합을 수행하여, 제3 픽셀 값을 획득하는 단계; 및performing linear mixing based on the control parameter, the second pixel value, and the first pixel value to obtain a third pixel value; and

상기 제3 픽셀 값에 기반하여, 상기 제3 얼굴 이미지를 생성하는 단계를 포함한다.and generating the third face image based on the third pixel value.

본 실시예에서 상기 제어 파라미터는 이미지 기기에 의해 휴먼-머신 인터랙션 인터페이스 또는 다른 기기로부터 수신된 외부 제어 파라미터일 수 있고, 제어 애플존의 브라이트닝 수준을 제어하는데 사용할 수 있으며, 애플존 브라이트닝의 수준 제어 파라미터이다.In this embodiment, the control parameter may be an external control parameter received from a human-machine interaction interface or another device by the imaging device, and may be used to control the brightening level of the control apple zone, and the level control parameter of the apple zone brightening. am.

제2 필셀 값을 획득한 후, 제어 파라미터와 제1 픽셀 값에 기반하여 선형 혼합을 수행하여, 상기 제3 픽셀 값을 획득한다. 예를 들어, 상기 제어 파라미터가 비율 파라미터이면, A(RGB1)+RGB2=RGB3을 기반으로 할 수 있다. 예를 들어, A는 상기 제어 파라미터일 수 있고; 상기 RGB1는 제2 얼굴 이미지의 원래 제1 픽셀 값일 수 있으며; RGB2는 혼합된 상기 제2 픽셀 값일 수 있고; RGB3는 다시 혼합한 후 상기 제3 얼굴 이미지를 형성하는 제3 픽셀 값일 수 있다.After obtaining the second pixel value, linear mixing is performed based on the control parameter and the first pixel value to obtain the third pixel value. For example, if the control parameter is a ratio parameter, it may be based on A(RGB1)+RGB2=RGB3. For example, A may be the control parameter; the RGB1 may be the original first pixel value of the second face image; RGB2 may be the mixed second pixel value; RGB3 may be a third pixel value that forms the third face image after mixing again.

본 실시예에서 상기 제3 얼굴 이미지는 제2 픽셀 값을 직접 이용하여 생성되지 않고, 원래 제2 얼굴 이미지 및 혼합된 제2 픽셀 값을 이용하여 다시 선형 혼합하여, 상기 제3 얼굴 이미지를 획득하며, 이러한 방식으로, 애플존의 브라이트닝은 하여금 더욱 자연스러울 수 있고, 이미지 처리 효과도 더욱 우수하다.In this embodiment, the third face image is not generated using the second pixel value directly, but is linearly mixed again using the original second face image and the mixed second pixel value to obtain the third face image, , In this way, the brightening of Apple Zone can be more natural, and the image processing effect is better.

이해해야 할 것은, 본 발명의 실시예는 얼굴 이미지에서의 애플존의 목표 영역 조정에 대해 상세히 설명하고, 실제 응용에서 본 발명의 실시예에서 제공된 기술 방안에 근거하여 이미지에서의 이마 영역, 턱 영역, 광대뼈 영역 등에 대해 조정할 수 있다.It should be understood that the embodiment of the present invention describes in detail the adjustment of the target region of the apple zone in the face image, and in actual application, based on the technical solution provided in the embodiment of the present invention, the forehead region, the chin region, It can be adjusted for the cheekbone area, etc.

도 8에 도시된 바와 같이, 본 실시예에 의해 제공된 이미지 처리 장치(1)는, As shown in Fig. 8, the image processing apparatus 1 provided by the present embodiment includes:

제1 얼굴 이미지의 키 포인트를 검출하기 위한 검출 유닛(11); a detecting unit 11 for detecting a key point of the first face image;

상기 키 포인트에 기반하여, 애플존에 의해 조정된 목표 영역을 결정하기 위한 제1 결정 유닛(12); a first determining unit (12) for determining, based on the key point, a target area adjusted by the Apple Zone;

상기 키 포인트에 기반하여, 애플존의 조정 파라미터를 결정하기 위한 제2 결정 유닛(13); 및a second determining unit (13) for determining, based on the key point, an adjustment parameter of the apple zone; and

상기 조정 파라미터에 기반하여, 상기 목표 영역을 조정하여 제2 얼굴 이미지를 형성하기 위한 조정 유닛(14)을 포함한다.and an adjustment unit (14) for adjusting the target area to form a second face image, based on the adjustment parameter.

본 발명의 임의의 실시형태와 결합하면, 상기 이미지 처리 장치(1)는, Combined with any embodiment of the present invention, the image processing device 1 comprises:

상기 제1 얼굴 이미지에서 얼굴의 방향을 결정하기 위한 제3 결정 유닛(15)을 더 포함하며; a third determining unit (15) for determining a direction of a face in the first face image;

상기 제1 결정 유닛(12)은, The first determining unit 12,

상기 키 포인트 및 상기 방향에 기반하여, 애플존에 의해 조정된 상기 목표 영역을 결정하기 위한 것이다based on the key point and the direction, to determine the target area adjusted by the applezone.

본 발명의 임의의 실시형태와 결합하면, 상기 키 포인트는, 눈꼬리 키 포인트, 제1 얼굴 윤곽 키 포인트 및 콧방울 키 포인트를 포함하며; Combined with any of the embodiments of the present invention, the key points include an eye corner key point, a first facial contour key point and a nostril key point;

상기 제2 결정 유닛(13)은, The second determining unit 13,

상기 방향이 제1 얼굴 이미지가 정면 얼굴 이미지임을 나타내는 것으로 결정될 경우, 상기 제1 얼굴 윤곽 키 포인트 및 상기 콧방울 키 포인트에 기반하여, 상기 목표 영역의 제1 중간점을 결정하고;if it is determined that the direction indicates that the first facial image is a frontal facial image, determine a first midpoint of the target area based on the first facial contour key point and the nostril key point;

상기 제1 중간점 및 상기 눈꼬리 키 포인트에 기반하여, 상기 목표 영역을 결정하기 위한 것이다.Based on the first midpoint and the key point of the corner of the eye, the target area is determined.

본 발명의 임의의 실시형태와 결합하면, 상기 키 포인트는 눈꼬리 키 포인트, 제2 얼굴 윤곽 키 포인트 및 콧방울 키 포인트를 포함하며;In combination with any of the embodiments of the present invention, the key points include an eye corner key point, a second facial contour key point and a nostril key point;

상기 제1 결정 유닛(12)은, The first determining unit 12,

상기 방향이 상기 제1 얼굴 이미지가 측면 얼굴 이미지임을 나타내는 것으로 결정될 경우, 상기 제2 얼굴 윤곽 키 포인트 및 상기 콧방울 키 포인트에 기반하여, 상기 목표 영역의 제2 중간점을 결정하고;if it is determined that the direction indicates that the first face image is a side face image, determine a second midpoint of the target area based on the second facial contour key point and the nostril key point;

상기 제2 중간점과 상기 눈꼬리 키 포인트에 기반하여, 상기 목표 영역을 결정하기 위한 것이다.Based on the second midpoint and the key point of the corner of the eye, the target area is determined.

본 발명의 임의의 실시형태와 결합하면, 상기 제2 결정 유닛(13)은, Combined with any embodiment of the present invention, the second determining unit 13 comprises:

상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 방향을 결정하기 위한 것이다.Based on the key point and the direction, to determine the adjustment direction of the apple zone.

본 발명의 임의의 실시형태와 결합하면, 상기 제3 결정 유닛(15)은, Combined with any embodiment of the present invention, the third determining unit 15 comprises:

상기 방향이 제1 얼굴 이미지가 정면 얼굴 이미지임을 나타낼 경우, 상기 키 포인트에 기반하여 애플존의 조정 방향이 제1 방향이라고 결정하기 위한 것이다.When the direction indicates that the first face image is a front face image, it is determined that the adjustment direction of the Apple Zone is the first direction based on the key point.

본 발명의 임의의 실시형태와 결합하면, 상기 제3 결정 유닛(15)은 또한, Combined with any embodiment of the present invention, the third determining unit 15 also

상기 방향이 제1 얼굴 이미지가 측면 얼굴 이미지임을 나타낼 경우, 상기 키 포인트에 기반하여 애플존의 조정 방향이 제2 방향 및 제3 방향이라고 결정하기 위한 것이고, 여기서, 상기 제3 방향은 상기 제2 방향과 상이하다.when the direction indicates that the first face image is a side face image, determining that the adjustment directions of the apple zone are a second direction and a third direction based on the key point, wherein the third direction is the second direction different from the direction

본 발명의 임의의 실시형태와 결합하면, 상기 제1 방향은, 상기 목표 영역의 제1 중간점이 눈꼬리 키 포인트를 가리키는 방향이다.Combined with any embodiment of the present invention, the first direction is a direction in which the first midpoint of the target area points to the corner key point.

본 발명의 임의의 실시형태와 결합하면, 상기 제2 방향은, 상기 목표 영역의 제2 중간점이 눈꼬리 키 포인트를 가리키는 방향이다.Combined with any of the embodiments of the present invention, the second direction is a direction in which the second midpoint of the target area points to the corner key point.

상기 제3 방향은, 콧방울 키 포인트가 목표 영역을 결정하는 제2 얼굴 윤곽 키 포인트를 가리키는 방향이다.The third direction is a direction in which the nose bridge key point points to the second facial contour key point determining the target area.

본 발명의 임의의 실시형태와 결합하면, 상기 제2 결정 유닛(13)은, Combined with any embodiment of the present invention, the second determining unit 13 comprises:

상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 폭을 결정하기 위한 것이다.based on the key point and the direction, to determine an adjustment width of the apple zone.

본 발명의 임의의 실시형태와 결합하면, 상기 제2 결정 유닛(13)은, Combined with any embodiment of the present invention, the second determining unit 13 comprises:

눈꼬리 키 포인트 및 눈머리 키 포인트에 기반하여, 상기 애플존의 최대 이동 거리를 결정하고;determining the maximum moving distance of the apple zone based on the key points of the corners of the eyes and the key points of the corners of the eyes;

상기 방향이 상기 제1 얼굴 이미지가 측면 얼굴 이미지임을 나타낼 경우, 얼굴 편향각 및 상기 최대 이동 거리에 따라, 상기 제1 얼굴 이미지의 애플존의 실제 이동 거리를 결정하기 위한 것이다.When the direction indicates that the first face image is a side face image, an actual moving distance of the apple zone of the first face image is determined according to a face deflection angle and the maximum moving distance.

본 발명의 임의의 실시형태와 결합하면, 상기 이미지 처리 장치(1)는, Combined with any embodiment of the present invention, the image processing device 1 comprises:

상기 제2 얼굴 이미지에서의 애플존에 대해 브라이트닝 처리를 수행하여, 제3 얼굴 이미지를 획득하기 위한 브라이트닝 처리 유닛(16)을 더 포함한다.and a brightening processing unit 16 for performing brightening processing on the apple zone in the second facial image to obtain a third facial image.

본 발명의 임의의 실시형태와 결합하면, 상기 브라이트닝 처리 유닛(16)은, Combined with any embodiment of the present invention, the brightening processing unit 16 comprises:

상기 제2 얼굴 이미지로부터 얼굴의 피부색 파라미터를 획득하고;obtain a skin color parameter of the face from the second face image;

상기 얼굴 피부색 파라미터에 기반하여, 애플존 브라이트닝 처리를 위한 브라이트닝 파라미터를 결정하며;determine a brightening parameter for apple zone brightening treatment based on the facial skin color parameter;

상기 브라이트닝 파라미터에 기반하여 상기 제2 얼굴 이미지에서의 애플존에 대해 브라이트닝 처리를 수행하여, 상기 제3 얼굴 이미지를 획득하기 위한 것이다.Brightening processing is performed on the apple zone in the second face image based on the brightening parameter to obtain the third face image.

본 발명의 임의의 실시형태와 결합하면, 상기 브라이트닝 처리 유닛(16)은, Combined with any embodiment of the present invention, the brightening processing unit 16 comprises:

상기 제2 얼굴 이미지에서의 애플존의 위치에 따라, 마스크 이미지를 생성하고;generate a mask image according to the position of the apple zone in the second face image;

상기 마스크 이미지에 기반하여, 상기 제2 얼굴 이미지에 대해 상기 애플존의 브라이트닝 처리를 수행하여 상기 제3 얼굴 이미지를 획득하기 위한 것이다.Based on the mask image, the Apple Zone brightening process is performed on the second face image to obtain the third face image.

본 발명의 임의의 실시형태와 결합하면, 상기 브라이트닝 처리 유닛(16)은, Combined with any embodiment of the present invention, the brightening processing unit 16 comprises:

기설정된 애플존 브라이트닝의 밝은 점, 및 상기 제2 얼굴 이미지에서의 애플존의 위치에 따라, 상기 밝은 점을 포함한 상기 마스크 이미지를 생성하기 위한 것이다.This is to generate the mask image including the bright point according to the preset bright point of the apple zone brightening and the position of the apple zone in the second face image.

본 발명의 임의의 실시형태와 결합하면, 상기 브라이트닝 처리 유닛(16)은, Combined with any embodiment of the present invention, the brightening processing unit 16 comprises:

상기 마스크 이미지의 픽셀 값이 소정의 임계값보다 큰 픽셀을, 상기 제2 얼굴 이미지에 대응하는 위치 픽셀의 제1 픽셀 값과 혼합하여, 혼합된 제2 픽셀 값를 획득하고;a pixel having a pixel value greater than a predetermined threshold value of the mask image is mixed with a first pixel value of a position pixel corresponding to the second face image to obtain a mixed second pixel value;

상기 제2 픽셀 값에 기반하여, 상기 제3 얼굴 이미지를 생성하기 위한 것이다.Based on the second pixel value, the third face image is generated.

본 발명의 임의의 실시형태와 결합하면, 상기 이미지 처리 장치(1)는, Combined with any embodiment of the present invention, the image processing device 1 comprises:

제어 파라미터를 획득하기 위한 획득 유닛(17)을 더 포함하며; an acquiring unit 17 for acquiring the control parameter;

상기 브라이트닝 처리 유닛(16)은, The brightening processing unit 16,

상기 제어 파라미터, 상기 제2 픽셀 값 및 상기 제1 픽셀 값에 기반하여 선형 혼합을 수행하여, 제3 픽셀 값을 획득하고;perform linear mixing based on the control parameter, the second pixel value, and the first pixel value to obtain a third pixel value;

상기 제3 픽셀 값에 기반하여, 상기 제3 얼굴 이미지를 생성하기 위한 것이다.Based on the third pixel value, the third face image is generated.

다음 상기 실시예에 기반하여 두 개의 구체적인 예를 제공한다.Next, two specific examples are provided based on the above embodiment.

예 1에 있어서, In Example 1,

애플존 조정 방법은 다음의 단계를 포함할 수 있다.The apple zone adjustment method may include the following steps.

1) 제1 얼굴 이미지에서의 애플존 범위 영역을 위로 당긴다. 1) Pull up the Apple Zone area in the first face image.

2) 제1 얼굴 이미지가 측면 얼굴 이미지일 때 풀업 외에도, 또한 제1 얼굴 이미지의 얼굴 편향각에 따라 이 영역을 바깥쪽으로 확장한다. 2) In addition to the pull-up when the first face image is a side face image, also extend this area outward according to the face deflection angle of the first face image.

3) 마스크(mask) 텍스처를 사용하여 애플존이 위치한 영역을 브라이트닝한다.3) Use a mask texture to brighten the area where the Apple Zone is located.

도 9에 도시된 바와 같이, 제1 얼굴 이미지의 애플존이 위치한 영역에 대해 애플존 풀업 또는 횡방향 확장 조작을 수행하여, 제2 얼굴 이미지를 획득한다. 도 9에서 제1 얼굴 이미지에 대한 제2 얼굴 이미지의 점선 원형 영역은 상기 애플존이 위치한 목표 영역일 수 있고; 제2 마스크 이미지 및 제2 얼굴 이미지를 합병한 후 애플존이 브라이트닝된 제3 얼굴 이미지를 획득한다.As shown in FIG. 9 , a second face image is obtained by performing an apple zone pull-up or lateral expansion operation on an area in which the apple zone of the first face image is located. In FIG. 9 , the dotted circular area of the second face image with respect to the first face image may be the target area in which the apple zone is located; After merging the second mask image and the second face image, a third face image in which the Apple Zone is brightened is obtained.

예 2에 있어서, In Example 2,

제1 얼굴 이미지에서의 왼쪽 얼굴 영역을 예로 들어, 애플존에 의해 조정된 예를 제공하며,다음을 포함한다.Taking the left face region in the first face image as an example, an example adjusted by Applezone is provided, and includes the following.

1. 제1 얼굴 이미지가 정면 얼굴 이미지인 경우, 제1 얼굴 이미지에서 애플존 범위의 영역(상기 목표 영역에 대응함)을 끌어 당긴다. 1. When the first face image is a front face image, an area within the apple zone (corresponding to the target area) is drawn from the first face image.

1) 키 포인트 5와 키 포인트 80의 중점을 풀링 영역(원형 영역)의 중간점으로 계산하며, 풀링 영역의 최대 이동 거리는 키 포인트 52 및 키 포인트 55 사이의 거리의 k 배로 설정되고, k는 양의 정수이며, 실제 요구에 기반하여 구성을 수행할 수 있으며; 1) Calculate the midpoint of key point 5 and key point 80 as the midpoint of the pooling area (circular area), the maximum travel distance of the pooling area is set to k times the distance between key point 52 and key point 55, where k is positive is an integer, and configuration can be performed based on actual needs;

2) 풀업 방향은 풀링 영역의 중간점에서 키 포인트 52(목표점)로 향하는 방향이며, 풀링 영역의 범위(반경)는 중간점에서 목표점까지의 선형 보간에 의해 획득되며; 2) the pull-up direction is from the midpoint of the pulling area to the key point 52 (target point), and the range (radius) of the pulling area is obtained by linear interpolation from the midpoint to the target point;

2. 제1 얼굴 이미지가 측면 얼굴 이미지인 경우, 애플존이 위치한 영역을 풀업하는 외에도, 또한 제1 얼굴 이미지의 얼굴 편향각에 따라 이 영역을 바깥쪽으로 확장한다. 2. When the first face image is a side face image, in addition to pulling up the area where the apple zone is located, this area is also extended outward according to the face deflection angle of the first face image.

1) 제1 얼굴 이미지의 얼굴 편향각에 근거하여 하나의 확장 영역을 결정할 수 있고, 키 포인트 4를 확장 영역의 중간점으로 하고, 확장 영역의 최대 이동 거리는 당기는 거리와 동일하며, 동시에 얼굴 편향각과 양의 상관 관계가 있다. 1) One extension area can be determined based on the face deflection angle of the first face image, and the key point 4 is the midpoint of the extension area, and the maximum moving distance of the extension area is equal to the pulling distance, and at the same time the face deflection angle and the There is a positive correlation.

2) 키 포인트 4를 확장 영역의 중간점으로 하고, 확장 방향은 키 포인트 4에서 키 포인트 80으로 향하는 방향과 반대이며, 확장 영역의 범위(반경)는 중간점에서 목표점까지의 선형 보간에 의해 획득된다. 2) Let key point 4 be the midpoint of the extension region, the extension direction is opposite to the direction from key point 4 to key point 80, and the extent (radius) of the extension region is obtained by linear interpolation from the midpoint to the target point do.

3. 마스크 텍스처를 사용하여 애플존의 영역을 브라이트닝한다.3. Use the mask texture to brighten the area of the apple zone.

1) 마지막으로 브라이트닝 처리를 수행하고, 즉 한장의 마스크 텍스처를 사용하고, 상기 무늬는 표준 얼굴 애플존 영역을 강조한 다음, 제1 얼굴 이미지와 색상을 혼합하여, 얼굴의 애플존 영역을 브라이트닝하고, 더 입체적으로 보이게 한다. 1) Finally perform a brightening process, that is, using a single mask texture, the pattern emphasizes the standard face apple zone area, and then blends the color with the first face image to brighten the apple zone area of the face, make it look more three-dimensional.

도 10에 도시된 바와 같이, 본 실시예에 의해 제공된 이미지 기기는, As shown in FIG. 10 , the imaging device provided by this embodiment includes:

메모리; 및 Memory; and

프로세서를 포함하며, 상기 프로세서는 상기 메모리에 연결되어, 상기 메모리에 위치한 컴퓨터 실행 가능한 명령어를 실행하는 것을 통해, 전술한 임의의 기술방안에서 제공된 이미지 처리 방법을 구현하며, 예를 들어, 도 1 및 도 3 중 적어도 하나에 도시된 이미지 처리 방법을 구현하기 위한 것이다.a processor, wherein the processor is coupled to the memory and executes computer-executable instructions located in the memory to implement the image processing method provided in any of the foregoing technical solutions, for example, FIG. 1 and This is to implement the image processing method shown in at least one of FIG. 3 .

상기 메모리는 램, 롬, 플래시 메모리 등과 같은 다양한 타입의 메모리일 수 있다. 상기 메모리는 정보, 예를 들어, 컴퓨터 실행 가능한 명령어 등을 저장하기 위한 것이다. 상기 컴퓨터 실행 가능한 명령어는 다양한 프로그램 명령어, 예를 들어, 타겟 프로그램 명령어 및 소스 프로그램 명령어 중 적어도 하나일 수 있다.The memory may be various types of memory, such as RAM, ROM, and flash memory. The memory is for storing information, for example, computer-executable instructions and the like. The computer-executable instructions may be various program instructions, for example, at least one of a target program instruction and a source program instruction.

상기 프로세서는 중앙 프로세서, 마이크로 프로세서, 디지털 신호 프로세서, 프로그램 가능 어레이, 디지털 신호 프로세서, 애플리케이션 특정 집적 회로 또는 이미지 프로세서와 같은 다양한 유형의 프로세서일 수 있다.The processor may be any type of processor, such as a central processor, microprocessor, digital signal processor, programmable array, digital signal processor, application specific integrated circuit, or image processor.

상기 프로세서는 버스를 통해 상기 메모리에 연결된다. 상기 버스는 집적 회로 버스 등일 수 있다.The processor is coupled to the memory via a bus. The bus may be an integrated circuit bus or the like.

일부 실시예에 있어서, 상기 이미지 기기는, 통신 인터페이스를 더 포함할 수 있고, 상기 통신 인터페이스는, 네트워크 인터페이스, 예를 들어, 랜 인터페이스, 송수신 안테나 등을 포함할 수 있다. 마찬가지로 상기 통신 인터페이스는 상기 프로세서에 연결되어, 정보의 송수신에 사용될 수 있다.In some embodiments, the imaging device may further include a communication interface, and the communication interface may include a network interface, for example, a LAN interface, a transmission/reception antenna, and the like. Likewise, the communication interface may be connected to the processor and used to transmit and receive information.

일부 실시예에 있어서, 상기 이미지 기기는 휴먼-머신 인터랙션 인터페이스를 더 포함하고, 예를 들어, 상기 휴먼-머신 인터랙션 인터페이스는 다양한 입력 출력 기기, 예를 들어, 키보드 및 터치 스크린 등을 포함할 수 있다.In some embodiments, the imaging device further includes a human-machine interaction interface, for example, the human-machine interaction interface may include various input and output devices, for example, a keyboard and a touch screen. .

본 발명의 실시예는 컴퓨터 실행 가능한 코드가 저장되어 있는 컴퓨터 저장 매체를 제공하고; 상기 컴퓨터 실행 가능한 명령어가 실행된 후, 이미지 기기, 데이터베이스, 및 제1 사설 네트워크에서 하나 또는 복수 개의 기술 방안에 의해 제공되는 도 1 및 도 2 중 적어도 하나에 도시된 이미지 처리 방안과 같은 이미지 처리 방법에 적용될 수 있다An embodiment of the present invention provides a computer storage medium having computer executable code stored thereon; After the computer-executable instructions are executed, an image processing method such as the image processing method shown in at least one of FIGS. 1 and 2 provided by one or a plurality of technical methods in an image device, a database, and a first private network can be applied to

상기 컴퓨터 저장 매체는 CD, 플로피 디스크, 하드 디스크, 자기 테이프, 광 디스크, U 디스크, 또는 모바일 하드 디스크 다양한 저장 매체와 같은 기록 기능을 갖는 다양한 매체를 포함할 수 있다. 선택적으로 상기 컴퓨터 저장 매체는 비 일시적 저장 매체일 수 있고, 상기 컴퓨터 저장 매체는 프로세서에 의해 판독될 수 있으므로, 컴퓨터 저장 매체에 저장된 컴퓨터 실행 가능한 명령이 제1 프로세서에 의해 획득 및 실행되어, 전술한 임의의 기술 방안에서 제공된 이미지 처리 방법을 구현하며, 예를 들어, 이미지 기기에 적용되는 이미지 처리 방법 또는 애플리케이션 서버에 적용되는 이미지 처리 방법이 실행된다.The computer storage medium may include various media having a recording function, such as a CD, a floppy disk, a hard disk, a magnetic tape, an optical disk, a U disk, or a mobile hard disk various storage media. Optionally, the computer storage medium may be a non-transitory storage medium, and the computer storage medium is readable by a processor, so that the computer-executable instructions stored in the computer storage medium are obtained and executed by the first processor, An image processing method provided in any technical solution is implemented, for example, an image processing method applied to an image device or an image processing method applied to an application server is executed.

본 실시예는 컴퓨터 프로그램 제품을 더 제공하고, 상기 컴퓨터 프로그램 제품은 컴퓨터 실행 가능한 명령어를 포함하며; 상기 컴퓨터 실행 가능한 명령어가 실행된 후, 전술한 하나 또는 복수 개의 기술 방안에서 제공된 이미지 처리 방법을 구현할 수 있으며, 예를 들어 도 3 및 도 5에 도시된 적어도 하나의 이미지 처리 방법을 포함한다.This embodiment further provides a computer program product, wherein the computer program product includes computer-executable instructions; After the computer-executable instruction is executed, the image processing method provided in one or more of the above-described technical solutions may be implemented, including, for example, at least one image processing method illustrated in FIGS. 3 and 5 .

상기 컴퓨터 저장 매체에 유형적으로 포함된 컴퓨터 프로그램을 포함하고, 컴퓨터 프로그램은 흐름도에 도시된 방법을 실행하기 위한 프로그램 코드를 포함하며, 프로그램 코드는 본 발명의 실시예에 제공된 방볍 단계에 대응하는 명령어를 포함할 수 있다.a computer program tangibly contained in the computer storage medium, wherein the computer program includes program code for executing the method shown in the flowchart, the program code comprising instructions corresponding to the method steps provided in the embodiments of the present invention. may include

본 발명에서 제공된 여러 실시예에서, 개시된 장치 및 방법은 다른 방식으로 구현될 수 있음을 이해해야 한다. 이상에서 설명한 장치 실시예는 다만 예시적인 것이고, 예를 들면 상기 유닛의 분할은 다만 논리적 기능 분할일 뿐이고 실제 응용시 다른 분할 방식이 있을 수 있으며, 예를 들어, 복수의 유닛 또는 컴포넌트는 다른 하나의 시스템에 조합 또는 통합될 수 있거나, 일부 특징은 생략되거나 실행되지 않을 수 있다. 또한, 나타내거나 논의된 각 구성 부분의 상호간의 결합 또는 직접 결합 또는 통신 연결은, 일부 인터페이스, 기기 또는 유닛을 통한 간접 결합 또는 통신 연결일 수 있으며, 전기, 기계 또는 다른 형태일 수 있다.In the various embodiments provided herein, it is to be understood that the disclosed apparatus and method may be implemented in other ways. The device embodiment described above is merely exemplary, for example, the division of the unit is only logical function division, and there may be other division methods in actual application, for example, a plurality of units or components are It may be combined or integrated into the system, or some features may be omitted or not implemented. In addition, the mutual coupling or direct coupling or communication connection of each component part shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.

상기 분리된 부품으로서 설명된 유닛은 물리적으로 분리되거나 분리되지 않을수 있고, 유닛으로서 디스플레이된 구성 요소는 물리적 유닛일 수 있거나 아닐수도 있으며, 또는 한 장소에 있거나, 복수 개의 너트웨크 유닛에 분포될 수 있으며; 실제 필요에 따라 그 중의 부분 또는 전부 유닛을 선택하여 본 실시예의 방안의 목적을 구현할 수 있다.A unit described as a separate part may or may not be physically separated, and a component displayed as a unit may or may not be a physical unit, or may be in one location or distributed in a plurality of network units; ; According to actual needs, some or all of the units may be selected to implement the purpose of the scheme of the present embodiment.

또한, 본 발명의 각 실시예 중의 각 기능 모듈은 모두 하나의 처리 유닛에 통합될 수 있으며, 각 유닛은 각각 단독적으로 하나의 유닛으로 사용될 수 있으며, 둘 또는 둘 이상의 유닛이 하나의 유닛에 통합될 수 있으며; 상기 통합된 유닛은 하드웨어의 형태로 구현될 수 있으며, 소프트웨어 기능 유닛의 형태로 구현될 수도 있다.In addition, each functional module in each embodiment of the present invention may all be integrated into one processing unit, each unit may be used alone as one unit, and two or more units may be integrated into one unit. can; The integrated unit may be implemented in the form of hardware or may be implemented in the form of a software functional unit.

당업자는 상기 방법 실시예를 구현하기 위한 모든 또는 일부 동작은 프로그램 명령어와 관련되는 하드웨어를 통해 완료될 수 있으며, 전술한 프로그램은 컴퓨터 판독 가능 저장 매체에 저장될 수 있으며, 상기 프로그램이 수행될 때, 수행은 상기 방법 실시예의 동작을 포함하며; 전술한 저장 매체는 모바일 저장 기기, 판독 전용 메모리(Read Only Memory, ROM), 랜덤 액세스 메모리(Random Access Memory, RAM), 자기 디스크 또는 광 디스크와 같은 프로그램 코드를 저장할 수 있는 다양한 매체를 포함한다.A person skilled in the art will know that all or part of the operations for implementing the embodiment of the method may be completed through hardware related to program instructions, and the above-described program may be stored in a computer-readable storage medium, and when the program is performed, performing includes operation of the method embodiment; The aforementioned storage medium includes various media capable of storing a program code such as a mobile storage device, a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

이상의 설명은 다만 본 발명의 구체적인 실시형태일뿐이고, 본 발명의 보호 범위는 이에 한정되지 않는다. 본 발명이 속하는 기술 분야의 통상의 기술자라면, 본 발명에서 개시된 기술적 범위 내의 변화 또는 교체가 모두 본 출원의 보호 범위 내에 속해야 함을 쉽게 알 수 있을 것이다. 따라서, 본 발명의 보호 범위는 특허청구범위의 보호 범위를 기준으로 해야 한다.The above description is only specific embodiments of the present invention, and the protection scope of the present invention is not limited thereto. Those of ordinary skill in the art to which the present invention pertains will readily appreciate that all changes or replacements within the technical scope disclosed in the present invention must fall within the protection scope of the present application. Accordingly, the protection scope of the present invention should be based on the protection scope of the claims.

Claims (36)

이미지 처리 방법으로서,
제1 얼굴 이미지의 키 포인트를 검출하는 단계;
상기 키 포인트에 기반하여, 애플존에 의해 조정된 목표 영역을 결정하는 단계;
상기 키 포인트에 기반하여, 애플존의 조정 파라미터를 결정하는 단계;
상기 조정 파라미터에 기반하여, 상기 목표 영역을 조정하여 제2 얼굴 이미지를 형성하는 단계;
기설정된 애플존 브라이트닝의 밝은 점, 및 상기 제2 얼굴 이미지에서의 애플존의 위치에 따라, 상기 밝은 점을 포함한 마스크 이미지를 생성하는 단계; 및
상기 마스크 이미지에 기반하여, 상기 제2 얼굴 이미지에 대해 상기 애플존의 브라이트닝 처리를 수행하여 제3 얼굴 이미지를 획득하는 단계를 포함하는 것을 특징으로 하는 이미지 처리 방법.
An image processing method comprising:
detecting a key point of the first face image;
determining a target area adjusted by the Apple Zone based on the key point;
determining an adjustment parameter of the Apple Zone based on the key point;
adjusting the target area based on the adjustment parameter to form a second face image;
generating a mask image including the bright point according to the preset bright point of the apple zone brightening and the position of the apple zone in the second face image; and
and obtaining a third face image by performing the Apple Zone brightening process on the second face image based on the mask image.
제1항에 있어서,
상기 키 포인트에 기반하여, 애플존에 의해 조정된 목표 영역을 결정하기 전에, 상기 이미지 처리 방법은,
상기 제1 얼굴 이미지에서 얼굴의 방향을 결정하는 단계를 더 포함하며;
상기 키 포인트에 기반하여, 애플존에 의해 조정된 목표 영역을 결정하는 단계는,
상기 키 포인트 및 상기 방향에 기반하여, 애플존에 의해 조정된 상기 목표 영역을 결정하는 단계를 포함하는 것을 특징으로 하는 이미지 처리 방법.
According to claim 1,
Before determining the target area adjusted by the Applezone based on the key point, the image processing method includes:
determining the orientation of the face in the first face image;
Determining the target area adjusted by the Apple Zone based on the key point comprises:
and determining the target area adjusted by the applezone based on the key point and the direction.
제2항에 있어서,
상기 키 포인트는, 눈꼬리 키 포인트, 제1 얼굴 윤곽 키 포인트 및 콧방울 키 포인트를 포함하며;
상기 키 포인트 및 상기 방향에 기반하여, 애플존에 의해 조정된 상기 목표 영역을 결정하는 단계는,
상기 방향이 제1 얼굴 이미지가 정면 얼굴 이미지임을 나타내는 것으로 결정될 경우, 상기 제1 얼굴 윤곽 키 포인트 및 상기 콧방울 키 포인트에 기반하여, 상기 목표 영역의 제1 중간점을 결정하는 단계; 및
상기 제1 중간점 및 상기 눈꼬리 키 포인트에 기반하여, 상기 목표 영역을 결정하는 단계를 포함하는 것을 특징으로 하는 이미지 처리 방법.
3. The method of claim 2,
the key points include an eyebrow key point, a first facial contour key point, and a nostril key point;
Determining the target area adjusted by the Apple Zone based on the key point and the direction comprises:
when it is determined that the direction indicates that the first facial image is a frontal facial image, determining a first midpoint of the target area based on the first facial contour key point and the nostril key point; and
and determining the target area based on the first midpoint and the key point of the corner of the eye.
제2항에 있어서,
상기 키 포인트는 눈꼬리 키 포인트, 제2 얼굴 윤곽 키 포인트 및 콧방울 키 포인트를 포함하며;
상기 키 포인트 및 상기 방향에 기반하여, 애플존에 의해 조정된 상기 목표 영역을 결정하는 단계는,
상기 방향이 상기 제1 얼굴 이미지가 측면 얼굴 이미지임을 나타내는 것으로 결정될 경우, 상기 제2 얼굴 윤곽 키 포인트 및 상기 콧방울 키 포인트에 기반하여, 상기 목표 영역의 제2 중간점을 결정하는 단계; 및
상기 제2 중간점과 상기 눈꼬리 키 포인트에 기반하여, 상기 목표 영역을 결정하는 단계를 포함하는 것을 특징으로 하는 이미지 처리 방법.
3. The method of claim 2,
the key points include an eyebrow key point, a second facial contour key point, and a nostril key point;
Determining the target area adjusted by the Apple Zone based on the key point and the direction comprises:
when it is determined that the direction indicates that the first face image is a side face image, determining a second midpoint of the target area based on the second facial contour key point and the nostril key point; and
and determining the target area based on the second midpoint and the key point of the corner of the eye.
제2항에 있어서,
상기 키 포인트에 기반하여, 애플존의 조정 파라미터를 결정하는 단계는,
상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 방향을 결정하는 단계를 포함하는 것을 특징으로 하는 이미지 처리 방법.
3. The method of claim 2,
Determining the adjustment parameter of the Apple Zone based on the key point comprises:
and determining an adjustment direction of the apple zone based on the key point and the direction.
제5항에 있어서,
상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 방향을 결정하는 단계는,
상기 방향이 제1 얼굴 이미지가 정면 얼굴 이미지임을 나타낼 경우, 상기 키 포인트에 기반하여 애플존의 조정 방향이 제1 방향이라고 결정하는 단계를 포함하는 것을 특징으로 하는 이미지 처리 방법.
6. The method of claim 5,
Determining the adjustment direction of the apple zone based on the key point and the direction comprises:
and determining that the adjustment direction of the Apple Zone is the first direction based on the key point when the direction indicates that the first face image is a front face image.
제5항에 있어서,
상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 방향을 결정하는 단계는,
상기 방향이 제1 얼굴 이미지가 측면 얼굴 이미지임을 나타낼 경우, 상기 키 포인트에 기반하여 애플존의 조정 방향이 제2 방향 및 제3 방향이라고 결정하는 단계 - 상기 제3 방향은 상기 제2 방향과 상이함 - 를 포함하는 것을 특징으로 하는 이미지 처리 방법.
6. The method of claim 5,
Determining the adjustment direction of the apple zone based on the key point and the direction comprises:
when the direction indicates that the first face image is a side face image, determining that the adjustment directions of the apple zone are a second direction and a third direction based on the key point - the third direction is different from the second direction An image processing method comprising:
제6항에 있어서,
상기 제1 방향은, 상기 목표 영역의 제1 중간점이 눈꼬리 키 포인트를 가리키는 방향인 것을 특징으로 하는 이미지 처리 방법.
7. The method of claim 6,
The first direction is an image processing method, characterized in that the first intermediate point of the target area is a direction in which the key point of the corner of the eye points.
제7항에 있어서,
상기 제2 방향은, 상기 목표 영역의 제2 중간점이 눈꼬리 키 포인트를 가리키는 방향이며; 상기 제3 방향은, 콧방울 키 포인트가 목표 영역을 결정하는 제2 얼굴 윤곽 키 포인트를 가리키는 방향인 것을 특징으로 하는 이미지 처리 방법.
8. The method of claim 7,
the second direction is a direction in which a second midpoint of the target area points to an eye corner key point; The third direction is an image processing method, characterized in that the nose bridge key point points to the second facial contour key point for determining the target area.
제2항에 있어서,
상기 키 포인트에 기반하여, 애플존의 조정 파라미터를 결정하는 단계는,
상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 폭을 결정하는 단계를 포함하는 것을 특징으로 하는 이미지 처리 방법.
3. The method of claim 2,
Determining the adjustment parameter of the Apple Zone based on the key point comprises:
and determining an adjustment width of the apple zone based on the key point and the direction.
제10항에 있어서,
상기 키 포인트 및 상기 방향에 기반하여, 상기 애플존의 조정 폭을 결정하는 단계는,
눈꼬리 키 포인트 및 눈머리 키 포인트에 기반하여, 상기 애플존의 최대 이동 거리를 결정하는 단계; 및
상기 방향이 상기 제1 얼굴 이미지가 측면 얼굴 이미지임을 나타낼 경우, 얼굴 편향각 및 상기 최대 이동 거리에 따라, 상기 제1 얼굴 이미지의 애플존의 실제 이동 거리를 결정하는 단계를 포함하는 것을 특징으로 하는 이미지 처리 방법.
11. The method of claim 10,
Determining the adjustment width of the apple zone based on the key point and the direction comprises:
determining the maximum moving distance of the apple zone based on the key point of the corner of the eye and the key point of the corner of the eye; and
when the direction indicates that the first face image is a side face image, determining an actual moving distance of the apple zone of the first face image according to a face deflection angle and the maximum moving distance Image processing method.
삭제delete 삭제delete 삭제delete 삭제delete 제1항에 있어서,
상기 마스크 이미지에 기반하여, 상기 제2 얼굴 이미지에 대해 상기 애플존의 브라이트닝 처리를 수행하여 상기 제3 얼굴 이미지를 획득하는 단계는,
상기 마스크 이미지의 픽셀 값이 소정의 임계값보다 큰 픽셀을, 상기 제2 얼굴 이미지에 대응하는 위치 픽셀의 제1 픽셀 값과 혼합하여, 혼합된 제2 픽셀 값를 획득하는 단계; 및
상기 제2 픽셀 값에 기반하여, 상기 제3 얼굴 이미지를 생성하는 단계를 포함하는 것을 특징으로 하는 이미지 처리 방법.
According to claim 1,
Acquiring the third face image by performing the apple zone brightening process on the second face image based on the mask image,
obtaining a mixed second pixel value by mixing a pixel of the mask image whose pixel value is greater than a predetermined threshold with a first pixel value of a position pixel corresponding to the second face image; and
and generating the third face image based on the second pixel value.
제16항에 있어서,
상기 이미지 처리 방법은,
제어 파라미터를 획득하는 단계를 더 포함하며;
상기 제2 픽셀 값에 기반하여, 상기 제3 얼굴 이미지를 생성하는 단계는,
상기 제어 파라미터, 상기 제2 픽셀 값 및 상기 제1 픽셀 값에 기반하여 선형 혼합을 수행하여, 제3 픽셀 값을 획득하는 단계; 및
상기 제3 픽셀 값에 기반하여, 상기 제3 얼굴 이미지를 생성하는 단계를 포함하는 것을 특징으로 하는 이미지 처리 방법.
17. The method of claim 16,
The image processing method is
further comprising obtaining a control parameter;
Based on the second pixel value, generating the third face image includes:
performing linear mixing based on the control parameter, the second pixel value, and the first pixel value to obtain a third pixel value; and
and generating the third face image based on the third pixel value.
이미지 처리 장치로서,
제1 얼굴 이미지의 키 포인트를 검출하기 위한 검출 유닛;
상기 키 포인트에 기반하여, 애플존에 의해 조정된 목표 영역을 결정하기 위한 제1 결정 유닛;
상기 키 포인트에 기반하여, 애플존의 조정 파라미터를 결정하기 위한 제2 결정 유닛;
상기 조정 파라미터에 기반하여, 상기 목표 영역을 조정하여 제2 얼굴 이미지를 형성하기 위한 조정 유닛; 및
기설정된 애플존 브라이트닝의 밝은 점, 및 상기 제2 얼굴 이미지에서의 애플존의 위치에 따라, 상기 밝은 점을 포함한 마스크 이미지를 생성하고; 상기 마스크 이미지에 기반하여, 상기 제2 얼굴 이미지에 대해 상기 애플존의 브라이트닝 처리를 수행하여 제3 얼굴 이미지를 획득하기 위한 브라이트닝 처리 유닛을 포함하는 것을 특징으로 하는 이미지 처리 장치.
An image processing device comprising:
a detection unit for detecting a key point of the first face image;
a first determining unit for determining, based on the key point, a target area adjusted by the apple zone;
a second determining unit for determining, based on the key point, an adjustment parameter of the apple zone;
an adjustment unit for adjusting the target area to form a second face image based on the adjustment parameter; and
generating a mask image including the bright point according to the preset bright point of the apple zone brightening and the position of the apple zone in the second face image; and a brightening processing unit configured to perform the apple zone brightening process on the second face image to obtain a third face image based on the mask image.
이미지 기기로서,
메모리; 및
상기 메모리에 연결되고, 상기 메모리에 저장된 컴퓨터 실행 가능한 명령어를 실행하여, 제1 항 내지 제11항, 제16항 및 제17항 중 어느 한 항에 따른 방법을 구현하기 위한 프로세서를 포함하는 것을 특징으로 하는 이미지 기기.
An imaging device comprising:
Memory; and
18. A processor, coupled to said memory, for executing computer-executable instructions stored in said memory to implement the method according to any one of claims 1 to 11, 16 or 17. imaging device.
컴퓨터 실행 가능한 명령어가 저장된 컴퓨터 저장 매체로서,
상기 컴퓨터 실행 가능한 명령어가 실행된 후, 제1항 내지 제11항, 제16항 및 제17항 중 어느 한 항에 따른 방법이 구현 가능한 것을 특징으로 하는 컴퓨터 저장 매체.
A computer storage medium storing computer-executable instructions, comprising:
A computer storage medium, characterized in that after the computer-executable instructions are executed, the method according to any one of claims 1 to 11, 16 and 17 can be implemented.
컴퓨터 판독 가능한 저장 매체에 저장되는 컴퓨터 프로그램으로서,
상기 컴퓨터 프로그램이 프로세서에 의해 실행될 때, 제1항 내지 제11항, 제16항 및 제17항 중 어느 한 항에 따른 방법을 구현하는 것을 특징으로 하는 컴퓨터 프로그램.
As a computer program stored in a computer-readable storage medium,
A computer program, characterized in that it implements the method according to any one of claims 1 to 11, 16 and 17 when the computer program is executed by a processor.
삭제delete 삭제delete 삭제delete 삭제delete 삭제delete 삭제delete 삭제delete 삭제delete 삭제delete 삭제delete 삭제delete 삭제delete 삭제delete 삭제delete 삭제delete
KR1020207019432A 2019-03-06 2019-12-11 Image processing method and apparatus, electronic device and storage medium KR102386642B1 (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN201910169460.X 2019-03-06
CN201910169460.XA CN109949237A (en) 2019-03-06 2019-03-06 Image processing method and device, vision facilities and storage medium
PCT/CN2019/124515 WO2020177434A1 (en) 2019-03-06 2019-12-11 Image processing method and apparatus, image device, and storage medium

Publications (2)

Publication Number Publication Date
KR20200107957A KR20200107957A (en) 2020-09-16
KR102386642B1 true KR102386642B1 (en) 2022-04-14

Family

ID=67009236

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020207019432A KR102386642B1 (en) 2019-03-06 2019-12-11 Image processing method and apparatus, electronic device and storage medium

Country Status (7)

Country Link
US (1) US11238569B2 (en)
JP (1) JP6990773B2 (en)
KR (1) KR102386642B1 (en)
CN (1) CN109949237A (en)
SG (1) SG11202006333VA (en)
TW (1) TWI752419B (en)
WO (1) WO2020177434A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109949237A (en) 2019-03-06 2019-06-28 北京市商汤科技开发有限公司 Image processing method and device, vision facilities and storage medium
CN111754415B (en) 2019-08-28 2022-09-27 北京市商汤科技开发有限公司 Face image processing method and device, image equipment and storage medium
CN110555896B (en) * 2019-09-05 2022-12-09 腾讯科技(深圳)有限公司 Image generation method and device and storage medium
CN111680546A (en) * 2020-04-26 2020-09-18 北京三快在线科技有限公司 Attention detection method, attention detection device, electronic equipment and storage medium
CN112001872B (en) * 2020-08-26 2021-09-14 北京字节跳动网络技术有限公司 Information display method, device and storage medium
CN112767288B (en) * 2021-03-19 2023-05-12 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium
CN113674139A (en) * 2021-08-17 2021-11-19 北京京东尚科信息技术有限公司 Face image processing method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004318204A (en) 2003-04-10 2004-11-11 Sony Corp Image processing device, image processing method, and photographing device
CN108230331A (en) * 2017-09-30 2018-06-29 深圳市商汤科技有限公司 Image processing method and device, electronic equipment, computer storage media
CN108876731A (en) * 2018-05-25 2018-11-23 北京小米移动软件有限公司 Image processing method and device
CN109376684A (en) 2018-11-13 2019-02-22 广州市百果园信息技术有限公司 A kind of face critical point detection method, apparatus, computer equipment and storage medium
CN109377446A (en) * 2018-10-25 2019-02-22 北京市商汤科技开发有限公司 Processing method and processing device, electronic equipment and the storage medium of facial image

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20040075672A (en) * 2003-02-21 2004-08-30 정보통신연구진흥원 A simulation method for hierarchical cyber face plastic surgery
JP2007193729A (en) 2006-01-23 2007-08-02 Seiko Epson Corp Printer, image processor, printing method and image processing method
JP2007193730A (en) 2006-01-23 2007-08-02 Seiko Epson Corp Printer, image processor, printing method and image processing method
JP2009064423A (en) * 2007-08-10 2009-03-26 Shiseido Co Ltd Makeup simulation system, makeup simulation device, makeup simulation method, and makeup simulation program
JP2009211513A (en) * 2008-03-05 2009-09-17 Toshiba Corp Image processing apparatus and method therefor
CN103236066A (en) * 2013-05-10 2013-08-07 苏州华漫信息服务有限公司 Virtual trial make-up method based on human face feature analysis
CN106991367B (en) * 2016-01-21 2019-03-19 腾讯科技(深圳)有限公司 The method and apparatus for determining face rotational angle
CN107103271A (en) * 2016-02-23 2017-08-29 芋头科技(杭州)有限公司 A kind of method for detecting human face
CN107305622B (en) * 2016-04-15 2021-08-31 北京市商汤科技开发有限公司 Face facial feature recognition method, device and system
CN108734070A (en) * 2017-04-24 2018-11-02 丽宝大数据股份有限公司 Blush guidance device and method
KR20200014280A (en) 2017-05-31 2020-02-10 소니 주식회사 An image processing apparatus, an image processing system, and an image processing method, and a program
CN108986019A (en) * 2018-07-13 2018-12-11 北京小米智能科技有限公司 Method for regulating skin color and device, electronic equipment, machine readable storage medium
CN109376671B (en) * 2018-10-30 2022-06-21 北京市商汤科技开发有限公司 Image processing method, electronic device, and computer-readable medium
CN109949237A (en) * 2019-03-06 2019-06-28 北京市商汤科技开发有限公司 Image processing method and device, vision facilities and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004318204A (en) 2003-04-10 2004-11-11 Sony Corp Image processing device, image processing method, and photographing device
CN108230331A (en) * 2017-09-30 2018-06-29 深圳市商汤科技有限公司 Image processing method and device, electronic equipment, computer storage media
CN108876731A (en) * 2018-05-25 2018-11-23 北京小米移动软件有限公司 Image processing method and device
CN109377446A (en) * 2018-10-25 2019-02-22 北京市商汤科技开发有限公司 Processing method and processing device, electronic equipment and the storage medium of facial image
CN109376684A (en) 2018-11-13 2019-02-22 广州市百果园信息技术有限公司 A kind of face critical point detection method, apparatus, computer equipment and storage medium

Also Published As

Publication number Publication date
US20200327647A1 (en) 2020-10-15
WO2020177434A1 (en) 2020-09-10
JP6990773B2 (en) 2022-01-12
US11238569B2 (en) 2022-02-01
KR20200107957A (en) 2020-09-16
TWI752419B (en) 2022-01-11
JP2021517676A (en) 2021-07-26
CN109949237A (en) 2019-06-28
SG11202006333VA (en) 2020-10-29
TW202036467A (en) 2020-10-01

Similar Documents

Publication Publication Date Title
KR102386642B1 (en) Image processing method and apparatus, electronic device and storage medium
JP6864449B2 (en) Methods and devices for adjusting the brightness of the image
US11423556B2 (en) Methods and systems to modify two dimensional facial images in a video to generate, in real-time, facial images that appear three dimensional
US11250241B2 (en) Face image processing methods and apparatuses, and electronic devices
US9639914B2 (en) Portrait deformation method and apparatus
US8698796B2 (en) Image processing apparatus, image processing method, and program
US8908904B2 (en) Method and system for make-up simulation on portable devices having digital cameras
JP7129502B2 (en) Face image processing method and device, image equipment and storage medium
CN110688948B (en) Method and device for transforming gender of human face in video, electronic equipment and storage medium
CN106920274A (en) Mobile terminal 2D key points rapid translating is the human face model building of 3D fusion deformations
US20140254939A1 (en) Apparatus and method for outputting information on facial expression
CN111339928B (en) Eye spirit adjusting method and device and storage medium
CN107452049B (en) Three-dimensional head modeling method and device
CN109952594A (en) Image processing method, device, terminal and storage medium
US9135726B2 (en) Image generation apparatus, image generation method, and recording medium
CN109242760B (en) Face image processing method and device and electronic equipment
CN110838084A (en) Image style transfer method and device, electronic equipment and storage medium
CN110580733A (en) Data processing method and device and data processing device
CN111311733A (en) Three-dimensional model processing method and device, processor, electronic device and storage medium
CN110580677A (en) Data processing method and device and data processing device
CN111652795A (en) Face shape adjusting method, face shape adjusting device, live broadcast method, live broadcast device, electronic equipment and storage medium
CN111652792B (en) Local processing method, live broadcasting method, device, equipment and storage medium for image
US20150379329A1 (en) Movement processing apparatus, movement processing method, and computer-readable medium
CN110852934A (en) Image processing method and apparatus, image device, and storage medium
CN114998115A (en) Image beautification processing method and device and electronic equipment

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant