Skip to content

Vision Framework Computer Vision ​

Choosing and combining Apple's on-device computer vision APIs: the Vision framework for analysis in your own code, and VisionKit for ready-made interfaces such as the live scanner.

When to Use ​

Use this skill when you're:

  • Isolating a subject from its background, with the system interface or in your own pipeline
  • Getting a box around an object without including the hand that holds it
  • Detecting hand poses for gestures, or body poses for fitness and action classification
  • Segmenting people, together or separately
  • Detecting faces or finding where people are in an image
  • Recognizing text, barcodes, or QR codes in an image or from the live camera
  • Scanning documents, correcting perspective, or extracting tables and other structure
  • Choosing between VisionKit and Vision
  • Compositing a subject onto a new background while preserving HDR

Example Prompts ​

Questions you can ask your assistant that will draw from this skill:

  • "How do I isolate a subject from the background?"
  • "How can I get a bounding box around an object without including the hand holding it?"
  • "Should I use VisionKit or Vision for subject lifting?"
  • "I need to detect a pinch gesture from the camera."
  • "How do I count squats without training a model?"
  • "How do I segment each person in a photo separately?"
  • "How do I recognize text in an image?"
  • "Should I use DataScannerViewController or Vision directly to scan QR codes?"
  • "How do I extract a table from a scanned receipt?"

What This Skill Provides ​

Choosing an API ​

  • A decision tree from the task to the request or view controller: subjects, people, hands, bodies, faces, text, barcodes, and documents
  • Signs you're making it harder than it needs to be, such as training a model for something Vision already does
  • What needs the 27 releases: tap-to-segment (not on watchOS), and Vision on Apple Watch, which has no text or pose requests

Setting Up ​

  • Running Vision off the main thread, because requests can block it long enough to freeze your interface
  • VNImageRequestHandler for single images, VNSequenceRequestHandler for video frames

Patterns ​

  • Subject lifting with VisionKit, instance masks, tap-to-select, and excluding a hand from an object
  • Pinch gestures, separating up to four people, and body pose for action classification
  • Rep counting from joint angles, with no trained model
  • Text recognition, barcode detection, live scanning, and a real-time phone number scanner
  • Document scanning, edge detection, and structured extraction

Mistakes It Prevents ​

  • Ignoring confidence scores, or forgetting that Vision's origin is at the lower left
  • Setting maximumHandCount higher than you need
  • Using ARKit where Vision is enough
  • Pressure scenarios: "just ship the feature" and "train our own model"

Documentation Scope ​

This page documents the vision-framework skill (in the axiom-vision suite), which your assistant loads when you design or build a computer vision feature. The skill holds the code for each pattern.

  • Media Intelligence – Face grouping and video highlights across a photo or video library
  • camera-capture – Building the capture session that supplies camera frames to Vision
  • photo-library – Picking the images you analyze
  • coreml-ref – Running a custom model when no built-in request fits

Resources ​

WWDC: 2019-234, 2020-10653, 2021-10041, 2022-10024, 2022-10025, 2023-10176, 2023-111241, 2025-272, 2026-237

Docs: /vision, /visionkit

Released under the MIT License