Slide 105
Slide 105 text
إҐஔݕग़
let buffer: CVImageBuffer = ...
let inputImage = CIImage(cvImageBuffer: buffer)
//ᶃإۣܗऔಘϦΫΤετ
let handler = VNImageRequestHandler(ciImage: inputImage)
handler.perform([
VNDetectFaceRectanglesRequest(completionHandler: { (req, err) in
//ᶄإۣܗͷऔಘ
let req = request as! VNDetectFaceRectanglesRequest,
let faces = req.results as! [VNFaceObservation],
let face = faces.first.boundingBox,
let rect = face.boundingBox,
//ᶅإ෦ͷΓൈ͖
let faceImage: CIImage = cropImage(from inputImage, rect: rect)