Open wanghaibo325 opened 2 years ago
Pyinstallerでexe化の参考資料; https://www.youtube.com/watch?v=ZfTbvGh9vUw
ドキュメントの走査と識別 step 1: 側の検索 step 2: 輪郭を読み込む step 3: 変換
def resize(image, width=None, height=None, inter=cv2.INTER_AREA): dim = None (h,w) = image.shape[:2] if width is None and height is None: return image if width is None: r = height / float(h) dim = (int(w * r). height) else: r = width / float(w) dim = (width, int(h * r)) resized = cv2.resize(image, dim, interpolation=inter) return resized
image = cv2.imread(args["image"])
ratio = image.shape[0] / 500.0 orig = image.copy()
image = resize(orig, height = 500)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) gray = cv2.GaussianBlur(gray,(5,5),0) edged = cv2.Canny(gray,75,200)
print(" STEP 1") cv2.imshow("Image",image) cv2.imshow("Edged",edged) cv2.waitKey(0) cv2.destroyAllWindows()
cnts = cv2.findContours(edged.copy(), cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)[1] cnts = sorted(cnts, key = cv2.contourArea, reverse = True)[:5]
for c in cnts:
peri = cv2.arcLength(c, True)
approx = cv2.approxPolyDP(c, 0.02 * peri, Ture)
if len(approx) == 4:
screenCnt = approx
break
print("STEP 2:輪郭をとる") cv2.drawContours(image, [screenCnt], -1, (0,255,0), 2) cv2.imshow("OutLine",image) cv2.waitKey(0) cv2.destroyAllWindows()
開発概要 ●必要ものはpythoncharm ,svm , knn。 svm(サポートベクターマシンは、現在知られている手法の中でも認識性能が優れた学習モデルの一つである。サポートベ クターマシンが優れた認識性能を発揮することができる理由は、未学習データに対して高い識別性能を得るための工夫が あるためである。) knn(k近傍法は、インスタンスに基づく学習の一種であり、怠惰学習(英語: lazy learning) の一種である。) ●データ収集:まず私たち四人のジェスチャーを収集します。 ●OpenCV画像処理ー ●特徴計算ー ●データ集作るー ●まとめ学習ー ●認識ー ●GUI画面(コンピューターの画面上に表示されるウィンドウやアイコン、ボタン、プルダウンメニューなどを使い、マウスなどのポインティングデバイスで操作できるインターフェース。これに対して、文字によるコマンド入力方式のインターフェースは「CUI(Character User Interface)」と呼ばれる。現在のパソコンのインターフェースは、ほぼすべてGUIを採用している。)
二人OpenCVを勉強續きます。のごり二人はWindow実装の方法を試します。