---
title: "Python/OpenCV : Brouillon : Détection des contours du blob"
url: https://www.cyber-neurones.org/2022/04/python-opencv-brouillon-detection-des-contours-du-blob/
date: 2022-04-24
modified: 2022-04-25
author: "Frederic"
description: "C'est pas gagné pour faire la détection du contour du blob (en mv4) : [video width=\"1060\" height=\"720\" m4v=\"https://www.cyber-neurones.org/wp-content/uploads/2022/04/blob2outpytest.m4v\"][/video] J'ai des problèmes de jaune :( import cv2 import numpy as np..."
categories:
  - "Linux"
tags:
  - "OpenCV"
  - "Python"
image: https://www.cyber-neurones.org/wp-content/uploads/2022/04/capture-decran-2022-04-25-a-101422-1024x432.png
word_count: 63
---

# Python/OpenCV : Brouillon : Détection des contours du blob

C'est pas gagné pour faire la détection du contour du blob (en mv4) :

[https://www.cyber-neurones.org/wp-content/uploads/2022/04/blob2outpytest.m4v](https://www.cyber-neurones.org/wp-content/uploads/2022/04/blob2outpytest.m4v)

J'ai des problèmes de jaune :(
import cv2
import numpy as np
import matplotlib.pyplot as plt
....
frame_hsv=cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)

low_yellow=np.array([10, 125, 100])
upper_yellow=np.array([60, 220, 220])
mask_yellow=cv2.inRange(frame_hsv,low_yellow,upper_yellow)

list_masks=[mask_yellow]
for i,mask in enumerate(list_masks):

contours, _=cv2.findContours(mask,cv2.RETR_LIST,cv2.CHAIN_APPROX_NONE)

Sans le polygone (et en mp4):

[https://www.cyber-neurones.org/wp-content/uploads/2022/04/blob2outpytest2.mp4](https://www.cyber-neurones.org/wp-content/uploads/2022/04/blob2outpytest2.mp4)

A suivre.