如何从图像文件生成马赛克图片?
我有一个源图像(如左图)和一组元素(如右图): Source Image和 Elements...
..我需要生成像 这样的马赛克图片这个。
但直到现在我还没有接触过图像,我不知道应该从哪里开始。
我使用 C# 工作了几年,但您可以使用其他类似语言给出示例。
I have a source image like left picture and a set of elements like right picture: Source Image And Elements...
..and I need to generate a mosaic picture like this.
But until this moment I have not worked with images, аnd I do not know where I should start.
I worked several years with C#, but you can give examples in other similar languages.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您给出的结果图像显然是 ministeck 模式 - 2011 年,他们有一个可下载的软件,似乎可以做您想要的事情想。 (ministeck 不再直接提供该服务,但 pfci.de 似乎仍然提供下载)。
因此,如果您只是想从给定的图像中生成 ministeck 的模式,请使用他们的软件。如果您正在寻找一种算法来实现不同的目标,那么这将无济于事。
编辑
好的,如果您在分析图像后,需要将其加载到如下所示的对象中:
Bitmap 对象有几个 属性 和 方法将帮助您分析图像内容。尝试这样做来开始分析您的图像,并且不要忘记随后处理您的位图或将其包装到 using 语句中,如上所示......
The result image you gave is apparently a ministeck pattern - in 2011 they had a downloadable software that seemed to do what you want. (Which is not available anymore by ministeck directly, but it seems that pfci.de still provides a download).
So, if you're just looking to generate the patterns for ministeck out of a given image, use their software. If you're after an algorithm to achieve something different, this won't help.
EDIT
Ok, if you're after analyzing your image, you need to load it into an object like this:
The Bitmap object has several properties and methods that will help you to analyze the image content. Try this to get started with analyzing your image, and don't forget to either dispose your bitmap afterwards or wrap it into a using statement as shown above ...