接口说明

CameraConfig

GET/api/CameraConfig

  • 说明

    获取相机的拍照参数。

  • 请求方式

    http://[IP]:5000/api/CameraConfig
  • 返回结果示例

    {
      "ExpTime2D": 200,
      "Gain2D": 1,
      "ProjectorBrightness": 2,
      "FlashLightOn": true,
      "ParamsBatch3D": [
        {
          "ExpTime3D": 20,
          "Gain3D": 1
        }
      ],
      "PatternMode": 4,
      "SmoothLevel": 0
    }
  • 返回数据说明

    名称

    类型

    必选

    说明

    ExpTime2D

    integer

    true

    2D曝光时间

    Gain2D

    integer

    true

    2D增益

    ProjectorBrightness

    integer

    true

    投影亮度

    FlashLightOn

    boolean

    true

    打开补光灯

    ParamsBatch3D

    [object]

    true

    3D参数组

    ExpTime3D

    integer

    true

    3D曝光时间

    Gain3D

    integer

    true

    3D增益

    PatternMode

    integer

    true

    投影模式

    SmoothLevel

    integer

    true

    平滑等级

PUT/api/CameraConfig

  • 说明

    设置相机参数。

  • 请求方式

    http://[IP]:5000/api/CameraConfig,content
  • 请求示例

    http://[IP]:5000/api/CameraConfig,content
    
    
    content = {
      "ExpTime2D": 100,
      "Gain2D": 1,
      "ProjectorBrightness": 2,
      "FlashLightOn": true,
      "ParamsBatch3D": [
        {
          "ExpTime3D": 20,
          "Gain3D": 1
        }
      ],
      "PatternMode": 4,
      "SmoothLevel": 0
    }
  • 返回结果示例

    {
      "ExpTime2D": 100,
      "Gain2D": 1,
      "ProjectorBrightness": 2,
      "FlashLightOn": true,
      "ParamsBatch3D": [
        {
          "ExpTime3D": 20,
          "Gain3D": 1
        }
      ],
      "PatternMode": 4,
      "SmoothLevel": 0
    }
  • 返回数据说明

    名称

    类型

    必选

    说明

    ExpTime2D

    integer

    true

    2D曝光时间

    Gain2D

    integer

    true

    2D增益

    ProjectorBrightness

    integer

    true

    投影亮度

    FlashLightOn

    boolean

    true

    打开补光灯

    ParamsBatch3D

    [object]

    true

    3D参数组

    ExpTime3D

    integer

    true

    3D曝光时间

    Gain3D

    integer

    true

    3D增益

    PatternMode

    integer

    true

    投影模式

    SmoothLevel

    integer

    true

    平滑等级

CameraParameters

GET/api/CameraParameters/Intrinsic/CameraMatrix

  • 说明

    获取相机内参。

  • 请求方式

    http://[IP]:5000/api/CameraParameters/Intrinsic/CameraMatrix
  • 返回结果示例

    [
      1815.1392644283005,
      0,
      960.890136038176,
      0,
      1815.1392644283005,
      754.4678034865751,
      0,
      0,
      1
    ]
  • 返回数据说明

    interface intrinsic cameramatrix

GET/api/CameraParameters/Intrinsic/Distortion

  • 说明

    获取相机的畸变参数。

  • 请求方式

    http://[IP]:5000/api/CameraParameters/Intrinsic/Distortion
  • 返回结果示例

    [
      0,
      0,
      0,
      0,
      0
    ]
  • 返回数据说明

    分别对应k1, k2, p1, p2, k3。

Depth

GET/api/Depth

  • 说明

    通过frameId获取对应帧的深度数据。

  • 请求方式

    http://[IP]:5000/api/Depth?frameId

    名称

    位置

    类型

    说明

    frameId

    query

    string

    触发拍照获取到的frameId(frameId可通过api/Frame接口获得)

  • 请求示例

    http://10.10.11.110:5000/api/Depth?frameId=48603_dac639e7-9dbb-4d2d-810c-607adcf3f7a4
  • 返回数据说明

EpicEye

GET/api/EpicEye/Info

  • 说明

    获取相机的信息。

  • 请求方式

    http://[IP]:5000/api/EpicEye/Info
  • 返回示例

    {
      "version": "3.4.0",
      "sn": "SNxxxxxxxxxx",
      "ip": "127.0.0.1:5000",
      "model": "EpicEye Laser L",
      "alias": "A工厂-A线-A相机",
      "width": 2048,
      "height": 1536
    }
  • 返回数据说明

    名称

    类型

    必选

    说明

    version

    string

    true

    EpicEye相机软件版本

    sn

    string

    true

    相机序列号

    ip

    string

    true

    相机IP

    model

    string

    true

    相机型号

    alias

    string

    true

    相机别名

    width

    integer

    true

    分辨率-宽

    height

    integer

    true

    分辨率-高

PUT/api/EpicEye/Info

  • 说明

    修改相机的别名。

  • 请求方式

    http://[IP]:5000/api/EpicEye/Info?alias

    名称

    位置

    类型

    说明

    alias

    query

    string

    自定义的相机别名

  • 请求示例

    http://10.10.11.110:5000/api/EpicEye/Info?alias="测试相机"
  • 返回示例

    {
      "version": "3.4.0",
      "sn": "SNxxxxxxxxxx",
      "ip": "127.0.0.1:5000",
      "model": "EpicEye Laser L",
      "alias": "测试相机",
      "width": 2048,
      "height": 1536
    }
  • 返回数据说明

    名称

    类型

    必选

    说明

    version

    string

    true

    EpicEye相机软件版本

    sn

    string

    true

    相机序列号

    ip

    string

    true

    相机IP

    model

    string

    true

    相机型号

    alias

    string

    true

    相机别名

    width

    integer

    true

    分辨率-宽

    height

    integer

    true

    分辨率-高

