Fix NV12 crash issue when recreate camera object
This commit is contained in:
@@ -24,7 +24,7 @@ namespace ANSCENTER
|
||||
ANSCENTER::ModelConfig _lpdmodelConfig;
|
||||
ANSCENTER::ModelConfig _ocrModelConfig;
|
||||
ANSCENTER::ModelConfig _lpColourModelConfig;
|
||||
cv::Ptr<cv::CLAHE> _clahe; // Reusable CLAHE instance
|
||||
// _clahe moved to thread-local in enhanceForOCR() for thread safety
|
||||
ANSCENTER::NV12PreprocessHelper _nv12Helper; // NV12 crop for high-res plate OCR
|
||||
|
||||
std::string _lpdLabels;
|
||||
@@ -147,6 +147,7 @@ namespace ANSCENTER
|
||||
int framesSinceLastSeen = 0;
|
||||
};
|
||||
// cameraId → list of tracked plate identities
|
||||
std::mutex _plateIdentitiesMutex; // Fine-grained lock for plate identity tracking
|
||||
std::unordered_map<std::string, std::vector<SpatialPlateIdentity>> _plateIdentities;
|
||||
static constexpr float PLATE_SPATIAL_MATCH_THRESHOLD = 0.3f; // IoU threshold for same plate
|
||||
void ensureUniquePlateText(std::vector<Object>& results, const std::string& cameraId);
|
||||
@@ -176,6 +177,7 @@ namespace ANSCENTER
|
||||
std::string colour;
|
||||
int hitCount = 0;
|
||||
};
|
||||
std::mutex _colourCacheMutex; // Fine-grained lock for colour cache only
|
||||
std::unordered_map<std::string, ColourCacheEntry> _colourCache;
|
||||
static constexpr size_t COLOUR_CACHE_MAX_SIZE = 200;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user