矩形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()
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://blog.csdn.net/jacke121/article/details/124459753
内容来源于网络,如有侵权,请联系作者删除!