matlab-enhance-camera-image

Diagnose and enhance camera image quality using MATLAB hardware tuning and Image Processing Toolbox functions.

995|122|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-enhance-camera-image
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-enhance-camera-image
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/test-and-measurement/matlab-enhance-camera-image
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-enhance-camera-image

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Camera images often suffer from poor quality—too dark, blurry, noisy, washed out, or color-cast—and users struggle to know whether to fix hardware settings or apply software corrections. This Skill diagnoses image quality issues from cameras connected via Image Acquisition Toolbox or the USB Webcams support package, then applies targeted fixes.

Core Features & Use Cases

  • Automated Quality Diagnosis: Analyzes captured images across six metrics (brightness, clipping, contrast, sharpness, noise, color balance) plus backlight detection, with extended metrics for vignetting, banding, flicker, and chromatic aberration.
  • Hardware-First Tuning: Discovers camera properties at runtime via videoinput/webcam, maps diagnosed problems to safe property adjustments (exposure, gain, white balance, focus), and iterates one change at a time.
  • Software Enhancement Pipeline: Applies Image Processing Toolbox functions in the correct order—brighten, contrast, sharpen—using imlocalbrighten, locallapfilt, adapthisteq, and imsharpen.
  • Use Case: A user complains their webcam image is too dark and grainy. The Skill captures a baseline, diagnoses underexposure and high noise, increases Exposure instead of Gain, applies imlocalbrighten and imgaussfilt, then generates a reusable acquireEnhancedImage.m function for future captures.

Quick Start

Ask your AI agent to diagnose why the image from my connected camera looks dark and noisy and improve its quality.

Frequently Asked Questions about matlab-enhance-camera-image

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix dark or backlit camera images in MATLAB?

First adjust hardware settings like BacklightCompensation, Exposure, or Brightness on the camera source object, then apply software fixes such as imlocalbrighten or gamma correction with imadjust. Hardware fixes preserve full dynamic range and are preferred over post-processing.

How to diagnose camera image quality issues programmatically in MATLAB?

Capture a baseline image and compute metrics for brightness, clipping, contrast, sharpness, noise, and color balance. The diagnoseImageQuality function returns a struct with numeric values and assessments of OK, Problem, or Severe for each metric.

Should I use videoinput or webcam for camera image acquisition in MATLAB?

Prefer videoinput when Image Acquisition Toolbox is installed because it exposes more properties via propinfo, supports bulk frame capture with getdata, and offers streaming callbacks. Use webcam only as a fallback with the USB Webcams support package.

Why does my MATLAB camera image have wrong colors from a YUY2 webcam?

Many USB webcams output YUY2 format, which gets misinterpreted as RGB. Set vid.ReturnedColorSpace = 'rgb' on the videoinput object before capturing so getsnapshot returns correctly converted RGB data.

What is the correct order for image enhancement functions in MATLAB?

Brighten first, then enhance contrast, then sharpen last. Sharpening amplifies noise, so denoise before sharpening if noise is severe, and never apply contrast enhancement to a dark image before brightening it.

When should I not use camera image enhancement workflows?

Avoid this approach for general image processing on files not from a camera, building acquisition pipelines from scratch, or geometric camera calibration. Use Image Processing Toolbox directly, Image Acquisition Toolbox documentation, or the Camera Calibrator app respectively.