mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 06:46:53 +08:00
Fixed UUID str output bug for alprd
This commit is contained in:
@@ -266,14 +266,15 @@ void streamRecognitionThread(void* arg)
|
||||
{
|
||||
long epoch_time = getEpochTime();
|
||||
|
||||
std::stringstream uuid;
|
||||
uuid << tdata->site_id << "-cam" << tdata->camera_id << "-" << epoch_time;
|
||||
|
||||
std::stringstream uuid_ss;
|
||||
uuid_ss << tdata->site_id << "-cam" << tdata->camera_id << "-" << epoch_time;
|
||||
std::string uuid = uuid_ss.str();
|
||||
|
||||
// Save the image to disk (using the UUID)
|
||||
if (tdata->output_images)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << tdata->output_image_folder << "/" << uuid.str() << ".jpg";
|
||||
ss << tdata->output_image_folder << "/" << uuid << ".jpg";
|
||||
|
||||
cv::imwrite(ss.str(), latestFrame);
|
||||
}
|
||||
@@ -283,7 +284,7 @@ void streamRecognitionThread(void* arg)
|
||||
std::string json = alpr.toJson(results, totalProcessingTime, epoch_time);
|
||||
|
||||
cJSON *root = cJSON_Parse(json.c_str());
|
||||
cJSON_AddStringToObject(root, "uuid", uuid.str().c_str());
|
||||
cJSON_AddStringToObject(root, "uuid", uuid.c_str());
|
||||
cJSON_AddNumberToObject(root, "camera_id", tdata->camera_id);
|
||||
cJSON_AddStringToObject(root, "site_id", tdata->site_id.c_str());
|
||||
cJSON_AddNumberToObject(root, "img_width", latestFrame.cols);
|
||||
|
Reference in New Issue
Block a user