Revert "Using multiple instances of OCR and state recognizer for multiple threads"

This reverts commit 29cb8fab21.
This commit is contained in:
Matt Hill
2014-04-04 13:58:53 -05:00
parent 3231fa47d7
commit ec8fdc8aad
2 changed files with 24 additions and 77 deletions

View File

@@ -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;