diff --git a/bindings/csharp/openalpr-net/openalpr-net.cpp b/bindings/csharp/openalpr-net/openalpr-net.cpp index 33f984e..7ac9769 100644 --- a/bindings/csharp/openalpr-net/openalpr-net.cpp +++ b/bindings/csharp/openalpr-net/openalpr-net.cpp @@ -336,18 +336,19 @@ namespace openalprnet { /// Recognize from an image on disk /// AlprResultsNet^ recognize(System::String^ filepath) { - /* AlprResults results = m_Impl->recognize(marshal_as(filepath)); return gcnew AlprResultsNet(results); - */ + } + + /// + /// Recognize from an image on disk + /// + AlprResultsNet^ recognize(System::String^ filepath, List^ regionsOfInterest) { cv::Mat frame = cv::imread( marshal_as(filepath) ); - - std::vector regionsOfInterest; - regionsOfInterest.push_back(AlprRegionOfInterest(0,0, frame.cols, frame.rows)); - - AlprResults results = m_Impl->recognize(frame.data, frame.elemSize(), frame.cols, frame.rows, regionsOfInterest ); + std::vector rois = AlprHelper::ToVector(regionsOfInterest); + AlprResults results = m_Impl->recognize(frame.data, frame.elemSize(), frame.cols, frame.rows, rois ); return gcnew AlprResultsNet(results); - } + } /// /// Recognize from byte data representing an encoded image (e.g., BMP, PNG, JPG, GIF etc). @@ -378,11 +379,6 @@ namespace openalprnet { return AlprHelper::ToManagedString(Alpr::getVersion()); } - // System::String^ toJson(AlprResultsNet^ results) { - // std::string json = Alpr::toJson(marshal_as(results)); - // return AlprHelper::ToManagedString(json); - // } - protected: // Deallocate the native object on the finalizer just in case no destructor is called !AlprNet() {