在图像上的指定位置内爆
我有一个关于 implode 函数的问题 (https://docs.wand-py.org/en/0.6.7/guide/fx.html#implode)。是否有可能对图像中非中心的点使用内爆函数?通过传递例如坐标元组?
I have a question regarding the implode
function (https://docs.wand-py.org/en/0.6.7/guide/fx.html#implode). Is there any possibility to use the implode function for a point in the image that is not the center? By passing e.g. a tuple of coordinates?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会分享我的解决方法以防万一。我编写了一个小脚本,以通过用鼠标在图像上单击图像来找出要爆裂的点的位置。我最终得到了坐标(例如,在形状100、100的图像中40,30)。
在下一步中,我必须以某种方式将40,30的像素“移动”到图像中心。为此,我决定相应地(使用CV2)在图像周围添加边界。因此,我将不得不在图像的左侧水平添加20个(因此图像为120,100,40,30的像素与每个边界的距离相同(右侧60,左侧60)。我愿意垂直轴相同,在这种情况下,尺寸为120x140的图像,
现在我在我指定的点上爆炸,如果我要介绍了四个情况,一切都可以自动化AT是较高或较低的H/2或W/2,因此我知道我必须在哪一侧添加边框
。
I'll share my workaround just in case. I've written a small script to find out the position of the point I want to implode by clicking on it on the image with the mouse. I end up with coordinates (e.g. 40,30 in a image with the shape 100, 100).
In the next step I'd have to somehow "move" my pixel at 40,30 into the image center. To do so I've decided to add borders around my image accordingly (with cv2). So I'll have to add 20 horizontally on the left side of my image (so the image is 120,100 and my pixel at 40,30 has the same distance to each border (60 to the right, 60 to the left). I do the same for the vertical axis and end up, in this case, with an image with the dimension of 120x140.
Now I cam implode at my specified point and everything is able to being automated if I cover four cases of the point I want to implode at is either higher or lower of h/2 or w/2 so I know on which side I have to add the border.
Afterwards you can use the trim function to get rid of the extended border and you're good to go.