Logotipo de Matlab Use Visual Inspection

Matlab Use Visual Inspection

OrganizaciónPopular
matlab
matlab-use-visual-inspection

Build machine vision inspection systems with MATLAB Visual Inspection Toolbox. Covers the full arc from problem selection through deployment: anomaly detection (Student-Teacher, PatchCore, FastFlow, FCDD), object detection (YOLOX), counting (CounTR, shape matching), gauging and measurement (caliper, fitcircle, fitangle), blob analysis (regionprops, calibrated measurement), shape matching for fixturing and localization, synthetic data generation for training augmentation, and deployment to standalone apps, embedded C/C++, NVIDIA GPUs (TensorRT), NPUs (ONNX), and Beckhoff PLCs. Routes to rule-based tools when problems are geometric and deterministic, AI-based tools when defect appearance varies, and hybrid pipelines combining both.

Descripción general

Editormatlab
Repositoriomatlab-agentic-toolkit
Nombre de la habilidadmatlab-use-visual-inspection
Estrellas
1.2K
Forks
138
Archivos incluidos
9
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Archivos incluidos: 9

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por matlab en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Matlab Use Visual Inspection en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/image-processing-and-computer-vision/matlab-use-visual-inspection
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/matlab/matlab-agentic-toolkit.git /tmp/matlab-agentic-toolkit
mkdir -p .claude/skills
cp -r /tmp/matlab-agentic-toolkit/skills-catalog/image-processing-and-computer-vision/matlab-use-visual-inspection .claude/skills/matlab-use-visual-inspection
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Matlab Use Visual Inspection en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Matlab Use Visual Inspection automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Matlab Use Visual Inspection no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Visual Inspection with MATLAB

Build machine vision inspection systems using Visual Inspection Toolbox. Select the right approach — rule-based, AI-based, or hybrid — based on problem characteristics, then implement, train, and deploy.

When to Use

Defect detection and classification

  • Detecting anomalies on manufactured parts (scratches, dents, contamination)
  • Training anomaly detectors with good-part images only (one-class learning)
  • Detecting and localizing defects with bounding boxes (YOLOX)
  • Classifying defect types or severity levels

Measurement and gauging

  • Measuring widths, gaps, angles, diameters on parts
  • Calibrated measurement in physical units (mm, degrees)
  • Vision fixturing — locating parts and repositioning measurement tools
  • Blob analysis — area, perimeter, shape metrics of segmented regions

Counting and localization

  • Counting identical rigid parts via shape matching
  • Few-shot counting with intra-class variation (CounTR)
  • Locating parts by edge geometry for downstream inspection

Training data augmentation

  • Generating synthetic labeled data via copy-paste augmentation
  • Expanding small defect datasets for YOLOX training

Deployment

  • Packaging inspection as standalone executables (MATLAB Compiler)
  • Generating C/C++ for embedded/edge targets (MATLAB Coder)
  • GPU-accelerated inference with TensorRT (GPU Coder)
  • ONNX export for NPUs, AI accelerators, smart camera SDKs
  • Deploying to Beckhoff TwinCAT industrial PLCs

When NOT to Use

  • Camera acquisition, frame grabber configuration — use Image Acquisition Toolbox
  • PLC communication, OPC UA, MQTT protocols — use Industrial Communication Toolbox
  • General image processing unrelated to inspection (artistic filters, medical imaging)

Must-Follow Rules

Approach Selection

  • Rule-based for geometric, deterministic problems — when defects are dimensional deviations or parts have known geometry, use caliper/fitcircle/matchshape. No training data needed
  • AI-based for variable appearance — when defect appearance can't be enumerated, use anomaly detection or YOLOX. Requires training data
  • Hybrid when parts move — use matchshape to fixture (locate + normalize pose), then AI on the cropped/warped region. Anomaly detectors are NOT rotation/scale invariant

Anomaly Detection

  • Anomaly detectors require consistent pose — CNN backbones are not rotation/scale invariant. Fixture with matchshape + imwarp to canonical orientation before training and inference
  • Choose detector by data availability — >100 good images: studentTeacherAnomalyDetector; <100 images: patchCoreAnomalyDetector; have anomaly labels: fcddAnomalyDetector
  • Use classify for inference — returns [tf, score, map] for anomaly map visualization

