0 Replies
      Latest reply on Mar 28, 2019 12:56 AM by kart
      kart Level 1 Level 1 (0 points)

        I'm getting a CIVector from VNImageHomographicAlignmentObservation, which is supposed to represent a transformation matrix. Does this CIVector use row- or column- major order?


        In case, it matters, this matrix represents a homography:

        let observation: VNImageHomographicAlignmentObservation = ... // The input uses column-major order, so convert it to row-major for CIVector:
        let (col0, col1, col2) = observation.warpTransform.columns
        let values: [CGFloat] = [CGFloat(col0.x), CGFloat(col1.x), CGFloat(col2.x), CGFloat(col0.y), CGFloat(col1.y), CGFloat(col2.y), CGFloat(col0.z), CGFloat(col1.z), CGFloat(col2.z)]
        let vector = CIVector(values: values, count: values.count)