Fac*_*res 4 python opencv image-processing
我正在使用特定类型的图像.那些,在获得光谱(aply the fft)后,我得到如下图:

所以我想以下列方式选择其中一个"点"(称为谱的顺序):

我的意思是"绘制"一个圆圈,选择里面的像素,然后将这些像素居中(没有"边框圆圈"):

如何使用OpenCV执行它?有没有任何功能?
编辑:根据下面的讨论,要"选择"一个圆圈,可以使用一个掩码:
# Build mask
mask = np.zeros(image_array.shape, dtype=np.uint8)
cv2.circle(mask, max_loc, circle_radius, (255, 255, 255), -1, 8, 0)
# Apply mask (using bitwise & operator)
result_array = image_array & mask
# Crop/center result (assuming max_loc is of the form (x, y))
result_array = result_array[max_loc[1] - circle_radius:max_loc[1] + circle_radius,
max_loc[0] - circle_radius:max_loc[0] + circle_radius, :]
Run Code Online (Sandbox Code Playgroud)
这给我留下了类似的东西:

另一个编辑: 这可能对查找峰值很有用.