找出向量下图像的像素
这可能是一个简单的问题,但我无法解决它。
我有需要处理的高度图。我必须允许用户在图像上追踪矢量,指示应在给定时间处理高度图的哪条“线”。
问题是,一旦我追踪到矢量,我如何找出光栅图像的哪些像素位于所述矢量“下方”?
如果矢量是水平或垂直的,或者即使它绘制 45° 角,但不是任意旋转角度,则很容易。
This might be a simple problem but I can't manage to solve it.
I've got this heightmap which I need to process. I must allow the user to trace a vector over an image, indicating which "line" of the height map should be processed at a given time.
The question is, once I got the vector traced, how can I find out which pixels of the raster image lie "under" said vector?
It's easy if the vector is horizontal or vertical, or even if it draws a 45º angle, but not with an arbitrary rotation angle.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不完全确定我在关注您,但是您是否正在寻找类似 Bresenham 线算法的东西?
I'm not completely sure I'm following you, but are you perhaps looking for something like Bresenham's line algorithm?