Object Detection (YOLOX)

  • Use AutoResize=false for full-resolution inference — prevents downscaling that loses small defects. Pair with tiled training when objects are small relative to image
  • Synthetic data benefits YOLOX most — copy-paste augmentation via objectInsertionDatastore is proven for detection tasks

Measurement

  • Vision fixturing pattern — matchshape locates part → transform measurement positions to detected pose → measure at repositioned locations
  • Calibrated measurements require imageToWorldPlane — converts pixel measurements to physical units using camera calibration
  • images.geotrans.Warper for production rectification — precompute the mapping once, apply per frame for maximum throughput

Deployment

  • Always use persistent + isempty guard in codegen entry points — load model once, infer many times
  • coder.loadDeepLearningNetwork for DL models — not coder.load (which is for structs/shape models)
  • coder.Constant for MAT file path — codegen requires compile-time constant paths
  • Pass detector objects directly to exportONNXNetwork — never extract .Network or .Backbone first. The object-level export includes pre/post-processing logic
  • ONNX for NPUs/AI accelerators; GPU Coder + TensorRT for NVIDIA — don't use ONNX for Jetson/Orin

Pipeline Construction

Machine vision inspections compose tools in sequence:

  1. Acquire — Get the image (Image Acquisition Toolbox)
  2. Fixture — Locate a stable reference feature (matchshape)
  3. Reposition — Transform measurement positions to detected pose
  4. Inspect — Apply measurement or classification at repositioned locations
  5. Decide — Compare to tolerances → pass/fail
  6. Communicate — Send results to PLC/SCADA (Industrial Communication Toolbox)

Common Hybrid Patterns

PatternRule-Based PartAI Part
Fixture + classifymatchshape locates part, crops ROIAnomaly detector on cropped region
Fixture + detectmatchshape locates partYOLOX finds defects relative to fixture
Pose normalize + anomalymatchshape + imwarp to canonical poseAnomaly detector on normalized image
Segment + measureThresholding / morphologyregionprops on segmented blobs

Primary Decision: Rule-Based vs. AI-Based

Choose Rule-Based WhenChoose AI-Based When
Defects have predictable, enumerable geometryDefect appearance varies unpredictably
Lighting and positioning are tightly controlledBackground or part appearance varies
Need dimensional measurements (mm, degrees)Need classification without precise measurement
Few or no labeled examples availableHave labeled training data (or can generate synthetic)
Require explainable, auditable decisionsAccuracy matters more than explainability

Key Functions

FunctionPurposeToolboxAvailable From
shapemodelBuild edge-geometry model from templateVisual Inspection ToolboxR2026b
matchshapeFind model instances in search imageVisual Inspection ToolboxR2026b
caliperMeasure edge distances along a profileVisual Inspection ToolboxR2026b
fitangleMeasure angle between edgesVisual Inspection ToolboxR2026b
fitcircleMeasure circle center and radiusVisual Inspection ToolboxR2026b
studentTeacherAnomalyDetectorOne-class anomaly detection (>100 good images)Visual Inspection ToolboxR2026b
patchCoreAnomalyDetectorOne-class anomaly detection (few-shot, <100 images)Visual Inspection ToolboxR2026b
fastFlowAnomalyDetectorNormalizing-flow anomaly detectionVisual Inspection ToolboxR2026b
fcddAnomalyDetectorSemi-supervised anomaly detectionVisual Inspection ToolboxR2026b
yoloxObjectDetectorObject/defect detection with bounding boxesVisual Inspection ToolboxR2026b
counTRObjectCounterCounting with intra-class variation (few-shot)Visual Inspection ToolboxR2026b
objectInsertionDatastoreSynthetic labeled training data (copy-paste)Visual Inspection ToolboxR2026b
regionpropsBlob area, perimeter, shape featuresImage Processing ToolboxR2006a
imageToWorldPlaneCalibrated world-unit measurementComputer Vision ToolboxR2022b

Decision Trees

"I need to detect defects"

SituationApproach
Defect appearance unpredictable; good-part images onlyAnomaly detection
Classify defect types with bounding boxes; have labeled dataYOLOX object detection
Defects are geometric deviations from known shapeShape matching + gauging
Dimensional out-of-tolerance (too wide, too narrow)Caliper / fitcircle / fitangle

"I need to measure parts"

SituationApproach
Widths, gaps, edge-to-edge distancescaliper
Angles between edgesfitangle
Hole diameters, arc radiifitcircle
Area, perimeter, shape of segmented blobsregionprops
Need measurements in mm (physical units)Camera calibration + rectification
Part position varies image-to-imageVision fixturing with matchshape

