mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-07 02:52:50 +08:00
Wrapped OpenALPR library in "alpr" namespace. Resolves issue #60.
This commit is contained in:
@@ -52,56 +52,58 @@
|
||||
|
||||
#define ALPR_NULL_PTR 0
|
||||
|
||||
|
||||
struct AlprFullDetails
|
||||
{
|
||||
std::vector<PlateRegion> plateRegions;
|
||||
AlprResults results;
|
||||
};
|
||||
|
||||
class AlprImpl
|
||||
namespace alpr
|
||||
{
|
||||
|
||||
public:
|
||||
AlprImpl(const std::string country, const std::string configFile = "", const std::string runtimeDir = "");
|
||||
virtual ~AlprImpl();
|
||||
struct AlprFullDetails
|
||||
{
|
||||
std::vector<PlateRegion> plateRegions;
|
||||
AlprResults results;
|
||||
};
|
||||
|
||||
AlprFullDetails recognizeFullDetails(cv::Mat img);
|
||||
AlprFullDetails recognizeFullDetails(cv::Mat img, std::vector<cv::Rect> regionsOfInterest);
|
||||
|
||||
AlprResults recognize( std::vector<char> imageBytes, std::vector<AlprRegionOfInterest> regionsOfInterest );
|
||||
AlprResults recognize( unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector<AlprRegionOfInterest> regionsOfInterest );
|
||||
AlprResults recognize( cv::Mat img, std::vector<cv::Rect> regionsOfInterest );
|
||||
|
||||
void applyRegionTemplate(AlprPlateResult* result, std::string region);
|
||||
|
||||
void setDetectRegion(bool detectRegion);
|
||||
void setTopN(int topn);
|
||||
void setDefaultRegion(std::string region);
|
||||
|
||||
static std::string toJson( const AlprResults results );
|
||||
static AlprResults fromJson(std::string json);
|
||||
static std::string getVersion();
|
||||
|
||||
Config* config;
|
||||
|
||||
bool isLoaded();
|
||||
|
||||
private:
|
||||
|
||||
Detector* plateDetector;
|
||||
StateIdentifier* stateIdentifier;
|
||||
OCR* ocr;
|
||||
|
||||
int topN;
|
||||
bool detectRegion;
|
||||
std::string defaultRegion;
|
||||
|
||||
std::vector<cv::Rect> convertRects(std::vector<AlprRegionOfInterest> regionsOfInterest);
|
||||
|
||||
static cJSON* createJsonObj(const AlprPlateResult* result);
|
||||
};
|
||||
class AlprImpl
|
||||
{
|
||||
|
||||
public:
|
||||
AlprImpl(const std::string country, const std::string configFile = "", const std::string runtimeDir = "");
|
||||
virtual ~AlprImpl();
|
||||
|
||||
AlprFullDetails recognizeFullDetails(cv::Mat img);
|
||||
AlprFullDetails recognizeFullDetails(cv::Mat img, std::vector<cv::Rect> regionsOfInterest);
|
||||
|
||||
AlprResults recognize( std::vector<char> imageBytes, std::vector<AlprRegionOfInterest> regionsOfInterest );
|
||||
AlprResults recognize( unsigned char* pixelData, int bytesPerPixel, int imgWidth, int imgHeight, std::vector<AlprRegionOfInterest> regionsOfInterest );
|
||||
AlprResults recognize( cv::Mat img, std::vector<cv::Rect> regionsOfInterest );
|
||||
|
||||
void applyRegionTemplate(AlprPlateResult* result, std::string region);
|
||||
|
||||
void setDetectRegion(bool detectRegion);
|
||||
void setTopN(int topn);
|
||||
void setDefaultRegion(std::string region);
|
||||
|
||||
static std::string toJson( const AlprResults results );
|
||||
static AlprResults fromJson(std::string json);
|
||||
static std::string getVersion();
|
||||
|
||||
Config* config;
|
||||
|
||||
bool isLoaded();
|
||||
|
||||
private:
|
||||
|
||||
Detector* plateDetector;
|
||||
StateIdentifier* stateIdentifier;
|
||||
OCR* ocr;
|
||||
|
||||
int topN;
|
||||
bool detectRegion;
|
||||
std::string defaultRegion;
|
||||
|
||||
std::vector<cv::Rect> convertRects(std::vector<AlprRegionOfInterest> regionsOfInterest);
|
||||
|
||||
static cJSON* createJsonObj(const AlprPlateResult* result);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif // OPENALPR_ALPRIMPL_H
|
Reference in New Issue
Block a user