Frame

POST/api/Frame

  • 说明

    触发相机进行一次拍照。

  • 请求方式

    http://[IP]:5000/api/Frame

    不进行点云重建:

    http://[IP]:5000/api/Frame?pointCloud=false

    进行点云重建:

    http://[IP]:5000/api/Frame?pointCloud=true
  • 返回结果示例

    48609_4451b6d7-5338-41dc-9afc-70b3145264e8
  • 返回数据说明

    图像帧的唯一标识符。

GET/api/Frame

  • 说明

    通过frameId获取完整的EpicRaw数据。

  • 请求方式

    http://[IP]:5000/api/Frame?frameId

    名称

    位置

    类型

    说明

    rameId

    query

    string

    触发拍照获取到的frameId

  • 请求示例

    http://10.10.11.110:5000/api/Frame?frameId=48603_dac639e7-9dbb-4d2d-810c-607adcf3f7a4
  • 返回数据说明

    请参考EpicRaw格式说明

GET/api/Frame/Header

  • 说明

    通过frameId获取该frame的帧头信息。

  • 请求方式

    http://[IP]:5000/api/Header?frameId

    名称

    位置

    类型

    说明

    frameId

    query

    string

    触发拍照获取到的frameId。

  • 请求示例

    http://10.10.11.110:5000/api/PointCloud/PLY?frameId=48603_dac639e7-9dbb-4d2d-810c-607adcf3f7a4
  • 返回结果示例

    {
      "width": 2048,
      "height": 1536,
      "dataType": 8,
      "cameraMatrixLength": 72,
      "distortionLength": 40,
      "configStrLength": 209,
      "depthDataLength": 12582912,
      "imageDataLength": 18874368
    }
  • 返回数据说明

    名称

    类型

    必选

    说明

    width

    integer

    true

    分辨率-宽

    height

    integer

    true

    分辨率-高

    dataType

    integer

    true

    数据类型

    cameraMatrixLength

    integer

    true

    相机矩阵长度

    distortionLength

    integer

    true

    畸变参数长度

    configStrLength

    integer

    true

    配置字符串长度

    depthDataLength

    integer

    true

    深度数据长度

    imageDataLength

    integer

    true

    2D图像数据长度

PointCloud

GET/api/PointCloud/PLY

  • 说明

    通过frameId获取.ply格式的点云。

  • 请求方式

    http://[IP]:5000/api/PointCloud/PLY?frameId

    名称

    位置

    类型

    说明

    frameId

    query

    string

    触发拍照获取到的frameId

  • 请求示例

    http://10.10.11.110:5000/api/PointCloud/PLY?frameId=48603_dac639e7-9dbb-4d2d-810c-607adcf3f7a4
  • 返回数据说明

    请参考EpicRaw格式说明

注意事项

  • 使用过程中若遇到问题,可参考返回的错误信息或检查相机网络连接情况。

  • 某些接口调用需要确定相机的 IP 地址和相应的参数,确保参数正确性以避免请求失败。

数据传输格式说明

  • 参数格式一般使用JSON格式。

  • 图像、深度图、点云等格式使用EpicRaw格式进行存储。

EpicRaw格式说明

  • EpicRaw1

    • Header

      FileType = "EPICRAW1"         // 8 bytes, version info
      width = int32                 // 4 bytes
      height = int32                // 4 bytes
      // 3 * 3 camera matrix, row major
      camera matrix = float64 * 9   // 8 * 9 = 72 bytes, camera matrix
      distortion = float64 * 5      // 8 * 5 = 40 bytes, camera distortion
          // K1  = float64
          // K2  = float64
          // P1  = float64
          // P2  = float64
          // K3  = float64
      camera config                 // 4 * 7 = 28 bytes, camera configs
          // projector brightness = int32
          // exp time 2d          = float32
          // exp time 3d          = float32
          // use hdr              = bool but save as int32
          // exp time hdr         = float32
          // use PF               = bool but save as int32
          // use SF               = bool but save as int32
      data type = int32             // 4 bytes
          // 0: RGB only
          // 1: depth only
          // 4: depth + RGB
      depth data length = int32     // 4 bytes
      image data length = int32     // 4 bytes
      
      
      Total: 168 bytes
    • Data

      Data由depth data和image data构成。

      • depth data 长度为depth data length。

      • image data 长度为image data length。

  • EpicRaw2

    • Header

      FileType = "EPICRAW2"         // 8 bytes, version info
      width = int32                 // 4 bytes
      height = int32                // 4 bytes
      data type = int32             // 4 bytes
          // 0: RGB only
          // 1: depth only
          // 2: RGB16bit image only
          // 4: depth + RGB
          // 8: depth + RGB16bit
          // 16: origin Fringe-Pattern images
      camera matrix length = int32  // 4 bytes, default: 8 * 9 = 72, row major
      distortion length = int32     // 4 bytes
      config str length = int32     // 4 bytes
      depth data length = int32     // 4 bytes
      image data length = int32     // 4 bytes
      
      
      Total: 40 bytes
    • Data

      Data由camera matrix、distortion、config string、depth data、image data构成。

      • camera matrix

        默认长度: float64 * 9 = 8 * 9 = 72 bytes

        内容: 3 * 3 camera matrix, row major

      • distortion

        内容参照OpenCV畸变系数协定

        一般系数长度为5,数据类型为float64,即K1, K2, P1, P2, K3,长度为5 * 8 = 40 bytes。

      • config string

        以json str格式存储。

      • depth data

        长度为depth data length。

      • image data

        长度为image data length。

状态码说明

状态码

状态码含义

200

成功

400

错误