teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

5

追記

2018/06/07 21:07

投稿

umyu
umyu

スコア5846

answer CHANGED
@@ -30,6 +30,5 @@
30
30
  ◇実行結果
31
31
  ![イメージ説明](66b95512a314a0f5c6cb97a9d74a9de7.png)![イメージ説明](7ae490eefb95db64f722425af4132d1d.png)
32
32
  ◇参考情報
33
- [【OpenCV; Python】findcontours関数のまとめ](https://qiita.com/anyamaru/items/fd3d894966a98098376c)
33
+ 0. [【OpenCV; Python】findcontours関数のまとめ](https://qiita.com/anyamaru/items/fd3d894966a98098376c)
34
-
35
- 手前味噌ですが、`cv2.adaptiveThreshold`の`parameter`チェック用に`GitHub`に[AdaptiveThresholdSimulator](https://github.com/umyuu/AdaptiveThresholdSimulator)を公開してたりもします。
34
+ 0. [AdaptiveThresholdSimulator](https://github.com/umyuu/AdaptiveThresholdSimulator)

4

追記

2018/06/07 21:07

投稿

umyu
umyu

スコア5846

answer CHANGED
@@ -15,7 +15,7 @@
15
15
  assert img is not None, FILE_NAME
16
16
 
17
17
  img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
18
- ret = cv2.adaptiveThreshold(img_gray, 255, 0, 1, 11, 3)
18
+ ret = cv2.adaptiveThreshold(img_gray, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY_INV, 11, 3)
19
19
  imshow(ret)
20
20
  im2, contours, hierarchy = cv2.findContours(ret, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_TC89_L1)
21
21
  for c in contours:

3

追記

2018/06/07 21:06

投稿

umyu
umyu

スコア5846

answer CHANGED
@@ -1,4 +1,4 @@
1
- `cv2.adaptiveThreshold`を使った抽出です、ご参考まで。
1
+ [cv2.adaptiveThreshold](https://docs.opencv.org/3.4.0/d7/d4d/tutorial_py_thresholding.html)を使った抽出です、ご参考まで。
2
2
 
3
3
  ```Python
4
4
  import cv2
@@ -27,6 +27,8 @@
27
27
  main()
28
28
 
29
29
  ```
30
+ ◇実行結果
31
+ ![イメージ説明](66b95512a314a0f5c6cb97a9d74a9de7.png)![イメージ説明](7ae490eefb95db64f722425af4132d1d.png)
30
32
  ◇参考情報
31
33
  [【OpenCV; Python】findcontours関数のまとめ](https://qiita.com/anyamaru/items/fd3d894966a98098376c)
32
34
 

2

追記

2018/06/07 20:30

投稿

umyu
umyu

スコア5846

answer CHANGED
@@ -30,4 +30,4 @@
30
30
  ◇参考情報
31
31
  [【OpenCV; Python】findcontours関数のまとめ](https://qiita.com/anyamaru/items/fd3d894966a98098376c)
32
32
 
33
- 手前味噌ですが、GitHubに[AdaptiveThresholdSimulator](https://github.com/umyuu/AdaptiveThresholdSimulator)を公開してたりもします。
33
+ 手前味噌ですが、`cv2.adaptiveThreshold`の`parameter`チェック用に`GitHub`に[AdaptiveThresholdSimulator](https://github.com/umyuu/AdaptiveThresholdSimulator)を公開してたりもします。

1

追記

2018/06/07 19:05

投稿

umyu
umyu

スコア5846

answer CHANGED
@@ -28,4 +28,6 @@
28
28
 
29
29
  ```
30
30
  ◇参考情報
31
- [【OpenCV; Python】findcontours関数のまとめ](https://qiita.com/anyamaru/items/fd3d894966a98098376c)
31
+ [【OpenCV; Python】findcontours関数のまとめ](https://qiita.com/anyamaru/items/fd3d894966a98098376c)
32
+
33
+ 手前味噌ですが、GitHubに[AdaptiveThresholdSimulator](https://github.com/umyuu/AdaptiveThresholdSimulator)を公開してたりもします。