code: # USAGE
  # python opencv_generate_aruco.py --id 24 --type DICT_5X5_100 --output tags/DICT_5X5_100_id24.png
  
  # import the necessary packages
  import numpy as np
  import argparse
  import cv2
  import sys
  
  # construct the argument parser and parse the arguments
  ap = argparse.ArgumentParser()
  ap.add_argument("-o", "--output", required=True,
  	help="path to output image containing ArUCo tag")
  ap.add_argument("-i", "--id", type=int, required=True,
  	help="ID of ArUCo tag to generate")
  ap.add_argument("-t", "--type", type=str,
  	default="DICT_ARUCO_ORIGINAL",
  	help="type of ArUCo tag to generate")
  args = vars(ap.parse_args())
  
  # define names of each possible ArUco tag OpenCV supports
  ARUCO_DICT = {
  	"DICT_4X4_50": cv2.aruco.DICT_4X4_50,
  	"DICT_4X4_100": cv2.aruco.DICT_4X4_100,
  	"DICT_4X4_250": cv2.aruco.DICT_4X4_250,
  	"DICT_4X4_1000": cv2.aruco.DICT_4X4_1000,
  	"DICT_5X5_50": cv2.aruco.DICT_5X5_50,
  	"DICT_5X5_100": cv2.aruco.DICT_5X5_100,
  	"DICT_5X5_250": cv2.aruco.DICT_5X5_250,
  	"DICT_5X5_1000": cv2.aruco.DICT_5X5_1000,
  	"DICT_6X6_50": cv2.aruco.DICT_6X6_50,
  	"DICT_6X6_100": cv2.aruco.DICT_6X6_100,
  	"DICT_6X6_250": cv2.aruco.DICT_6X6_250,
  	"DICT_6X6_1000": cv2.aruco.DICT_6X6_1000,
  	"DICT_7X7_50": cv2.aruco.DICT_7X7_50,
  	"DICT_7X7_100": cv2.aruco.DICT_7X7_100,
  	"DICT_7X7_250": cv2.aruco.DICT_7X7_250,
  	"DICT_7X7_1000": cv2.aruco.DICT_7X7_1000,
  	"DICT_ARUCO_ORIGINAL": cv2.aruco.DICT_ARUCO_ORIGINAL,
  	"DICT_APRILTAG_16h5": cv2.aruco.DICT_APRILTAG_16h5,
  	"DICT_APRILTAG_25h9": cv2.aruco.DICT_APRILTAG_25h9,
  	"DICT_APRILTAG_36h10": cv2.aruco.DICT_APRILTAG_36h10,
  	"DICT_APRILTAG_36h11": cv2.aruco.DICT_APRILTAG_36h11
  }
  
  # verify that the supplied ArUCo tag exists and is supported by
  # OpenCV
  if ARUCO_DICT.get(args["type"], None) is None:
  	print("[INFO] ArUCo tag of '{}' is not supported".format(
  		args["type"]))
  	sys.exit(0)
  
  # load the ArUCo dictionary
  arucoDict = cv2.aruco.Dictionary_get(ARUCO_DICT[args["type"]])
  
  # allocate memory for the output ArUCo tag and then draw the ArUCo
  # tag on the output image
  print("[INFO] generating ArUCo tag type '{}' with ID '{}'".format(
  	args["type"], args["id"]))
  tag = np.zeros((300, 300, 1), dtype="uint8")
  cv2.aruco.drawMarker(arucoDict, args["id"], 300, tag, 1)
  
  # write the generated ArUCo tag to disk and then display it to our
  # screen
  cv2.imwrite(args["output"], tag)
  cv2.imshow("ArUCo Tag", tag)
  cv2.waitKey(0) # USAGE
  # python auto_canny_practice.py --images images
  
  # import the necessary packages
  import numpy as np
  import argparse
  import glob
  import cv2
  
  def auto_canny(image, sigma=0.33):
      # compute the median of the single channel pixel intensities
      v = np.median(image)
      # apply automatic Canny edge detection using the computed median
      lower = int(max(0, (1.0 - sigma) * v))
      upper = int(min(255, (1.0 - sigma) * v))
      edged = cv2.Canny(image, lower, upper)
      
      # return the edged image
      return edged
  
  # construct the argument parser and the arguments
  ap = argparse.ArgumentParser()
  ap.add_argument("-i", "--images", type=str, required=True,
  	help="path to the input image")
  args = vars(ap.parse_args())
  
  # loop over the images
  for imagePath in glob.glob(args["images"] + "/*.jpg"):
      # convert the image to grayscale and blur it slightly
      image = cv2.imread(imagePath)
      gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
      blurred = cv2.GaussianBlur(image, (3, 3), 0)
      
      # apply Canny edge detection using a wide threshold, tight threshold, 
      # and automatically determined threshold
      wide = cv2.Canny(blurred, 10, 200)
      tight = cv2.Canny(blurred, 225, 250)
      auto = auto_canny(blurred)
      
      # show the images
      cv2.imshow("Original", image)
      cv2.imshow("Edges", np.hstack([wide, tight, auto]))
      cv2.waitKey(0)
apis: numpy.zeros
apis: numpy.hstack numpy.median