Skip to content

Instantly share code, notes, and snippets.

@s-yoshiki
Last active September 9, 2015 09:45
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 s-yoshiki/32d431a4ebed08db8ae5 to your computer and use it in GitHub Desktop.
Save s-yoshiki/32d431a4ebed08db8ae5 to your computer and use it in GitHub Desktop.
homebrewを用いてMacにOpenCVを導入 ref: http://qiita.com/sy_sft_/items/535b2d2a2b488f1af151
You have not agreed to the Xcode license.
Before running the installer again please agree to the license by opening
Xcode.app or running:
sudo xcodebuild -license
import cv2
import numpy as np
import sys
cv2.namedWindow('edge')
img = cv2.imread('test1.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
thrs1 =1000
thrs2 =10
edge = cv2.Canny(gray, thrs1, thrs2, apertureSize=5)
cv2.imshow('edge', edge)
cv2.waitKey(0)
cv2.destroyAllWindows()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment