贴部分代码
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import cv2
import numpy as np
from PIL import Image
area = 0
def ostu(img):
global area
image=cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # 转灰度
blur = cv2.GaussianBlur(image,(5,5),0) # 阈值一定要设为 0 !高斯模糊
ret3,th3 = cv2.threshold(blur,0,255,cv2.THR
2021-07-27 22:12:37
31KB
c
nc
op
1