{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/gpt-conceptual-understanding/",
  "atlas": "https://www.pystone.net/?node=gpt-conceptual-understanding#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/gpt-conceptual-understanding.md",
  "context": "https://www.pystone.net/notes/gpt-conceptual-understanding.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:gpt-conceptual-understanding",
  "slug": "gpt-conceptual-understanding",
  "title": "GPT理解",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "GPT理解",
  "contentRole": "unspecified",
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "unspecified",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "05f73c11f816258787c1f5addbbb8eca7402c235bd5e06e984c0dd701b6e6b4b",
  "assets": [
    {
      "reference": "assets/1590635841697.png",
      "url": "/media/50d8dc836455a857fb5a.png",
      "mediaType": "image/png",
      "contentHash": "50d8dc836455a857fb5ab318ddfdbaa3674985389f1bbc4f9569ddc6ff0936c8",
      "byteLength": 47440,
      "width": 761,
      "height": 206
    },
    {
      "reference": "assets/1590635848149.png",
      "url": "/media/eb79b460d523e9745700.png",
      "mediaType": "image/png",
      "contentHash": "eb79b460d523e97457003658cada1f8eaedce8ea0ed67ecfcbfac000ee3ece56",
      "byteLength": 68632,
      "width": 573,
      "height": 262
    }
  ],
  "headings": [
    {
      "depth": 1,
      "text": "GPT理解",
      "anchor": "gpt理解",
      "citation": "https://www.pystone.net/notes/gpt-conceptual-understanding/#gpt%E7%90%86%E8%A7%A3"
    },
    {
      "depth": 2,
      "text": "贪婪投影算法原理英文翻译",
      "anchor": "贪婪投影算法原理英文翻译",
      "citation": "https://www.pystone.net/notes/gpt-conceptual-understanding/#%E8%B4%AA%E5%A9%AA%E6%8A%95%E5%BD%B1%E7%AE%97%E6%B3%95%E5%8E%9F%E7%90%86%E8%8B%B1%E6%96%87%E7%BF%BB%E8%AF%91"
    },
    {
      "depth": 2,
      "text": "关于mu和searchradius",
      "anchor": "关于mu和searchradius",
      "citation": "https://www.pystone.net/notes/gpt-conceptual-understanding/#%E5%85%B3%E4%BA%8Emu%E5%92%8Csearchradius"
    },
    {
      "depth": 3,
      "text": "源码",
      "anchor": "源码",
      "citation": "https://www.pystone.net/notes/gpt-conceptual-understanding/#%E6%BA%90%E7%A0%81"
    },
    {
      "depth": 3,
      "text": "Doc",
      "anchor": "doc",
      "citation": "https://www.pystone.net/notes/gpt-conceptual-understanding/#doc"
    },
    {
      "depth": 3,
      "text": "博客",
      "anchor": "博客",
      "citation": "https://www.pystone.net/notes/gpt-conceptual-understanding/#%E5%8D%9A%E5%AE%A2"
    }
  ],
  "claims": [],
  "outgoing": [],
  "incoming": [
    {
      "id": "note:graphics-and-3d-reconstruction",
      "title": "图形学与三维重构",
      "url": "https://www.pystone.net/notes/graphics-and-3d-reconstruction/",
      "atlas": "https://www.pystone.net/?node=graphics-and-3d-reconstruction#knowledge-atlas",
      "label": "图形学与三维重构",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "本层中的“GPT理解”导航项",
      "citation": "https://www.pystone.net/notes/graphics-and-3d-reconstruction/#%E6%9C%AC%E5%B1%82"
    }
  ],
  "contentMarkdown": "# GPT理解\n\n> 创建时间：2020/5/26 23:38\n\n## 贪婪投影算法原理英文翻译\n\n贪婪投影算法原理是：通过控制一系列点列表（边缘点）能使网格生长，并将其向外扩展直到所有可能的点被连接。局部三角化是通过沿点的法向映射点的局部领域点，并连接未连接点。\n该算法是基于增量表面生长原理，遵循贪婪类型方法。该算法首先创建一个初始三角形，并继续添加新的三角形，直到考虑了点云中的所有点，或者没有更多地有效三角形可以连接到网格中。\n算法流程：\n1、 最近邻搜索：对于点云中的每个点“P”，选择k-领域；\n通过再半径为r的球内搜索参考点的最近k-领域来创建点p的领域。半径r定义为u*d，其中d是点p和最近领域的距离；u是用户考虑点云密度的自定义常数。\n为了找到点云中给定点的最近邻居，使用了Kd-tree最近邻搜索。\n依据点云三角化算法过程中的交互作用，点云中的点被标记为多种状态：自由、边缘、边界和完成。\na） 首先，点云中所有的点都处于“自由”状态，自由点被定义为没有邻接三角形的点；\nb） 当一个点的所有邻接三角形都被确定了，则该点标记为“完成”；\nc） 当一个点被选为参考点但由于最大允许角度参数约束而具有一些缺失三角形时，它被称为边界点；\nd） 边缘点是指未被选择作为参考点的点。\n2、 使用切平面的领域投影：领域投影再一个平面上，该平面与领域形成的表面大致相切，并在p周围排序。\n3、 修剪：通过可见性和距离标准修建点，并通过边连接到p和连续点，形成满足具有最大角度标准和可选的最小角度标准的三角形。点云修剪依赖于很多标准\na) 按距离修剪：使用kd-tree搜索候选邻近点在当前参考点的空间领域中；\nb) 位于参考点影响中心球半径之外的其他点是不能作为候选点。所选择的领域点被称为候选点；\nc) 投影平面的选择：应用距离标准获得的候选点集投影到近似切平面；\nd) 角度排序：以参考点为原点定义新的局部坐标系，前一步的投影平面作为xy平面；候选点集中的所有点都投影到这个平面，点基于局部坐标系的x轴与从原点到投影候选点的角度排序\ne) 可见性：丢弃可能形成自相交网格的点。算法定义了两种边缘类型来检查这种情况；\nI 边界边：仅有一个相邻三角形的边，这些边连接“边缘”点或者“边界”点；\nII 内部边：连接“完成”点与其他任何点；\n使用参考点、候选点集和边界边投影平面。在这种情况下，从参考点到候选点的光线被边遮挡，则该点为不可见。\n\n参考文献：\nNavpreet Kaur Pawar 2013\nGopi, M. & Krishnan, S. 2000\n后续将继续更新。\n\n## 关于mu_和search_radius\n\n### 源码\n\nconst double sqr_mu = mu_*mu_;\nconst double sqr_max_edge = search_radius_*search_radius_;\n\n//距离门槛\ndouble sqr_dist_threshold = (std::min)(sqr_max_edge, sqr_mu * sqrDists[1]);//sqr_mu * sqr_avg_conn_dist);\n\n// Variables to hold the results of nearest neighbor searches\nstd::vector nnIdx (nnn_);\nstd::vector sqrDists (nnn_);\n\n### Doc\n\n![Alt text](assets/1590635841697.png)\n\n  * setMu()\n\nSet the multiplier of the nearest neighbor distance to obtain the final search radius for each point (this will make the algorithm adapt to different point densities in the cloud).\n\n  * mu_\nThe nearest neighbor distance multiplier to obtain the final search radius.\n\n最邻近点距离的乘子\n用于确定每个点的最终的搜索半径\n\n![Alt text](assets/1590635848149.png)\n\n  * setSearchRadius()\nSet the sphere radius that is to be used for determining the k-nearest neighbors used for triangulating.\n\n  * search_radius_\nThe nearest neighbors search radius for each point and the maximum edge length.\n\n表示对每个点最邻近搜索的半径\n又该距离限制重建的网格模型面片的最大边长\n\nconst double sqr_max_edge = search_radius_*search_radius_;\n\n//距离门槛\ndouble sqr_dist_threshold = (std::min)(sqr_max_edge, sqr_mu * sqrDists[1]);//sqr_mu * sqr_avg_conn_dist);//sqr_mu * sqr_avg_conn_dist);\n\n由该代码可知，距离门槛search_radius_和sqr_mu * sqrDists[1]当中较小的一个\n前者由用户设定\n后者由用户设定的mu值与点云平均距离的乘积确定\n\nsearch_radius_ 在最近邻搜索前设置，搜索时发挥作用\nmu_ 在搜索完，进行剔除时发挥所用（利用搜索的结果，获取平均距离值，进行相称）\n\n根据文档可知，\n\n### 博客\n\ngp3.setSearchRadius (1.5f); //设置连接点之间的最大距离（最大边长）用于确定k近邻的球半径【默认值 0】\ngp3.setMu (2.5f); //设置最近邻距离的乘子，以得到每个点的最终搜索半径【默认值 0】\n"
}
