# 概述

## 计算机视觉

计算机视觉（CV）是让设备变得智能的关键技术。

计算机视觉技术用于不同的领域和用例，例如智能手机、机器人、物联网、汽车等。

一些用例（包括但不限于）是：

- 图像处理
- 图像转换
- 运动和目标跟踪
- 目标检测
- 特征检测
- 颜色转换

## OpenCV

- OpenCV（开源计算机视觉库：[http://opencv.org](http://opencv.org)）是世界上最大的计算机视觉库。
- 它是开源的，包含 2500 多种算法，由非营利的 Open Source Vision Foundation 运营。
- 它易于构建、开放可用，并且易于在任何平台上集成。
- OpenCV 是面向开发人员的 API，使开发人员可以无缝利用基于 OpenCV 的现有应用程序并将其移植到 Qualcomm Snapdragon 平台。

|  | 支持的 OpenCV 版本 | 当前实现 |
| --- | --- | --- |
| 当前发行版本 | OpenCV 4.10 | CPU 和 FastCV |

## FastCV

- FastCV 库为 Qualcomm 专有，与其他 CV 库相比，它可以在各种硬件上更快地实现 CV 算法。
- 这些 API 允许用户在硬件上加速 FastCV 功能。
- 它为计算机视觉应用程序开发人员提供了两个主要功能：

    - 经过优化的 CV 函数库，可在 Qualcomm 硬件上高效运行。
    - 干净的、与处理器无关的硬件加速 API

## 使用 FastCV 进行 OpenCV 加速

- 以 FastCV 为后端提供 OpenCV API 加速，以提供更好的性能。
- OpenCV 功能通过基于 FastCV 的扩展 API 得到增强，早期版本中没有这些 API，仅包含默认的 OpenCV 库。
- eSDK 提供了一种使用 OpenCV API 和自动工具构建 CV 应用程序的简单方法。
- 可以使用默认的 OpenCV API 来开发 CV 应用程序。OpenCV 库调用 FastCV HAL API，然后调用 FastCV 算法。

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export cv-block-diagram.svg cv-block-diagram -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="8.32292in" height="1.88542in" viewbox="0 0 599.25 135.75" xml:space="preserve" color-interpolation-filters="sRGB" class="st10" svgdefaultwidth="679"><v:documentproperties v:langid="1033" v:viewmarkup="false">	<v:userdefs>		<v:ud v:nameu="msvNoAutoConnect" v:val="VT0(1):26"></v:ud>	</v:userdefs></v:documentproperties>
<style>.svg-1 .st1 { fill: #f8f8f8; stroke: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-1 .st2 { fill: #7ba0ff; stroke: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-1 .st3 { fill: #000000; font-family: Roboto; font-size: 1.16666em }
.svg-1 .st4 { font-family: Microsoft YaHei; font-size: 1em }
.svg-1 .st5 { fill: #000000; font-family: Microsoft YaHei; font-size: 1.16666em }
.svg-1 .st6 { font-family: Roboto; font-size: 1em }
.svg-1 .st7 { font-size: 1em }
.svg-1 .st8 { marker-end: url("#mrkr13-26"); stroke: #000000; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1 }
.svg-1 .st9 { fill: #000000; fill-opacity: 1; stroke: #000000; stroke-opacity: 1; stroke-width: 0.28409090909091 }
.svg-1 .st10 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<defs id="Markers">	<g id="lend13">		<path d="M 3 1 L 0 0 L 3 -1 L 3 1 " style="stroke:none"></path>	</g>	<marker id="mrkr13-26" class="st9" v:arrowtype="13" v:arrowsize="2" v:setback="10.56" refx="-10.56" orient="auto" markerunits="strokeWidth" overflow="visible">		<use xlink:href="#lend13" transform="scale(-3.52,-3.52) "></use>	</marker></defs><g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>cv-block-diagram</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<g id="shape7-1" v:mid="7" v:groupcontext="shape" transform="translate(18.375,-18.375)">		<title>Sheet.7</title>		<rect x="0" y="36.75" width="562.5" height="99" class="st1"></rect>	</g>	<g id="shape1-3" v:mid="1" v:groupcontext="shape" transform="translate(23.625,-27.375)">		<title>Sheet.1</title>		<desc>OpenCV 应用程序</desc>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="76.5" cy="95.0625" width="153.01" height="81.375"></v:textrect>		<rect x="0" y="54.375" width="153" height="81.375" class="st2"></rect>		<text x="21.45" y="99.31" class="st3" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>OpenCV <tspan class="st4">应用程序</tspan></text>		</g>	<g id="shape2-7" v:mid="2" v:groupcontext="shape" transform="translate(223.125,-27.375)">		<title>Sheet.2</title>		<desc>使用 FastCV HAL/扩展进行 OpenCV 加速</desc>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="76.5" cy="95.0625" width="153.01" height="81.375"></v:textrect>		<rect x="0" y="54.375" width="153" height="81.375" class="st2"></rect>		<text x="38.18" y="82.31" class="st5" v:langid="1033"><v:paragraph v:horizalign="1" v:bulletsize="0.166667"></v:paragraph><v:tablist></v:tablist>使用<tspan class="st6"> </tspan><tspan class="st6">FastCV <v:lf></v:lf></tspan><tspan x="32.29" dy="1.215em" class="st6">HAL/</tspan>扩展进行<tspan class="st6"> </tspan><tspan x="35.45" dy="1.215em" class="st6">OpenCV </tspan>加速</text>		</g>	<g id="shape3-15" v:mid="3" v:groupcontext="shape" transform="translate(422.625,-27.375)">		<title>Sheet.3</title>		<desc>使用 FastCV 进行 硬件加速</desc>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="76.5" cy="95.0625" width="153.01" height="81.375"></v:textrect>		<rect x="0" y="54.375" width="153" height="81.375" class="st2"></rect>		<text x="22.45" y="90.81" class="st5" v:langid="1033"><v:paragraph v:horizalign="1" v:bulletsize="0.166667"></v:paragraph><v:tablist></v:tablist>使用<tspan class="st6"> </tspan><tspan class="st6">FastCV </tspan>进行<v:newlinechar></v:newlinechar><tspan x="48.5" dy="1.215em" class="st7">硬件加速</tspan></text>		</g>	<g id="shape8-21" v:mid="8" v:groupcontext="shape" transform="translate(176.625,-67.875)">		<title>Sheet.8</title>		<path d="M0 135.75 L35.94 135.75" class="st8"></path>	</g>	<g id="shape9-27" v:mid="9" v:groupcontext="shape" transform="translate(376.125,-67.875)">		<title>Sheet.9</title>		<path d="M0 135.75 L35.94 135.75" class="st8"></path>	</g></g>
</svg>

**架构框图**

Last Published: Jan 23, 2025

[Next Topic
入门指南](https://docs.qualcomm.com/bundle/publicresource/80-70017-21SC/topics/getting-started.md)