Run3 batch grayscale conversion inplace
Converts all extracted keyframe images in a directory from RGB to grayscale and overwrites the original files.From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill run3_batch_grayscale_conversion_inplaceAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
0.7 KB, 128 tokens by cl100k_base, as published. Nobody here has run it
Use python3 and OpenCV to process the images. This reduces the complexity for subsequent template matching tasks.
import cv2
import glob
import os
def convert_to_grayscale(path_pattern="/root/keyframes_*.png"):
image_files = sorted(glob.glob(path_pattern))
for image_path in image_files:
img = cv2.imread(image_path)
if img is not None:
gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.imwrite(image_path, gray_img)
if __name__ == "__main__":
convert_to_grayscale()
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.