Run2 opencv grayscale
Convert images to grayscale in-place using OpenCV, including both keyframes and template images.From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill run2_opencv-grayscaleAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
0.9 KB, 210 tokens by cl100k_base, as published. Nobody here has run it
OpenCV Grayscale Conversion
Convert All Images In-Place
Both keyframes AND template images must be converted to grayscale before template matching.
import cv2
import glob
# Convert keyframes
for path in sorted(glob.glob('/root/keyframes_*.png')):
img = cv2.imread(path)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.imwrite(path, gray)
# Convert templates
for path in ['/root/coin.png', '/root/enemy.png', '/root/turtle.png']:
img = cv2.imread(path)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.imwrite(path, gray)
Important
- The
count_objects.pyscript reads withIMREAD_GRAYSCALE, so files must be grayscale before counting - Overwriting originals is required per the task specification
- Grayscale images are single-channel (H x W) vs RGB (H x W x 3)
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.