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

# NET_SDK_SEARCH_IMAGE_BY_IMAGE

### 结构体定义

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
    24
    25
    26
    27
    28
    29
    30
    31
    32
    typedef struct _net_sdk_search_image_by_image_
    {
        unsigned int pageIndex;
        unsigned int pageSize;
        unsigned int similarity;
        unsigned int resultCountLimit;
        DD_TIME_EX startTime;
        DD_TIME_EX endTime;
        unsigned int searchType;
        struct
        {
            unsigned int itemId;
        } sfaceFeatures;
        NET_SDK_FACE_IMG_INFO_CH sfaceImgs;
        struct
        {
            unsigned int groupsId;
        } sfaceFeatureGroups;
        struct
        {
            unsigned int isContainRecognized;
            unsigned int isContainNotRecognized;
            unsigned int groupsId;
        } srecognizedFilter;
        struct
        {
            unsigned int imgWidth;
            unsigned int imgHeight;
            unsigned int imgLen;
            unsigned char* imgData;
        } sfaceImgData;
    } NET_SDK_SEARCH_IMAGE_BY_IMAGE;

     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
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    [StructLayout(LayoutKind.Sequential, Pack = 4)]
    public struct NET_SDK_SEARCH_IMAGE_BY_IMAGE
    {
        public UInt32 pageIndex;
        public UInt32 pageSize;
        public UInt32 similarity;
        public UInt32 resultCountLimit;
        public DD_TIME_EX startTime;
        public DD_TIME_EX endTime;
        public UInt32 searchType;
        public struct NET_SDK_SEARCH_IMAGE_BY_IMAGE_sfaceFeatures
        {
            public UInt32 itemId;
        }
        public NET_SDK_SEARCH_IMAGE_BY_IMAGE_sfaceFeatures sfaceFeatures;
        public NET_SDK_FACE_IMG_INFO_CH sfaceImgs;
        public struct NET_SDK_SEARCH_IMAGE_BY_IMAGE_sfaceFeatureGroups
        {
            public UInt32 groupsId;
        }
        public NET_SDK_SEARCH_IMAGE_BY_IMAGE_sfaceFeatureGroups sfaceFeatureGroups;
        public struct NET_SDK_SEARCH_IMAGE_BY_IMAGE_srecognizedFilter
        {
            public UInt32 isContainRecognized;
            public UInt32 isContainNotRecognized;
            public UInt32 groupsId;
        }
        public NET_SDK_SEARCH_IMAGE_BY_IMAGE_srecognizedFilter srecognizedFilter;
        public struct NET_SDK_SEARCH_IMAGE_BY_IMAGE_sfaceImgData
        {
            public UInt32 imgWidth;
            public UInt32 imgHeight;
            public UInt32 imgLen;
            public IntPtr imgData;
        }
        public NET_SDK_SEARCH_IMAGE_BY_IMAGE_sfaceImgData sfaceImgData;
    }

### 功能描述

以图搜图结构体。

### 成员说明

成员 | 类型 | 说明
--- | --- | ---
pageIndex | unsigned int | 查询的第几页。
pageSize | unsigned int | 每页数量。
similarity | unsigned int | 相似度。
resultCountLimit | unsigned int | 结果个数限制。
startTime | `DD_TIME_EX` | 开始时间。
endTime | `DD_TIME_EX` | 结束时间。
searchType | unsigned int | 搜索类型，参考`NET_SDK_SEARCH_IMAGE_BY_IMAGE_TYPE`。
sfaceFeatures |
    1
    2
    3
    4
    struct
    {
        unsigned int itemId;            // 目标ID
    } sfaceFeatures;
| 人脸特征，当searchType为SEARCH_IMAGE_BY_FACE_FEATURES。
sfaceImgs | `NET_SDK_FACE_IMG_INFO_CH` | 人脸图像，当searchType为SEARCH_IMAGE_BY_FACE_FEATURE_GROUPS。
sfaceFeatureGroups |
    1
    2
    3
    4
    struct
    {
        unsigned int groupsId; // 人脸组ID。
    } sfaceFeatureGroups;
| 人脸组
srecognizedFilter |
    1
    2
    3
    4
    5
    6
    struct
    {
        unsigned int isContainRecognized;    // 是否包含已识别的。
        unsigned int isContainNotRecognized; // 是否包含未识别的。
        unsigned int groupsId;               // 人脸组ID。
    } srecognizedFilter;
| 识别过滤器。
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_FACE_IMAGE_DATA。

错误码