# InteractiveSegmenterLegacyResult

    class InteractiveSegmenterLegacyResult: TaskResult, NSCopying

Represents the segmentation results generated by `ImageSegmenter`.
- `
  ### [init(confidenceMasks:categoryMask:qualityScores:timestampInMilliseconds:)](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/InteractiveSegmenterLegacyResult.md.txt#/c:objc(cs)MPPInteractiveSegmenterLegacyResult(im)initWithConfidenceMasks:categoryMask:qualityScores:timestampInMilliseconds:)

  ` Initializes a new `ImageSegmenterResult` with the given array of confidence masks, category mask, quality scores and timestamp (in milliseconds).

  #### Declaration

  Swift

      init(confidenceMasks: [Mask]?, categoryMask: Mask?, qualityScores: [NSNumber]?, timestampInMilliseconds: Int)

  #### Parameters

  |---|---|
  | `confidenceMasks` | An optional array of `Mask` objects. Each `Mask` in the array must be of type `float32`. |
  | `categoryMask` | An optional `Mask` object of type `uInt8`. |
  | `qualityScores` | The quality scores of the result masks of type NSArray\<NSNumber \*\> \*. Each `NSNumber` in the array holds a `float`. |
  | `timestampInMilliseconds` | The timestamp (in milliseconds) for this result. |

  #### Return Value

  An instance of `ImageSegmenterResult` initialized with the given array of confidence masks, category mask, quality scores and timestamp (in milliseconds).
- `
  ### [categoryMask](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/InteractiveSegmenterLegacyResult.md.txt#/c:objc(cs)MPPInteractiveSegmenterLegacyResult(py)categoryMask)

  ` An optional `Mask` that holds a`UInt8` array of size `image width` \* `image height`. Each element of this array represents the class to which the pixel in the original image was predicted to belong to.

  #### Declaration

  Swift

      var categoryMask: Mask? { get }

- `
  ### [confidenceMasks](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/InteractiveSegmenterLegacyResult.md.txt#/c:objc(cs)MPPInteractiveSegmenterLegacyResult(py)confidenceMasks)

  ` An optional array of `Mask` objects. Each `Mask` in the array holds a 32 bit float array of size `image width` \* `image height` which represents the confidence mask for each category. Each element of the float array represents the confidence with which the model predicted that the corresponding pixel belongs to the category that the mask represents, usually in the range \[0,1\].

  #### Declaration

  Swift

      var confidenceMasks: [Mask]? { get }

- `
  ### [qualityScores](https://developers.google.com/edge/api/mediapipe/swift/vision/Classes/InteractiveSegmenterLegacyResult.md.txt#/c:objc(cs)MPPInteractiveSegmenterLegacyResult(py)qualityScores)

  ` The quality scores of the result masks, in the range of \[0, 1\]. Defaults to `1` if the model doesn't output quality scores. Each element corresponds to the score of the category in the model outputs.

  #### Declaration

  Swift

      var qualityScores: [NSNumber]? { get }