Skip to content

Instantly share code, notes, and snippets.

@jimlinntu
Created November 15, 2020 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimlinntu/7bbcd0e4007e40ba21fcb7701164467c to your computer and use it in GitHub Desktop.
Save jimlinntu/7bbcd0e4007e40ba21fcb7701164467c to your computer and use it in GitHub Desktop.
import cv2
import numpy as np
def main():
img = cv2.imread("./demo.jpeg", cv2.IMREAD_COLOR)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
edges = cv2.Canny(img, 100, 200)
cv2.imwrite("edge.jpeg", edges)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment