为了提升用户体验,在OCR识别场景都将利用到边缘检测
涉及的权限
NSCameraUsageDescription
从CSDN下载Demo源码:https://download.csdn.net/download/u011018979/19260280
1、应用场景:为了提升用户体验,在OCR识别场景都将利用到边缘检测 2、原理:采用原生CoreImage框架下CIDetector可进行边缘检测,识别到边缘之后使用CAShapeLayer将边缘绘制并显示 3、原理文章:https://kunnan.blog.csdn.net/article/details/117367345
CoreImage
下CIDetector.h
自带了四种识别功能
/* 人脸识别 */
CORE_IMAGE_EXPORT NSString* const CIDetectorTypeFace NS_AVAILABLE(10_7, 5_0);
/* 矩形边缘识别 */
CORE_IMAGE_EXPORT NSString* const CIDetectorTypeRectangle NS_AVAILABLE(10_10, 8_0);
/* 二维码识别 */
CORE_IMAGE_EXPORT NSString* const CIDetectorTypeQRCode NS_AVAILABLE(10_10, 8_0);
/* 文本识别 */
#if __OBJC2__
CORE_IMAGE_EXPORT NSString* const CIDetectorTypeText NS_AVAILABLE(10_11, 9_0);
采用原生CoreImage
框架下CIDetector
可进行边缘检测
[CIDetector detectorOfType:CIDetectorTypeRectangle context:nil options:@{CIDetectorAccuracy : CIDetectorAccuracyHigh}];
识别到边缘之后使用CAShapeLayer
将边缘绘制并显示
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有