跳转至
本 SDK 仅适用于过去 3 年内发布的设备。我们定期优化和更新 SDK，以确保兼容性和性能。对于超过 3 年的旧设备，我们不保证兼容性，也不会提供技术支持。

# NET_SDK_SEARCH_IMAGE_BY_IMAGE_V2

### 结构体定义

C++C#

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    typedef struct _net_sdk_search_image_by_image_v2
    {
        unsigned int limitNum;
        DD_TIME_EX startTime;
        DD_TIME_EX endTime;
        unsigned int similarity;
        unsigned int searchType;
        unsigned int imgSourceType;
        unsigned int imgNum;
        unsigned int* imgId;
        unsigned int eventType;
        unsigned int groupsNum;
        unsigned int* groupsId;
        unsigned int sfaceImgsNum;
        NET_SDK_FACE_IMG_INFO_CH* sfaceImgs;
        struct
        {
            unsigned int imgWidth;
            unsigned int imgHeight;
            unsigned int imgLen;
            unsigned char* imgData;
        } sfaceImgData;
    } NET_SDK_SEARCH_IMAGE_BY_IMAGE_V2;

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    [StructLayout(LayoutKind.Sequential, Pack = 4)]
    public struct NET_SDK_SEARCH_IMAGE_BY_IMAGE_V2
    {
        public UInt32 limitNum;
        public DD_TIME_EX startTime;
        public DD_TIME_EX endTime;
        public UInt32 similarity;
        public UInt32 searchType;
        public UInt32 imgSourceType;
        public UInt32 imgNum;
        public IntPtr imgId;
        public UInt32 eventType;
        public UInt32 groupsNum;
        public IntPtr groupsId;
        public UInt32 sfaceImgsNum;
        public IntPtr sfaceImgs;
        public struct NET_SDK_SEARCH_IMAGE_BY_IMAGE_V2_sfaceImgData
        {
            public UInt32 imgWidth;
            public UInt32 imgHeight;
            public UInt32 imgLen;
            public IntPtr imgData;
        }
        public NET_SDK_SEARCH_IMAGE_BY_IMAGE_V2_sfaceImgData sfaceImgData;
    }

### 功能描述

以图搜图V2。

### 成员说明

成员 | 类型 | 说明
--- | --- | ---
limitNum | unsigned int | 数量限制。
startTime | `DD_TIME_EX` | 开始时间。
endTime | `DD_TIME_EX` | 结束时间。
similarity | unsigned int | 相似度。
searchType | unsigned int | 搜索类型，参考`NET_SDK_SEARCH_IMAGE_BY_IMAGE_TYPE`。
imgSourceType | unsigned int | 图片来源，当searchType为SEARCH_IMAGE_BY_IMAGE时用`NET_SDK_SEARCH_IMAGE_SOURCE_V2`。
imgNum | unsigned int | 图片id数量，当searchType为SEARCH_IMAGE_BY_IMAGE时,imgSourceType为FROM_ALBUM用到。
imgId | unsigned int* | 图片id，当searchType为SEARCH_IMAGE_BY_IMAGE时,imgSourceType为FROM_ALBUM用到。
eventType | unsigned int | 当searchType为SEARCH_IMAGE_BY_EVENT时用到，`NET_SDK_SEARCH_IMAGE_BY_EVENT_TYPE_V2`。
groupsNum | unsigned int | 目标库数量，当searchType为SEARCH_IMAGE_BY_IMAGE时,imgSourceType为FROM_GROUP用到。
groupsId | unsigned int* | 目标库Id，当searchType为SEARCH_IMAGE_BY_IMAGE时,imgSourceType为FROM_GROUP用到。
sfaceImgsNum | unsigned int | 图片数量，当searchType为SEARCH_IMAGE_BY_IMAGE时,imgSourceType为FROM_SNAP用到。
sfaceImgs | `NET_SDK_FACE_IMG_INFO_CH`* | SEARCH_IMAGE_BY_FACE_IMAGES,当searchType为SEARCH_IMAGE_BY_IMAGE时,imgSourceType为FROM_SNAP用到。
sfaceImgData |
    1
    2
    3
    4
    5
    6
    7
    struct
    {
        unsigned int imgWidth;  // 图片宽度。
        unsigned int imgHeight; // 图片高度。
        unsigned int imgLen;    // 图像数据长度。
        unsigned char* imgData; // 图像数据。
    } sfaceImgData;
| 当searchType为SEARCH_IMAGE_BY_IMAGE时,imgSourceType为FROM_EXTERNAL用到。

错误码