在python中提取四分之一圆内的像素
我有一张图像,我想提取其中特定部分的像素。这部分是四分之一圆,我的愿望是获得它的像素。
我有中心的坐标以及线连接到圆的点。怎么可能只提取四分之一而忽略其他部分呢?
I have an image which I want to extract the pixels of the specific part of that. This part is a quarter circle, and my desire is to obtain the pixels of that.
I have the coordinates of the center and points which the lines connected to the circle. How is it possible to extract one quarter and ignore other parts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
圆盘具有方程
(X-Xc)²+(Y-Yc)²≤R²
。在中心相交的半平面有方程
c(X-Xc) + s(Y-Yc)≥0
,其中c
和s
为角度的余弦和正弦。因此,扫描图像(或仅扫描圆的边界框)并考虑像素
(X, Y)
,以满足三个约束。The disk has the equation
(X-Xc)²+(Y-Yc)²≤R²
.The half planes meeting at the center have equations
c(X-Xc) + s(Y-Yc)≥0
wherec
ands
are the cosine and sine of the angle.Hence, scan the image (or just the bounding box of the circle) and consider the pixels
(X, Y)
such that the three constraints are satisfied.