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

benbenRH 2014-04-17 08:47:57
请教一问题,我新建一个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

...全文
100 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

29,049

社区成员

发帖
与我相关
我的任务
社区描述
主要讨论与iOS相关的软件和技术
社区管理员
  • iOS
  • 大熊猫侯佩
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