diff --git a/src/bindings/csharp/openalpr-net/openalpr-net.cpp b/src/bindings/csharp/openalpr-net/openalpr-net.cpp index 2a7c21f..9325579 100644 --- a/src/bindings/csharp/openalpr-net/openalpr-net.cpp +++ b/src/bindings/csharp/openalpr-net/openalpr-net.cpp @@ -1269,6 +1269,35 @@ namespace openalprnet { cv::Mat frame = cv::imread( marshal_as(filepath) ); std::vector rois = AlprHelper::ToVector(regionsOfInterest); AlprResults results = m_Impl->recognize(frame.data, frame.elemSize(), frame.cols, frame.rows, rois ); + /// + /// Recognize from a bitmap + /// + AlprResultsNet^ recognize(Bitmap^ bitmap, List^ regionsOfInterest) + { + cv::Mat frame = AlprHelper::BitmapToMat(bitmap); + 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 a bitmap + /// + AlprResultsNet^ recognize(Bitmap^ bitmap) + { + cv::Mat frame = AlprHelper::BitmapToMat(bitmap); + std::vector rois; + AlprResults results = m_Impl->recognize(frame.data, frame.elemSize(), frame.cols, frame.rows, rois); + return gcnew AlprResultsNet(results); + } + + /// + /// Recognize from MemoryStream representing an encoded image (e.g., BMP, PNG, JPG, GIF etc). + /// + AlprResultsNet^ recognize(MemoryStream^ memoryStream) + { + std::vector p = AlprHelper::MemoryStreamToVector(memoryStream); + AlprResults results = m_Impl->recognize(p); return gcnew AlprResultsNet(results); }