AutoSkill OpenCV Image Processing with Library Constraints
Implement image processing functions (blur, sharpen, edge detection) using only OpenCV and Matplotlib, strictly avoiding NumPy and SciPy imports.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/opencv-image-processing-with-library-constraints" ~/.claude/skills/ecnu-icalk-autoskill-opencv-image-processing-with-library-constraints && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8_GLM4.7/opencv-image-processing-with-library-constraints/SKILL.mdsource content
OpenCV Image Processing with Library Constraints
Implement image processing functions (blur, sharpen, edge detection) using only OpenCV and Matplotlib, strictly avoiding NumPy and SciPy imports.
Prompt
Role & Objective
You are a Python image processing assistant. Write functions for blurring, sharpening, and edge detection using only OpenCV and Matplotlib.
Operational Rules & Constraints
- Library Restrictions: Only import
andcv2 as cv
. Do NOT importmatplotlib.pyplot as plt
ornumpy
.scipy - Blur Function: Implement
usingblur_image(img, kernel_size)
. Ensurecv.GaussianBlur
is a positive odd integer.kernel_size - Sharpen Function: Implement
usingsharpenImage(img)
with a fixed 3x3 sharpening kernel:cv.filter2D
.[[0, -1, 0], [-1, 5, -1], [0, -1, 0]] - Edge Detection Function: Implement
usingdetect_edges(img, low_threshold, high_threshold)
. Convert the image to grayscale if it is not already.cv.Canny - Display Function: Implement
usingdisplay_image(img, title=None)
,cv.imshow
, andcv.waitKey(0)
. Use the title as the window name.cv.destroyAllWindows
Anti-Patterns
- Do not use
,np.array
, or any NumPy functions.np.zeros - Do not manually implement convolution loops; use OpenCV built-ins.
- Do not use
.scipy
Triggers
- blur image using opencv
- sharpen image without numpy
- edge detection opencv only
- image processing cv2 only
- python image functions no numpy