# 机器视觉

### 点积：可以反应方向相似程度

```
a⋅b=|a|*|b|*cosθ

其中：
|a| 是向量 a 的长度（模）
|b| 是向量 b 的长度
θ 是它们之间的夹角（0° 到 180°）

所以：
如果 a ⊥ b（垂直）→ θ = 90° → cosθ = 0 → 点积 = 0
如果 a 与 b 同向 → θ = 0° → cosθ = 1 → 点积 = |a||b|
如果 a 与 b 反向 → θ = 180° → cosθ = -1 → 点积 = -|a||b|
```

### 点积值的解读（假设向量非零）

<div class="qwen-markdown-table-wrap qwen-markdown-table-wrap-pc group relative my-2 w-full" id="bkmrk-%E7%82%B9%E7%A7%AF%E7%BB%93%E6%9E%9C-%E6%95%B0%E5%80%BC%E8%8C%83%E5%9B%B4-%E5%87%A0%E4%BD%95%E6%84%8F%E4%B9%89-%E8%AF%B4%E6%98%8E-%E6%9C%80%E5%A4%A7"><div class="scrollbar-hidden relative max-w-full overflow-x-auto whitespace-nowrap rounded-lg"><table border="1" class="qwen-markdown-table w-full max-w-full table-auto rounded-xl text-left text-sm text-gray-500 dark:text-gray-400" style="border-collapse: collapse; border-width: 2px; width: 100.595%; height: 205.375px;"><thead class="qwen-markdown-table-thead border-none bg-gray-50 text-xs uppercase text-gray-700 dark:bg-gray-850 dark:text-gray-400"><tr class="qwen-markdown-table-thead-tr" style="height: 30.7969px;"><th class="qwen-markdown-table-thead-tr-th cursor-pointer select-none border border-gray-50 dark:border-gray-850" scope="col" style="border-width: 2px; width: 11.2124%; height: 30.7969px;">点积结果</th><th class="qwen-markdown-table-thead-tr-th cursor-pointer select-none border border-gray-50 dark:border-gray-850" scope="col" style="border-width: 2px; width: 16.364%; height: 30.7969px;">数值范围</th><th class="qwen-markdown-table-thead-tr-th cursor-pointer select-none border border-gray-50 dark:border-gray-850" scope="col" style="border-width: 2px; width: 23.4854%; height: 30.7969px;">几何意义</th><th class="qwen-markdown-table-thead-tr-th cursor-pointer select-none border border-gray-50 dark:border-gray-850" scope="col" style="border-width: 2px; width: 48.789%; height: 30.7969px;">说明</th></tr></thead><tbody class="qwen-markdown-table-tbody"><tr class="qwen-markdown-table-tbody-tr bg-white text-xs dark:border-gray-850 dark:bg-gray-900" style="height: 47.5938px;"><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 11.2124%; height: 47.5938px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]">**最大正值**</div></td><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 16.364%; height: 47.5938px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]"><span translate="no"><span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="mrel">=</span></span><span class="base"><span class="mord">∣</span><span class="mord mathbf">a</span><span class="mord">∣∣</span><span class="mord mathbf">b</span><span class="mord">∣</span></span></span></span></span></div></td><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 23.4854%; height: 47.5938px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]">**完全同向**（θ = 0°）</div></td><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 48.789%; height: 47.5938px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]">向量指向完全相同方向，cosθ = 1</div></td></tr><tr class="qwen-markdown-table-tbody-tr bg-white text-xs dark:border-gray-850 dark:bg-gray-900" style="height: 30.7969px;"><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 11.2124%; height: 30.7969px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]">**正数**</div></td><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 16.364%; height: 30.7969px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]"><span translate="no"><span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="mrel">&gt;</span></span><span class="base"><span class="mord">0</span></span></span></span></span></div></td><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 23.4854%; height: 30.7969px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]">**夹角 &lt; 90°**（锐角）</div></td><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 48.789%; height: 30.7969px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]">方向“大致相同”，越接近同向，点积越大</div></td></tr><tr class="qwen-markdown-table-tbody-tr bg-white text-xs dark:border-gray-850 dark:bg-gray-900" style="height: 30.7969px;"><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 11.2124%; height: 30.7969px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]">**零**</div></td><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 16.364%; height: 30.7969px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]"><span translate="no"><span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="mrel">=</span></span><span class="base"><span class="mord">0</span></span></span></span></span></div></td><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 23.4854%; height: 30.7969px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]">**垂直**（θ = 90°）</div></td><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 48.789%; height: 30.7969px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]">互相正交，无方向关联</div></td></tr><tr class="qwen-markdown-table-tbody-tr bg-white text-xs dark:border-gray-850 dark:bg-gray-900" style="height: 30.7969px;"><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 11.2124%; height: 30.7969px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]">**负数**</div></td><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 16.364%; height: 30.7969px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]"><span translate="no"><span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="mrel">&lt;</span></span><span class="base"><span class="mord">0</span></span></span></span></span></div></td><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 23.4854%; height: 30.7969px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]">**夹角 &gt; 90°**（钝角）</div></td><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 48.789%; height: 30.7969px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]">方向“相反倾向”，越接近反向，点积越小（越负）</div></td></tr><tr class="qwen-markdown-table-tbody-tr bg-white text-xs dark:border-gray-850 dark:bg-gray-900" style="height: 34.5938px;"><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 11.2124%; height: 34.5938px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]">**最小负值**</div></td><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 16.364%; height: 34.5938px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]"><span translate="no"><span class="katex"><span aria-hidden="true" class="katex-html"><span class="base"><span class="mrel">=</span></span><span class="base"><span class="mord">−</span><span class="mord">∣</span><span class="mord mathbf">a</span><span class="mord">∣∣</span><span class="mord mathbf">b</span><span class="mord">∣</span></span></span></span></span></div></td><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 23.4854%; height: 34.5938px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]">**完全反向**（θ = 180°）</div></td><td class="qwen-markdown-table-tbody-tr-td w-max border border-gray-50 text-gray-900 dark:border-gray-850 dark:text-white" style="border-width: 2px; width: 48.789%; height: 34.5938px;"><div class="qwen-markdown-table-tbody-tr-td-col flex items-center gap-[2px]" data-spm-anchor-id="a2ty_o01.29997173.0.i17.1540c921Qax0rX">cosθ = -1</div></td></tr></tbody></table>

</div></div>