地形图等高线提取
我正在尝试从彩色地形图中提取等高线。 目标是使用我从零开始开发的引擎构建该区域的 3D 演示。 直到现在一切都工作得很好(从零开始制作 3D 引擎并显示对象等),但现在我陷入困境......
我已经看到了许多描述执行此类操作的算法的文档,但是 - 他们使用了我拥有的简短语言很难理解并假设对图像处理有很强的了解。
如果你们中的任何人能告诉我一个很好的资源来学习如何做到这一点,或者告诉我一系列资源,这些资源将使我能够将它们组合成一个完整的算法,我将非常高兴。 如果你知道任何一本书包含有关该问题的章节,或者有描述,可以让我将其中的一些元素组合到我自己的系统中,这将会有很大的帮助。
如果你知道有人做过类似的事情 - 这也会帮助我了解他。
提前致谢 !
I am trying to extract the contour lines from colour topographic maps.
The goal is to build a 3D demonstration of the area, using an engine developed by me from zero.
Untill now everything worked great (making the 3D engine from zero and displaying objects etc.), but now I got stuck...
I have seen many documents describing algorithms for doing such a thing, however - they use a short language which I have a hard time understanding and assume a very strong knowledge of image proccessing.
I would be very pleased if any of you could tell me of a good resource to learn from how to do it, or tell of a sequence of resources which will allow me to combine them into a complete alogrithm.
If you know any book which contains a chapter on ther matter, or has descriptions which will allow me to combine some elements in them into my own system, it would be of great help.
If you know of someone who did a similar thing - it would also help me to know him.
Thanks in advance !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 GDAL 库,它提供了从栅格生成等值线的 API。请参阅 GDALContourGenerate 函数。如果你想了解算法细节,只需查看GDAL的源代码即可。
您还可以使用命令行实用程序试验此 GDAL 功能:gdal_contour
You can use GDAL library which provides API for generating contours from raster. See GDALContourGenerate function. If you want to learn about algorithms details, just take a look into the source code of GDAL.
You also can experiment with this GDAL capability using command line utility: gdal_contour
我们根据 USGS DEM(数字高程模型)文件进行所有 3D 地形建模。
编辑:
将扫描图像转换为灰度并增加对比度,直到获得轮廓线而没有其他任何东西(通过图像编辑软件或以编程方式)。此时你的线条应该是黑色的。扫描像素并记录与其他黑色像素接壤的所有黑色像素。假设您需要至少两个其他接壤像素的匹配。您还可以对每个保存的区域应用某种体积公式......比如说......任何小于 50 个连续像素的东西都会被丢弃。
We do all our 3D terrain modeling from USGS DEM (Digital elevation model) files.
Edit:
Convert your scanned images into grayscale and increase the contrast until you have the contour lines and not much else (either via image editing software or programmatically). At this point your lines should be black. Scan through the pixels and record all the black pixels that border other black pixels.. say you need a match of at least two other bordering pixels. You could also apply some kind of volume formula to each saved region.. say.. anything less than 50 contiguous pixels is thrown out.