From c1018cb1ada7a3c7ac634cb5885bc5b558865e04 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Mon, 14 Mar 2016 22:28:08 -0400 Subject: [PATCH] Added toString function to prewarp --- src/openalpr/prewarp.cpp | 12 ++++++++++++ src/openalpr/prewarp.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/openalpr/prewarp.cpp b/src/openalpr/prewarp.cpp index ece8783..0ec9108 100644 --- a/src/openalpr/prewarp.cpp +++ b/src/openalpr/prewarp.cpp @@ -111,6 +111,18 @@ namespace alpr PreWarp::~PreWarp() { } + std::string PreWarp::toString() { + + if (!this->valid) + return ""; + + stringstream sstream; + sstream << "planar," << w << "," << h << "," << rotationx << "," << rotationy << "," << rotationz << "," + << panX << "," << panY << "," << stretchX << "," << dist; + + return sstream.str(); + } + void PreWarp::setTransform(float w, float h, float rotationx, float rotationy, float rotationz, float panX, float panY, float stretchX, float dist) { this->w = w; diff --git a/src/openalpr/prewarp.h b/src/openalpr/prewarp.h index e41f6b5..439a5f7 100644 --- a/src/openalpr/prewarp.h +++ b/src/openalpr/prewarp.h @@ -46,6 +46,8 @@ namespace alpr bool valid; + std::string toString(); + private: Config* config; cv::Mat transform;