gpt4 book ai didi

python - 使用 openCV 提取图像的一部分

转载 作者:行者123 更新时间:2023-12-04 07:43:05 26 4
gpt4 key购买 nike

我是图像处理的新手。请问有没有什么办法可以把图片中的星星标志提取出来?
enter image description here

最佳答案

试一试

import cv2 as cv
import numpy as np

img = cv.imread('airplane.png')
cv.imshow('Original', img)

blank = np.zeros(img.shape[:2], dtype='uint8')

center_coordinates = (144, 233)

radius = 10

mask = cv.circle(blank, center_coordinates, radius, 255, -1)

masked = cv.bitwise_and(img, img, mask=mask)
cv.imshow('Output', masked)

cv.waitKey(0)

关于python - 使用 openCV 提取图像的一部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67353650/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com