Fred'ô / Python/OpenCV : Brouillon : Détection des contours du blob

Created Sun, 24 Apr 2022 00:00:00 +0000 Modified Sun, 24 Apr 2022 00:00:00 +0000

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 
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):

[video width=“1280” height=“720” mp4=“https://www.cyber-neurones.org/wp-content/uploads/2022/04/blob2outpytest2.mp4"][/video]

A suivre.