“Recommended” now is more terrible?OpenCV-based beauty camera tells you

0 Comments

T1 method: PIP Install Dlib

This method is to use the computer to use the CMAKE, the Boost environment use T2 method: Conda install -c menpo dlib = 18.18

This method is suitable for computers that have been installed in the CONDA library, T3 method: PIP Install DLIB-19.8.1-CP36-CP36M-Win_AMD64.WHL

DLIB library WHL file – DLIB-19.7.0-CP36-CP36M-WIN_AMD64.RAR

DLIB-19.3.1-CP35-CP35M-WIN_AMD64.WHL

# 五 官
Class ORGAN ():
DEF __INIT __ (Self, IMG, IMG_HSV, TEMP_IMG, TEMP_HSV, LANDMARKS, NAME, KSIZE = NONE):
Self.img = IMG
SELF.IMG_HSV = IMG_HSV
Self.landmarks = landmarks
SELF.NAME = Name
Self.get_Rect ()
Self.shape = (int (self.bottom-self.top), int (Self.right-self.left))
Self.size = self.shape [0] * Self.Shape [1] * 3
Self.Move = Int (np.sqrt (Self.size / 3) / 20)
Self.ksize = self.get_ksize ()
Self.patch_img, self.patch_hsv = self.get_patch (self.img), self.get_patch (self.img_hsv)
SELF.SET_TEMP (Temp_img, Temp_HSV)
Self.patch_mask = self.get_mask_relative ()
# Get positioning box
DEF get_RECT (Self):
Y, x = self.landmarks [:, 1], self.landmarks [:, 0]
Self.top, Self.Bottom, Self.Left, Self.right = np.min (y), np.max (y), np.min (x), np.max (x)
# 获得 k k, Gaussian transformer parameters
Def get_ksize (self, rate = 15):
Size = max ([INT (np.sqrt (Self.size / 3) / Rate), 1])
Size = (size if size% 2 == 1 else size + 1)
Return (Size, Size)
# Interpret partial slices
Def get_patch (self, img):
Shape = IMG.SHAPE
Return img [Np.max ([Self.top-Self.move, 0]): np.min ([Self.Bottom + Self.move, Shape [0]]), Np.max ([Self.Left-Self) .move, 0]): np.min ([Self.right + Self.Move, Shape [1]])]
DEF set_temp (self, temp_img, temp_hsv):
SELF.IMG_TEMP, SELF.HSV_TEMP = TEMP_IMG, TEMP_HSV
Self.patch_img_temp, self.patch_hsv_temp = self.get_patch (self.img_temp), self.get_patch (Self.hsv_temp)
# confirm
DEF Confirm (Self):
Self.Img [:], self.img_hsv [:] = self.img_temp [:], self.hsv_temp [:]
# renew
DEF UPDATE_TEMP (Self):
Self.img_temp [:], self.hsv_temp [:] = self.img [:], self.Img_hsv [:]
# 画 多
DEF _DRAW_CONVEX_HULL (Self, IMG, Points, Color):
Points = Cv2.convexhull (Points)
Cv2.fillconvexPoly (IMG, Points, Color = Color)
# Get partial relative coordinates cover
DEF GET_MASK_RELATIVE (Self, Ksize = None):
IF ksize == none:
KSIZE = SELF.KSIZE
Landmarks_re = self.landmarks.copy ()
Landmarks_re [:, 1] – = np.max ([Self.top-Self.Move, 0])
Landmarks_re [:, 0] – = np.max ([Self.Left-Self.move, 0])
Mask = np.zeros (Self.Patch_img.shape [: 2], DTYPE = np.float64)
Self._draw_convex_hull (Mask, Landmarks_re, Color = 1)
Mask = np.array ([Mask, Mask, Mask]). Transpose ((1, 2, 0))
Mask = (cv2.gaussianblur (mask, ksize, 0)> 0) * 1.0
Return Cv2.gaussianBlur (Mask, Ksize, 0) [:]
# Get global absolute coordinates cover
DEF GET_MASK_ABS (Self, ksize = none):
IF ksize == none:
KSIZE = SELF.KSIZE
Mask = np.zeros (Self.img.Shape, DTYPE = np.float64)
PATCH = Self.get_patch (MASK)
Patch [:] = Self.patch_mask [:]
Return Mask

Warning: Can only detect less than 5000 characters

Introduction

「推荐」现在的美颜特效有多可怕?基于Opencv的美颜相机告诉你

Every time I go out every time, my girlfriend likes to take pictures!BUT dislikes the photo of the photo to shoot is wrong, the light is not good …….

In short, the reason why I let me take pictures, the level of the camera is good!Be

Be

Sure enough, you are doing exercise, at least now I can see which young sisters who have bought themselves have batch photos.Be

「推荐」现在的美颜特效有多可怕?基于Opencv的美颜相机告诉你

Be

「推荐」现在的美颜特效有多可怕?基于Opencv的美颜相机告诉你

Can’t escape

I can’t escape, in order to get rid of this situation –

Rapida wrote a simple version of the beauty camera to secretly use her!This is not worried about being hammer.Wisdom is like me .jpg

text

「推荐」现在的美颜特效有多可怕?基于Opencv的美颜相机告诉你

Environmental installation:

DLIB library installation this blog offers three ways to install

Cv2 library installation method:

PIP Install OpenCV-Python

Human face facial features, coordinates, Gaussian blurred treatment, etc.

The treatment of the main beauty effect is as follows:

Be

「推荐」现在的美颜特效有多可怕?基于Opencv的美颜相机告诉你

Be

Be

「推荐」现在的美颜特效有多可怕?基于Opencv的美颜相机告诉你

The effect is as follows:

Be

嘿嘿 – Little sister is not a lot of white!

Summarize

「推荐」现在的美颜特效有多可怕?基于Opencv的美颜相机告诉你

This article is here!If you need to completely package your best, you can see it: [Private letter Xiaobian 06] can be charged free!

Remember attention, comment, praise three even oh ~

「推荐」现在的美颜特效有多可怕?基于Opencv的美颜相机告诉你

Be