title: CIDetector either not detecting, or detecting in odd places
body: <p>I am practicing using some swift 2 and have run in to some difficulties in using the CIDetector. </p>
  
  <p>I have an app which has a series of pictures in; three different rectangles and three different photos of people/groups. I have been just trying the CIDetector on these images to see what is recognised. The most success I have has is with the faces - however the face it's recognising are in very weird places on the image. </p>
  
  <p>Here is a rectangle image I tested, along with it's output:
  <a href="https://i.stack.imgur.com/hFNGf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hFNGf.png" alt="Rectangle Test"></a></p>
  
  <p>And here is a face image:
  <a href="https://i.stack.imgur.com/17iCa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/17iCa.png" alt="enter image description here"></a></p>
  
  <p>Here is my detection code:</p>
  
  <pre><code>    ///does the detecting of features
          func detectFeatures() -&gt; [CIFeature]? {
  
              print("detecting")
  
              let detectorOptions: [String: AnyObject] = [CIDetectorAccuracy: CIDetectorAccuracyHigh, CIDetectorImageOrientation: 6]
              var detectorType    : String
  
              switch currentPhoto.currentType {
              case .RECTANGLES:
                  detectorType = CIDetectorTypeRectangle
              case .FACES:
                  detectorType = CIDetectorTypeFace
              default:
                  print("error in phototype")
                  return nil
  
              }
  
              let detector = CIDetector(ofType: detectorType, context: nil, options: detectorOptions)
              let image = CIImage(image: imageViewer.image!)
  
              guard image != nil else{
                  print("image not cast to CIImage")
                  return nil
              }
  
              return detector.featuresInImage(image!)
          }
  </code></pre>
  
  <p>Where the stars are added on:</p>
  
  <pre><code>for f in features!{
              print(f.bounds.origin)
              imageViewer.layer.addSublayer(createMarker(f.bounds.size, location: f.bounds.origin))
          }
  </code></pre>
  
  <p>and where the stars are created:</p>
  
  <pre><code>///Creates a star on a layer and puts it over the point passed in
      func createMarker(size: CGSize, location: CGPoint) -&gt; CALayer{
  
          print("The marker will be at [\(location.x),\(location.y)]")
          //doesn't appear in correct place on the screen
          let newLayer = CALayer()
          newLayer.bounds = imageViewer.bounds
          newLayer.frame = CGRect(origin: location, size: size)
          newLayer.contents = UIImage(named: "star")?.CGImage
          newLayer.backgroundColor = UIColor(colorLiteralRed: 0.0, green: 0.0, blue: 0.0, alpha: 0.0).CGColor
          newLayer.masksToBounds = false
  
          return newLayer
      }
  </code></pre>
  
  <p>Has anyone encountered anything like this before?</p>