Builds computer vision pipelines: image preprocessing with OpenCV, detection with YOLO, and video analysis with ffmpeg.
Agentic Workflow: Read -> Reason -> Act (computer-vision)
You are computer-vision (ai) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — ai context for computer-vision
- Domain: Builds computer vision pipelines: image preprocessing with OpenCV, detection with YOLO, and video analysis with ffmpeg.
- image-processing: Preprocess images and video with OpenCV and ffmpeg —
python -c "import cv2; print(cv2.__version__)"
- Check
knowledge and prerequisites: python, opencv, tensorflow, pytorch
2. Reason — think for computer-vision
- For
image-processing: Preprocess images and video with OpenCV and ffmpeg — decide which checks to run
- Evaluate trust/policy:
kdesk trust + kdesk doctor patterns for your inputs
3. Act — execute with computer-vision tools
- Tools:
Glob, Grep, Read, Bash, Ffmpeg (see frontmatter tools/allowed-tools)
- Use
safe_path for any write; record evidence (paths, checksums)
- Fingerprint:
computer-vision:fa1ed5f6
Computer Vision
Builds CV systems: image preprocessing (OpenCV), object detection (YOLO), and video
pipelines (ffmpeg).
When to Use
- Preprocessing a dataset before training a detector
- Running detection on images, video files, or RTSP streams
- Extracting frames and creating datasets from video
Real Commands
# Verify the stack
python -c "import cv2; print(cv2.__version__)"
# Extract one frame per second from video
ffmpeg -i input.mp4 -vf "fps=1" frames/frame_%04d.jpg
# Resize and normalize a dataset
python -c "
import cv2, glob
for f in glob.glob('raw/*.jpg'):
img = cv2.imread(f)
img = cv2.resize(img, (640, 640))
cv2.imwrite('proc/' + f.split('')[-1], img)
"
# Run YOLO detection
python detect.py --source images/ --weights best.pt --conf 0.4 --save-txt
# Export to ONNX for edge deployment
python export.py --weights best.pt --include onnx
Dataset Prep
# Crop to square and save 100 frames
ffmpeg -i video.mp4 -vf "crop=640:640:0:0" -frames:v 100 crop/%05d.jpg
# Augment with flip/rotation
python augment.py --folder train/ --flip --rotate 10 --brightness 0.2
Best Practices
- Normalize (resize + RGB) identically for train and inference
- Use augmentation to avoid overfitting on small datasets
- Test on edge cases: blur, occlusion, low light
- Benchmark FPS after quantization/export
- Keep class balance in the dataset
Example Response
The agent produces a preprocessing command sequence, runs detection, and returns
class counts, confidence stats, and per-image annotated outputs.
Capabilities
image-processing
Preprocess images and video with OpenCV and ffmpeg
Parameters:
source (string): Image, video, directory, or stream URL to process
save-txt (boolean): Write detection results as YOLO-format txt files
weights (string): Path to trained model weights, e.g. best.pt
Commands:
python -c "import cv2; print(cv2.__version__)"
python -m pip install opencv-python pillow
ffmpeg -i input.mp4 -vf "fps=1" frames/frame_%04d.jpg
python -c "import cv2; img=cv2.imread('a.jpg'); cv2.resize(img,(640,640)); cv2.imwrite('r.jpg',img)"
ffmpeg -i input.mp4 -vf scale=320:320 -c:v libx264 out.mp4
Examples:
- ffmpeg -i video.mp4 -vf "crop=640:640:0:0" -frames:v 100 crop/%05d.jpg
- python augment.py --folder train/ --flip --rotate 10
- python detect.py --source rtsp://cam:554/stream --save-txt
References
1---2name: "computer-vision"3description: "Builds computer vision pipelines: image preprocessing with OpenCV, detection with YOLO, and video analysis with ffmpeg. Use when working with image processing or when the user mentions image processing."4license: "MIT"5compatibility: "Requires python, opencv, tensorflow, pytorch, yolo."6metadata:7 source: https://skillmd.com/skills/opknock/computer-vision8 author: Kdesk9 version: 2.0.010 category: ai11allowed-tools: "Glob Grep Read Bash(ffmpeg:*) Bash(python:*)"12---1314Builds computer vision pipelines: image preprocessing with OpenCV, detection with YOLO, and video analysis with ffmpeg.1516## Agentic Workflow: Read -> Reason -> Act (computer-vision)1718You are **computer-vision** (ai) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.1920### 1. Read — ai context for `computer-vision`21- Domain: Builds computer vision pipelines: image preprocessing with OpenCV, detection with YOLO, and video analysis with ffmpeg.22- **image-processing**: Preprocess images and video with OpenCV and ffmpeg — `python -c "import cv2; print(cv2.__version__)"`23- Check `knowledge` and `prerequisites: python, opencv, tensorflow, pytorch`2425### 2. Reason — think for `computer-vision`26- For `image-processing`: Preprocess images and video with OpenCV and ffmpeg — decide which checks to run27- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs2829### 3. Act — execute with `computer-vision` tools30- Tools: `Glob`, `Grep`, `Read`, `Bash`, `Ffmpeg` (see frontmatter `tools`/`allowed-tools`)31- Use `safe_path` for any write; record evidence (paths, checksums)32- Fingerprint: `computer-vision:fa1ed5f6`3334# Computer Vision3536Builds CV systems: image preprocessing (OpenCV), object detection (YOLO), and video37pipelines (ffmpeg).3839## When to Use4041- Preprocessing a dataset before training a detector42- Running detection on images, video files, or RTSP streams43- Extracting frames and creating datasets from video4445## Real Commands4647```bash48# Verify the stack49python -c "import cv2; print(cv2.__version__)"5051# Extract one frame per second from video52ffmpeg -i input.mp4 -vf "fps=1" frames/frame_%04d.jpg5354# Resize and normalize a dataset55python -c "56import cv2, glob57for f in glob.glob('raw/*.jpg'):58 img = cv2.imread(f)59 img = cv2.resize(img, (640, 640))60 cv2.imwrite('proc/' + f.split('')[-1], img)61"6263# Run YOLO detection64python detect.py --source images/ --weights best.pt --conf 0.4 --save-txt6566# Export to ONNX for edge deployment67python export.py --weights best.pt --include onnx68```6970## Dataset Prep7172```bash73# Crop to square and save 100 frames74ffmpeg -i video.mp4 -vf "crop=640:640:0:0" -frames:v 100 crop/%05d.jpg7576# Augment with flip/rotation77python augment.py --folder train/ --flip --rotate 10 --brightness 0.278```7980## Best Practices8182- Normalize (resize + RGB) identically for train and inference83- Use augmentation to avoid overfitting on small datasets84- Test on edge cases: blur, occlusion, low light85- Benchmark FPS after quantization/export86- Keep class balance in the dataset8788## Example Response8990The agent produces a preprocessing command sequence, runs detection, and returns91class counts, confidence stats, and per-image annotated outputs.9293## Capabilities9495### image-processing96Preprocess images and video with OpenCV and ffmpeg9798**Parameters:**99- `source` (string): Image, video, directory, or stream URL to process100- `save-txt` (boolean): Write detection results as YOLO-format txt files101- `weights` (string): Path to trained model weights, e.g. best.pt102103**Commands:**104- `python -c "import cv2; print(cv2.__version__)"`105- `python -m pip install opencv-python pillow`106- `ffmpeg -i input.mp4 -vf "fps=1" frames/frame_%04d.jpg`107- `python -c "import cv2; img=cv2.imread('a.jpg'); cv2.resize(img,(640,640)); cv2.imwrite('r.jpg',img)"`108- `ffmpeg -i input.mp4 -vf scale=320:320 -c:v libx264 out.mp4`109110**Examples:**111- ffmpeg -i video.mp4 -vf "crop=640:640:0:0" -frames:v 100 crop/%05d.jpg112- python augment.py --folder train/ --flip --rotate 10113- python detect.py --source rtsp://cam:554/stream --save-txt114115## References116- [OpenCV docs](https://docs.opencv.org/)117- [Ultralytics YOLO docs](https://docs.ultralytics.com/)118- [ffmpeg documentation](https://ffmpeg.org/documentation.html)