矩形roi填充斑块
import cv2
import numpy as np
img = np.zeros([200,200,3],np.uint8)
img[:,:,:]=255
img[50:100,50:100]=[0,0,0]
cv2.imshow("asdf",img)
img_ = cv2.GaussianBlur(img,(51,51),0)
cv2.imshow('img_',img_)
cv2.waitKey()
圆形roi填充斑块
import cv2
import numpy as np
img = np.zeros([200,200,3],np.uint8)
img[:,:,:]=255
img = cv2.circle(img, (100, 100), 50, (0, 0, 0), -1)
# img = cv2.circle(img, (50, 50), 50, (255, 0, 0), 1, 8, 0) # 画圆
# img[50:100,50:100]=[0,0,0]
cv2.imshow("img",img)
img_ = cv2.GaussianBlur(img,(51,51),0)
cv2.imshow('result',img_)
cv2.waitKey()
椭圆roi
import cv2
import numpy as np
img = np.zeros([200,200,3],np.uint8)
img[:,:,:]=255
img=cv2.ellipse(img, (100,100), (75, 50), 0, 0, 360, (0, 0, 0), -1)
# img = cv2.circle(img, (100, 100), 50, (0, 0, 0), -1)
# img = cv2.circle(img, (50, 50), 50, (255, 0, 0), 1, 8, 0) # 画圆
# img[50:100,50:100]=[0,0,0]
cv2.imshow("img",img)
img_ = cv2.GaussianBlur(img,(51,51),0)
cv2.imshow('result',img_)
cv2.waitKey()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)