<jupyter_start><jupyter_text>Gray<jupyter_code>img = cv2.imread("./images/lena.jpg")

# 灰度图
# OpenCV中颜色通道为BGR
imgGray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)

cv2.imshow("Gray Image",imgGray)
cv2.waitKey(0)<jupyter_output><empty_output><jupyter_text>Blur<jupyter_code># 模糊图

imgBlur= cv2.GaussianBlur(imgGray,ksize=(7,7),sigmaX=0)

cv2.imshow("Blur Image",imgBlur)
cv2.waitKey(0)<jupyter_output><empty_output><jupyter_text>Canny<jupyter_code># Canny边缘检测器

imgCanny=cv2.Canny(img,threshold1=100,threshold2=100)
cv2.imshow("Canny Image",imgCanny)
cv2.waitKey(0)<jupyter_output><empty_output><jupyter_text>Dilate<jupyter_code># 膨胀

import numpy as np

kernel=np.ones((5,5),np.uint8)

imgDialation=cv2.dilate(imgCanny,kernel,iterations=1)
cv2.imshow("Dialation Image",imgDialation)
cv2.waitKey(0)<jupyter_output><empty_output><jupyter_text>Erode<jupyter_code># 腐蚀

imgEroded=cv2.erode(imgDialation,kernel,iterations=1)
cv2.imshow("Eroded Image",imgEroded)
cv2.waitKey(0)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15175879396984926, 'fraction_numerical': 0.03919597989949749, 'mean_word_length': 13.028169014084508, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '655270', 'license': 'MIT', 'n_tokens_mistral': 504, 'n_tokens_neox': 490, 'n_words': 35, 'path': 'CV/OpenCV/Learn_OpenCV_in_3_hours/tutorial/CHAPTER2.Basic Functions.ipynb', 'repo_name': 'tsuirak/skills', 'size': '995'}