Skip to main content
API Reference SwiftyNsdk NsdkSemanticsSession

latestConfidence

Retrieves the latest confidence map for a specific semantic channel....

Declaration

func latestConfidence(channel: SemanticsChannelName) throws(NsdkError) -> NsdkAsyncState<SemanticsResult, AwarenessError>

Summary

Retrieves the latest confidence map for a specific semantic channel.
This method returns a confidence map where each pixel value represents the confidence
score (0.0-1.0) that the pixel belongs to the specified semantic category. Higher
confidence values indicate stronger belief in the semantic classification.
- Parameter channel: The name of the semantic channel to retrieve
- Returns: A tuple containing the operation status and semantic result if successful
## Example
swift <br />// Get confidence for "sky" channel (assuming it's at index 0) <br />let (status, result) = semanticsSession.getLatestConfidence(channelIndex: 0) <br />if status.isOk(), let semanticResult = result &#123; <br /> print("Sky confidence image size: \\(semanticResult.image?.width ?? 0) x \\(semanticResult.image?.height ?? 0)") <br /> // Process confidence data <br /> if let image = semanticResult.image &#123; <br /> processConfidenceMap(image, forChannel: "sky") <br /> &#125; <br />&#125; <br />
## Confidence Interpretation
Confidence values range from 0.0 to 1.0:
- 0.0: Definitely not the specified semantic category
- 0.5: Uncertain classification
- 1.0: Definitely the specified semantic category
Use confidence thresholds to filter results based on your application's needs.


ON THIS PAGE