mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-08 18:00:06 +08:00
Revert "Using multiple instances of OCR and state recognizer for multiple threads"
This reverts commit 29cb8fab21
.
This commit is contained in:
@@ -63,17 +63,15 @@ class AlprImpl
|
||||
|
||||
private:
|
||||
|
||||
int getNumThreads();
|
||||
cJSON* createJsonObj(const AlprResult* result);
|
||||
|
||||
RegionDetector* plateDetector;
|
||||
vector<StateIdentifier*> stateIdentifiers;
|
||||
vector<OCR*> ocrs;
|
||||
StateIdentifier* stateIdentifier;
|
||||
OCR* ocr;
|
||||
|
||||
int topN;
|
||||
bool detectRegion;
|
||||
std::string defaultRegion;
|
||||
|
||||
cJSON* createJsonObj(const AlprResult* result);
|
||||
|
||||
|
||||
};
|
||||
@@ -83,21 +81,19 @@ class PlateDispatcher
|
||||
public:
|
||||
PlateDispatcher(vector<Rect> plateRegions, cv::Mat* image,
|
||||
Config* config,
|
||||
vector<StateIdentifier*> stateIdentifiers,
|
||||
vector<OCR*> ocrs,
|
||||
StateIdentifier* stateIdentifier,
|
||||
OCR* ocr,
|
||||
int topN, bool detectRegion, std::string defaultRegion)
|
||||
{
|
||||
this->plateRegions = plateRegions;
|
||||
this->frame = image;
|
||||
|
||||
this->config = config;
|
||||
this->stateIdentifiers = stateIdentifiers;
|
||||
this->ocrs = ocrs;
|
||||
this->stateIdentifier = stateIdentifier;
|
||||
this->ocr = ocr;
|
||||
this->topN = topN;
|
||||
this->detectRegion = detectRegion;
|
||||
this->defaultRegion = defaultRegion;
|
||||
|
||||
this->threadCounter = 0;
|
||||
}
|
||||
|
||||
cv::Mat getImageCopy()
|
||||
@@ -109,13 +105,6 @@ class PlateDispatcher
|
||||
|
||||
return img;
|
||||
}
|
||||
|
||||
int getUniqueThreadId()
|
||||
{
|
||||
tthread::lock_guard<tthread::mutex> guard(mMutex);
|
||||
|
||||
return threadCounter++;
|
||||
}
|
||||
|
||||
bool hasPlate()
|
||||
{
|
||||
@@ -147,8 +136,8 @@ class PlateDispatcher
|
||||
}
|
||||
|
||||
|
||||
vector<StateIdentifier*> stateIdentifiers;
|
||||
vector<OCR*> ocrs;
|
||||
StateIdentifier* stateIdentifier;
|
||||
OCR* ocr;
|
||||
Config* config;
|
||||
|
||||
int topN;
|
||||
@@ -157,7 +146,6 @@ class PlateDispatcher
|
||||
|
||||
private:
|
||||
|
||||
int threadCounter;
|
||||
tthread::mutex mMutex;
|
||||
cv::Mat* frame;
|
||||
vector<Rect> plateRegions;
|
||||
|
Reference in New Issue
Block a user