# Camera & Pose Detection

Fine-tune the camera and pose detection system.

| Parameter | Type | Default | Description | Effect |
|-----------|------|---------|-------------|--------|
| shouldAskCamera | boolean | true | Prompt for camera permission | Shows camera permission dialog before starting |
| shouldShowCameraSelector | boolean | false | Show camera selection UI | Allows user to choose between available cameras |
| shouldShowOpenCameraSettings | boolean | false | Show settings button | Displays button to open device camera settings |
| cameraId | string | - | Specific camera device ID | Forces use of a specific camera |
| cameraLabel | string | - | Camera label for display | Shows custom label for the selected camera |
| minPoseDetectionConfidence | number | 0.5 | Minimum detection confidence (0-1) | Lower values detect poses more easily but may be less accurate |
| minTrackingConfidence | number | 0.5 | Minimum tracking confidence (0-1) | Affects how persistently poses are tracked between frames |
| minPosePresenceConfidence | number | 0.5 | Minimum presence confidence (0-1) | Threshold for determining if a person is in frame |
| mediapipeModel | "full" "heavy" "light" | "full" | MediaPipe model variant | light: Faster, less accurate. full: Balanced. heavy: Most accurate, slower |
| defaultDelegate | "GPU" "CPU" | Auto | Processing delegate | Forces GPU or CPU processing for pose detection |
| landmarkColor | string | "#14FF00" | Pose landmark color | Changes the color of skeleton overlay (hex color) |
| showSilhouette | boolean | true | Show body silhouette | Displays silhouette guide overlay during exercises |
| includePoseData | boolean | - | Include raw pose data | Sends pose landmark data in postMessage events |
| includePoseBorders | boolean | true | Show pose boundary guides | Displays borders indicating optimal pose positioning |
| includeRealtimeAccuracy | boolean | - | Send real-time accuracy | Broadcasts accuracy scores in real-time via postMessage |
| videoFit | "contain" | "cover" | Camera feed display mode | When set to "contain", shows the full camera frame instead of zooming in to fill the area. Useful for maximizing available space for motion tracking |

**Note:** `defaultDelegate` can also be set via URL parameter `?delegate=GPU` or `?delegate=CPU`

**Camera & Pose Detection Settings**

_Swift (iOS)_
```swift
// Via customParams
kinestex.createCameraView(
    exercises: exerciseList,
    currentExercise: $currentExercise,
    customParams: [
        "landmarkColor": "#FF5500",
        "showSilhouette": true,
        "mediapipeModel": "heavy",
        "defaultDelegate": "GPU",
        "includePoseData": true,
        "includeRealtimeAccuracy": true,
        "shouldShowCameraSelector": true,
        "videoFit": "contain" // show full camera frame
    ]
)
```

_Kotlin (Android)_
```kotlin
// Via customParams
KinesteXSDK.createCameraComponent(
    exercises = exerciseList,
    currentExercise = "Squats",
    customParams = mapOf(
        "landmarkColor" to "#FF5500",
        "showSilhouette" to true,
        "mediapipeModel" to "heavy",
        "defaultDelegate" to "GPU",
        "includePoseData" to true,
        "includeRealtimeAccuracy" to true,
        "videoFit" to "contain" // show full camera frame
    )
)
```

_React Native_
```jsx
// Via customParameters
const postData: IPostData = {
  key: 'YOUR_API_KEY',
  userId: 'user-123',
  company: 'YOUR_COMPANY',
  exercises: ['Squats', 'Lunges'],
  currentExercise: 'Squats',
  customParameters: {
    landmarkColor: '#FF5500',
    showSilhouette: true,
    mediapipeModel: 'heavy',
    defaultDelegate: 'GPU',
    includePoseData: true,
    includeRealtimeAccuracy: true,
    shouldShowCameraSelector: true,
    videoFit: 'contain', // show full camera frame
  },
};
```

_Flutter_
```dart
// Via customParams
KinesteXAIFramework.createCameraComponent(
  exercises: ["Squats", "Lunges"],
  currentExercise: "Squats",
  customParams: {
    "landmarkColor": "#FF5500",
    "showSilhouette": true,
    "mediapipeModel": "heavy",
    "defaultDelegate": "GPU",
    "includePoseData": true,
    "includeRealtimeAccuracy": true,
    "videoFit": "contain", // show full camera frame
  },
);
```

_HTML / JavaScript_
```html
// Direct in postData object
const postData = {
  userId: "user-123",
  company: "YOUR_COMPANY",
  key: "YOUR_API_KEY",
  exercises: ["Squats", "Lunges"],
  currentExercise: "Squats",
  landmarkColor: "#FF5500",
  showSilhouette: true,
  mediapipeModel: "heavy",
  defaultDelegate: "GPU",
  includePoseData: true,
  includeRealtimeAccuracy: true,
  shouldShowCameraSelector: true,
  videoFit: "contain", // show full camera frame
};
```

_React (TypeScript)_
```tsx
// Via customParameters
const postData: IPostData = {
  key: 'YOUR_API_KEY',
  userId: 'user-123',
  company: 'YOUR_COMPANY',
  exercises: ['Squats', 'Lunges'],
  currentExercise: 'Squats',
  customParameters: {
    landmarkColor: '#FF5500',
    showSilhouette: true,
    mediapipeModel: 'heavy',
    defaultDelegate: 'GPU',
    includePoseData: true,
    includeRealtimeAccuracy: true,
    videoFit: 'contain', // show full camera frame
  },
};
```

---
Source: https://kinestex.com/docs/customization-parameters/camera-pose-detection · Index: https://kinestex.com/llms.txt
