
エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Pythonを使って黄色い線の輪郭検出 - Qiita
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Pythonを使って黄色い線の輪郭検出 - Qiita
import cv2 from matplotlib import pyplot as plt img = cv2.imread('yellow_line.jpeg', 1) img_gray ... import cv2 from matplotlib import pyplot as plt img = cv2.imread('yellow_line.jpeg', 1) img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) ret, img_binary = cv2.threshold(img_gray, 140, 255, cv2.THRESH_BINARY) contours, hierarchy = cv2.findContours(img_binary, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE) contours = list(filter(lambda x: cv2.contourArea(x) > 100, contours)) img_contour = cv2.drawContour