CIFaceFeature的所有属性都是只读的,请问自己创建一个实例,怎样初始化它的值啊?谢谢

benbenRH benbenRH 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
请教一问题,我新建一个CIFaceFeature对象:

CIFaceFeature *feture = [[CIFaceFeature alloc]init];

这个CIFaceFeature的所有属性都是只读的,请问自己创建一个实例,怎样初始化它的值啊?谢谢!

CIFaceFeature的定义如下(苹果的官方定义):

/** A face feature found by a CIDetector.
All positions are relative to the original image. */
CORE_IMAGE_CLASS_EXPORT
@interface CIFaceFeature : CIFeature
{
CGRect bounds;
BOOL hasLeftEyePosition;
CGPoint leftEyePosition;
BOOL hasRightEyePosition;
CGPoint rightEyePosition;
BOOL hasMouthPosition;
CGPoint mouthPosition;


BOOL hasTrackingID;
int trackingID;
BOOL hasTrackingFrameCount;
int trackingFrameCount;

BOOL hasFaceAngle;
float faceAngle;

BOOL hasSmile;
BOOL leftEyeClosed;
BOOL rightEyeClosed;

}

/** coordinates of various cardinal points within a face.

Note that the left eye is the eye on the left side of the face
from the observer's perspective. It is not the left eye from
the subject's perspective. */

@property (readonly, assign) CGRect bounds;
@property (readonly, assign) BOOL hasLeftEyePosition;
@property (readonly, assign) CGPoint leftEyePosition;
@property (readonly, assign) BOOL hasRightEyePosition;
@property (readonly, assign) CGPoint rightEyePosition;
@property (readonly, assign) BOOL hasMouthPosition;
@property (readonly, assign) CGPoint mouthPosition;

@property (readonly, assign) BOOL hasTrackingID;
@property (readonly, assign) int trackingID;
@property (readonly, assign) BOOL hasTrackingFrameCount;
@property (readonly, assign) int trackingFrameCount;

@property (readonly, assign) BOOL hasFaceAngle;
@property (readonly, assign) float faceAngle;

@property (readonly, assign) BOOL hasSmile;
@property (readonly, assign) BOOL leftEyeClosed;
@property (readonly, assign) BOOL rightEyeClosed;

@end

...全文
评论
收藏 已收藏
分享
返回顶部
benbenRH
iOS 29,037 成员 12,459 内容