Skip to content

feat(camera): configurable resolution for vision explain capture - #2168

Draft
78 with Copilot wants to merge 3 commits into
mainfrom
copilot/feature-configurable-camera-resolution
Draft

feat(camera): configurable resolution for vision explain capture#2168
78 with Copilot wants to merge 3 commits into
mainfrom
copilot/feature-configurable-camera-resolution

Conversation

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Vision explain always used the board’s fixed init frame size, so higher-res sensors (e.g. AtomS3R-M12 OV3660) could not send enough detail for text/label reading.

Changes

  • Camera::SetFrameSize(name) — optional API; empty string is a no-op; unsupported drivers return false
  • Esp32Camera — parse common size names (QVGA/VGA/SVGA/UXGA/…); sensor-only change when FB fits; reinit (with restore) when a larger buffer is needed; keep hmirror/vflip
  • MCP self.camera.take_photo — optional resolution argument (default = board setting)
  • AtomS3R-CAM/M12CAMERA_FRAME_SIZE_NAME in config.h (default "SVGA"); init QVGA then raise OV3660 → board default, GC0308 → VGA
  • Docs — mcp-usage (EN/ZH), custom-board, board README
  • Host tests — assert API wiring and AtomS3R defaults

Usage

// board config.h
#define CAMERA_FRAME_SIZE_NAME "SVGA"
{
  "name": "self.camera.take_photo",
  "arguments": {
    "question": "Read the label text",
    "resolution": "SVGA"
  }
}

Higher resolutions trade RAM and upload latency for detail; leave resolution unset to keep the board default.

Copilot AI changed the title [WIP] Add configurable resolution for camera vision explain feat(camera): configurable resolution for vision explain capture Aug 2, 2026
Copilot finished work on behalf of 78 August 2, 2026 17:05
Copilot AI requested a review from 78 August 2, 2026 17:05
@78

78 commented Aug 2, 2026

Copy link
Copy Markdown
Owner

@copilot Can we obtain the supported resolution modes (VGA, SVGA, etc.) of the camera device in advance, and write them into the MCP description?

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Can we obtain the supported resolution modes (VGA, SVGA, etc.) of the camera device in advance, and write them into the MCP description?

Done in 38c0a89.

Esp32Camera now reads the sensor max framesize via esp_camera_sensor_get_info() and exposes the supported named modes through Camera::GetSupportedFrameSizeNames() / GetFrameSizeName().

At MCP registration time, self.camera.take_photo builds its description from that list (e.g. GC0308 → up to VGA; OV3660 → up to QXGA) and includes the current default. The optional resolution argument is only advertised when the driver reports selectable sizes.

Copilot finished work on behalf of 78 August 2, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Configurable resolution for camera vision/explain (currently hardcoded to VGA)

2 participants