"I need to count objects"

SituationApproach
Identical rigid parts, controlled backgroundshapemodel / matchshape
Intra-class variation, few labeled examplesCounTR (few-shot counting)
Multiple classes, complex scenes, have labelsYOLOX detection → count

"I need to locate parts"

SituationApproach
Rigid part, known edge geometryshapemodel / matchshape
Variable appearance, multiple classesYOLOX detection

"I don't have enough training data"

SituationApproach
Have segmented defect examples + clean imagesCopy-paste synthetic data
Good-part images only (no defect labels)Anomaly detection (one-class)
No data at all, defects are geometricRule-based (no training needed)

"I need to deploy"

TargetPath
Standalone app, full MATLAB featuresMATLAB Compiler
Monitoring dashboard or UI appMATLAB Compiler
Embedded CPU (x86, ARM)MATLAB Coder
NVIDIA Jetson/Orin or dGPUGPU Coder + TensorRT
NPU or AI acceleratorONNX export
Smart camera with vendor SDKONNX export
Beckhoff industrial PLCMATLAB Coder → TwinCAT

Patterns

Each reference file contains executable code patterns, API calling conventions, and worked examples for its topic. Load the relevant reference before writing code.

Conventions

  • Always: use machine vision terminology (rule-based, tool chaining, fixturing)
  • Always: recommend the specific VIT function, not generic IPT building blocks
  • Always: consider hybrid pipelines (rule-based fixturing + AI classification)
  • Always: ensure anomaly detector receives images in consistent pose
  • Always: use persistent + isempty for model loading in codegen entry points
  • Always: pass detector objects directly to exportONNXNetwork (never extract .Network)
  • Never: recommend AI when the problem is purely dimensional measurement
  • Never: recommend rule-based when defect appearance is highly variable
  • Never: use coder.load for deep learning models (use coder.loadDeepLearningNetwork)
  • Never: use ONNX export for NVIDIA targets (use GPU Coder + TensorRT)
  • Prefer: anomaly detection when only good-part images are available
  • Prefer: YOLOX when labeled defect examples with bounding boxes exist
  • Prefer: shapemodel/matchshape over YOLOX for locating rigid parts
  • Prefer: images.geotrans.Warper for production rectification throughput
  • Prefer: MATLAB Compiler for dashboards and UI-based monitoring apps

References

Load when...Reference
Training or using anomaly detectorsreferences/detect-anomaly.md
Locating parts by shape, vision fixturingreferences/match-shape.md
Training or using YOLOX object detectorsreferences/detect-objects.md
Counting objects (shape matching, CounTR, YOLOX)references/count-objects.md
Measuring with caliper, fitcircle, fitanglereferences/measure-gauging.md
Blob analysis, regionprops, calibrated measurementreferences/blob-analysis.md
Deploying models (Compiler, Coder, TensorRT, ONNX)references/deploy-inspection.md
Generating synthetic training datareferences/synthetic-data.md

Copyright 2026 The MathWorks, Inc.


Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Son archivos de solo lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA Matlab Use Visual Inspection?

Build machine vision inspection systems with MATLAB Visual Inspection Toolbox. Covers the full arc from problem selection through deployment: anomaly detection (Student-Teacher, PatchCore, FastFlow, FCDD), object detection (YOLOX), counting (CounTR, shape matching), gauging and measurement (caliper, fitcircle, fitangle), blob analysis (regionprops, calibrated measurement), shape matching for fixturing and localization, synthetic data generation for training augmentation, and deployment to standalone apps, embedded C/C++, NVIDIA GPUs (TensorRT), NPUs (ONNX), and Beckhoff PLCs. Routes to rule...

¿Por qué usar Matlab Use Visual Inspection en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Matlab Use Visual Inspection está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Matlab Use Visual Inspection en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/image-processing-and-computer-vision/matlab-use-visual-inspection. TypingMind lee el archivo SKILL.md de esa carpeta, empaqueta los archivos de la carpeta e instala el conjunto como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Matlab Use Visual Inspection?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Matlab Use Visual Inspection?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Matlab Use Visual Inspection con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Matlab Use Visual Inspection?

matlab la ha publicado en GitHub. Consulta el repositorio para conocer las condiciones de la licencia. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