Python基于openCV火焰识别

#!/usr/bin/env python
# -*- coding:utf-8 -*-
import cv2 as cv
import numpy as np
w_thre=50; #长宽最小阈值
h_thre=50;
def find_countours_center(frame,countours):
    C=[]#放中心点
    for i in range(np.array(contours, dtype=object).shape[0]):
        # print(countours[i])
        x_list = []
        y_list = []
        for j in range(np.array(countours[i]).shape[0]):#将一个闭合曲线里面的所有x,y轴坐标放在两个list里
            x_list.append(countours[i][j][0][0])
            y_list.append(countours[i][j][0][1])
        if (max(x_list)-min(x_list))>w_thre or (max(y_list)-min(y_list))>h_thre

你可能感兴趣的:(python)