如何自动定位网格 3D 图的峰值中心?
我已经在 matlab 中研究 3d 图一段时间了。我已经用 40 x 40 网格在网格图上绘制了三个矩阵,我可以手动查看峰值并手动定位峰值,但我无法找到使用 40 x 40 1600 点的逻辑自动定位峰值的方法我们可以在网格中比较每个顶点并查看哪个顶点的点数最多,从而自动获取顶点。如果有人可以帮助我如何读取绘图的数据,从而定义比较顶点的逻辑。
I have been working on the 3d plots for a while in matlab. I have plotted three matrices on the mesh plot with a 40 by 40 grid and I could see peaks manually and locate the peaks manually but I'm not able to find a method to locate the peaks automatically using logic of the 40 by 40 1600 point grid where we can compare each vertice and see which one has the maximum number of points and thus automatically get the vertices. If someone could help me how to read the data of the plot and thus define a logic to compare the vertices.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您正在尝试在矩阵中找到局部最大值(和/或最小值)。
在这种情况下,Cumputer Vision 工具箱中有一个功能(如果有的话)。如果没有,您可以简单地创建一个函数来迭代矩阵的元素并获取其中的一部分(比方说,3x3,但也可以是 5x5 或更多)。然后检查中心元素是否是该小矩阵中最大的元素,如果是,则将坐标(行和列索引)添加到向量中。
您还可以将子矩阵的大小作为参数,以定义函数对小峰值的敏感程度。
I argue that you are trying to find local maxima (and/or minima) in your matrix.
In this case, there is a function in the Cumputer Vision toolbox if you have it. If don't, you can simply create a function that iterates over elements of your matrix and takes a portion of it (let's say, 3x3, but could be also 5x5 or more). Then you check if the central element is the biggest of that small matrix, and if it is you add the coordinates (row and col indexes) in a vector.
You can also give the size of the sub-matrix as a parameter, to define how sensitive is your function to small peaks.