Teaching Computers to Learn•Interactive notebook lesson•Free
Image thresholding
No account is required. Learn the material, try the examples, and mark it complete when you are ready to move on. Sign in with email only if you want to save progress across devices.
Codepython
import cv2
import os
import matplotlib.pyplot as plt
import numpy as np
import urllib.request
from IPython.display import display, Image
Codepython
# If the folder "resources" exists, do nothing, else create the folder "resources"
resources_folder = "resources"
if os.path.isdir(resources_folder):
print(f"Directory: `{resources_folder}` already exists")
else:
print(f"Creating directory: `{resources_folder}`")
os.makedirs(resources_folder)
Output
Directory: `resources` already exists
Codepython
# iruma_army_url = "https://github.com/cookieSensei/AI-tutorials/blob/main/iruma%20kun.PNG?raw=true"
# Creating CLI path to the image
iruma_army_img_path = os.path.join("resources", "iruma kun.PNG")
iruma_army_img_path