wx_human_seg 3.0.0
wx_idphoto_detect.h
Go to the documentation of this file.
1
8#ifndef WX_IDPHOTO_DETECT_H_
9#define WX_IDPHOTO_DETECT_H_
10
11#include <memory>
12#include <string>
13#include <vector>
14#include "wx_api.h"
15#include "wx_exception.h"
16#include "wx_image.h"
17#include "wx_idphoto.h"
18
19namespace wonxai {
20
21class WXIDPhotoDetectorImpl;
22
63
64public:
65 virtual ~WXIDPhotoDetectResult();
66
75 virtual int getInt(const std::string &key) = 0;
76
85 virtual float getFloat(const std::string &key) = 0;
86
95 virtual bool getBool(const std::string &key) = 0;
96
105 virtual const std::string& getString(const std::string &key) = 0;
106
115 virtual const std::vector<int> &getIntArray(const std::string &key) = 0;
116
125 virtual const std::vector<float> &getFloatArray(const std::string &key) = 0;
126
130 virtual bool exists(const std::string &key) = 0;
131
135 virtual std::vector<std::string> keys() = 0;
136
140 virtual std::string dumps() = 0;
141
142protected:
144};
145
149class WX_API WXIDPhotoDetector final {
150public:
158
160
166 const std::shared_ptr<WXIDPhotoDetectResult>
167 detect(std::shared_ptr<WXImage>inImg);
168
174 detect(const WXImage *inImg);
175
180 void setSettings(const std::shared_ptr<WXIDPhotoSettings> &settings);
181
186 void setSettings(const WXIDPhotoSettings *settings);
187
188private:
189 std::unique_ptr<WXIDPhotoDetectorImpl> _impl;
190};
191
192} // end of namespace wonxai
193
194#endif //WX_IDPHOTO_DETECT_H_
Definition: wx_idphoto_detect.h:62
virtual const std::vector< int > & getIntArray(const std::string &key)=0
virtual const std::string & getString(const std::string &key)=0
virtual bool exists(const std::string &key)=0
virtual const std::vector< float > & getFloatArray(const std::string &key)=0
virtual std::vector< std::string > keys()=0
virtual int getInt(const std::string &key)=0
virtual std::string dumps()=0
virtual bool getBool(const std::string &key)=0
virtual float getFloat(const std::string &key)=0
Definition: wx_idphoto_detect.h:149
WXIDPhotoDetectResult * detect(const WXImage *inImg)
证件照检测接口
WXIDPhotoDetector(WXDeviceType deviceType=kDeviceCPU)
WXIDPhotoDetector构造函数
void setSettings(const WXIDPhotoSettings *settings)
void setSettings(const std::shared_ptr< WXIDPhotoSettings > &settings)
const std::shared_ptr< WXIDPhotoDetectResult > detect(std::shared_ptr< WXImage >inImg)
证件照检测接口
Definition: wx_idphoto.h:95
Definition: wx_image.h:15
WXDeviceType
Definition: wx_api.h:21
@ kDeviceCPU
Definition: wx_api.h:23