# MobileNetSpatialDetectionNetwork

MobileNet NN 的空间检测。它类似于
[MobileNetDetectionNetwork](https://docs.luxonis.com/software/depthai-components/nodes/mobilenet_detection_network.md) 和
[SpatialLocationCalculator](https://docs.luxonis.com/software/depthai/examples/spatial_location_calculator.md) 的组合。

## 放置方法

#### Python

```python
pipeline = dai.Pipeline()
mobilenetSpatial = pipeline.create(dai.node.MobileNetSpatialDetectionNetwork)
```

#### C++

```cpp
dai::Pipeline pipeline;
auto mobilenetSpatial = pipeline.create<dai::node::MobileNetSpatialDetectionNetwork>();
```

## 输入和输出

## 使用示例

#### Python

```python
pipeline = dai.Pipeline()
mobilenetSpatial = pipeline.create(dai.node.MobileNetSpatialDetectionNetwork)

mobilenetSpatial.setBlobPath(nnBlobPath)
# 忽略置信度低于 50% 的所有检测结果
mobilenetSpatial.setConfidenceThreshold(0.5)
mobilenetSpatial.input.setBlocking(False)
# ROI 的大小（值越小，读数越稳定）
mobilenetSpatial.setBoundingBoxScaleFactor(0.5)
# 最小/最大阈值。超出范围的值将被设为 0（无效）
mobilenetSpatial.setDepthLowerThreshold(100)
mobilenetSpatial.setDepthUpperThreshold(5000)

# 连接 StereoDepth 节点的深度输出
stereo.depth.link(mobilenetSpatial.inputDepth)
```

#### C++

```cpp
dai::Pipeline pipeline;
auto mobilenetSpatial = pipeline.create<dai::node::MobileNetSpatialDetectionNetwork>();

mobilenetSpatial->setBlobPath(nnBlobPath);
// 忽略置信度低于 50% 的所有检测结果
mobilenetSpatial->setConfidenceThreshold(0.5f);
mobilenetSpatial->input.setBlocking(false);
// ROI 的大小（值越小，读数越稳定）
mobilenetSpatial->setBoundingBoxScaleFactor(0.5f);
// 最小/最大阈值。超出范围的值将被设为 0（无效）
mobilenetSpatial->setDepthLowerThreshold(100);
mobilenetSpatial->setDepthUpperThreshold(5000);

// 连接 StereoDepth 节点的深度输出
stereo->depth.link(mobilenetSpatial->inputDepth);
```

## 功能示例

 * [RGB & MobilenetSSD 与空间数据](https://docs.luxonis.com/software/depthai/examples/spatial_mobilenet.md)
 * [Mono & MobilenetSSD 与空间数据](https://docs.luxonis.com/software/depthai/examples/mono_depth_mobilenetssd.md)

## 空间坐标系

OAK 相机使用 左手（笛卡尔）坐标系 处理所有空间坐标。

画面中心为 X、Y 坐标的 0,0 点。向上移动时 Y 值增加，向右移动时 X 值增加。

## 参考

### depthai.node.MobileNetSpatialDetectionNetwork(depthai.node.SpatialDetectionNetwork)

Kind: Class

MobileNetSpatialDetectionNetwork node. Mobilenet-SSD based network with spatial
location data.

### 需要帮助？

请前往 [OAKChina 官网](https://www.oakchina.cn/) 获取技术支持或解答您的任何疑问。
