开发者

How to build a grid from scattered points in OpenCV?

What I need is to construct a intensity grid(image) in OpenCV from which I can extract some contours. I have already resolved this issue with a complete data grid, but my problem is that I will only have some scattered points available on the map and I will have to build this grid myself. From what I've read from different sources the way to go is usin开发者_JAVA技巧g Delaunay triangulation on the scattered points. I have already found some functions in OpenCV that build these triangles, but I can't find a way how to use this data to build my needed data grid. If there are other more helping functions in OpenCV or a way to use my current progress, i would appreciate it if you can point me in the right direction. Thank you.


So, you could use the delaunay triangulation to give you the interpolating points to fill in the empty image points in between. This is basically what happens when you use delaunay to render a sparse height field. It may help to read up on barycentric coordinates (as those are the coordinates you would use to perform the interpolation). I just checked and Wikipedia actually has a section on interpolation on an unstructured grid that basically answers how to take the triangulation to the interpolated grid.

http://en.wikipedia.org/wiki/Barycentric_coordinate_system_(mathematics)#Interpolation_on_a_triangular_unstructured_grid

Unfortunately, I'm not familiar enough with OpenCV to tell you if there are any short cuts in there, but hopefully this gets you with the right search words to get to your desired end state. At a wild guess, since the GPU was originally made to do this exact operation, it should be possible to do this really stinking quickly on one.


More than Delaunay, I think you need a Voronoi diagram:

How to build a grid from scattered points in OpenCV?

You can generate it using OpenCV dilate starting from each point of your grid, and using different colors for each intensity (or dilate step).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