pythonとか

python3+opencvで何か色々やります

findContours,hierarchy

OpenCVの輪郭検出機能にfindContoursがある これを使うと返り値にコンターと階層構造が取得できる試しに以下のような画像を用意して次のコードを実行する import cv2 img = cv2.imread("./test.png") gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) ret, con…

テスト

あああ for cs in range(0, len(contours)): cnt = contours[cs] cv2.drawContours(img_col, [cnt], 0, (0,0,255), 1)

test2

中間テスト

test

期末テスト