大家虽然经常用到美颜api接口相关的功能,但是大部分用户并不是很了解技术层面的问题。今天小编就来跟大家分享一下美颜SDK常用功能“背后”的小知识,请耐心阅读。
一、人脸关键点识别
美颜api接口中最常用的就是人脸关键点识别算法,几乎每一个美颜功能的实现都离不开人脸关键点识别技术的帮助,由此可见它的重要性。人脸识别算法是怎么实现的呢?首先,拍摄时美颜sdk会自动识别出人脸区域和非人脸区域,然后精准提取人脸的五官信息并回馈。
二、磨皮算法
磨皮功能是美颜里比较重要的功能之一,磨皮功能的实现是基于“人脸磨皮算法”。磨皮算法的关键点就是将图像中皮肤部分进行“打磨”,使皮肤变得光滑。
三、美白
美白功能是最常见的功能,同时也是用户们最常用的一个功能。此功能背后的算法比较简单,美颜算法通过调整目标内的数值,数值越大、越接近255的时候,图片也就越白,等于255时即为纯白;反之,数值越小、越接近0的时候就是纯黑,等于0时即为纯黑。
四、代码分析
<?xml version="1.0" encoding="UTF-8"?><key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>使用相机</string>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>